Skip to content

Commit

Permalink
Correct the deployment setup of EmptyBeansXmlDiscoveryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn authored and Ladicek committed Jun 6, 2023
1 parent fa9fb88 commit 80306ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ public T withName(String name) {
* Add <code>beans.xml</code> located in src/main/resource/{testPackagePath}.
* <p/>
* <p>
* Do not use this in new tests - use {@link #withBeansXml(BeansXml)} instead.
* In most cases, the alternative method {@link #withBeansXml(BeansXml)} should be used instead.
* However, this variant is still useful if the test needs a very specific beans.xml file such as completely empty
* file or one with invalid format.
* </p>
*
* @param beansXml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
import jakarta.enterprise.inject.spi.CDI;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.cdi.tck.AbstractTest;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.test.audit.annotations.SpecVersion;
import org.testng.annotations.Test;

/**
* Tests that a singular archive with empty beans.xml results in annotated discovery mode.
*/
@SpecVersion(spec = "cdi", version = "4.0")
public class EmptyBeansXmlDiscoveryTest extends AbstractTest {

@Deployment
public static WebArchive createTestArchive() {
return ShrinkWrap.create(WebArchive.class).addClasses(SomeAnnotatedBean.class, SomeUnannotatedBean.class)
.addAsWebInfResource(new StringAsset(""), "beans.xml");
return new WebArchiveBuilder().withTestClassPackage(EmptyBeansXmlDiscoveryTest.class)
.withBeansXml("beans.xml").build();
}

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
Expand Down
Empty file.

0 comments on commit 80306ee

Please sign in to comment.