Commit 80306ee 1 parent fa9fb88 commit 80306ee Copy full SHA for 80306ee
File tree 3 files changed +8
-5
lines changed
tests/deployment/discovery
resources/org/jboss/cdi/tck/tests/deployment/discovery
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,9 @@ public T withName(String name) {
171
171
* Add <code>beans.xml</code> located in src/main/resource/{testPackagePath}.
172
172
* <p/>
173
173
* <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.
175
177
* </p>
176
178
*
177
179
* @param beansXml
Original file line number Diff line number Diff line change 7
7
import jakarta .enterprise .inject .spi .CDI ;
8
8
import org .jboss .arquillian .container .test .api .Deployment ;
9
9
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 ;
12
11
import org .jboss .shrinkwrap .api .spec .WebArchive ;
12
+ import org .jboss .test .audit .annotations .SpecVersion ;
13
13
import org .testng .annotations .Test ;
14
14
15
15
/**
16
16
* Tests that a singular archive with empty beans.xml results in annotated discovery mode.
17
17
*/
18
+ @ SpecVersion (spec = "cdi" , version = "4.0" )
18
19
public class EmptyBeansXmlDiscoveryTest extends AbstractTest {
19
20
20
21
@ Deployment
21
22
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 ( );
24
25
}
25
26
26
27
@ Test (dataProvider = ARQUILLIAN_DATA_PROVIDER )
You can’t perform that action at this time.
0 commit comments