Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the deployment setup of EmptyBeansXmlDiscoveryTest #471

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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