Skip to content

Commit

Permalink
Merge pull request #151 from shadogray/master
Browse files Browse the repository at this point in the history
Wildfly-31 wildfly-build-managed - BeansXmlUtil.discovery-mode=all - mostly working
  • Loading branch information
tandraschko authored Feb 26, 2024
2 parents e38afd9 + 110ddd8 commit 9593635
Show file tree
Hide file tree
Showing 93 changed files with 458 additions and 203 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
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 static org.apache.deltaspike.test.utils.BeansXmlUtil.BEANS_XML_ALL;

/**
* Test for picking up a file system based config
*/
Expand All @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
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 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
Expand All @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*/
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}
*/
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}
*/
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
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;
import org.junit.Test;
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;

/**
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}
*/
Expand All @@ -61,15 +62,15 @@ 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")
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
.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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
Loading

0 comments on commit 9593635

Please sign in to comment.