Skip to content

Commit 80306ee

Browse files
manovotnLadicek
authored andcommitted
Correct the deployment setup of EmptyBeansXmlDiscoveryTest
1 parent fa9fb88 commit 80306ee

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

impl/src/main/java/org/jboss/cdi/tck/shrinkwrap/ArchiveBuilder.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ public T withName(String name) {
171171
* Add <code>beans.xml</code> located in src/main/resource/{testPackagePath}.
172172
* <p/>
173173
* <p>
174-
* Do not use this in new tests - use {@link #withBeansXml(BeansXml)} instead.
174+
* In most cases, the alternative method {@link #withBeansXml(BeansXml)} should be used instead.
175+
* However, this variant is still useful if the test needs a very specific beans.xml file such as completely empty
176+
* file or one with invalid format.
175177
* </p>
176178
*
177179
* @param beansXml

impl/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/EmptyBeansXmlDiscoveryTest.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77
import jakarta.enterprise.inject.spi.CDI;
88
import org.jboss.arquillian.container.test.api.Deployment;
99
import org.jboss.cdi.tck.AbstractTest;
10-
import org.jboss.shrinkwrap.api.ShrinkWrap;
11-
import org.jboss.shrinkwrap.api.asset.StringAsset;
10+
import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder;
1211
import org.jboss.shrinkwrap.api.spec.WebArchive;
12+
import org.jboss.test.audit.annotations.SpecVersion;
1313
import org.testng.annotations.Test;
1414

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

2021
@Deployment
2122
public static WebArchive createTestArchive() {
22-
return ShrinkWrap.create(WebArchive.class).addClasses(SomeAnnotatedBean.class, SomeUnannotatedBean.class)
23-
.addAsWebInfResource(new StringAsset(""), "beans.xml");
23+
return new WebArchiveBuilder().withTestClassPackage(EmptyBeansXmlDiscoveryTest.class)
24+
.withBeansXml("beans.xml").build();
2425
}
2526

2627
@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)

impl/src/main/resources/org/jboss/cdi/tck/tests/deployment/discovery/beans.xml

Whitespace-only changes.

0 commit comments

Comments
 (0)