From 6191844eae079f34894d131b1fcaf875677f338f Mon Sep 17 00:00:00 2001 From: Jorge Bescos Gascon Date: Tue, 23 May 2023 09:16:48 +0200 Subject: [PATCH] TCK Tracking: Jakarta EE 10 Core Profile #6799 Signed-off-by: Jorge Bescos Gascon --- dependencies/pom.xml | 2 +- .../config/ConfigCdiExtension.java | 26 ++-- .../HelidonContainerConfiguration.java | 12 +- .../arquillian/HelidonContainerExtension.java | 16 +- .../HelidonDeployableContainer.java | 136 ++++++++++++++-- .../src/main/resources/templates/beans.xml | 6 +- microprofile/tests/tck/pom.xml | 35 +---- .../tests/tck/tck-annotations/pom.xml | 85 ++++++++++ microprofile/tests/tck/tck-cdi/pom.xml | 105 +++++++++++++ .../cdi/tck/UrlLoaderExtension.java | 31 ++++ .../cdi/tck/UrlResourceProvider.java | 44 ++++++ .../src/test/resources/META-INF/beans.xml | 25 +++ .../resources/META-INF/cdi-tck.properties | 24 +++ ...boss.arquillian.core.spi.LoadableExtension | 18 +++ .../src/test/resources/application.yaml | 19 +++ .../tck-cdi/src/test/resources/arquillian.xml | 34 ++++ .../tests/tck/tck-core-profile/README.md | 3 + .../tck/tck-core-profile/artifact-install.sh | 30 ++++ .../tests/tck/tck-core-profile/pom.xml | 63 ++++++++ .../tck-core-profile-test/pom.xml | 84 ++++++++++ .../coreprofile/tck/UrlLoaderExtension.java | 31 ++++ .../coreprofile/tck/UrlResourceProvider.java | 44 ++++++ ...boss.arquillian.core.spi.LoadableExtension | 18 +++ .../src/test/resources/arquillian.xml | 33 ++++ microprofile/tests/tck/tck-graphql/pom.xml | 5 + microprofile/tests/tck/tck-health/pom.xml | 5 + microprofile/tests/tck/tck-inject/README.md | 3 + .../tests/tck/tck-inject/artifact-install.sh | 25 +++ microprofile/tests/tck/tck-inject/pom.xml | 63 ++++++++ .../tck/tck-inject/tck-inject-test/pom.xml | 76 +++++++++ .../tests/inject/AtInjectTCKExtension.java | 73 +++++++++ .../tests/inject/TckInjectTest.java | 50 ++++++ ...nterprise.inject.se.SeContainerInitializer | 17 ++ .../src/test/resources/application.yaml | 19 +++ microprofile/tests/tck/tck-jsonb/pom.xml | 63 ++++++++ .../tck/tck-jsonb/tck-jsonb-test/pom.xml | 84 ++++++++++ microprofile/tests/tck/tck-jsonp/README.md | 3 + .../tests/tck/tck-jsonp/artifact-install.sh | 70 +++++++++ microprofile/tests/tck/tck-jsonp/pom.xml | 64 ++++++++ .../tck/tck-jsonp/tck-jsonp-test/pom.xml | 74 +++++++++ microprofile/tests/tck/tck-jwt-auth/pom.xml | 5 + microprofile/tests/tck/tck-openapi/pom.xml | 5 + .../tests/tck/tck-opentracing/pom.xml | 5 + .../tests/tck/tck-reactive-operators/pom.xml | 5 + .../tests/tck/tck-rest-client/pom.xml | 5 + microprofile/tests/tck/tck-restfull/README.md | 3 + .../tck/tck-restfull/artifact-install.sh | 25 +++ microprofile/tests/tck/tck-restfull/pom.xml | 63 ++++++++ .../tck-restfull/tck-restfull-test/pom.xml | 145 ++++++++++++++++++ .../restfull/tck/UrlLoaderExtension.java | 31 ++++ .../restfull/tck/UrlResourceProvider.java | 44 ++++++ ...boss.arquillian.core.spi.LoadableExtension | 18 +++ .../src/test/resources/arquillian.xml | 35 +++++ microprofile/tests/tck/tck-telemetry/pom.xml | 5 + pom.xml | 33 ++++ 55 files changed, 1982 insertions(+), 63 deletions(-) create mode 100644 microprofile/tests/tck/tck-annotations/pom.xml create mode 100644 microprofile/tests/tck/tck-cdi/pom.xml create mode 100644 microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlLoaderExtension.java create mode 100644 microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlResourceProvider.java create mode 100644 microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/beans.xml create mode 100644 microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/cdi-tck.properties create mode 100644 microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension create mode 100644 microprofile/tests/tck/tck-cdi/src/test/resources/application.yaml create mode 100644 microprofile/tests/tck/tck-cdi/src/test/resources/arquillian.xml create mode 100644 microprofile/tests/tck/tck-core-profile/README.md create mode 100755 microprofile/tests/tck/tck-core-profile/artifact-install.sh create mode 100644 microprofile/tests/tck/tck-core-profile/pom.xml create mode 100644 microprofile/tests/tck/tck-core-profile/tck-core-profile-test/pom.xml create mode 100644 microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlLoaderExtension.java create mode 100644 microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlResourceProvider.java create mode 100644 microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension create mode 100644 microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/arquillian.xml create mode 100644 microprofile/tests/tck/tck-inject/README.md create mode 100755 microprofile/tests/tck/tck-inject/artifact-install.sh create mode 100644 microprofile/tests/tck/tck-inject/pom.xml create mode 100644 microprofile/tests/tck/tck-inject/tck-inject-test/pom.xml create mode 100644 microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/AtInjectTCKExtension.java create mode 100644 microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/TckInjectTest.java create mode 100644 microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/META-INF/services/jakarta.enterprise.inject.se.SeContainerInitializer create mode 100644 microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/application.yaml create mode 100644 microprofile/tests/tck/tck-jsonb/pom.xml create mode 100644 microprofile/tests/tck/tck-jsonb/tck-jsonb-test/pom.xml create mode 100644 microprofile/tests/tck/tck-jsonp/README.md create mode 100755 microprofile/tests/tck/tck-jsonp/artifact-install.sh create mode 100644 microprofile/tests/tck/tck-jsonp/pom.xml create mode 100644 microprofile/tests/tck/tck-jsonp/tck-jsonp-test/pom.xml create mode 100644 microprofile/tests/tck/tck-restfull/README.md create mode 100755 microprofile/tests/tck/tck-restfull/artifact-install.sh create mode 100644 microprofile/tests/tck/tck-restfull/pom.xml create mode 100644 microprofile/tests/tck/tck-restfull/tck-restfull-test/pom.xml create mode 100644 microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlLoaderExtension.java create mode 100644 microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlResourceProvider.java create mode 100644 microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension create mode 100644 microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/arquillian.xml diff --git a/dependencies/pom.xml b/dependencies/pom.xml index d8193d6f852..ea50963e842 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -140,7 +140,7 @@ 0.2.1 0.1.8 0.25.0 - 1.0.2 + 1.1.2 42.4.3 0.16.0 1.0.4 diff --git a/microprofile/config/src/main/java/io/helidon/microprofile/config/ConfigCdiExtension.java b/microprofile/config/src/main/java/io/helidon/microprofile/config/ConfigCdiExtension.java index 941daa0a716..3f1cadb526c 100644 --- a/microprofile/config/src/main/java/io/helidon/microprofile/config/ConfigCdiExtension.java +++ b/microprofile/config/src/main/java/io/helidon/microprofile/config/ConfigCdiExtension.java @@ -136,18 +136,20 @@ private void processAnnotatedType(@Observes @WithAnnotations(ConfigProperties.cl private void harvestConfigPropertyInjectionPointsFromEnabledObserverMethod(@Observes ProcessObserverMethod event, BeanManager beanManager) { AnnotatedMethod annotatedMethod = event.getAnnotatedMethod(); - List> annotatedParameters = annotatedMethod.getParameters(); - if (annotatedParameters != null) { - for (AnnotatedParameter annotatedParameter : annotatedParameters) { - if ((annotatedParameter != null) - && !annotatedParameter.isAnnotationPresent(Observes.class)) { - InjectionPoint injectionPoint = beanManager.createInjectionPoint(annotatedParameter); - Set qualifiers = injectionPoint.getQualifiers(); - assert qualifiers != null; - for (Annotation qualifier : qualifiers) { - if (qualifier instanceof ConfigProperty) { - ips.add(injectionPoint); - break; + if (annotatedMethod != null) { + List> annotatedParameters = annotatedMethod.getParameters(); + if (annotatedParameters != null) { + for (AnnotatedParameter annotatedParameter : annotatedParameters) { + if ((annotatedParameter != null) + && !annotatedParameter.isAnnotationPresent(Observes.class)) { + InjectionPoint injectionPoint = beanManager.createInjectionPoint(annotatedParameter); + Set qualifiers = injectionPoint.getQualifiers(); + assert qualifiers != null; + for (Annotation qualifier : qualifiers) { + if (qualifier instanceof ConfigProperty) { + ips.add(injectionPoint); + break; + } } } } diff --git a/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerConfiguration.java b/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerConfiguration.java index f717983a9f5..54863b4524e 100644 --- a/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerConfiguration.java +++ b/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022 Oracle and/or its affiliates. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ * is empty) *
  • replaceConfigSourcesWithMp: (Optional) defaults to false: whether to replace config sources with microprofile if it * exists
  • + *
  • inWebContainer: defaults to false: sets web app context root, load WEB-INF/beans.xml and find any jakarta.ws.rs.core.Application in the webapp classes
  • * */ public class HelidonContainerConfiguration implements ContainerConfiguration { @@ -45,6 +46,7 @@ public class HelidonContainerConfiguration implements ContainerConfiguration { private boolean deleteTmp = true; private boolean useRelativePath = false; private boolean useParentClassloader = true; + private boolean inWebContainer = false; private final List> builderConsumers = new ArrayList<>(); /** @@ -104,6 +106,14 @@ public void setUseParentClassloader(boolean useParentClassloader) { this.useParentClassloader = useParentClassloader; } + public boolean isInWebContainer() { + return inWebContainer; + } + + public void setInWebContainer(boolean inWebContainer) { + this.inWebContainer = inWebContainer; + } + @Override public void validate() throws ConfigurationException { if ((port <= 0) || (port > Short.MAX_VALUE)) { diff --git a/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerExtension.java b/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerExtension.java index b751badab96..b4fdb94e987 100644 --- a/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerExtension.java +++ b/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonContainerExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022 Oracle and/or its affiliates. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package io.helidon.microprofile.arquillian; import java.lang.reflect.Method; -import java.util.Optional; import jakarta.enterprise.context.control.RequestContextController; import jakarta.enterprise.context.spi.CreationalContext; @@ -29,6 +28,7 @@ import org.jboss.arquillian.core.spi.LoadableExtension; import org.jboss.arquillian.test.spi.TestEnricher; import org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher; +import org.testng.annotations.Test; /** * An arquillian LoadableExtension defining the {@link HelidonDeployableContainer}. @@ -44,6 +44,8 @@ class HelidonContainerExtension implements LoadableExtension { */ static class HelidonCDIInjectionEnricher extends CDIInjectionEnricher { + private static final String ARQUILLIAN_DATA_PROVIDER = "ARQUILLIAN_DATA_PROVIDER"; + private static final Object[] EMPTY = new Object[0]; private BeanManager beanManager; private RequestContextController requestContextController; @@ -78,11 +80,11 @@ public RequestContextController getRequestContextController() { @Override public Object[] resolve(Method method) { - return Optional.ofNullable(method.getAnnotation(org.testng.annotations.Test.class)) - .filter(test -> !test.dataProvider().isEmpty()) - // Don't resolve TestNG data providers parameters as cdi beans - .map(unused -> new Object[0]) - .orElseGet(() -> super.resolve(method)); + Test test = method.getAnnotation(org.testng.annotations.Test.class); + if (test != null && !ARQUILLIAN_DATA_PROVIDER.equals(test.dataProvider())) { + return EMPTY; + } + return super.resolve(method); } private static CDI cdi() { diff --git a/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonDeployableContainer.java b/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonDeployableContainer.java index 4bf4dfd2788..052564b4832 100644 --- a/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonDeployableContainer.java +++ b/microprofile/tests/arquillian/src/main/java/io/helidon/microprofile/arquillian/HelidonDeployableContainer.java @@ -32,10 +32,12 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.Enumeration; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -45,12 +47,17 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.regex.Pattern; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + import io.helidon.config.mp.MpConfigSources; import jakarta.enterprise.inject.se.SeContainer; import jakarta.enterprise.inject.spi.CDI; import jakarta.enterprise.inject.spi.DefinitionException; import jakarta.enterprise.util.AnnotationLiteral; +import jakarta.ws.rs.core.Application; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; import org.eclipse.microprofile.config.spi.ConfigBuilder; @@ -64,9 +71,13 @@ import org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ArchivePath; +import org.jboss.shrinkwrap.api.ArchivePaths; import org.jboss.shrinkwrap.api.Node; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.descriptor.api.Descriptor; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; /** * Implementation of DeployableContainer for launching Helidon microprofile server. @@ -77,6 +88,7 @@ *
  • A temporary directory is created
  • *
  • The WebArchive contents are written to the temporary directory
  • *
  • beans.xml is created in WEB-INF/classes if not present
  • + *
  • WEB-INF/beans.xml will be moved to WEB-INF/classes/META-INF if present
  • *
  • The server is started with WEB-INF/classes and all libraries in WEB-INF/libon the classpath.
  • * * @@ -180,19 +192,26 @@ public ProtocolMetaData deploy(Archive archive) throws DeploymentException { Path rootDir = context.deployDir.resolve(""); if (isJavaArchive) { - ensureBeansXml(rootDir); + ensureBeansXml(rootDir, null); classPath.add(rootDir); } else { // Prepare the launcher files Path webInfDir = context.deployDir.resolve("WEB-INF"); Path classesDir = webInfDir.resolve("classes"); Path libDir = webInfDir.resolve("lib"); - ensureBeansXml(classesDir); + ensureBeansXml(classesDir, webInfDir); addServerClasspath(classPath, classesDir, libDir, rootDir); + if (containerConfig.isInWebContainer()) { + context.rootContext = archive.getName().split("\\.")[0]; + if (!loadApplicationFromWebXml(context, webInfDir)) { + // Search Application in classes + loadApplicationFromClasses(context, archive); + } + } } startServer(context, classPath.toArray(new Path[0])); - } catch (IOException e) { + } catch (IOException | SAXException | ParserConfigurationException e) { LOGGER.log(Level.INFO, "Failed to start container", e); throw new DeploymentException("Failed to copy the archive assets into the deployment directory", e); } catch (InvocationTargetException e) { @@ -221,6 +240,78 @@ public ProtocolMetaData deploy(Archive archive) throws DeploymentException { return new ProtocolMetaData(); } + private boolean loadApplicationFromClasses(RunContext context, Archive archive) + throws ClassNotFoundException, ReflectiveOperationException { + ArchivePath classes = ArchivePaths.create("WEB-INF", "classes"); + org.jboss.shrinkwrap.api.Node root = archive.getContent().get(classes); + Collection> applications = new HashSet<>(); + if (root != null) { + deepApplicationFind(root, applications); + context.applications.addAll(applications); + } + return !context.applications.isEmpty(); + } + + private void deepApplicationFind(org.jboss.shrinkwrap.api.Node parent, + Collection> applications) throws ClassNotFoundException { + for (org.jboss.shrinkwrap.api.Node child : parent.getChildren()) { + if (child.getChildren().isEmpty()) { + String name = child.toString(); + if (name.endsWith(".class")) { + name = name.replaceFirst("\\.class", "").replaceFirst("/WEB-INF/classes/", "").replaceAll("/", "."); + Class clazz = Class.forName(name); + if (Application.class.isAssignableFrom(clazz)) { + applications.add((Class) clazz); + } + } + } else { + deepApplicationFind(child, applications); + } + } + } + + private boolean loadApplicationFromWebXml(RunContext context, Path webInfDir) throws IOException, + ParserConfigurationException, SAXException, ReflectiveOperationException { + Path webXml = webInfDir.resolve("web.xml"); + if (Files.exists(webXml)) { + try (InputStream inputStream = Files.newInputStream(webXml)) { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document doc = db.parse(inputStream); + NodeList nodes = doc.getElementsByTagName("init-param"); + for (int i = 0; i < nodes.getLength(); i++) { + NodeList childs = nodes.item(i).getChildNodes(); + Class application = application(childs); + if (application != null) { + context.applications.add(application); + return true; + } + } + } + } + return false; + } + + private Class application(NodeList childs) throws ClassNotFoundException { + boolean isApp = false; + String appName = null; + for (int j = 0; j < childs.getLength(); j++) { + org.w3c.dom.Node element = childs.item(j); + String name = element.getNodeName(); + String value = element.getTextContent(); + if ("param-name".equals(name) && "jakarta.ws.rs.Application".equals(value)) { + isApp = true; + } else if ("param-value".equals(name)) { + appName = value; + } + } + if (isApp) { + return (Class) Class.forName(appName); + } else { + return null; + } + } + static Optional lookForSupressedDeploymentException(Throwable t) { if (t == null) { return Optional.empty(); @@ -290,6 +381,18 @@ void startServer(RunContext context, Path[] classPath) // META-INF/microprofile-config.properties (such as JWT-Auth) ConfigBuilder builder = ConfigProviderResolver.instance() .getBuilder(); + // Add root context path per Application + if (context.rootContext != null && !context.applications.isEmpty()) { + containerConfig.addConfigBuilderConsumer(configBuilder -> { + Map properties = new HashMap<>(); + for (Class app : context.applications) { + String key = app.getName() + ".routing-path.path"; + String value = "/" + context.rootContext; + properties.put(key, value); + } + configBuilder.withSources(MpConfigSources.create(properties)); + }); + } // we must use the default configuration to support profiles (and test them correctly in config TCK) // we may need to have a custom configuration for TCKs that do require workarounds /* @@ -376,17 +479,24 @@ void addServerClasspath(List classpath, Path classesDir, Path libDir, Path classpath.add(rootDir); } - private void ensureBeansXml(Path classesDir) throws IOException { + private void ensureBeansXml(Path classesDir, Path webinfDir) throws IOException { Path beansPath = classesDir.resolve("META-INF/beans.xml"); + Path metaInfPath = beansPath.getParent(); + if (null != metaInfPath) { + Files.createDirectories(metaInfPath); + } + if (containerConfig.isInWebContainer() && webinfDir != null) { + // In case exists WEB-INF/beans.xml, then move it to classes/META-INF/beans.xml + Path webInfBeansPath = webinfDir.resolve("beans.xml"); + if (Files.exists(webInfBeansPath)) { + Files.move(webInfBeansPath, beansPath); + return; + } + } if (Files.exists(beansPath)) { return; } try (InputStream beanXmlTemplate = HelidonDeployableContainer.class.getResourceAsStream("/templates/beans.xml")) { - Path metaInfPath = beansPath.getParent(); - if (null != metaInfPath) { - Files.createDirectories(metaInfPath); - } - if (null == beanXmlTemplate) { Files.write(beansPath, new byte[0]); } else { @@ -531,6 +641,8 @@ private static class RunContext { private Object runner; // existing class loader private ClassLoader oldClassLoader; + private String rootContext; + private Set> applications = new HashSet<>(); } static class HelidonContainerClassloader extends ClassLoader implements Closeable { @@ -576,8 +688,10 @@ public Enumeration getResources(String name) throws IOException { } } } - - return Collections.enumeration(result); + // Give priority to WebApp resources (for example ServiceLoader provided by WebApp) + List toRevert = new ArrayList(result); + Collections.reverse(toRevert); + return Collections.enumeration(toRevert); } @Override diff --git a/microprofile/tests/arquillian/src/main/resources/templates/beans.xml b/microprofile/tests/arquillian/src/main/resources/templates/beans.xml index 08e4a6696fb..7a12579eb75 100644 --- a/microprofile/tests/arquillian/src/main/resources/templates/beans.xml +++ b/microprofile/tests/arquillian/src/main/resources/templates/beans.xml @@ -1,7 +1,7 @@ + + + 4.0.0 + + io.helidon.microprofile.tests + tck-project + 4.0.0-SNAPSHOT + + tck-annotations + Helidon Microprofile Tests TCK Annotations + + + + jakarta.annotation + jakarta.annotation-api + + + + + + + maven-dependency-plugin + + + compile + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + maven-antrun-plugin + + + test + + run + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/microprofile/tests/tck/tck-cdi/pom.xml b/microprofile/tests/tck/tck-cdi/pom.xml new file mode 100644 index 00000000000..75a8f83462b --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/pom.xml @@ -0,0 +1,105 @@ + + + + + 4.0.0 + + tck-project + io.helidon.microprofile.tests + 4.0.0-SNAPSHOT + + tck-cdi + Helidon Microprofile Tests TCK CDI + + + + io.helidon.microprofile.tests + helidon-arquillian + ${project.version} + test + + + jakarta.enterprise + cdi-tck-api + test + + + jakarta.enterprise + cdi-tck-core-impl + test + + + org.jboss.weld + weld-porting-package-tck + test + + + org.testng + testng + test + + + org.glassfish + jakarta.el + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + cdi-full,se + + jakarta.enterprise:cdi-tck-core-impl + + + org/jboss/cdi/tck/tests/**/*Test.java + org/jboss/cdi/tck/interceptors/DependentContextTesttests/**/*Test.java + + + org/jboss/cdi/tck/tests/fulSyntheticBeanWithLookupTestl/extensions/lifecycle/bbd/broken/passivatingScope/AddingPassivatingScopeTest.java + + org/jboss/cdi/tck/tests/build/compatible/extensions/changeObserverQualifier/ChangeObserverQualifierTest.java + org/jboss/cdi/tck/tests/build/compatible/extensions/customStereotype/CustomStereotypeTest.java + org/jboss/cdi/tck/tests/build/compatible/extensions/syntheticBeanWithLookup/SyntheticBeanWithLookupTest.java + org/jboss/cdi/tck/tests/context/dependent/DependentContextTest.java + org/jboss/cdi/tck/tests/definition/bean/types/ManagedBeanTypesTest.java + org/jboss/cdi.tck/tests/event/EventTest.java + org/jboss/cdi/tck/tests/event/lifecycle/StartupShutdownTest.java + org/jboss/cdi/tck/tests/event/observer/broken/validation/unsatisfied/ObserverMethodParameterInjectionValidationTest.java + org/jboss/cdi/tck/tests/event/observer/broken/validation/ambiguous/ObserverMethodParameterInjectionValidationTest.java + org/jboss/cdi/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java + org/jboss/cdi/tck/tests/event/observer/conditional/ConditionalObserverTest.java + org/jboss/cdi/tck/tests/event/observer/ObserverNotificationTest.java + org/jboss/cdi/tck/tests/event/observer/async/executor/FireAsyncWithCustomExecutorTest.java + org/jboss/cdi/tck/tests/inheritance/generics/MemberLevelInheritanceTest.java + org/jboss/cdi/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/PrivateConstructorTest.java + org/jboss/cdi/tck/tests/lookup/clientProxy/unproxyable/beanConstructor/BeanConstructorWithParametersTest.java + org/jboss/cdi/tck/tests/implementation/simple/lifecycle/unproxyable/UnproxyableManagedBeanTest.java + + + + + + diff --git a/microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlLoaderExtension.java b/microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlLoaderExtension.java new file mode 100644 index 00000000000..39105a3bc5e --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlLoaderExtension.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.helidon.microprofile.cdi.tck; + +import org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider; +import org.jboss.arquillian.core.spi.LoadableExtension; +import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; + +/** + * LoadableExtension tht will load UrlResourceProvider. + */ +public class UrlLoaderExtension implements LoadableExtension { + @Override + public void register(ExtensionBuilder extensionBuilder) { + extensionBuilder.override(ResourceProvider.class, URLResourceProvider.class, UrlResourceProvider.class); + } +} diff --git a/microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlResourceProvider.java b/microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlResourceProvider.java new file mode 100644 index 00000000000..dbd9834999c --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/src/test/java/io/helidon/microprofile/cdi/tck/UrlResourceProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.helidon.microprofile.cdi.tck; + +import java.lang.annotation.Annotation; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; + +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; + +/** + * TCKs use addition when creating URL for a client. The default Arquillian implementation returns url without the trailing + * /. + */ +public class UrlResourceProvider implements ResourceProvider { + @Override + public Object lookup(ArquillianResource arquillianResource, Annotation... annotations) { + try { + return URI.create("http://localhost:8080/").toURL(); + } catch (MalformedURLException e) { + return null; + } + } + + @Override + public boolean canProvide(Class type) { + return URL.class.isAssignableFrom(type); + } +} diff --git a/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/beans.xml b/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/beans.xml new file mode 100644 index 00000000000..8b91810cea1 --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/beans.xml @@ -0,0 +1,25 @@ + + + + diff --git a/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/cdi-tck.properties b/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/cdi-tck.properties new file mode 100644 index 00000000000..eb25158ccef --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/cdi-tck.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +org.jboss.cdi.tck.cdiLiteMode=true +org.jboss.cdi.tck.libraryDirectory= +org.jboss.cdi.tck.testDataSource= +org.jboss.cdi.tck.testJmsConnectionFactory= +org.jboss.cdi.tck.testJmsQueue= +org.jboss.cdi.tck.testJmsTopic= +org.jboss.cdi.tck.spi.Beans=org.jboss.weld.tck.BeansImpl +org.jboss.cdi.tck.spi.Contexts=org.jboss.weld.tck.ContextsImpl +org.jboss.cdi.tck.spi.EL=org.jboss.weld.tck.ELImpl \ No newline at end of file diff --git a/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 00000000000..910053e9d23 --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +io.helidon.microprofile.cdi.tck.UrlLoaderExtension + diff --git a/microprofile/tests/tck/tck-cdi/src/test/resources/application.yaml b/microprofile/tests/tck/tck-cdi/src/test/resources/application.yaml new file mode 100644 index 00000000000..27189276ed8 --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/src/test/resources/application.yaml @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +mp: + initializer: + allow: true diff --git a/microprofile/tests/tck/tck-cdi/src/test/resources/arquillian.xml b/microprofile/tests/tck/tck-cdi/src/test/resources/arquillian.xml new file mode 100644 index 00000000000..5320417c279 --- /dev/null +++ b/microprofile/tests/tck/tck-cdi/src/test/resources/arquillian.xml @@ -0,0 +1,34 @@ + + + + + + target/deployments + 8080 + + + + true + + + \ No newline at end of file diff --git a/microprofile/tests/tck/tck-core-profile/README.md b/microprofile/tests/tck/tck-core-profile/README.md new file mode 100644 index 00000000000..e60b55bddd0 --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/README.md @@ -0,0 +1,3 @@ +# artifact-install.sh + +This file is used from an ant script in this module to install TCK artifacts in the local Maven repository \ No newline at end of file diff --git a/microprofile/tests/tck/tck-core-profile/artifact-install.sh b/microprofile/tests/tck/tck-core-profile/artifact-install.sh new file mode 100755 index 00000000000..1367e41aaf2 --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/artifact-install.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +##script to install the artifact directory contents into a local maven repository + +VERSION="$1" + +# pom +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=target/core-profile-tck-"$VERSION"/artifacts/core-tck-parent-"$VERSION".pom -DgroupId=jakarta.ee.tck.coreprofile \ +-DartifactId=core-tck-parent -Dversion="$VERSION" -Dpackaging=pom + +# jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=target/core-profile-tck-"$VERSION"/artifacts/core-profile-tck-impl-"$VERSION".jar -DgroupId=jakarta.ee.tck.coreprofile \ +-DartifactId=core-profile-tck-impl -Dversion="$VERSION" -Dpackaging=jar diff --git a/microprofile/tests/tck/tck-core-profile/pom.xml b/microprofile/tests/tck/tck-core-profile/pom.xml new file mode 100644 index 00000000000..23eac49ea5c --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/pom.xml @@ -0,0 +1,63 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-project + 4.0.0-SNAPSHOT + + pom + tck-core-profile + Helidon Microprofile Tests TCK Core Profile + + + tck-core-profile-test + + + + + + maven-antrun-plugin + + + validate + + run + + + + + + + + + + + + + + + + + + diff --git a/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/pom.xml b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/pom.xml new file mode 100644 index 00000000000..c99743d9be1 --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/pom.xml @@ -0,0 +1,84 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-core-profile + 4.0.0-SNAPSHOT + + tck-core-profile-test + Helidon Microprofile Tests TCK Core Profile + + + + io.helidon.microprofile.tests + helidon-arquillian + ${project.version} + test + + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + jakarta.ee.tck.coreprofile + core-profile-tck-impl + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + + + maven-antrun-plugin + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + + + jakarta.ee.tck.coreprofile:core-profile-tck-impl + + + *IT.java + + + + ee/jakarta/tck/core/jsonb/JsonbApplicationIT.java + ee/jakarta/tck/core/json/ApplicationJsonpIT.java + ee/jakarta/tck/core/rest/jsonb/cdi/CustomJsonbSerializationIT.java + + + + + + diff --git a/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlLoaderExtension.java b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlLoaderExtension.java new file mode 100644 index 00000000000..da589938f7c --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlLoaderExtension.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.helidon.microprofile.coreprofile.tck; + +import org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider; +import org.jboss.arquillian.core.spi.LoadableExtension; +import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; + +/** + * LoadableExtension tht will load UrlResourceProvider. + */ +public class UrlLoaderExtension implements LoadableExtension { + @Override + public void register(ExtensionBuilder extensionBuilder) { + extensionBuilder.override(ResourceProvider.class, URLResourceProvider.class, UrlResourceProvider.class); + } +} diff --git a/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlResourceProvider.java b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlResourceProvider.java new file mode 100644 index 00000000000..caa6063da0c --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/java/io/helidon/microprofile/coreprofile/tck/UrlResourceProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.helidon.microprofile.coreprofile.tck; + +import java.lang.annotation.Annotation; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; + +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; + +/** + * TCKs use addition when creating URL for a client. The default Arquillian implementation returns url without the trailing + * /. + */ +public class UrlResourceProvider implements ResourceProvider { + @Override + public Object lookup(ArquillianResource arquillianResource, Annotation... annotations) { + try { + return URI.create("http://localhost:8080/").toURL(); + } catch (MalformedURLException e) { + return null; + } + } + + @Override + public boolean canProvide(Class type) { + return URL.class.isAssignableFrom(type); + } +} diff --git a/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 00000000000..1f291ae7977 --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +io.helidon.microprofile.coreprofile.tck.UrlLoaderExtension + diff --git a/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/arquillian.xml b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/arquillian.xml new file mode 100644 index 00000000000..f47555c4b3a --- /dev/null +++ b/microprofile/tests/tck/tck-core-profile/tck-core-profile-test/src/test/resources/arquillian.xml @@ -0,0 +1,33 @@ + + + + + + target/deployments + + + + true + + + \ No newline at end of file diff --git a/microprofile/tests/tck/tck-graphql/pom.xml b/microprofile/tests/tck/tck-graphql/pom.xml index 04061b66de5..0bc3081d50a 100644 --- a/microprofile/tests/tck/tck-graphql/pom.xml +++ b/microprofile/tests/tck/tck-graphql/pom.xml @@ -62,6 +62,11 @@ jakarta.xml.bind-api test + + org.testng + testng + test + diff --git a/microprofile/tests/tck/tck-health/pom.xml b/microprofile/tests/tck/tck-health/pom.xml index cf950bf802b..d015c632c6d 100644 --- a/microprofile/tests/tck/tck-health/pom.xml +++ b/microprofile/tests/tck/tck-health/pom.xml @@ -56,6 +56,11 @@ com.google.guava guava + + org.testng + testng + test + diff --git a/microprofile/tests/tck/tck-inject/README.md b/microprofile/tests/tck/tck-inject/README.md new file mode 100644 index 00000000000..e60b55bddd0 --- /dev/null +++ b/microprofile/tests/tck/tck-inject/README.md @@ -0,0 +1,3 @@ +# artifact-install.sh + +This file is used from an ant script in this module to install TCK artifacts in the local Maven repository \ No newline at end of file diff --git a/microprofile/tests/tck/tck-inject/artifact-install.sh b/microprofile/tests/tck/tck-inject/artifact-install.sh new file mode 100755 index 00000000000..402d95eb718 --- /dev/null +++ b/microprofile/tests/tck/tck-inject/artifact-install.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +##script to install the artifact directory contents into a local maven repository + +VERSION="$1" + +# jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=target/jakarta.inject-tck-"$VERSION"/jakarta.inject-tck-"$VERSION".jar -DgroupId=jakarta.inject \ +-DartifactId=jakarta.inject-tck -Dversion="$VERSION" -Dpackaging=jar diff --git a/microprofile/tests/tck/tck-inject/pom.xml b/microprofile/tests/tck/tck-inject/pom.xml new file mode 100644 index 00000000000..1467afddd8f --- /dev/null +++ b/microprofile/tests/tck/tck-inject/pom.xml @@ -0,0 +1,63 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-project + 4.0.0-SNAPSHOT + + pom + tck-inject + Helidon Microprofile Tests TCK Inject + + + tck-inject-test + + + + + + maven-antrun-plugin + + + validate + + run + + + + + + + + + + + + + + + + + + diff --git a/microprofile/tests/tck/tck-inject/tck-inject-test/pom.xml b/microprofile/tests/tck/tck-inject/tck-inject-test/pom.xml new file mode 100644 index 00000000000..8b2c0e1a901 --- /dev/null +++ b/microprofile/tests/tck/tck-inject/tck-inject-test/pom.xml @@ -0,0 +1,76 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-inject + 4.0.0-SNAPSHOT + + tck-inject-tests + Helidon Microprofile Tests TCK Inject + + + + org.junit.jupiter + junit-jupiter-engine + test + + + io.helidon.microprofile.weld + weld-se-core + test + + + io.helidon.microprofile.bundles + helidon-microprofile + test + + + jakarta.inject + jakarta.inject-tck + + 2.0.2 + test + + + + + + + maven-antrun-plugin + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + + + io.helidon.microprofile.tests.inject.TckInjectTest.java + + + + + + diff --git a/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/AtInjectTCKExtension.java b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/AtInjectTCKExtension.java new file mode 100644 index 00000000000..d86031faa30 --- /dev/null +++ b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/AtInjectTCKExtension.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.helidon.microprofile.tests.inject; + +import org.atinject.tck.auto.Convertible; +import org.atinject.tck.auto.Drivers; +import org.atinject.tck.auto.DriversSeat; +import org.atinject.tck.auto.accessories.SpareTire; +import org.jboss.weld.literal.NamedLiteral; + +import jakarta.enterprise.event.Observes; +import jakarta.enterprise.inject.spi.Extension; +import jakarta.enterprise.inject.spi.ProcessAnnotatedType; +import jakarta.enterprise.util.AnnotationLiteral; +import jakarta.inject.Qualifier; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +class AtInjectTCKExtension implements Extension { + public void convertible(@Observes ProcessAnnotatedType pat) { + pat.configureAnnotatedType() + .filterFields(field -> "spareTire".equals(field.getJavaMember().getName())) + // add @Spare to the injection point, because the bean doesn't have @Default; see also below + .forEach(field -> {field.add(SpareLiteral.INSTANCE); System.out.printf("Added @Spare to %s\n", field.getAnnotated());}); + } + + public void driversSeat(@Observes ProcessAnnotatedType pat) { + pat.configureAnnotatedType() + .add(DriversLiteral.INSTANCE); + System.out.printf("Added @Drivers to: %s\n", pat.getAnnotatedType()); + } + + public void spareTire(@Observes ProcessAnnotatedType pat) { + pat.configureAnnotatedType() + .add(new NamedLiteral("spare")) + // add @Spare to prevent adding @Default, otherwise there would be 2 beans for the Tire type + .add(SpareLiteral.INSTANCE); + System.out.printf("Added @Named('spare') to: %s\n", pat.getAnnotatedType()); + } + + static final class DriversLiteral extends AnnotationLiteral implements Drivers { + static final DriversLiteral INSTANCE = new DriversLiteral(); + + private DriversLiteral() { + } + } + + @Qualifier + @Retention(RetentionPolicy.RUNTIME) + @interface Spare { + } + + static final class SpareLiteral extends AnnotationLiteral implements Spare { + static final SpareLiteral INSTANCE = new SpareLiteral(); + + private SpareLiteral() { + } + } +} diff --git a/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/TckInjectTest.java b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/TckInjectTest.java new file mode 100644 index 00000000000..607cb36f635 --- /dev/null +++ b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/java/io/helidon/microprofile/tests/inject/TckInjectTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.helidon.microprofile.tests.inject; + +import jakarta.enterprise.inject.se.SeContainer; +import jakarta.enterprise.inject.se.SeContainerInitializer; +import org.atinject.tck.Tck; +import org.atinject.tck.auto.Car; +import org.atinject.tck.auto.Convertible; +import org.atinject.tck.auto.DriversSeat; +import org.atinject.tck.auto.FuelTank; +import org.atinject.tck.auto.Seat; +import org.atinject.tck.auto.Seatbelt; +import org.atinject.tck.auto.Tire; +import org.atinject.tck.auto.V8Engine; +import org.atinject.tck.auto.accessories.Cupholder; +import org.atinject.tck.auto.accessories.RoundThing; +import org.atinject.tck.auto.accessories.SpareTire; +import org.junit.jupiter.api.Test; + +class TckInjectTest { + + @Test + public void test() { + SeContainer container = SeContainerInitializer + .newInstance() + .addExtensions(AtInjectTCKExtension.class) + .addBeanClasses(Car.class) + .addBeanClasses(Convertible.class, DriversSeat.class, FuelTank.class, Seat.class, Seatbelt.class, + Tire.class, V8Engine.class, Cupholder.class, RoundThing.class, SpareTire.class) + .initialize(); + Car tckCar = container.select(Car.class).get(); + Tck.testsFor(tckCar, false, true); + } + +} diff --git a/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/META-INF/services/jakarta.enterprise.inject.se.SeContainerInitializer b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/META-INF/services/jakarta.enterprise.inject.se.SeContainerInitializer new file mode 100644 index 00000000000..d1f5b545e0c --- /dev/null +++ b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/META-INF/services/jakarta.enterprise.inject.se.SeContainerInitializer @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +io.helidon.microprofile.cdi.HelidonContainerInitializer \ No newline at end of file diff --git a/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/application.yaml b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/application.yaml new file mode 100644 index 00000000000..27189276ed8 --- /dev/null +++ b/microprofile/tests/tck/tck-inject/tck-inject-test/src/test/resources/application.yaml @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +mp: + initializer: + allow: true diff --git a/microprofile/tests/tck/tck-jsonb/pom.xml b/microprofile/tests/tck/tck-jsonb/pom.xml new file mode 100644 index 00000000000..8f58e526209 --- /dev/null +++ b/microprofile/tests/tck/tck-jsonb/pom.xml @@ -0,0 +1,63 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-project + 4.0.0-SNAPSHOT + + pom + tck-jsonb + Helidon Microprofile Tests TCK JSONB + + + tck-jsonb-test + + + + + + maven-antrun-plugin + + + validate + + run + + + + + + + + + + + + + + + + + + diff --git a/microprofile/tests/tck/tck-jsonb/tck-jsonb-test/pom.xml b/microprofile/tests/tck/tck-jsonb/tck-jsonb-test/pom.xml new file mode 100644 index 00000000000..3d6a8142383 --- /dev/null +++ b/microprofile/tests/tck/tck-jsonb/tck-jsonb-test/pom.xml @@ -0,0 +1,84 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-jsonb + 4.0.0-SNAPSHOT + + tck-jsonb-tests + Helidon Microprofile Tests TCK JSONB + + + + org.junit.jupiter + junit-jupiter-engine + test + + + io.helidon.microprofile.bundles + helidon-microprofile + test + + + jakarta.json.bind + jakarta.json.bind-tck + ${version.lib.jakarta.jsonb-api} + test + + + org.eclipse + yasson + + 3.0.3 + + + + + + + maven-antrun-plugin + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + + + jakarta.json.bind:jakarta.json.bind-tck + + + *Test.java + + + *CDITest.java + *JSONBSigTest.java + NumberFormatCustomizationTest.java + + + + + + diff --git a/microprofile/tests/tck/tck-jsonp/README.md b/microprofile/tests/tck/tck-jsonp/README.md new file mode 100644 index 00000000000..e60b55bddd0 --- /dev/null +++ b/microprofile/tests/tck/tck-jsonp/README.md @@ -0,0 +1,3 @@ +# artifact-install.sh + +This file is used from an ant script in this module to install TCK artifacts in the local Maven repository \ No newline at end of file diff --git a/microprofile/tests/tck/tck-jsonp/artifact-install.sh b/microprofile/tests/tck/tck-jsonp/artifact-install.sh new file mode 100755 index 00000000000..db282287a3a --- /dev/null +++ b/microprofile/tests/tck/tck-jsonp/artifact-install.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +##script to install the artifact directory contents into a local maven repository + +VERSION="$1" + +# Parent pom +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-"$VERSION".pom -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck -Dversion="$VERSION" -Dpackaging=pom + +# pom +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-common-"$VERSION".pom -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-common -Dversion="$VERSION" -Dpackaging=pom + +# jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-common-"$VERSION".jar -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-common -Dversion="$VERSION" -Dpackaging=jar + +# sources jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-common-"$VERSION"-sources.jar -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-common-sources -Dversion="$VERSION" -Dpackaging=jar + +# pom +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-tests-"$VERSION".pom -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-tests -Dversion="$VERSION" -Dpackaging=pom + +# jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-tests-"$VERSION".jar -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-tests -Dversion="$VERSION" -Dpackaging=jar + +# sources jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-tests-"$VERSION"-sources.jar -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-tests-sources -Dversion="$VERSION" -Dpackaging=jar + +# pom +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-tests-pluggability-"$VERSION".pom -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-tests-pluggability -Dversion="$VERSION" -Dpackaging=pom + +# jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-tests-pluggability-"$VERSION".jar -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-tests-pluggability -Dversion="$VERSION" -Dpackaging=jar + +# sources jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=jakarta.json-tck-tests-pluggability-"$VERSION"-sources.jar -DgroupId=jakarta.json \ +-DartifactId=jakarta.json-tck-tests-pluggability-sources -Dversion="$VERSION" -Dpackaging=jar diff --git a/microprofile/tests/tck/tck-jsonp/pom.xml b/microprofile/tests/tck/tck-jsonp/pom.xml new file mode 100644 index 00000000000..ab6a88f8b5a --- /dev/null +++ b/microprofile/tests/tck/tck-jsonp/pom.xml @@ -0,0 +1,64 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-project + 4.0.0-SNAPSHOT + + pom + tck-jsonp + Helidon Microprofile Tests TCK JSONP + + + tck-jsonp-test + + + + + + maven-antrun-plugin + + + validate + + run + + + + + + + + + + + + + + + + + + + diff --git a/microprofile/tests/tck/tck-jsonp/tck-jsonp-test/pom.xml b/microprofile/tests/tck/tck-jsonp/tck-jsonp-test/pom.xml new file mode 100644 index 00000000000..d66a2bb550b --- /dev/null +++ b/microprofile/tests/tck/tck-jsonp/tck-jsonp-test/pom.xml @@ -0,0 +1,74 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-jsonp + 4.0.0-SNAPSHOT + + tck-jsonp-test + Helidon Microprofile Tests TCK JSONP + + + + org.junit.jupiter + junit-jupiter-engine + test + + + io.helidon.microprofile.bundles + helidon-microprofile + test + + + + jakarta.json + jakarta.json-tck-tests + ${version.lib.jakarta.jsonp-api} + test + + + + + + + maven-antrun-plugin + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + + + jakarta.json:jakarta.json-tck-tests + + + *Tests.java + + + + + + diff --git a/microprofile/tests/tck/tck-jwt-auth/pom.xml b/microprofile/tests/tck/tck-jwt-auth/pom.xml index 0e5be254168..3651c252990 100644 --- a/microprofile/tests/tck/tck-jwt-auth/pom.xml +++ b/microprofile/tests/tck/tck-jwt-auth/pom.xml @@ -62,6 +62,11 @@ arquillian-container-test-spi test + + org.testng + testng + test + diff --git a/microprofile/tests/tck/tck-openapi/pom.xml b/microprofile/tests/tck/tck-openapi/pom.xml index bf07387bb70..54a00780d75 100644 --- a/microprofile/tests/tck/tck-openapi/pom.xml +++ b/microprofile/tests/tck/tck-openapi/pom.xml @@ -96,6 +96,11 @@ 2.3.2 test + + org.testng + testng + test + diff --git a/microprofile/tests/tck/tck-opentracing/pom.xml b/microprofile/tests/tck/tck-opentracing/pom.xml index 4a2c80420a4..a5f64c60652 100644 --- a/microprofile/tests/tck/tck-opentracing/pom.xml +++ b/microprofile/tests/tck/tck-opentracing/pom.xml @@ -54,6 +54,11 @@ helidon-microprofile-tracing test + + org.testng + testng + test + diff --git a/microprofile/tests/tck/tck-reactive-operators/pom.xml b/microprofile/tests/tck/tck-reactive-operators/pom.xml index 5ca386e407d..27278a486c2 100644 --- a/microprofile/tests/tck/tck-reactive-operators/pom.xml +++ b/microprofile/tests/tck/tck-reactive-operators/pom.xml @@ -51,6 +51,11 @@ org.eclipse.microprofile.reactive-streams-operators microprofile-reactive-streams-operators-tck + + org.testng + testng + test + diff --git a/microprofile/tests/tck/tck-rest-client/pom.xml b/microprofile/tests/tck/tck-rest-client/pom.xml index 5d923b5204c..6a776f7b6e6 100644 --- a/microprofile/tests/tck/tck-rest-client/pom.xml +++ b/microprofile/tests/tck/tck-rest-client/pom.xml @@ -50,6 +50,11 @@ commons-lang3 test + + org.testng + testng + test + diff --git a/microprofile/tests/tck/tck-restfull/README.md b/microprofile/tests/tck/tck-restfull/README.md new file mode 100644 index 00000000000..e60b55bddd0 --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/README.md @@ -0,0 +1,3 @@ +# artifact-install.sh + +This file is used from an ant script in this module to install TCK artifacts in the local Maven repository \ No newline at end of file diff --git a/microprofile/tests/tck/tck-restfull/artifact-install.sh b/microprofile/tests/tck/tck-restfull/artifact-install.sh new file mode 100755 index 00000000000..9f1c71d7b75 --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/artifact-install.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +##script to install the artifact directory contents into a local maven repository + +VERSION="$1" + +# jar +mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \ +-Dfile=target/jakarta-restful-ws-tck-"$VERSION".jar -DgroupId=jakarta.ws.rs \ +-DartifactId=jakarta-restful-ws-tck -Dversion="$VERSION" -Dpackaging=jar diff --git a/microprofile/tests/tck/tck-restfull/pom.xml b/microprofile/tests/tck/tck-restfull/pom.xml new file mode 100644 index 00000000000..28cb7a4578d --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/pom.xml @@ -0,0 +1,63 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-project + 4.0.0-SNAPSHOT + + pom + tck-restfull + Helidon Microprofile Tests TCK Restfull + + + tck-restfull-test + + + + + + maven-antrun-plugin + + + validate + + run + + + + + + + + + + + + + + + + + + diff --git a/microprofile/tests/tck/tck-restfull/tck-restfull-test/pom.xml b/microprofile/tests/tck/tck-restfull/tck-restfull-test/pom.xml new file mode 100644 index 00000000000..9336062be29 --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/tck-restfull-test/pom.xml @@ -0,0 +1,145 @@ + + + + + 4.0.0 + + io.helidon.microprofile.tests + tck-restfull + 4.0.0-SNAPSHOT + + tck-resfull-test + Helidon Microprofile Tests TCK Restfull + + + + io.helidon.microprofile.tests + helidon-arquillian + ${project.version} + test + + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + jakarta.ws.rs + jakarta-restful-ws-tck + test + + + org.junit.jupiter + junit-jupiter + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + io.helidon.microprofile.bundles + helidon-microprofile + test + + + com.sun.xml.bind + jaxb-impl + + + org.glassfish.jersey.media + jersey-media-jaxb + + + + + + + maven-antrun-plugin + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + + jakarta.ws.rs:jakarta-restful-ws-tck + + + *IT.java + + + + ee/jakarta/tck/ws/rs/ee/rs/core/request/JAXRSClientIT.java + + ee/jakarta/tck/ws/rs/spec/client/exceptions/ClientExceptionsIT.java + ee/jakarta/tck/ws/rs/ee/rs/container/responsecontext/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/pathparam/sub/JAXRSSubClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/matrixparam/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/spec/resourceconstructor/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/pathparam/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/beanparam/plain/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/ext/providers/JAXRSProvidersClientIT.java + ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/spec/provider/sort/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/cookieparam/locator/JAXRSLocatorClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/headerparam/sub/JAXRSSubClientIT.java + ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/ext/paramconverter/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/beanparam/matrix/plain/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/beanparam/path/plain/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/pathparam/locator/JAXRSLocatorClientIT.java + ee/jakarta/tck/ws/rs/spec/provider/standard/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/signaturetest/jaxrs/JAXRSSigTestIT.java + ee/jakarta/tck/ws/rs/ee/rs/queryparam/sub/JAXRSSubClientIT.java + ee/jakarta/tck/ws/rs/jaxrs21/ee/client/executor/rx/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/spec/contextprovider/JsonbContextProviderIT.java + ee/jakarta/tck/ws/rs/spec/resource/locator/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/matrixparam/locator/JAXRSLocatorClientIT.java + ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/ssebroadcaster/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/core/configurable/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/spec/resource/annotationprecedence/subclass/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/sebootstrap/SeBootstrapIT.java + ee/jakarta/tck/ws/rs/ee/rs/core/uriinfo/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/cookieparam/sub/JAXRSSubClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/matrixparam/sub/JAXRSSubClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/formparam/sub/JAXRSSubClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/formparam/locator/JAXRSLocatorClientIT.java + ee/jakarta/tck/ws/rs/servlet3/rs/applicationpath/JAXRSClientIT.java + ee/jakarta/tck/ws/rs/ee/rs/headerparam/locator/JAXRSLocatorClientIT.java + ee/jakarta/tck/ws/rs/spec/resource/valueofandfromstring/JAXRSClientIT.java + + xml_binding,servlet,security + + localhost + 8080 + + + + + + diff --git a/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlLoaderExtension.java b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlLoaderExtension.java new file mode 100644 index 00000000000..f060ea6edb1 --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlLoaderExtension.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.helidon.microprofile.restfull.tck; + +import org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider; +import org.jboss.arquillian.core.spi.LoadableExtension; +import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; + +/** + * LoadableExtension tht will load UrlResourceProvider. + */ +public class UrlLoaderExtension implements LoadableExtension { + @Override + public void register(ExtensionBuilder extensionBuilder) { + extensionBuilder.override(ResourceProvider.class, URLResourceProvider.class, UrlResourceProvider.class); + } +} diff --git a/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlResourceProvider.java b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlResourceProvider.java new file mode 100644 index 00000000000..9972bdc80be --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/java/io/helidon/microprofile/restfull/tck/UrlResourceProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.helidon.microprofile.restfull.tck; + +import java.lang.annotation.Annotation; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; + +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; + +/** + * TCKs use addition when creating URL for a client. The default Arquillian implementation returns url without the trailing + * /. + */ +public class UrlResourceProvider implements ResourceProvider { + @Override + public Object lookup(ArquillianResource arquillianResource, Annotation... annotations) { + try { + return URI.create("http://localhost:8080/").toURL(); + } catch (MalformedURLException e) { + return null; + } + } + + @Override + public boolean canProvide(Class type) { + return URL.class.isAssignableFrom(type); + } +} diff --git a/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 00000000000..a9f56c581b4 --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +io.helidon.microprofile.restfull.tck.UrlLoaderExtension + diff --git a/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/arquillian.xml b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/arquillian.xml new file mode 100644 index 00000000000..a04cc2bee39 --- /dev/null +++ b/microprofile/tests/tck/tck-restfull/tck-restfull-test/src/test/resources/arquillian.xml @@ -0,0 +1,35 @@ + + + + + + target/deployments + 8080 + + + + false + true + + + \ No newline at end of file diff --git a/microprofile/tests/tck/tck-telemetry/pom.xml b/microprofile/tests/tck/tck-telemetry/pom.xml index c8da159caea..81545d8252f 100644 --- a/microprofile/tests/tck/tck-telemetry/pom.xml +++ b/microprofile/tests/tck/tck-telemetry/pom.xml @@ -55,6 +55,11 @@ microprofile-telemetry-tracing-tck test + + org.testng + testng + test + diff --git a/pom.xml b/pom.xml index 9e17f17e26a..5f8c131bc2e 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,9 @@ 9.1 2.11.0 2.4.14 + 10.0.1 + 4.0.10 + 3.1.3 2.2.1.Final 1.15.3 @@ -94,6 +97,7 @@ 3.1.2 3.1.2 + 3.1.0 3.4.0 3.1.2 3.11.0 @@ -770,6 +774,10 @@ fail + + maven-antrun-plugin + ${version.plugin.ant} + @@ -942,6 +950,26 @@ opentracing-mock ${version.lib.opentracing} + + jakarta.ee.tck.coreprofile + core-profile-tck-impl + ${version.lib.microprofile-core-profile} + + + jakarta.enterprise + cdi-tck-core-impl + ${version.lib.microprofile-cdi-tck} + + + jakarta.enterprise + cdi-tck-api + ${version.lib.microprofile-cdi-tck} + + + jakarta.ws.rs + jakarta-restful-ws-tck + ${version.lib.microprofile-restfull-tck} + com.github.akarnokd rxjava2-jdk9-interop @@ -967,6 +995,11 @@ org.eclipse.jgit.junit ${version.lib.jgit} + + org.jboss.weld + weld-porting-package-tck + ${version.lib.weld} + io.zipkin.zipkin2 zipkin-junit