From bf94d4bf483434b53009624f5b9360c5f5cf6667 Mon Sep 17 00:00:00 2001 From: Arjan Tijms Date: Wed, 19 Jun 2024 19:29:52 +0200 Subject: [PATCH 1/5] Updated CDI API TCK to 4.1.0 Note: only API done, model still to do Signed-off-by: Arjan Tijms --- glassfish-runner/cdi-tck/pom.xml | 438 +++++++----------- .../glassfish/GlassFishContextualsImpl.java | 69 +++ .../GlassFishCreationalContextsImpl.java | 80 ++++ ...assFishDeploymentExceptionTransformer.java | 7 +- .../resources/META-INF/cdi-tck.properties | 2 + pom.xml | 4 +- 6 files changed, 324 insertions(+), 276 deletions(-) create mode 100644 glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishContextualsImpl.java create mode 100644 glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishCreationalContextsImpl.java diff --git a/glassfish-runner/cdi-tck/pom.xml b/glassfish-runner/cdi-tck/pom.xml index 0b81ce2ffc..7b11c80766 100644 --- a/glassfish-runner/cdi-tck/pom.xml +++ b/glassfish-runner/cdi-tck/pom.xml @@ -32,15 +32,20 @@ - 4.0.7 - ${glassfish.root}/glassfish7 + 4.1.0 ${project.build.directory} - 7.0.0-M10 + + + 8.0.0-M6 2.50.0 - 5.0.0.SP2 + false + + + 6.0.0.Beta1 + 6.0.Beta4 @@ -49,246 +54,213 @@ jakarta.enterprise jakarta.enterprise.cdi-api - 4.0.0 + provided + + + jakarta.enterprise + jakarta.enterprise.cdi-el-api + 4.1.0 + provided + + + jakarta.el + jakarta.el-api + provided jakarta.faces jakarta.faces-api - 4.0.0 + test + + + jakarta.servlet + jakarta.servlet-api + test + + + jakarta.jms + jakarta.jms-api + test + + + jakarta.transaction + jakarta.transaction-api + test + + + jakarta.resource + jakarta.resource-api + test + + + jakarta.servlet.jsp + jakarta.servlet.jsp-api + test + + + jakarta.ws.rs + jakarta.ws.rs-api + test org.jboss.weld - weld-core-impl - ${weld.version} + weld-api + ${weld.version2} + provided - org.testng - testng - - - jakarta.el - jakarta.el-api + * + * - org.jboss.weld - weld-lite-extension-translator - ${weld.version} - - - - org.jboss.weld.module - weld-jsf - ${weld.version} + weld-spi + ${weld.version2} + provided - org.testng - testng + * + * - - org.jboss.weld.module - weld-ejb + org.jboss.weld + weld-core-impl ${weld.version} + provided + + + * + * + + org.jboss.weld.module weld-web ${weld.version} - - - - - jakarta.enterprise - cdi-tck-api - ${cdi.tck-4-0.version} + provided - jakarta.el - jakarta.el-api + * + * + The TCK API is quite small and mostly contains the org.jboss.cdi.tck.api.Configuration interface + for programmatically configuring the TCK with things such as "org.jboss.cdi.tck.testDataSource" which + are set below using a system property. + --> jakarta.enterprise - cdi-tck-core-impl - ${cdi.tck-4-0.version} + cdi-tck-api + ${cdi.tck-4-1.version} test - jakarta.el - jakarta.el-api - - - jakarta.faces - jakarta.faces-api - - - org.jboss.arquillian.container - container-se-api - - - org.jboss.test-audit - jboss-test-audit-api - - - org.jboss.test-audit - jboss-test-audit-impl + * + * + The TCK Core implementation contains test helper code such as the Configuration implementation + and the ArchiveBuilder, as well as a large amount of tests. + --> jakarta.enterprise - cdi-tck-web-impl - ${cdi.tck-4-0.version} + cdi-tck-core-impl + ${cdi.tck-4-1.version} test - jakarta.el - jakarta.el-api - - - jakarta.faces - jakarta.faces-api - - - org.jboss.arquillian.container - container-se-api - - - org.jboss.test-audit - jboss-test-audit-api - - - org.jboss.test-audit - jboss-test-audit-impl + * + * - jakarta.enterprise - cdi-tck-web-impl - ${cdi.tck-4-0.version} + cdi-tck-core-impl + ${cdi.tck-4-1.version} suite xml test - jakarta.el - jakarta.el-api - - - jakarta.faces - jakarta.faces-api - - - org.jboss.arquillian.container - container-se-api - - - org.jboss.test-audit - jboss-test-audit-api - - - org.jboss.test-audit - jboss-test-audit-impl + * + * - - jakarta.enterprise - cdi-tck-core-impl - ${cdi.tck-4-0.version} - sigtest-jdk11 - sig - test + org.glassfish.expressly + expressly + 6.0.0-M1 + provided - org.jboss.test-audit - jboss-test-audit-api - - - org.jboss.test-audit - jboss-test-audit-impl + * + * - org.glassfish.expressly - expressly - 5.0.0-M2 + commons-lang + commons-lang + 2.6 + test - - org.glassfish.main.common - container-common - ${glassfish.version} + net.sourceforge.htmlunit + htmlunit + ${htmlunit.version} test - commons-lang - commons-lang - 2.6 - test + org.jboss.weld + weld-lite-extension-translator + ${weld.version} org.testng testng - 7.4.0 + 7.9.0 + test - - - org.netbeans.tools - sigtest-maven-plugin - 1.6 + org.jboss.arquillian.testng + arquillian-testng-container + 1.8.0.Final + test + + + org.jboss.shrinkwrap.descriptors + shrinkwrap-descriptors-impl-javaee + test - + The Arquillian connector that starts GlassFish and deploys archives to it. + --> org.omnifaces.arquillian arquillian-glassfish-server-managed - 1.2 - - - - jakarta.el - jakarta.el-api - 5.0.0 + 1.4 + test @@ -320,104 +292,39 @@ - org.apache.maven.plugins maven-dependency-plugin - - unpack-jars - - unpack-dependencies - - validate - - true - ${project.build.directory}/cdi-sigtest-classes - - - jakarta.enterprise - cdi-tck-core-impl - ${cdi.tck-4-0.version} - test - - - jar - *.* - - - - unpack-jars-gf - - unpack-dependencies - - validate - - true - ${project.build.directory}/cdi-sigtest-classes - - - jakarta.annotation - jakarta.annotation-api - system - ${glassfish.home}/glassfish/modules/jakarta.annotation-api.jar - - - jakarta.el - jakarta.el-api - system - ${glassfish.home}/glassfish/modules/jakarta.el-api.jar - - - jakarta.interceptor - jakarta.interceptor-api - system - ${glassfish.home}/glassfish/modules/jakarta.interceptor-api.jar - - - jakarta.inject - jakarta.inject-api - system - ${glassfish.home}/glassfish/modules/jakarta.inject-api.jar - - - jakarta.enterprise - jakarta.enterprise.lang-model - system - ${glassfish.home}/glassfish/modules/jakarta.enterprise.lang-model.jar - - - jakarta.enterprise - jakarta.enterprise.cdi-api - system - ${glassfish.home}/glassfish/modules/jakarta.enterprise.cdi-api.jar - - - jar - - copy-test-suites copy - process-test-classes + pre-integration-test + jakarta.enterprise - cdi-tck-web-impl - ${cdi.tck-4-0.version} + cdi-tck-core-impl + ${cdi.tck-4-1.version} xml suite false - tck-web-suite.xml + tck-core-suite.xml - ${project.build.directory}/suites + target/suites false true + install-cdi-tck-ext-lib @@ -430,15 +337,16 @@ jakarta.enterprise cdi-tck-ext-lib - ${cdi.tck-4-0.version} + ${cdi.tck-4-1.version} jar true - ${glassfish.root}/glassfish7/glassfish/domains/domain1/lib/applibs + ${glassfish.root}/glassfish8/glassfish/domains/domain1/lib/applibs cdi-tck-ext-lib.jar + unpack-glassfish @@ -461,40 +369,20 @@ + - org.netbeans.tools - sigtest-maven-plugin - 1.6 - - ${project.build.directory}/cdi-sigtest-classes/cdi-api-jdk11.sig - jakarta.decorator,jakarta.enterprise,jakarta.interceptor - ${project.build.directory}/cdi-sigtest-classes - ${project.build.directory}/cdi-sig-report.txt - - - - sigtest - - check - - process-test-sources - - - - - org.apache.maven.plugins maven-failsafe-plugin + 3.3.0 -Xmx768m - ${project.build.directory}/suites/tck-web-suite.xml + target/suites/tck-core-suite.xml ${excluded.groups} jakarta.enterprise:cdi-tck-core-impl - jakarta.enterprise:cdi-tck-web-impl @@ -502,44 +390,49 @@ 1 - once + 1 + true - ${glassfish.root}/glassfish7 + ${glassfish.root}/glassfish8 true 2048m :org.jboss.cdi.tck... cdiTckExcludeDummy=true - glassfish.servlet.loadAllOnStartup=true + glassfish.servlet.loadAllOnStartup=true create-jms-resource --restype jakarta.jms.Queue --property Name=queue_test queue_test - create-jms-resource --restype jakarta.jms.Topic --property Name=topic_test topic_test - set configs.config.server-config.cdi-service.enable-implicit-cdi=true - create-file-user --groups student --passwordfile ${project.build.directory}/test-classes/password.txt - student - create-file-user --groups printer --passwordfile ${project.build.directory}/test-classes/password.txt - printer - create-file-user --groups student:alarm --passwordfile - ${project.build.directory}/test-classes/password.txt alarm + create-jms-resource --restype jakarta.jms.Topic --property Name=topic_test topic_test + set configs.config.server-config.cdi-service.enable-implicit-cdi=true + create-file-user --groups student --passwordfile ${project.build.directory}/test-classes/password.txt student + create-file-user --groups printer --passwordfile ${project.build.directory}/test-classes/password.txt printer + create-file-user --groups student:alarm --passwordfile ${project.build.directory}/test-classes/password.txt alarm ${project.build.outputDirectory} ${project.build.directory}/dependency/lib true + + + org.apache.maven.surefire + surefire-testng + 3.3.0 + + - integration-test + run tck integration-test - verify + integration-test + - org.apache.maven.plugins maven-surefire-report-plugin - 3.0.0 + ${project.build.directory}/failsafe-reports/junitreports ${project.build.directory}/surefire-reports test-report @@ -553,11 +446,13 @@ + + - javaee-full + full true @@ -567,11 +462,12 @@ - webprofile + web javaee-full,se web + diff --git a/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishContextualsImpl.java b/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishContextualsImpl.java new file mode 100644 index 0000000000..0c1ea19ae8 --- /dev/null +++ b/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishContextualsImpl.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Eclipse Foundation and/or its affiliates. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ +package org.jboss.weld.tck.glassfish; + +import jakarta.enterprise.context.spi.Context; +import jakarta.enterprise.context.spi.CreationalContext; +import org.jboss.cdi.tck.spi.Contextuals; + +public class GlassFishContextualsImpl implements Contextuals { + + @Override + public Inspectable create(T instance, Context context) { + return new InspectableContextual<>(instance); + } + + static class InspectableContextual implements Inspectable { + + private T instancePassedToConstructor; + private T instancePassedToDestroy; + + private CreationalContext creationalContextPassedToCreate; + private CreationalContext creationalContextPassedToDestroy; + + InspectableContextual(T instance) { + this.instancePassedToConstructor = instance; + } + + @Override + public T create(CreationalContext creationalContext) { + this.creationalContextPassedToCreate = creationalContext; + return instancePassedToConstructor; + } + + @Override + public void destroy(T instance, CreationalContext creationalContext) { + instancePassedToDestroy = instance; + creationalContextPassedToDestroy = creationalContext; + } + + @Override + public CreationalContext getCreationalContextPassedToCreate() { + return creationalContextPassedToCreate; + } + + @Override + public T getInstancePassedToDestroy() { + return instancePassedToDestroy; + } + + @Override + public CreationalContext getCreationalContextPassedToDestroy() { + return creationalContextPassedToDestroy; + } + } + +} diff --git a/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishCreationalContextsImpl.java b/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishCreationalContextsImpl.java new file mode 100644 index 0000000000..05f52b3c2e --- /dev/null +++ b/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishCreationalContextsImpl.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2024 Contributors to the Eclipse Foundation. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ +package org.jboss.weld.tck.glassfish; + +import jakarta.enterprise.context.spi.Contextual; +import org.jboss.cdi.tck.spi.CreationalContexts; +import org.jboss.weld.contexts.CreationalContextImpl; + +/** + * This returns the Weld (and thus GlassFish) specific CreationalContextImpl with added methods + * for inspection. + */ +public class GlassFishCreationalContextsImpl implements CreationalContexts { + + @Override + public Inspectable create(Contextual contextual) { + return new InspectableCreationalContext<>(contextual); + } + + static class InspectableCreationalContext extends CreationalContextImpl implements Inspectable { + + private T lastBeanPushed; + private boolean pushCalled; + private boolean releaseCalled; + + public InspectableCreationalContext(Contextual contextual) { + super(contextual); + } + + @Override + public void push(T incompleteInstance) { + lastBeanPushed = incompleteInstance; + + pushCalled = true; + super.push(incompleteInstance); + } + + @Override + public Object getLastBeanPushed() { + return lastBeanPushed; + } + + @Override + public boolean isPushCalled() { + return pushCalled; + } + + @Override + public boolean isReleaseCalled() { + return releaseCalled; + } + + @Override + public void release(Contextual contextual, T instance) { + releaseCalled = true; + super.release(contextual, instance); + } + + @Override + public void release() { + releaseCalled = true; + super.release(); + } + + } + +} diff --git a/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishDeploymentExceptionTransformer.java b/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishDeploymentExceptionTransformer.java index 800dba3e27..d098234239 100644 --- a/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishDeploymentExceptionTransformer.java +++ b/glassfish-runner/cdi-tck/src/test/java/org/jboss/weld/tck/glassfish/GlassFishDeploymentExceptionTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation. + * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation. * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the @@ -35,6 +35,7 @@ public class GlassFishDeploymentExceptionTransformer implements DeploymentExceptionTransformer { private static final String[] DEPLOYMENT_EXCEPTION_FRAGMENTS = new String[] { + "Only normal scopes can be passivating", "org.jboss.weld.exceptions.DeploymentException", "org.jboss.weld.exceptions.UnserializableDependencyException", "org.jboss.weld.exceptions.InconsistentSpecializationException", @@ -67,10 +68,10 @@ public Throwable transform(Throwable throwable) { return root; } if (isFragmentFound(DEPLOYMENT_EXCEPTION_FRAGMENTS, root)) { - return new DeploymentException(root); + return new DeploymentException(root.getMessage()); } if (isFragmentFound(DEFINITION_EXCEPTION_FRAGMENTS, root)) { - return new DefinitionException(root); + return new DefinitionException(root.getMessage()); } return throwable; } diff --git a/glassfish-runner/cdi-tck/src/test/resources/META-INF/cdi-tck.properties b/glassfish-runner/cdi-tck/src/test/resources/META-INF/cdi-tck.properties index ca7b589f17..d04503bf95 100644 --- a/glassfish-runner/cdi-tck/src/test/resources/META-INF/cdi-tck.properties +++ b/glassfish-runner/cdi-tck/src/test/resources/META-INF/cdi-tck.properties @@ -1,5 +1,7 @@ org.jboss.cdi.tck.spi.Beans=org.jboss.weld.tck.glassfish.GlassFishBeansImpl +org.jboss.cdi.tck.spi.CreationalContexts=org.jboss.weld.tck.glassfish.GlassFishCreationalContextsImpl org.jboss.cdi.tck.spi.Contexts=org.jboss.weld.tck.glassfish.GlassFishContextImpl +org.jboss.cdi.tck.spi.Contextuals=org.jboss.weld.tck.glassfish.GlassFishContextualsImpl org.jboss.cdi.tck.spi.EL=org.jboss.weld.tck.glassfish.GlassFishELImpl org.jboss.cdi.tck.testDataSource=jdbc/__default org.jboss.cdi.tck.testJmsConnectionFactory=java:comp/DefaultJMSConnectionFactory diff --git a/pom.xml b/pom.xml index 2291cc512b..2c1adce126 100644 --- a/pom.xml +++ b/pom.xml @@ -87,9 +87,9 @@ 1.10.11 - 1.7.0.Alpha10 + 1.8.0.Final - 4.0.0 + 4.1.0 2.0.0 From d5e13a63dd761a289bc814a3eb8807898660daf8 Mon Sep 17 00:00:00 2001 From: Arjan Tijms Date: Wed, 19 Jun 2024 22:01:13 +0200 Subject: [PATCH 2/5] Ci seems to want this (?) Signed-off-by: Arjan Tijms --- glassfish-runner/servlet-tck/servlet-tck-run/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml b/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml index b5945f2896..55d56489cd 100644 --- a/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml +++ b/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml @@ -112,6 +112,12 @@ shrinkwrap-resolver-impl-maven-archive + + commons-io + commons-io + 2.16.1 + + org.jboss.arquillian.junit5 From c044ecb7b76d56d53a000f1d834613787d8da6b0 Mon Sep 17 00:00:00 2001 From: Arjan Tijms Date: Thu, 20 Jun 2024 00:07:32 +0200 Subject: [PATCH 3/5] Move commons-io Signed-off-by: Arjan Tijms --- glassfish-runner/servlet-tck/servlet-tck-run/pom.xml | 6 ------ servlet/pom.xml | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml b/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml index 55d56489cd..b5945f2896 100644 --- a/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml +++ b/glassfish-runner/servlet-tck/servlet-tck-run/pom.xml @@ -112,12 +112,6 @@ shrinkwrap-resolver-impl-maven-archive - - commons-io - commons-io - 2.16.1 - - org.jboss.arquillian.junit5 diff --git a/servlet/pom.xml b/servlet/pom.xml index e169a9b89c..f15f884b54 100644 --- a/servlet/pom.xml +++ b/servlet/pom.xml @@ -73,6 +73,10 @@ ${project.groupId} web-jsp + + commons-io + commons-io + org.slf4j From fb747fcf1a02688f5b491787664f9934d7370516 Mon Sep 17 00:00:00 2001 From: Arjan Tijms Date: Thu, 20 Jun 2024 00:37:53 +0200 Subject: [PATCH 4/5] Spotless again Signed-off-by: Arjan Tijms --- glassfish-runner/cdi-tck/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glassfish-runner/cdi-tck/pom.xml b/glassfish-runner/cdi-tck/pom.xml index 7b11c80766..117f64bc9d 100644 --- a/glassfish-runner/cdi-tck/pom.xml +++ b/glassfish-runner/cdi-tck/pom.xml @@ -34,7 +34,7 @@ 4.1.0 ${project.build.directory} - + 8.0.0-M6 From 76f43eaf7a0c97cac8e335c8406f1dbd6463d11d Mon Sep 17 00:00:00 2001 From: Arjan Tijms Date: Thu, 20 Jun 2024 14:39:53 +0200 Subject: [PATCH 5/5] Trying to unstuck Batch TCK Signed-off-by: Arjan Tijms --- glassfish-runner/cdi-tck/pom.xml | 19 +++++++++++++++++++ pom.xml | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/glassfish-runner/cdi-tck/pom.xml b/glassfish-runner/cdi-tck/pom.xml index 117f64bc9d..738942b91f 100644 --- a/glassfish-runner/cdi-tck/pom.xml +++ b/glassfish-runner/cdi-tck/pom.xml @@ -48,6 +48,24 @@ 6.0.Beta4 + + + + org.jboss.arquillian + arquillian-bom + 1.8.0.Final + pom + import + + + + jakarta.enterprise + jakarta.enterprise.cdi-api + 4.1.0 + + + + @@ -65,6 +83,7 @@ jakarta.el jakarta.el-api + 6.0.0 provided diff --git a/pom.xml b/pom.xml index 2c1adce126..2291cc512b 100644 --- a/pom.xml +++ b/pom.xml @@ -87,9 +87,9 @@ 1.10.11 - 1.8.0.Final + 1.7.0.Alpha10 - 4.1.0 + 4.0.0 2.0.0