diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/injectable/InjectableConfigPropertyTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/injectable/InjectableConfigPropertyTest.java index 80cfc9302..d79461cb7 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/injectable/InjectableConfigPropertyTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/injectable/InjectableConfigPropertyTest.java @@ -34,7 +34,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -46,6 +45,7 @@ import static java.util.Arrays.asList; import static java.util.Collections.singletonList; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -69,12 +69,12 @@ public static WebArchive deploy() .addPackage(ServerEndpointPojoWithCt.class.getPackage()) .addPackage(NumberConfiguredBean.class.getPackage()) .addAsManifestResource(FileUtils.getFileForURL(fileUrl.toString())) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, "beanProvider.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @ConfigProperty(name = "myapp.some.server", cacheFor = 2, cacheUnit = TimeUnit.SECONDS) diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java index 6aee67ce9..3b173ca1c 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java @@ -24,12 +24,13 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class ConfigPropertyWARTest extends BaseTestConfigProperty @@ -45,7 +46,7 @@ public static WebArchive deployEar() .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addPackage(ConfigPropertyWARTest.class.getPackage()) .addAsResource(CONFIG_FILE_NAME) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsWebInfResource(new StringAsset(PROPERTIES), "classes/META-INF/apache-deltaspike.properties"); diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/FileConfigSourceTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/FileConfigSourceTest.java index ab958cf64..fa2113e8f 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/FileConfigSourceTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/FileConfigSourceTest.java @@ -29,7 +29,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -37,6 +36,8 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Test for picking up a file system based config */ @@ -49,12 +50,12 @@ public static WebArchive deploy() { JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "FileConfigSourceTest.jar") .addClasses(FileConfigSourceTest.class, FileSystemConfig.class) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, "beanProvider.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/PropertyConfigSourceTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/PropertyConfigSourceTest.java index 554faf14e..6b32dc49e 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/PropertyConfigSourceTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/PropertyConfigSourceTest.java @@ -24,7 +24,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.experimental.categories.Category; @@ -32,6 +31,8 @@ import org.junit.Assert; import org.junit.Test; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) //X TODO this is only SeCategory as there is currently an Arq problem with properties! public class PropertyConfigSourceTest @@ -51,12 +52,12 @@ public static WebArchive deploy() .addAsResource(CONFIG_FILE_NAME) .addAsResource(BOOTCONFIG_FILE_NAME) .addAsResource(NOT_PICKED_UP_CONFIG_FILE_NAME) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, "beanProvider.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageWarFileDevelopment.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageWarFileDevelopment.java index ed94cdb7d..ee8b7bb74 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageWarFileDevelopment.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageWarFileDevelopment.java @@ -25,14 +25,14 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; import org.junit.AfterClass; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Tests for {@link org.apache.deltaspike.core.api.exclude.Exclude} */ @@ -53,14 +53,14 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "excludeTestProjectStageDevelopmentTest.jar") .addPackage(ExcludeTestProjectStageWarFileDevelopment.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsManifestResource(BEANS_XML_ALL, "beans.xml") .addAsResource(new StringAsset("org.apache.deltaspike.ProjectStage = Development"), "apache-deltaspike.properties"); // when deployed on some remote container return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @AfterClass diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeWarFileTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeWarFileTest.java index 04bf0a56b..d92829c4a 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeWarFileTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeWarFileTest.java @@ -18,6 +18,7 @@ */ package org.apache.deltaspike.test.core.api.exclude; +import jakarta.enterprise.inject.spi.Extension; import org.apache.deltaspike.core.api.projectstage.ProjectStage; import org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension; import org.apache.deltaspike.core.util.ProjectStageProducer; @@ -27,19 +28,19 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.AfterClass; import org.junit.runner.RunWith; -import jakarta.enterprise.inject.spi.Extension; import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.file.Files; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Tests for {@link org.apache.deltaspike.core.api.exclude.Exclude} */ @@ -63,12 +64,12 @@ public static WebArchive deploy() throws IOException .addPackage(TestClassDeactivator.class.getPackage()) .addAsManifestResource(new StringAsset(getConfigContent()), "apache-deltaspike.properties") // when deployed on some remote container; - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, ExcludeExtension.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/uc001/EntityExcludeTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/uc001/EntityExcludeTest.java index 88f944fac..1d3a1c3fd 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/uc001/EntityExcludeTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/uc001/EntityExcludeTest.java @@ -25,7 +25,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; @@ -34,6 +33,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class EntityExcludeTest { @@ -48,14 +49,14 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(EntityExcludeTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsManifestResource(BEANS_XML_ALL, "beans.xml") .addAsResource(new StringAsset("org.apache.deltaspike.ProjectStage = Development"), "apache-deltaspike.properties"); // when deployed on some remote container; return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @AfterClass diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageContextTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageContextTest.java index 4f3ce2a7c..a7d0e0184 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageContextTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageContextTest.java @@ -33,7 +33,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -42,6 +41,8 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Tests for {@link MessageContext} */ @@ -66,13 +67,13 @@ public static WebArchive deploy() final JavaArchive testJar = ShrinkWrap .create(JavaArchive.class, "messageContextTest.jar") .addPackage(MessageContextTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap .create(WebArchive.class, "messageContextTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, MessageBundleExtension.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageFormattedMessageTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageFormattedMessageTest.java index 633b1e864..30e5f8f4f 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageFormattedMessageTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageFormattedMessageTest.java @@ -29,7 +29,6 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.Asset; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; @@ -37,6 +36,7 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; /** @@ -72,7 +72,7 @@ public static WebArchive deploy() .create(WebArchive.class, "messageFormattedMessageTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, MessageBundleExtension.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageTest.java index a807e8fc9..4e75cae65 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MessageTest.java @@ -24,7 +24,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; @@ -34,6 +33,7 @@ import jakarta.enterprise.inject.spi.Extension; import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -57,13 +57,13 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap .create(JavaArchive.class, "messageTest.jar") .addPackage(MessageTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap .create(WebArchive.class, "messageTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, MessageBundleExtension.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MinimalMessagesTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MinimalMessagesTest.java index c83ddce00..cda96486f 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MinimalMessagesTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/MinimalMessagesTest.java @@ -25,7 +25,6 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Filters; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -35,6 +34,8 @@ import jakarta.enterprise.inject.spi.Extension; import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Tests for type-safe messages without {@link org.apache.deltaspike.core.api.message.MessageTemplate} */ @@ -61,7 +62,7 @@ public static WebArchive deploy() .create(JavaArchive.class, "minimalMessageTest.jar") .addPackages(false, Filters.exclude(MessageContextTest.class), MinimalMessagesTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap .create(WebArchive.class, "minimalMessageTest.war") @@ -69,7 +70,7 @@ public static WebArchive deploy() .addAsLibraries(testJar) .addAsResource("customMinimalMessage_en.properties") .addAsResource("org/apache/deltaspike/test/core/api/message/MinimalMessages_en.properties") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, MessageBundleExtension.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/SimpleMessageTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/SimpleMessageTest.java index d4fc18487..83b852ee0 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/SimpleMessageTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/SimpleMessageTest.java @@ -26,7 +26,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; @@ -36,6 +35,7 @@ import jakarta.enterprise.inject.spi.Extension; import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -66,13 +66,13 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap .create(JavaArchive.class, "simpleMessageTest.jar") .addPackage(SimpleMessageTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap .create(WebArchive.class, "simpleMessageTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, MessageBundleExtension.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/broken/BrokenMessageBundleOnClassTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/broken/BrokenMessageBundleOnClassTest.java index bcad94751..d5b8cf493 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/broken/BrokenMessageBundleOnClassTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/broken/BrokenMessageBundleOnClassTest.java @@ -28,13 +28,13 @@ import org.jboss.arquillian.container.test.api.ShouldThrowException; //X import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.experimental.categories.Category; //X import org.junit.Test; //X import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; /** @@ -64,13 +64,13 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap .create(JavaArchive.class, "invalidMessageBundleTest.jar") .addPackage(BrokenMessageBundleClass.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap .create(WebArchive.class, "invalidMessageBundleTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, MessageBundleExtension.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/locale/ConfigurableLocaleMessageTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/locale/ConfigurableLocaleMessageTest.java index 1284e6670..4dcc2330f 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/locale/ConfigurableLocaleMessageTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/message/locale/ConfigurableLocaleMessageTest.java @@ -30,7 +30,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; @@ -38,6 +37,7 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; /** @@ -48,7 +48,7 @@ public class ConfigurableLocaleMessageTest { private static final String BEANS_XML_CONTENT = - "" + + "" + ConfigurableLocaleResolver.class.getName() + ""; @@ -72,7 +72,7 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap .create(JavaArchive.class, "localeMessageTest.jar") .addPackage(ConfigurableLocaleMessageTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap .create(WebArchive.class, "localeMessageTest.war") diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanManagerProviderWarFileTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanManagerProviderWarFileTest.java index 7ba6f5884..ae6e712e5 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanManagerProviderWarFileTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanManagerProviderWarFileTest.java @@ -22,10 +22,11 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class BeanManagerProviderWarFileTest extends BeanManagerProviderTest { @@ -41,6 +42,6 @@ public static WebArchive deploy() return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addPackage(BeanManagerProviderWarFileTest.class.getPackage()) .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java index 2c659d8fc..73d33507a 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java @@ -27,7 +27,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -38,6 +37,8 @@ import java.util.List; import java.util.concurrent.ConcurrentHashMap; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class BeanProviderTest { @@ -53,12 +54,12 @@ public static WebArchive deploy() { JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "beanProviderTest.jar") .addPackage(BeanProviderTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, "beanProvider.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } /** diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/explicit/ExplicitlyGroupedConversationsTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/explicit/ExplicitlyGroupedConversationsTest.java index d12820174..f330c2d2b 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/explicit/ExplicitlyGroupedConversationsTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/explicit/ExplicitlyGroupedConversationsTest.java @@ -26,7 +26,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -37,6 +36,8 @@ import jakarta.enterprise.context.ContextNotActiveException; import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class ExplicitlyGroupedConversationsTest @@ -49,12 +50,12 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(ExplicitlyGroupedConversationsTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/implicit/ImplicitlyGroupedConversationsTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/implicit/ImplicitlyGroupedConversationsTest.java index a6ae1f392..873866e7b 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/implicit/ImplicitlyGroupedConversationsTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/grouped/implicit/ImplicitlyGroupedConversationsTest.java @@ -25,7 +25,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -36,6 +35,8 @@ import jakarta.enterprise.context.ContextNotActiveException; import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class ImplicitlyGroupedConversationsTest @@ -48,12 +49,12 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(ImplicitlyGroupedConversationsTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc001/GroupedConversationSubGroupTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc001/GroupedConversationSubGroupTest.java index 80613282e..6b4b4c873 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc001/GroupedConversationSubGroupTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc001/GroupedConversationSubGroupTest.java @@ -27,7 +27,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -37,6 +36,8 @@ import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class GroupedConversationSubGroupTest @@ -50,12 +51,12 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(GroupedConversationSubGroupTest.class.getPackage()) .addPackage(TestBaseBean.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc002/GroupedConversationSubGroupTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc002/GroupedConversationSubGroupTest.java index 3620250e4..d6f1cba7c 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc002/GroupedConversationSubGroupTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc002/GroupedConversationSubGroupTest.java @@ -31,7 +31,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -41,6 +40,8 @@ import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class GroupedConversationSubGroupTest @@ -54,12 +55,12 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(GroupedConversationSubGroupTest.class.getPackage()) .addPackage(TestBaseBean.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc003/GroupedConversationSubGroupTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc003/GroupedConversationSubGroupTest.java index 8716ba628..10d4a60a0 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc003/GroupedConversationSubGroupTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/conversation/subgroup/uc003/GroupedConversationSubGroupTest.java @@ -28,7 +28,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -38,6 +37,8 @@ import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class GroupedConversationSubGroupTest @@ -51,12 +52,12 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(GroupedConversationSubGroupTest.class.getPackage()) .addPackage(TestBaseBean.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java index 7e5863163..a25ea01ee 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java @@ -25,7 +25,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -35,6 +34,8 @@ import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class ViewAccessScopedTest @@ -47,12 +48,12 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(ViewAccessScopedTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/ProxyUtilsTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/ProxyUtilsTest.java index d673b96ae..da04ef4dc 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/ProxyUtilsTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/ProxyUtilsTest.java @@ -18,25 +18,25 @@ */ package org.apache.deltaspike.test.core.api.util; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.List; - import jakarta.inject.Inject; - import org.apache.deltaspike.core.util.ProxyUtils; import org.apache.deltaspike.test.util.ArchiveUtils; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.List; + +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class ProxyUtilsTest { @@ -53,7 +53,7 @@ public static Archive createTestArchive() return ShrinkWrap .create(WebArchive.class, "proxyUtil.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addClasses(ProxyUtilsTest.class, MyBean.class, MyInterface.class, MyInterfaceImpl.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/context/AbstractContextTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/context/AbstractContextTest.java index 38a0198ae..c0559e660 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/context/AbstractContextTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/util/context/AbstractContextTest.java @@ -19,20 +19,20 @@ package org.apache.deltaspike.test.core.api.util.context; import jakarta.enterprise.inject.spi.Extension; - import org.apache.deltaspike.core.api.provider.BeanProvider; import org.apache.deltaspike.test.category.SeCategory; import org.apache.deltaspike.test.util.ArchiveUtils; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assert; +import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import org.junit.Test; -import org.junit.Assert; + +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; /** * We test the AbstractContext by implementing a simple dummy context. @@ -52,14 +52,14 @@ public static WebArchive deploy() .create(JavaArchive.class, "abstractContextTest.jar") .addClass(AbstractContextTest.class) .addClass(DummyBean.class) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsManifestResource(BEANS_XML_ALL, "beans.xml") .addAsServiceProvider(Extension.class, DummyScopeExtension.class); return ShrinkWrap .create(WebArchive.class, "abstractContextTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/ClassDeactivationWarFileTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/ClassDeactivationWarFileTest.java index 76f95c474..9e8b93afb 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/ClassDeactivationWarFileTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/ClassDeactivationWarFileTest.java @@ -24,13 +24,14 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.runner.RunWith; import java.net.URL; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class ClassDeactivationWarFileTest extends ClassDeactivationTest { @@ -48,12 +49,12 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "testClassDeactivationTest.jar") .addPackage(ClassDeactivationWarFileTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) .addAsResource(FileUtils.getFileForURL(fileUrl.toString()), DeltaSpikeTest.DELTASPIKE_PROPERTIES) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/DefaultClassDeactivatorTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/DefaultClassDeactivatorTest.java index e2b664cc2..6b264a0c0 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/DefaultClassDeactivatorTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/activation/DefaultClassDeactivatorTest.java @@ -25,13 +25,13 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; @@ -54,13 +54,13 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "testClassDeactivationTest.jar") .addPackage(ClassDeactivationWarFileTest.class.getPackage()) .addClass(DefaultClassDeactivator.class) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) .addAsResource(new StringAsset(dsPropsBuilder.toString()), DeltaSpikeTest.DELTASPIKE_PROPERTIES) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/custom/spi/ServiceUtilsWarFileTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/custom/spi/ServiceUtilsWarFileTest.java index 568d802a5..1502e6fcc 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/custom/spi/ServiceUtilsWarFileTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/custom/spi/ServiceUtilsWarFileTest.java @@ -22,11 +22,12 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class ServiceUtilsWarFileTest extends ServiceUtilsTest { @@ -38,13 +39,13 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(ServiceUtilsWarFileTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) //due to an issue with arquillian we can just add it to the web-archive (and not the jar) .addAsServiceProvider(MyInterface.class, MyImpl.class) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java index 7cc8034f9..9d627a6ea 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java @@ -22,7 +22,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; @@ -35,6 +34,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -58,7 +58,7 @@ public static WebArchive deploy() return ShrinkWrap.create(WebArchive.class, "FutureableTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/ThreadPoolManagerTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/ThreadPoolManagerTest.java index 10c35142c..28f502f39 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/ThreadPoolManagerTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/ThreadPoolManagerTest.java @@ -25,7 +25,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; import org.junit.runner.RunWith; @@ -39,6 +38,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadPoolExecutor; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; @@ -52,7 +52,7 @@ public static WebArchive deploy() { return ShrinkWrap.create(WebArchive.class, "ThreadPoolManagerTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/interdyn/InterDynTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/interdyn/InterDynTest.java index 3051e92a3..91f05b65e 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/interdyn/InterDynTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/interdyn/InterDynTest.java @@ -23,7 +23,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; @@ -32,6 +31,8 @@ import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class InterDynTest { /** @@ -60,7 +61,7 @@ public static WebArchive deploy() return ShrinkWrap.create(WebArchive.class, "InterDynTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomPropertiesTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomPropertiesTest.java index ab6484ab7..b88ef2480 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomPropertiesTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomPropertiesTest.java @@ -23,7 +23,6 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +31,7 @@ import javax.management.ObjectName; import java.lang.management.ManagementFactory; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertTrue; @RunWith(Arquillian.class) @@ -42,7 +42,7 @@ public static Archive war() { return ShrinkWrap.create(WebArchive.class, "CustomPropertiesTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addClasses(CustomProperties.class, CustomProperties2.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomTypeTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomTypeTest.java index 94f45a608..90efe8242 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomTypeTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/CustomTypeTest.java @@ -23,7 +23,6 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; import org.junit.runner.RunWith; @@ -33,6 +32,7 @@ import javax.management.ObjectName; import java.lang.management.ManagementFactory; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -43,7 +43,7 @@ public static Archive war() { return ShrinkWrap.create(WebArchive.class, "CustomTypeTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml") .addClasses(CustomType.class); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/SimpleRegistrationWarFileTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/SimpleRegistrationWarFileTest.java index 813d88fb6..af65a7c45 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/SimpleRegistrationWarFileTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/SimpleRegistrationWarFileTest.java @@ -22,11 +22,12 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class SimpleRegistrationWarFileTest extends SimpleRegistrationTest { @@ -37,11 +38,11 @@ public static WebArchive deploy() { JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "simpleRegistrationTest.jar") .addPackage(SimpleRegistrationWarFileTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java index f26790800..a81e29981 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java @@ -26,7 +26,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; @@ -34,6 +33,8 @@ import org.junit.runner.RunWith; import org.junit.Assert; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class DefaultWindowContextTest @@ -43,12 +44,12 @@ public static WebArchive deploy() { JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "defaultWindowContextTest.jar") .addPackage(DefaultWindowContextTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, "defaultWindowContextTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/throttling/ThrottledTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/throttling/ThrottledTest.java index d21cd34b5..8a1a11127 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/throttling/ThrottledTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/throttling/ThrottledTest.java @@ -23,7 +23,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; @@ -38,6 +37,7 @@ import java.util.concurrent.atomic.AtomicReference; import static java.util.Arrays.asList; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; import static org.hamcrest.CoreMatchers.instanceOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -52,12 +52,12 @@ public static WebArchive deploy() { JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "ThrottledTest.jar") .addPackage(Service.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, "ThrottledTest.war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Inject diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/util/JndiUtilsWarFileTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/util/JndiUtilsWarFileTest.java index 0dc03c315..804220723 100644 --- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/util/JndiUtilsWarFileTest.java +++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/util/JndiUtilsWarFileTest.java @@ -23,12 +23,13 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class JndiUtilsWarFileTest extends JndiUtilsTest @@ -40,12 +41,12 @@ public static WebArchive deploy() String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1); JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "jndiTest.jar") - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addPackage(JndiUtilsWarFileTest.class.getPackage()) .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } } diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/Hibernate6QueryStringExtractor.java b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/Hibernate6QueryStringExtractor.java new file mode 100644 index 000000000..764dec392 --- /dev/null +++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/Hibernate6QueryStringExtractor.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.deltaspike.data.impl.util.jpa; + +@ProviderSpecific("org.hibernate.query.Query") +public class Hibernate6QueryStringExtractor extends BaseQueryStringExtractor +{ + + @Override + public String extractFrom(Object query) + { + return (String) invoke("getQueryString", query); + } + +} diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactory.java b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactory.java index 3cddecd75..900b07c0a 100644 --- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactory.java +++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/QueryStringExtractorFactory.java @@ -27,6 +27,7 @@ public class QueryStringExtractorFactory private final QueryStringExtractor[] extractors = new QueryStringExtractor[] { new HibernateQueryStringExtractor(), + new Hibernate6QueryStringExtractor(), new EclipseLinkEjbQueryStringExtractor(), new OpenJpaQueryStringExtractor() }; diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerInheritedTest.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerInheritedTest.java index 102a64597..96131bd7e 100644 --- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerInheritedTest.java +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerInheritedTest.java @@ -28,6 +28,7 @@ import org.apache.deltaspike.data.test.service.ExtendedRepositoryAbstractInherited; import org.apache.deltaspike.data.test.service.ExtendedRepositoryAbstractIntermediate; import org.apache.deltaspike.test.category.WebProfileCategory; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.asset.Asset; @@ -41,12 +42,10 @@ public class EntityRepositoryHandlerInheritedTest extends TransactionalTestCase { - private static final Asset beansXml = new StringAsset(""); - @Deployment public static Archive deployment() { - return initDeployment(true, beansXml) + return initDeployment(true) .addClasses(ExtendedRepositoryAbstractIntermediate.class, ExtendedRepositoryAbstractInherited.class, NamedQualifiedEntityManagerTestProducer.class) diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java index 258087619..c6a680fb9 100644 --- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/tx/TransactionalQueryRunnerTest.java @@ -46,7 +46,7 @@ public class TransactionalQueryRunnerTest @Deployment public static Archive deployment() { - return initDeployment() + return initDeployment(true, false) .addClasses(ExtendedRepositoryInterface.class) .addClass(TransactionalQueryRunnerWrapper.class) .addPackage(Simple.class.getPackage()); diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/BMTransactionStrategy.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/BMTransactionStrategy.java new file mode 100644 index 000000000..d35786b95 --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/BMTransactionStrategy.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.deltaspike.data.test; + +import jakarta.annotation.Priority; +import jakarta.enterprise.inject.Alternative; +import jakarta.interceptor.Interceptor; +import org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy; +import org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy; + +@Alternative +@Priority(Interceptor.Priority.APPLICATION+1) +public class BMTransactionStrategy extends BeanManagedUserTransactionStrategy +{ +} diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/JpaTransactionStrategy.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/JpaTransactionStrategy.java new file mode 100644 index 000000000..6b7d00278 --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/JpaTransactionStrategy.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.deltaspike.data.test; + +import jakarta.annotation.Priority; +import jakarta.enterprise.inject.Alternative; +import jakarta.interceptor.Interceptor; +import org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy; + +@Alternative +@Priority(Interceptor.Priority.APPLICATION+1) +public class JpaTransactionStrategy extends ContainerManagedTransactionStrategy +{ +} diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java index 24003ffda..303b41fac 100644 --- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java @@ -20,12 +20,13 @@ package org.apache.deltaspike.data.test.java8.util; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.jboss.shrinkwrap.resolver.api.maven.Maven; import java.io.File; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + public class TestDeployments { /** @@ -40,7 +41,7 @@ public static WebArchive initDeployment() .addAsLibraries(getDeltaSpikeDataWithDependencies()) .addClasses(EntityManagerProducer.class) .addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return archive; } diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/ExtendedRepositoryInterface.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/ExtendedRepositoryInterface.java index 0577d7259..00fe1e07c 100755 --- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/ExtendedRepositoryInterface.java +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/ExtendedRepositoryInterface.java @@ -18,15 +18,11 @@ */ package org.apache.deltaspike.data.test.service; -import static jakarta.persistence.LockModeType.PESSIMISTIC_READ; - -import org.apache.deltaspike.data.api.EntityManagerDelegate; -import org.apache.deltaspike.data.api.EntityRepository; -import org.apache.deltaspike.data.api.Modifying; -import org.apache.deltaspike.data.api.Query; -import org.apache.deltaspike.data.api.Repository; +import org.apache.deltaspike.data.api.*; import org.apache.deltaspike.data.test.domain.Simple; +import static jakarta.persistence.LockModeType.PESSIMISTIC_READ; + @Repository public interface ExtendedRepositoryInterface extends EntityRepository, EntityManagerDelegate { diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java index 0ea239123..4c68f9888 100755 --- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java @@ -18,13 +18,13 @@ */ package org.apache.deltaspike.data.test.util; -import org.apache.deltaspike.data.test.TestTransactionStrategy; +import org.apache.deltaspike.data.test.BMTransactionStrategy; +import org.apache.deltaspike.data.test.JpaTransactionStrategy; import org.apache.deltaspike.data.test.TransactionalTestCase; import org.apache.deltaspike.data.test.domain.AuditedEntity; import org.jboss.arquillian.container.test.spi.TestDeployment; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.Asset; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.jboss.shrinkwrap.resolver.api.maven.Maven; @@ -32,6 +32,8 @@ import java.io.File; import java.net.URL; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + public abstract class TestDeployments { /** @@ -41,22 +43,27 @@ public abstract class TestDeployments { */ public static WebArchive initDeployment() { - return initDeployment(true); + return initDeployment(true, true); } public static WebArchive initDeployment(boolean addDefaultEntityManagerProducer) { - return initDeployment(addDefaultEntityManagerProducer, EmptyAsset.INSTANCE); + return initDeployment(addDefaultEntityManagerProducer, BEANS_XML_ALL, true); } - - public static WebArchive initDeployment(boolean addDefaultEntityManagerProducer, Asset beansXmlAsset) + + public static WebArchive initDeployment(boolean addDefaultEntityManagerProducer, boolean jpa) + { + return initDeployment(addDefaultEntityManagerProducer, BEANS_XML_ALL, jpa); + } + + public static WebArchive initDeployment(boolean addDefaultEntityManagerProducer, Asset beansXmlAsset, boolean jpa) { Logging.reconfigure(); WebArchive archive = ShrinkWrap .create(WebArchive.class, "test.war") // used by many tests, shouldn't interfere with others - .addClasses(TransactionalTestCase.class, TestData.class, TestTransactionStrategy.class) + .addClasses(TransactionalTestCase.class, TestData.class) .addPackages(true, AuditedEntity.class.getPackage()) .addAsLibraries(getDeltaSpikeDataWithDependencies()) .addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml") @@ -66,6 +73,14 @@ public static WebArchive initDeployment(boolean addDefaultEntityManagerProducer, { archive.addClass(EntityManagerProducer.class); } + if (jpa) + { + archive.addClass(JpaTransactionStrategy.class); + } + else + { + archive.addClass(BMTransactionStrategy.class); + } return archive; } diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/aggregation/AggregatedDefaultEntityManagerInjectionTest.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/aggregation/AggregatedDefaultEntityManagerInjectionTest.java index e8ad1472d..44ae7008c 100644 --- a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/aggregation/AggregatedDefaultEntityManagerInjectionTest.java +++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/aggregation/AggregatedDefaultEntityManagerInjectionTest.java @@ -29,7 +29,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -42,6 +41,8 @@ import jakarta.inject.Inject; import jakarta.persistence.EntityManager; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class AggregatedDefaultEntityManagerInjectionTest @@ -58,7 +59,7 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "aggregatedDefaultInjectionTest.jar") .addPackage(ArchiveUtils.SHARED_PACKAGE) .addPackage(AggregatedDefaultEntityManagerInjectionTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class) .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJpaArchive()) diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultinjection/DefaultEntityManagerInjectionTest.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultinjection/DefaultEntityManagerInjectionTest.java index b3504f5f6..f8e011c1e 100644 --- a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultinjection/DefaultEntityManagerInjectionTest.java +++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultinjection/DefaultEntityManagerInjectionTest.java @@ -30,7 +30,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -43,6 +42,8 @@ import jakarta.inject.Inject; import jakarta.persistence.EntityManager; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class DefaultEntityManagerInjectionTest @@ -66,7 +67,7 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "defaultInjectionTest.jar") .addPackage(ArchiveUtils.SHARED_PACKAGE) .addPackage(DefaultEntityManagerInjectionTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class) .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJpaArchive()) diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultnested/DefaultNestedTransactionTest.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultnested/DefaultNestedTransactionTest.java index 39f947c2d..5be8a7d3f 100644 --- a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultnested/DefaultNestedTransactionTest.java +++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/defaultnested/DefaultNestedTransactionTest.java @@ -29,7 +29,6 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; @@ -41,6 +40,8 @@ import jakarta.enterprise.inject.spi.Extension; import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(SeCategory.class) public class DefaultNestedTransactionTest @@ -57,7 +58,7 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "defaultNestedTransactionTest.jar") .addPackage(ArchiveUtils.SHARED_PACKAGE) .addPackage(DefaultNestedTransactionTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class) .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJpaArchive()) diff --git a/deltaspike/modules/jsf/impl/pom.xml b/deltaspike/modules/jsf/impl/pom.xml index 0f9e45c5f..e4139186d 100644 --- a/deltaspike/modules/jsf/impl/pom.xml +++ b/deltaspike/modules/jsf/impl/pom.xml @@ -144,19 +144,19 @@ org.jboss.arquillian.extension arquillian-drone-api - 1.1.0.CR3 + 2.5.4 test org.jboss.arquillian.extension arquillian-warp-api - 1.0.0.Alpha1 + 1.0.0 test org.jboss.arquillian.graphene graphene-webdriver - 2.0.3.Final + 2.5.4 pom test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc001/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc001/ViewConfigTestDrone.java index 8a881c1f8..94ee1868e 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc001/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc001/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -39,6 +40,8 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class ViewConfigTestDrone @@ -59,7 +62,7 @@ public static WebArchive deploy() .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive()) .addAsWebResource("controller/simplePageConfig.xhtml", "/simplePageConfig.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc002/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc002/ViewConfigTestDrone.java index 469304813..4af5a9b2b 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc002/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc002/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -39,6 +40,8 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) @@ -60,7 +63,7 @@ public static WebArchive deploy() .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive()) .addAsWebResource("controller/simplePageConfig.xhtml", "/simplePageConfig.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc003/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc003/ViewConfigTestDrone.java index 3859cc104..5b6732fb1 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc003/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/controller/uc003/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -39,6 +40,8 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) @@ -60,7 +63,7 @@ public static WebArchive deploy() .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive()) .addAsWebResource("controller/simplePageConfig.xhtml", "/simplePageConfig.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc001/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc001/ViewConfigTestDrone.java index bd4984b34..c8b017888 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc001/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc001/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) @@ -64,7 +67,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/pages/index.xhtml", "/pages/index.xhtml") .addAsWebResource("navigation/pages/home.xhtml", "/pages/home.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc002/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc002/ViewConfigTestDrone.java index df49854ce..3b7efd220 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc002/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc002/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) @@ -66,7 +69,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/pages/overview.xhtml", "/pages/overview.xhtml") .addAsWebResource("navigation/pages/customErrorPage.xhtml", "/pages/customErrorPage.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc003/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc003/ViewConfigTestDrone.java index acb206c0c..971b2d100 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc003/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc003/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class ViewConfigTestDrone @@ -63,7 +66,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/pages/index.xhtml", "/pages/index.xhtml") .addAsWebResource("navigation/pages/home.xhtml", "/pages/home.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc004/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc004/ViewConfigTestDrone.java index dc07313ca..95cb38f05 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc004/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc004/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class ViewConfigTestDrone @@ -62,7 +65,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/pages/index.xhtml", "/pages/index.xhtml") .addAsWebResource("navigation/pages/overview.xhtml", "/pages/overview.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc006/ViewConfigTestDrone.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc006/ViewConfigTestDrone.java index bcaefefc8..ef6f58c63 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc006/ViewConfigTestDrone.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/destination/uc006/ViewConfigTestDrone.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class ViewConfigTestDrone @@ -62,7 +65,7 @@ public static WebArchive deploy() .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive()) .addAsWebResource("navigation/wizard1/step1.xhtml", "/wizard1/step1.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/event/uc001/PreViewConfigNavigateEventTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/event/uc001/PreViewConfigNavigateEventTest.java index 4849a17a8..42c404fad 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/event/uc001/PreViewConfigNavigateEventTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/event/uc001/PreViewConfigNavigateEventTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class PreViewConfigNavigateEventTest @@ -66,7 +69,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/pages/overview.xhtml", "/pages/overview.xhtml") .addAsWebResource("navigation/pages/customErrorPage.xhtml", "/pages/customErrorPage.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return archive; } @@ -77,6 +80,7 @@ public void testNavigationActionWithError() throws MalformedURLException driver.get(new URL(contextPath, "origin.xhtml").toString()); WebElement button = driver.findElement(By.id("event:pb002ActionWithError")); + Assert.assertNotNull(button); button.click(); // Index Page is shown instead of DefaultErrorView because PreViewConfigNavigateEvent changed the navigation Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("indexPage"), "You arrived at index page") diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc004/NavigationParameterTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc004/NavigationParameterTest.java index e5d74e50c..eb08f622e 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc004/NavigationParameterTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc004/NavigationParameterTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class NavigationParameterTest @@ -63,7 +66,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/origin.xhtml", "/origin.xhtml") .addAsWebResource("navigation/simplePageConfig.xhtml", "/simplePageConfig.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return archive; } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc005/NavigationParameterTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc005/NavigationParameterTest.java index 0a3941955..0fb71566b 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc005/NavigationParameterTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc005/NavigationParameterTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class NavigationParameterTest @@ -64,7 +67,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/pages/index.xhtml", "/pages/index.xhtml") .addAsWebResource("navigation/pages/overview.xhtml", "/pages/overview.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return archive; } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc006/NavigationParameterTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc006/NavigationParameterTest.java index 56bf76ee2..9c43c999a 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc006/NavigationParameterTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/config/view/navigation/parameter/uc006/NavigationParameterTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class NavigationParameterTest @@ -63,7 +66,7 @@ public static WebArchive deploy() .addAsWebResource("navigation/origin.xhtml", "/origin.xhtml") .addAsWebResource("navigation/pages/customErrorPage.xhtml", "/pages/customErrorPage.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return archive; } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/AnotherBeanConverter.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/AnotherBeanConverter.java index 2f9ced6ab..7ff0de60f 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/AnotherBeanConverter.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/AnotherBeanConverter.java @@ -25,8 +25,10 @@ import jakarta.faces.convert.ConverterException; import jakarta.faces.convert.FacesConverter; import jakarta.inject.Inject; +import jakarta.inject.Named; -@FacesConverter("myValueConverter") +@Named +@FacesConverter(value = "myValueConverter", managed = true) public class AnotherBeanConverter implements Converter { diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/InjectionDroneTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/InjectionDroneTest.java index 64e542bfb..91d73f522 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/InjectionDroneTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/InjectionDroneTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) @@ -61,7 +64,7 @@ public static WebArchive deploy() .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive()) .addAsWebResource("injection/testValidatorConverter.xhtml", "/testValidatorConverter.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/MyBeanValidator.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/MyBeanValidator.java index 7612f77c7..df1450b8c 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/MyBeanValidator.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc001/MyBeanValidator.java @@ -25,8 +25,10 @@ import jakarta.faces.validator.Validator; import jakarta.faces.validator.ValidatorException; import jakarta.inject.Inject; +import jakarta.inject.Named; -@FacesValidator("myBeanValidator") +@Named +@FacesValidator(value = "myBeanValidator", managed = true) public class MyBeanValidator implements Validator { diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/AnotherBeanConverter.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/AnotherBeanConverter.java index 2bc49a68a..2aa6b5937 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/AnotherBeanConverter.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/AnotherBeanConverter.java @@ -19,6 +19,7 @@ package org.apache.deltaspike.test.jsf.impl.injection.uc002; import jakarta.enterprise.context.RequestScoped; +import jakarta.enterprise.inject.Model; import jakarta.faces.application.FacesMessage; import jakarta.faces.component.UIComponent; import jakarta.faces.context.FacesContext; @@ -26,9 +27,11 @@ import jakarta.faces.convert.ConverterException; import jakarta.faces.convert.FacesConverter; import jakarta.inject.Inject; +import jakarta.inject.Named; +@Named @RequestScoped -@FacesConverter("myValueConverter") +@FacesConverter(value = "myValueConverter", managed = true) public class AnotherBeanConverter implements Converter { diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/InjectionDroneTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/InjectionDroneTest.java index 392c728d6..7938fc756 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/InjectionDroneTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/InjectionDroneTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class InjectionDroneTest @@ -60,7 +63,7 @@ public static WebArchive deploy() .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive()) .addAsWebResource("injection/testValidatorConverter.xhtml", "/testValidatorConverter.xhtml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/MyBeanValidator.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/MyBeanValidator.java index 9636053a2..ed246671f 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/MyBeanValidator.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc002/MyBeanValidator.java @@ -26,9 +26,11 @@ import jakarta.faces.validator.Validator; import jakarta.faces.validator.ValidatorException; import jakarta.inject.Inject; +import jakarta.inject.Named; +@Named @RequestScoped -@FacesValidator("myBeanValidator") +@FacesValidator(value = "myBeanValidator", managed = true) public class MyBeanValidator implements Validator { diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/AnotherBeanConverter.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/AnotherBeanConverter.java index 243d2382a..abd2a7040 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/AnotherBeanConverter.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/AnotherBeanConverter.java @@ -25,8 +25,10 @@ import jakarta.faces.convert.ConverterException; import jakarta.faces.convert.FacesConverter; import jakarta.inject.Inject; +import jakarta.inject.Named; -@FacesConverter("myValueConverter") +@Named +@FacesConverter(value = "myValueConverter", managed = true) public class AnotherBeanConverter extends AbstractStateHolder implements Converter { diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/InjectionDroneTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/InjectionDroneTest.java index 16bb325c7..9d27a7abb 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/InjectionDroneTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/InjectionDroneTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class InjectionDroneTest @@ -62,7 +65,7 @@ public static WebArchive deploy() .addAsWebInfResource("META-INF/test.taglib.xml", "classes/META-INF/test.taglib.xml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") .addAsWebInfResource("default/WEB-INF/faces-config.xml", "faces-config.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/MyBeanValidator.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/MyBeanValidator.java index 693a3e7d7..81fb89d26 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/MyBeanValidator.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc003/MyBeanValidator.java @@ -25,8 +25,10 @@ import jakarta.faces.validator.Validator; import jakarta.faces.validator.ValidatorException; import jakarta.inject.Inject; +import jakarta.inject.Named; -@FacesValidator("myBeanValidator") +@Named +@FacesValidator(value = "myBeanValidator", managed = true) public class MyBeanValidator extends AbstractStateHolder implements Validator { diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/AnotherBeanConverter.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/AnotherBeanConverter.java index dd7075663..f3eaebe31 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/AnotherBeanConverter.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/AnotherBeanConverter.java @@ -25,8 +25,10 @@ import jakarta.faces.convert.ConverterException; import jakarta.faces.convert.FacesConverter; import jakarta.inject.Inject; +import jakarta.inject.Named; -@FacesConverter("myValueConverter") +@Named +@FacesConverter(value = "myValueConverter", managed = true) public class AnotherBeanConverter implements Converter { diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/InjectionDroneTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/InjectionDroneTest.java index a5b00cd56..2ffc27bdb 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/InjectionDroneTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/InjectionDroneTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -40,6 +41,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class InjectionDroneTest @@ -62,7 +65,7 @@ public static WebArchive deploy() .addAsWebInfResource("META-INF/test.taglib.xml", "classes/META-INF/test.taglib.xml") .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") .addAsWebInfResource("default/WEB-INF/faces-config.xml", "faces-config.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/MyBeanValidator.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/MyBeanValidator.java index 603270436..984c659a4 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/MyBeanValidator.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/injection/uc004/MyBeanValidator.java @@ -26,15 +26,17 @@ import jakarta.faces.validator.Validator; import jakarta.faces.validator.ValidatorException; import jakarta.inject.Inject; +import jakarta.inject.Named; -@FacesValidator("myBeanValidator") +@Named +@FacesValidator(value = "myBeanValidator", managed = true) public class MyBeanValidator implements Validator, StateHolder { @Inject private MyBean myBean; - private String validValue = "Apache"; + private String validValue = "DeltaSpike"; private boolean isTransient; diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/message/JsfMessageTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/message/JsfMessageTest.java index 113be6202..50decf2fa 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/message/JsfMessageTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/message/JsfMessageTest.java @@ -25,6 +25,7 @@ import org.apache.deltaspike.test.jsf.impl.config.TestJsfModuleConfig; import org.apache.deltaspike.test.jsf.impl.message.beans.JsfMessageBackingBean; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -41,6 +42,8 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Test for the DeltaSpike JsfMessage Producer @@ -68,7 +71,7 @@ public static WebArchive deploy() .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive()) .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") .addAsWebResource("jsfMessageTest/page.xhtml", "page.xhtml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWebAppTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWebAppTest.java index 2d4f449af..4a7c95f59 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWebAppTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWebAppTest.java @@ -24,6 +24,7 @@ import org.apache.deltaspike.test.jsf.impl.scope.viewaccess.beans.ViewAccessScopedBeanX; import org.apache.deltaspike.test.jsf.impl.scope.viewaccess.beans.ViewAccessScopedBeanY; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -41,6 +42,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class ViewAccessScopedWebAppTest @@ -66,7 +69,7 @@ public static WebArchive deploy() .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") .addAsWebResource("viewAccessScopedContextTest/page1.xhtml", "page1.xhtml") .addAsWebResource("viewAccessScopedContextTest/page2.xhtml", "page2.xhtml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWithFViewActionWebAppTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWithFViewActionWebAppTest.java index 5a8a79cc5..c40e3a64f 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWithFViewActionWebAppTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/viewaccess/ViewAccessScopedWithFViewActionWebAppTest.java @@ -24,6 +24,7 @@ import org.apache.deltaspike.test.jsf.impl.scope.viewaccess.beans.ViewAccessScopedBeanX; import org.apache.deltaspike.test.jsf.impl.scope.viewaccess.beans.ViewAccessScopedBeanY; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -41,6 +42,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebEEProfileCategory.class) public class ViewAccessScopedWithFViewActionWebAppTest @@ -66,7 +69,7 @@ public static WebArchive deploy() .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") .addAsWebResource("viewAccessScopedContextTest/index.xhtml", "index.xhtml") .addAsWebResource("viewAccessScopedContextTest/next.xhtml", "next.xhtml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } @Test diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowMaxCountTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowMaxCountTest.java index 9992a1320..ba704fd6e 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowMaxCountTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowMaxCountTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.category.WebProfileCategory; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -39,6 +40,8 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) @Category(WebProfileCategory.class) public class WindowMaxCountTest @@ -62,7 +65,7 @@ public static WebArchive deploy() .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml") .addAsWebInfResource("META-INF/apache-deltaspike.properties", "classes/META-INF/apache-deltaspike.properties") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return archive; } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextFrameTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextFrameTest.java index a9016ee03..0cebe6014 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextFrameTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextFrameTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.jsf.impl.config.TestJsfModuleConfig; import org.apache.deltaspike.test.jsf.impl.scope.window.beans.WindowScopedBackingBean; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -42,6 +43,8 @@ import java.net.URL; import java.util.logging.Logger; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Test for the DeltaSpike JsfMessage Producer @@ -72,7 +75,7 @@ public static WebArchive deploy() "resources/deltaspike/windowhandler.js") .addAsWebResource("windowScopedContextTest/framecontainer.xhtml", "framecontainer.xhtml") .addAsWebResource("windowScopedContextTest/frame.xhtml", "frame.xhtml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java index d5fe27461..f5453fc5b 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java @@ -23,6 +23,7 @@ import org.apache.deltaspike.test.jsf.impl.config.TestJsfModuleConfig; import org.apache.deltaspike.test.jsf.impl.scope.window.beans.WindowScopedBackingBean; import org.apache.deltaspike.test.jsf.impl.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; @@ -43,6 +44,8 @@ import java.net.URL; import java.util.logging.Logger; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + /** * Test for the DeltaSpike JsfMessage Producer @@ -73,7 +76,7 @@ public static WebArchive deploy() "resources/deltaspike/windowhandler.js") .addAsWebResource("windowScopedContextTest/page.xhtml", "page.xhtml") .addAsWebResource("windowScopedContextTest/page2.xhtml", "page2.xhtml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/util/ArchiveUtils.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/util/ArchiveUtils.java index 3fe2bf96c..7fd50e9de 100644 --- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/util/ArchiveUtils.java +++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/util/ArchiveUtils.java @@ -84,7 +84,7 @@ public static JavaArchive[] getDeltaSpikeSecurityArchive() public static Asset getBeansXml() { Asset beansXml = new StringAsset( - "" + + "" + "" + "org.apache.deltaspike.jsf.impl.config.view.navigation.NavigationParameterInterceptor" + "org.apache.deltaspike.jsf.impl.config.view.navigation.NavigationParameterListInterceptor" + diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc004/ScopedPartialBeanTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc004/ScopedPartialBeanTest.java index 6286f6688..47a825cfe 100644 --- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc004/ScopedPartialBeanTest.java +++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc004/ScopedPartialBeanTest.java @@ -21,6 +21,7 @@ import org.apache.deltaspike.core.api.provider.BeanProvider; import org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding; import org.apache.deltaspike.test.core.api.partialbean.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; @@ -31,6 +32,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class ScopedPartialBeanTest { @@ -43,12 +46,12 @@ public static WebArchive war() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(ScopedPartialBeanTest.class.getPackage()) .addPackage(TestPartialBeanBinding.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); WebArchive webArchive = ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return webArchive; } diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java index a33ee85b1..0ab05b807 100644 --- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java +++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java @@ -45,7 +45,7 @@ public class MethodLevelInterceptorTest public static WebArchive war() { Asset beansXml = new StringAsset( - "" + + "" + CustomInterceptorImpl.class.getName() + "" ); diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java index 7fa54b962..4e6cf74d8 100644 --- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java +++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java @@ -45,7 +45,7 @@ public class ClassLevelInterceptorTest public static WebArchive war() { Asset beansXml = new StringAsset( - "" + + "" + CustomInterceptorImpl.class.getName() + "" ); diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc009/PartialBeanWithProducerWarFileTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc009/PartialBeanWithProducerWarFileTest.java index 6cf9887af..5e92b62c6 100644 --- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc009/PartialBeanWithProducerWarFileTest.java +++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc009/PartialBeanWithProducerWarFileTest.java @@ -19,6 +19,7 @@ package org.apache.deltaspike.test.core.api.partialbean.uc009; import org.apache.deltaspike.test.core.api.partialbean.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; @@ -27,6 +28,8 @@ import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class PartialBeanWithProducerWarFileTest extends PartialBeanWithProducerTest { @@ -38,11 +41,11 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(PartialBeanWithProducerWarFileTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); return ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); } } diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc012/ConcurrencyBugTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc012/ConcurrencyBugTest.java index 2a75b12ae..9b97ad3a5 100644 --- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc012/ConcurrencyBugTest.java +++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc012/ConcurrencyBugTest.java @@ -19,28 +19,22 @@ package org.apache.deltaspike.test.core.api.partialbean.uc012; +import jakarta.inject.Inject; import org.apache.deltaspike.test.core.api.partialbean.util.ArchiveUtils; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Test; import org.junit.runner.RunWith; -import jakarta.inject.Inject; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.*; import static java.util.concurrent.TimeUnit.SECONDS; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; @RunWith(Arquillian.class) public class ConcurrencyBugTest @@ -54,12 +48,12 @@ public static WebArchive war() final JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar") .addPackage(ConcurrencyBugTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, archiveName + ".war") .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()) .addAsLibraries(testJar) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsWebInfResource(BEANS_XML_ALL, "beans.xml"); return webArchive; } diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java index 346b6509d..71af4372a 100644 --- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java +++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java @@ -45,7 +45,7 @@ public class MethodLevelInterceptorTest public static WebArchive war() { Asset beansXml = new StringAsset( - "" + + "" + SimpleCacheInterceptor.class.getName() + "" ); diff --git a/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/CustomSchedulerWarFileTest.java b/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/CustomSchedulerWarFileTest.java index 007d302af..133c23d5a 100644 --- a/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/CustomSchedulerWarFileTest.java +++ b/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/CustomSchedulerWarFileTest.java @@ -21,6 +21,7 @@ import org.apache.deltaspike.core.spi.config.ConfigSource; import org.apache.deltaspike.scheduler.spi.Scheduler; import org.apache.deltaspike.test.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; @@ -31,6 +32,8 @@ import org.jboss.shrinkwrap.resolver.api.maven.Maven; import org.junit.runner.RunWith; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class CustomSchedulerWarFileTest extends CustomSchedulerTest { @@ -42,7 +45,7 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "customSchedulerTest.jar") .addPackage(CustomSchedulerWarFileTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsManifestResource(BEANS_XML_ALL, "beans.xml") .addAsResource(new StringAsset(MockedScheduler.class.getName()), "META-INF/services/" + Scheduler.class.getName()) .addAsResource(new StringAsset(CustomConfigSource.class.getName()), diff --git a/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/ScopeNotStartedTest.java b/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/ScopeNotStartedTest.java index bd4194659..153358438 100644 --- a/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/ScopeNotStartedTest.java +++ b/deltaspike/modules/scheduler/impl/src/test/java/org/apache/deltaspike/test/scheduler/custom/ScopeNotStartedTest.java @@ -22,6 +22,7 @@ import org.apache.deltaspike.core.spi.config.ConfigSource; import org.apache.deltaspike.scheduler.spi.Scheduler; import org.apache.deltaspike.test.util.ArchiveUtils; +import org.apache.deltaspike.test.utils.BeansXmlUtil; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; @@ -35,6 +36,8 @@ import jakarta.inject.Inject; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + @RunWith(Arquillian.class) public class ScopeNotStartedTest { @@ -47,7 +50,7 @@ public static WebArchive deploy() JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "scopeNotStartedTest.jar") .addPackage(CustomSchedulerWarFileTest.class.getPackage().getName()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") + .addAsManifestResource(BEANS_XML_ALL, "beans.xml") .addAsResource(new StringAsset(MockedScheduler.class.getName()), "META-INF/services/" + Scheduler.class.getName()) .addAsResource(new StringAsset(CustomDeactivatedConfigSource.class.getName()), diff --git a/deltaspike/parent/code/pom.xml b/deltaspike/parent/code/pom.xml index 7bacb06d9..e59305276 100644 --- a/deltaspike/parent/code/pom.xml +++ b/deltaspike/parent/code/pom.xml @@ -37,7 +37,6 @@ ${java.io.tmpdir}/deltaspike-arquillian-containers 31.0.0.Final - 5.0.0 2.0.11 5.0.1.Final 6.2024.1 @@ -437,19 +436,19 @@ jakarta.el jakarta.el-api - ${weld.el.api} + ${jakarta.el-api.version} test jakarta.transaction jakarta.transaction-api - 2.0.1 + ${jakarta.transaction-api.version} test jakarta.interceptor jakarta.interceptor-api - 2.1.0 + ${jakarta.interceptor-api.version} @@ -678,6 +677,11 @@ ${arquillian.version} test + + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet-api.version} + diff --git a/deltaspike/parent/pom.xml b/deltaspike/parent/pom.xml index 1ab5877ef..3e80fdc0b 100644 --- a/deltaspike/parent/pom.xml +++ b/deltaspike/parent/pom.xml @@ -123,9 +123,10 @@ 4.0.0 2.0.0 2.0.0 - 4.0.0 + 5.0.0 3.1.0 2.0.0 + 6.0.0 diff --git a/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaSpikeServerUtilAppender.java b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaSpikeServerUtilAppender.java index 922487514..6e66eb34e 100644 --- a/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaSpikeServerUtilAppender.java +++ b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaSpikeServerUtilAppender.java @@ -23,9 +23,10 @@ import org.jboss.arquillian.container.test.spi.client.deployment.CachedAuxilliaryArchiveAppender; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; +import static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL; + public class DeltaSpikeServerUtilAppender extends CachedAuxilliaryArchiveAppender { @Override @@ -34,6 +35,6 @@ protected Archive buildArchive() return ShrinkWrap.create(JavaArchive.class, "test-utils.jar") .addPackage(Serializer.class.getPackage()) .addPackage(DeltaSpikeTest.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + .addAsManifestResource(BEANS_XML_ALL, "beans.xml"); } } diff --git a/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/utils/BeansXmlUtil.java b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/utils/BeansXmlUtil.java new file mode 100644 index 000000000..8648efea7 --- /dev/null +++ b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/utils/BeansXmlUtil.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.deltaspike.test.utils; + +import org.jboss.shrinkwrap.api.asset.Asset; +import org.jboss.shrinkwrap.api.asset.StringAsset; + +public class BeansXmlUtil +{ + /** + * A Beans.xml instance enabling Discovery-Mode ALL for unit tests + */ + public static final Asset BEANS_XML_ALL = new StringAsset(""); + + private BeansXmlUtil() + { + } + +} diff --git a/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/utils/ShrinkWrapArchiveUtil.java b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/utils/ShrinkWrapArchiveUtil.java index e978fe38f..094c43586 100644 --- a/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/utils/ShrinkWrapArchiveUtil.java +++ b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/utils/ShrinkWrapArchiveUtil.java @@ -26,11 +26,7 @@ import java.io.IOException; import java.net.URI; import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; -import java.util.UUID; +import java.util.*; import java.util.logging.Logger;