diff --git a/bom/project-bom/pom.xml b/bom/project-bom/pom.xml index e53b7ca3..5843a7e1 100644 --- a/bom/project-bom/pom.xml +++ b/bom/project-bom/pom.xml @@ -26,7 +26,6 @@ 31.0.1.Final 1.0.0.Final 3.1.6 - 4.13.2 5.11.3 1.9.2.Final 10.0.0.Final @@ -128,12 +127,6 @@ ${version.jakarta.ws.rs-api} test - - junit - junit - test - ${version.junit} - org.jboss diff --git a/common-domain/pom.xml b/common-domain/pom.xml index 39f7c1b1..e1c255b5 100644 --- a/common-domain/pom.xml +++ b/common-domain/pom.xml @@ -68,13 +68,13 @@ - junit - junit + jakarta.servlet + jakarta.servlet-api test - jakarta.servlet - jakarta.servlet-api + org.junit.jupiter + junit-jupiter test diff --git a/common-domain/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java b/common-domain/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java index 612678ee..56e375ab 100644 --- a/common-domain/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java +++ b/common-domain/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java @@ -4,57 +4,58 @@ */ package org.jboss.as.arquillian.container; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; + import java.util.List; import org.jboss.as.arquillian.container.domain.ParameterUtils; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * TestCases for {@link ParameterUtils}. * */ -public class ParameterUtilsTest { +class ParameterUtilsTest { private static final String PARAM_WITH_WHITESPACE = "-Djboss.server.base.dir=Does contain whitespaces"; private static final String QUOTED_PARAM_WITH_WHITESPACE = "\"" + PARAM_WITH_WHITESPACE + "\""; private static final String PARAM_WITHOUT_WHITESPACE = "-Djboss.http.port=8080"; @Test - public void mixedParams() { + void mixedParams() { List splitParams = ParameterUtils .splitParams(QUOTED_PARAM_WITH_WHITESPACE.concat(" ").concat(PARAM_WITHOUT_WHITESPACE).concat(" ") .concat(QUOTED_PARAM_WITH_WHITESPACE).concat(" ").concat(QUOTED_PARAM_WITH_WHITESPACE).concat(" ") .concat(PARAM_WITHOUT_WHITESPACE).concat(" ").concat(QUOTED_PARAM_WITH_WHITESPACE)); - Assert.assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITH_WHITESPACE, + assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void singleParamWithWS() { + void singleParamWithWS() { List splitParams = ParameterUtils.splitParams(QUOTED_PARAM_WITH_WHITESPACE); - Assert.assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); + assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void singleParamWithoutWS() { + void singleParamWithoutWS() { List splitParams = ParameterUtils.splitParams(PARAM_WITHOUT_WHITESPACE); - Assert.assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE }, splitParams.toArray(new String[0])); + assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void onlyParamsWithWhitespaces() { + void onlyParamsWithWhitespaces() { List splitParams = ParameterUtils.splitParams(QUOTED_PARAM_WITH_WHITESPACE.concat(" ") .concat(QUOTED_PARAM_WITH_WHITESPACE).concat(QUOTED_PARAM_WITH_WHITESPACE)); - Assert.assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE }, + assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void onlyParamsWithoutWhitespaces() { + void onlyParamsWithoutWhitespaces() { List splitParams = ParameterUtils.splitParams(PARAM_WITHOUT_WHITESPACE.concat(" ") .concat(PARAM_WITHOUT_WHITESPACE).concat(" ").concat(PARAM_WITHOUT_WHITESPACE)); - Assert.assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE }, + assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE }, splitParams.toArray(new String[0])); } } diff --git a/common/pom.xml b/common/pom.xml index 46f9f1cc..fad6b85a 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -75,15 +75,13 @@ wildfly-plugin-tools - org.jboss.shrinkwrap.descriptors - shrinkwrap-descriptors-impl-base + org.junit.jupiter + junit-jupiter + test - - - junit - junit - test + org.jboss.shrinkwrap.descriptors + shrinkwrap-descriptors-impl-base diff --git a/common/src/test/java/org/jboss/as/arquillian/container/ManagementClientTest.java b/common/src/test/java/org/jboss/as/arquillian/container/ManagementClientTest.java index 234f7eb8..ec40f3e0 100644 --- a/common/src/test/java/org/jboss/as/arquillian/container/ManagementClientTest.java +++ b/common/src/test/java/org/jboss/as/arquillian/container/ManagementClientTest.java @@ -4,22 +4,23 @@ */ package org.jboss.as.arquillian.container; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; -public class ManagementClientTest { +import org.junit.jupiter.api.Test; + +class ManagementClientTest { @Test - public void shouldParseBindAllAsLocalhost() { + void shouldParseBindAllAsLocalhost() { String sourceIp = "0.0.0.0"; String parsedIp = ManagementClient.formatIP(sourceIp); - Assert.assertEquals("127.0.0.1", parsedIp); + assertEquals("127.0.0.1", parsedIp); } @Test - public void shouldParseLocalIPAsNormalIP() { + void shouldParseLocalIPAsNormalIP() { String sourceIp = "10.1.2.3"; String formattedIp = ManagementClient.formatIP(sourceIp); - Assert.assertEquals(sourceIp, formattedIp); + assertEquals(sourceIp, formattedIp); } } diff --git a/common/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java b/common/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java index 7e0c09a5..94dd6698 100644 --- a/common/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java +++ b/common/src/test/java/org/jboss/as/arquillian/container/ParameterUtilsTest.java @@ -4,56 +4,57 @@ */ package org.jboss.as.arquillian.container; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; + import java.util.List; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * TestCases for {@link ParameterUtils}. * */ -public class ParameterUtilsTest { +class ParameterUtilsTest { private static final String PARAM_WITH_WHITESPACE = "-Djboss.server.base.dir=Does contain whitespaces"; private static final String QUOTED_PARAM_WITH_WHITESPACE = "\"" + PARAM_WITH_WHITESPACE + "\""; private static final String PARAM_WITHOUT_WHITESPACE = "-Djboss.http.port=8080"; @Test - public void mixedParams() { + void mixedParams() { List splitParams = ParameterUtils .splitParams(QUOTED_PARAM_WITH_WHITESPACE.concat(" ").concat(PARAM_WITHOUT_WHITESPACE).concat(" ") .concat(QUOTED_PARAM_WITH_WHITESPACE).concat(" ").concat(QUOTED_PARAM_WITH_WHITESPACE).concat(" ") .concat(PARAM_WITHOUT_WHITESPACE).concat(" ").concat(QUOTED_PARAM_WITH_WHITESPACE)); - Assert.assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITH_WHITESPACE, + assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void singleParamWithWS() { + void singleParamWithWS() { List splitParams = ParameterUtils.splitParams(QUOTED_PARAM_WITH_WHITESPACE); - Assert.assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); + assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void singleParamWithoutWS() { + void singleParamWithoutWS() { List splitParams = ParameterUtils.splitParams(PARAM_WITHOUT_WHITESPACE); - Assert.assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE }, splitParams.toArray(new String[0])); + assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void onlyParamsWithWhitespaces() { + void onlyParamsWithWhitespaces() { List splitParams = ParameterUtils.splitParams(QUOTED_PARAM_WITH_WHITESPACE.concat(" ") .concat(QUOTED_PARAM_WITH_WHITESPACE).concat(QUOTED_PARAM_WITH_WHITESPACE)); - Assert.assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE }, + assertArrayEquals(new String[] { PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE }, splitParams.toArray(new String[0])); } @Test - public void onlyParamsWithoutWhitespaces() { + void onlyParamsWithoutWhitespaces() { List splitParams = ParameterUtils.splitParams(PARAM_WITHOUT_WHITESPACE.concat(" ") .concat(PARAM_WITHOUT_WHITESPACE).concat(" ").concat(PARAM_WITHOUT_WHITESPACE)); - Assert.assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE }, + assertArrayEquals(new String[] { PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE, PARAM_WITHOUT_WHITESPACE }, splitParams.toArray(new String[0])); } } diff --git a/container-bootable/pom.xml b/container-bootable/pom.xml index 895d560e..009b3a86 100644 --- a/container-bootable/pom.xml +++ b/container-bootable/pom.xml @@ -54,15 +54,19 @@ org.wildfly.launcher wildfly-launcher - - junit - junit + org.junit.jupiter + junit-jupiter test - org.jboss.arquillian.junit - arquillian-junit-container + org.junit.platform + junit-platform-suite + test + + + org.jboss.arquillian.junit5 + arquillian-junit5-container test @@ -112,7 +116,7 @@ compile true - true + true test-wildfly.jar @@ -145,7 +149,7 @@ **/*TestCase.java **/*TestSuite.java - org.jboss.as.arquillian.container.managed.manual.ManualMode + ManualMode **/ThreadContextClassloaderTest.java @@ -183,7 +187,7 @@ false - org.jboss.as.arquillian.container.managed.manual.ManualMode + ManualMode manual-arquillian.xml ${jboss.home} diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java index 9db89812..e9e26998 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java @@ -9,7 +9,7 @@ import javax.management.MBeanServerConnection; import javax.management.ObjectName; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author Kabir Khan diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java index b6d8a04b..cfc74555 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java @@ -6,7 +6,7 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ArchiveDeployer; import org.jboss.as.arquillian.container.ManagementClient; @@ -14,16 +14,16 @@ import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Test deploying through an injected {@link ArchiveDeployer}. * * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ClientDeploymentTestCase { @@ -37,29 +37,29 @@ public static WebArchive create() { @Test public void globalDeploymentTest(@ArquillianResource ManagementClient client) throws Exception { - Assert.assertNotNull("Expected the ArchiveDeployer to be injected", deployer); + Assertions.assertNotNull(deployer, "Expected the ArchiveDeployer to be injected"); testDeploy(deployer, client); } @Test public void parameterDeploymentTest(@ArquillianResource ManagementClient client, @ArquillianResource ArchiveDeployer deployer) throws Exception { - Assert.assertNotNull("Expected the ArchiveDeployer to be injected", deployer); + Assertions.assertNotNull(deployer, "Expected the ArchiveDeployer to be injected"); testDeploy(deployer, client); } private void testDeploy(final ArchiveDeployer deployer, final ManagementClient client) throws Exception { final WebArchive deployment = createDeployment("test-client-deployment.war"); - Assert.assertEquals(deployment.getName(), deployer.deploy(deployment)); + Assertions.assertEquals(deployment.getName(), deployer.deploy(deployment)); // Check the server for the deployment final ModelNode address = Operations.createAddress("deployment", deployment.getName()); final ModelNode result = client.getControllerClient() .execute(Operations.createReadAttributeOperation(address, "status")); if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } - Assert.assertEquals("OK", Operations.readResult(result).asString()); + Assertions.assertEquals("OK", Operations.readResult(result).asString()); deployer.undeploy(deployment.getName()); } diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java index a4b2732f..3a6beadd 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java @@ -5,18 +5,18 @@ package org.jboss.as.arquillian.container.managed; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.msc.service.ServiceActivator; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests basic deployment */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class DeploymentTestCase { @Deployment @@ -29,7 +29,7 @@ public static JavaArchive create() { @Test public void testSystemPropSet() throws Exception { - Assert.assertEquals(SystemPropertyServiceActivator.VALUE, + Assertions.assertEquals(SystemPropertyServiceActivator.VALUE, System.getProperty(SystemPropertyServiceActivator.TEST_PROPERTY)); } } \ No newline at end of file diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java index c94f97f6..4a7d4f8e 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java @@ -9,20 +9,20 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * AS7-3111 Ensures the JNDI Naming {@link Context} can be injected * * @author Andrew Lee Rubinger */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class InjectJndiContextTestCase { @@ -47,9 +47,9 @@ public static JavaArchive createDeployment() throws Exception { */ @Test public void shouldInjectJndiContext() throws NamingException { - Assert.assertNotNull("AS7-3111: JNDI Context must be injected", jndiContext); + Assertions.assertNotNull(jndiContext, "AS7-3111: JNDI Context must be injected"); // Attempt to look up the remote EJB final EjbBusiness ejb = (EjbBusiness) jndiContext.lookup(JNDI_NAME); - Assert.assertNotNull("Could not look up datasource using supplied JNDI Context", ejb); + Assertions.assertNotNull(ejb, "Could not look up datasource using supplied JNDI Context"); } } diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java index 228a8614..9730dfd8 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java @@ -5,21 +5,21 @@ package org.jboss.as.arquillian.container.managed; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * AS7-1415 Ensures injection of the {@link ManagementClient} is working correctly * * @author Andrew Lee Rubinger */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class InjectManagementClientTestCase { @ArquillianResource @@ -32,8 +32,8 @@ public static WebArchive createDeployment() throws Exception { @Test public void ensureManagementClientInjected() { - Assert.assertNotNull("Management client must be injected", managementClient); - Assert.assertTrue("Management client should report server as running", - managementClient.isServerInRunningState()); + Assertions.assertNotNull(managementClient, "Management client must be injected"); + Assertions.assertTrue(managementClient.isServerInRunningState(), + "Management client should report server as running"); } } diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java index ed7f2923..d5623e93 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java @@ -7,21 +7,21 @@ import jakarta.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.managed.archive.GreetingService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * IntegrationTestCase * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class IntegrationTestCase { @Deployment @@ -36,16 +36,16 @@ public static JavaArchive create() { @Test public void shouldBeAbleToInject() throws Exception { - Assert.assertNotNull(service); - Assert.assertEquals("Hello Earthling!", service.greet("Earthling")); + Assertions.assertNotNull(service); + Assertions.assertEquals("Hello Earthling!", service.greet("Earthling")); } @Test public void shouldBeAbleToFetchSystemProperties() throws Exception { final String prop1 = System.getProperties().getProperty("org.jboss.as.arquillian.container.managed.prop1"); final String prop2 = System.getProperties().getProperty("org.jboss.as.arquillian.container.managed.prop2"); - Assert.assertEquals("prop1", prop1); - Assert.assertEquals("prop2", prop2); + Assertions.assertEquals("prop1", prop1); + Assertions.assertEquals("prop2", prop2); } } \ No newline at end of file diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java index 39e10321..c3a682a9 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java @@ -10,14 +10,14 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * A client-side test case that verifies that the root deployment URL can be injected @@ -25,7 +25,7 @@ * * @author Dan Allen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ManagedAsClientEnterpriseArchiveServletTestCase { @@ -42,16 +42,16 @@ public static EnterpriseArchive createDeployment() throws Exception { @Test public void shouldBeAbleToInvokeServlet() throws Exception { - Assert.assertNotNull(deploymentUrl); + Assertions.assertNotNull(deploymentUrl); String result = getContent(new URL(deploymentUrl.toString() + HelloWorldServlet.URL_PATTERN.substring(1))); - Assert.assertEquals(HelloWorldServlet.GREETING, result); + Assertions.assertEquals(HelloWorldServlet.GREETING, result); } @Test public void testWebContext() { - Assert.assertTrue( - String.format("Expected context to start with /%s, but found %s", CONTEXT_NAME, deploymentUrl.getPath()), - deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME)); + Assertions.assertTrue( + deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME), + String.format("Expected context to start with /%s, but found %s", CONTEXT_NAME, deploymentUrl.getPath())); } private String getContent(URL url) throws Exception { diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java index 8fdae19b..c75ac7f1 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java @@ -11,14 +11,15 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.MBeanServerConnectionProvider; import org.jboss.as.arquillian.container.managed.archive.ConfigService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.After; -import org.junit.Ignore; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.xnio.IoUtils; /** @@ -27,10 +28,10 @@ * @author Kabir Khan * @author Thomas.Diesler@jboss.com */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient // Ignored, requires sar not present in standalone-microprofile.xml -@Ignore +@Disabled public class ManagedAsClientTestCase extends AbstractContainerTestCase { private MBeanServerConnectionProvider provider; @@ -51,12 +52,13 @@ protected MBeanServerConnection getMBeanServer() throws Exception { return provider.getConnection(); } - @After + @AfterEach public void closeProvider() { IoUtils.safeClose(provider); } @Override + @Test public void testDeployedService() throws Exception { super.testDeployedService(); } diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java index a0cb4c0c..67305736 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java @@ -11,13 +11,13 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.OverProtocol; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * A client-side test case that verifies that the root deployment URL can be injected @@ -25,7 +25,7 @@ * * @author Dan Allen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ManagedAsClientWebArchiveServletTestCase { @@ -42,19 +42,19 @@ public static WebArchive createDeployment() throws Exception { @Test public void shouldBeAbleToInvokeServlet() throws Exception { - Assert.assertNotNull(deploymentUrl); - Assert.assertTrue("deploymentUrl should end with " + CONTEXT_NAME + "/, but is " + deploymentUrl + - ", the context URL seems to be wrong", - deploymentUrl.toString().endsWith(CONTEXT_NAME + "/")); + Assertions.assertNotNull(deploymentUrl); + Assertions.assertTrue(deploymentUrl.toString().endsWith(CONTEXT_NAME + "/"), + "deploymentUrl should end with " + CONTEXT_NAME + "/, but is " + deploymentUrl + + ", the context URL seems to be wrong"); String result = getContent(new URL(deploymentUrl.toString() + HelloWorldServlet.URL_PATTERN.substring(1))); - Assert.assertEquals(HelloWorldServlet.GREETING, result); + Assertions.assertEquals(HelloWorldServlet.GREETING, result); } @Test public void testWebContext() { - Assert.assertTrue( - String.format("Expected context to start with /%s but found %s", CONTEXT_NAME, deploymentUrl.getPath()), - deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME)); + Assertions.assertTrue( + deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME), + String.format("Expected context to start with /%s but found %s", CONTEXT_NAME, deploymentUrl.getPath())); } private String getContent(URL url) throws Exception { diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java index 6f65ab6e..e33f5d09 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java @@ -12,12 +12,13 @@ import javax.management.MBeanServerConnection; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.managed.archive.ConfigService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Ignore; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * ManagedInContainerTestCase @@ -26,8 +27,8 @@ * @author Thomas.Diesler@jboss.com */ // Ignored, requires sar not present in standalone-microprofile.xml -@Ignore -@RunWith(Arquillian.class) +@Disabled +@ExtendWith(ArquillianExtension.class) public class ManagedInContainerTestCase extends AbstractContainerTestCase { @Deployment @@ -48,6 +49,7 @@ MBeanServerConnection getMBeanServer() throws Exception { } @Override + @Test public void testDeployedService() throws Exception { super.testDeployedService(); } diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java index 308c87a5..158773c1 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java @@ -5,22 +5,22 @@ package org.jboss.as.arquillian.container.managed; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ServerSetupAfterClassTestCase extends TestOperations { @ArquillianResource @@ -70,7 +70,7 @@ public void testUnmanagedAssumptionViolated() { private void testInVMProperty(String property, String expected) { String value = System.getProperty(property, ""); System.clearProperty(property); // housekeeping - assertEquals("Unexpected value for " + property, expected, value); + assertEquals(expected, value, "Unexpected value for " + property); } @Override diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java index 092e37f3..72b0482d 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java @@ -5,7 +5,7 @@ package org.jboss.as.arquillian.container.managed; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.util.function.Function; @@ -13,8 +13,8 @@ import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.AssumptionViolatedException; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.opentest4j.TestAbortedException; abstract class ServerSetupAssumptionTestBase { @@ -61,7 +61,7 @@ static class AssumptionViolatedSetup implements ServerSetupTask { private final Function assumptionFailureProducer; AssumptionViolatedSetup(String property) { - this(property, AssumptionViolatedException::new); + this(property, TestAbortedException::new); } AssumptionViolatedSetup(String property, Function assumptionFailureProducer) { diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java index 636856ed..ba6d1f44 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java @@ -6,19 +6,18 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.AssumptionViolatedException; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.extension.ExtendWith; /** * In conjunction with {@link ServerSetupAfterClassTestCase#testAssumptionViolated()}, tests - * what happens when a {@link ServerSetupTask} throws {@link AssumptionViolatedException} + * what happens when a {@link ServerSetupTask} throws {@link org.opentest4j.TestAbortedException} * when it executes prior to Arquillian deploying a {@code @Deployment(managed=true)} deployment. */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient @ServerSetup({ ServerSetupAssumptionViolationTestCase.BeforeSetup.class, diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java index 95b3c4fe..72829906 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java @@ -10,7 +10,7 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; @@ -19,13 +19,13 @@ import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @ServerSetup(ServerSetupDeploymentTestCase.SystemPropertySetupTask.class) @RunAsClient public class ServerSetupDeploymentTestCase extends TestOperations { diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java index b1a38343..60e6dcb2 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java @@ -5,16 +5,16 @@ package org.jboss.as.arquillian.container.managed; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; /** * Ensures the order of the tests to execute in the correct order. * * @author James R. Perkins */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ +@Suite +@SelectClasses(value = { ServerSetupDeploymentTestCase.class, ServerSetupAssumptionViolationTestCase.class, ServerSetupUnmanagedAssumptionViolationTestCase.class, diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java index a4db1312..439d47c0 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java @@ -7,21 +7,20 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.AssumptionViolatedException; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * In conjunction with {@link ServerSetupAfterClassTestCase#testAssumptionViolated()}, tests - * what happens when a {@link ServerSetupTask} throws {@link AssumptionViolatedException} + * what happens when a {@link ServerSetupTask} throws {@link org.opentest4j.TestAbortedException} * when it executes prior to Arquillian deploying a {@code @Deployment(managed=false)} deployment. */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient @ServerSetup({ ServerSetupUnmanagedAssumptionViolationTestCase.BeforeSetup.class, diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/SystemPropertyServiceActivator.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/SystemPropertyServiceActivator.java index e9adb364..c8233b8a 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/SystemPropertyServiceActivator.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/SystemPropertyServiceActivator.java @@ -5,13 +5,10 @@ package org.jboss.as.arquillian.container.managed; -import org.jboss.msc.service.Service; import org.jboss.msc.service.ServiceActivator; import org.jboss.msc.service.ServiceActivatorContext; -import org.jboss.msc.service.ServiceName; import org.jboss.msc.service.ServiceRegistryException; import org.jboss.msc.service.StartContext; -import org.jboss.msc.service.StartException; import org.jboss.msc.service.StopContext; /** @@ -24,20 +21,15 @@ public class SystemPropertyServiceActivator implements ServiceActivator { @Override public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException { - serviceActivatorContext.getServiceTarget().addService(ServiceName.of("test-service"), new Service() { + serviceActivatorContext.getServiceTarget().addService().setInstance(new org.jboss.msc.Service() { @Override - public void start(StartContext context) throws StartException { + public void start(final StartContext context) { System.setProperty(TEST_PROPERTY, VALUE); } @Override - public void stop(StopContext context) { - System.clearProperty(TEST_PROPERTY); - } - - @Override - public Object getValue() throws IllegalStateException, IllegalArgumentException { - return this; + public void stop(final StopContext context) { + System.setProperty(TEST_PROPERTY, VALUE); } }).install(); } diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java index d64067fd..0010e709 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java @@ -11,7 +11,7 @@ import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.dmr.ModelNode; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; /** * @author James R. Perkins @@ -25,15 +25,16 @@ void testSystemProperty(final String key) throws IOException { op.get("child-type").set("system-property"); final List result = executeForSuccess(getClient(), op).asList(); for (ModelNode property : result) { - Assert.assertNotEquals(String.format("The key '%s' should have been removed from the server", key), key, - property.asString()); + Assertions.assertNotEquals(key, + property.asString(), + String.format("The key '%s' should have been removed from the server", key)); } } void testSystemProperty(final String key, final String value) throws IOException { final ModelNode address = Operations.createAddress("system-property", key); final ModelNode result = executeForSuccess(getClient(), Operations.createReadResourceOperation(address)); - Assert.assertEquals(value, result.get("value").asString()); + Assertions.assertEquals(value, result.get("value").asString()); } static ModelNode executeForSuccess(final ManagementClient client, final ModelNode op) throws IOException { diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java index 8484820e..b52815b7 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java @@ -6,19 +6,21 @@ package org.jboss.as.arquillian.container.managed; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.modules.ModuleClassLoader; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(Arquillian.class) +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(ArquillianExtension.class) +@Disabled("WFARQ-153 - The enableThreadContextClassLoader setting does not work with JUnit 5") public class ThreadContextClassloaderTest { @Deployment @@ -27,22 +29,22 @@ public static JavaArchive deployment() { return archive; } - @BeforeClass + @BeforeAll public static void beforeClass() throws Exception { assertNoTCCL(); } - @AfterClass + @AfterAll public static void afterClass() throws Exception { assertNoTCCL(); } - @Before + @BeforeEach public void before() throws Exception { assertNoTCCL(); } - @After + @AfterEach public void after() throws Exception { assertNoTCCL(); } @@ -54,6 +56,6 @@ public void testClassLoader() throws Exception { private static void assertNoTCCL() { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - Assert.assertFalse("TCCL not ModuleClassLoader: " + tccl, tccl instanceof ModuleClassLoader); + Assertions.assertFalse(tccl instanceof ModuleClassLoader, "TCCL not ModuleClassLoader: " + tccl); } } diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java index ac1cb67b..abf644a6 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java @@ -7,8 +7,7 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.junit.InSequence; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; @@ -18,14 +17,18 @@ import org.jboss.msc.service.ServiceActivator; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests basic deployment */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @ServerSetup(UnmanagedDeploymentTestCase.SystemPropertyServerSetup.class) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) @RunAsClient public class UnmanagedDeploymentTestCase extends TestOperations { @@ -62,7 +65,7 @@ public static JavaArchive create() { } @Test - @InSequence(1) + @Order(1) public void undeployFirst() throws Exception { // Undeploy first which should not really do anything deployer.undeploy("test-deployment"); @@ -73,7 +76,7 @@ public void undeployFirst() throws Exception { } @Test - @InSequence(2) + @Order(2) public void contentDeployedThenUndeployed() throws Exception { // After the undeploy, the tearDown() won't happen until the class is complete deployer.undeploy("test-deployment"); diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java index 79a42a86..8c9187c2 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java @@ -22,9 +22,9 @@ import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author James R. Perkins @@ -45,7 +45,7 @@ public static WebArchive createDeployment() { .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } - @After + @AfterEach public void stop() throws Exception { if (controller.isStarted(containerName())) { controller.stop(containerName()); @@ -57,11 +57,11 @@ public void serverControl() { final String containerName = containerName(); // The primary container should already be started controller.start(containerName, createConfig("server-control")); - Assert.assertTrue(String.format("The container \"%s\" should be started", containerName), - controller.isStarted(containerName)); + Assertions.assertTrue(controller.isStarted(containerName), + String.format("The container \"%s\" should be started", containerName)); controller.stop(containerName); - Assert.assertFalse(String.format("The container \"%s\" should be stopped", containerName), - controller.isStarted(containerName)); + Assertions.assertFalse(controller.isStarted(containerName), + String.format("The container \"%s\" should be stopped", containerName)); } @Test @@ -82,8 +82,9 @@ public void deploy() throws Exception { deployer().deploy(createDeployment()); // Read each result, we should have two results for the first op and one for the second final int newDeployments = getCurrentDeploymentCount(client()); - Assert.assertEquals("Expected 1 deployments found " + (newDeployments - currentDeployments) + " for container " - + containerName, newDeployments, (1 + currentDeployments)); + Assertions.assertEquals(newDeployments, (1 + currentDeployments), + "Expected 1 deployments found " + (newDeployments - currentDeployments) + " for container " + + containerName); } finally { deployer().undeploy("dep1"); controller.stop(containerName); @@ -109,7 +110,7 @@ static ModelNode executeForSuccess(final ManagementClient client, final Operatio if (Operations.isSuccessfulOutcome(result)) { return Operations.readResult(result); } - Assert.fail( + Assertions.fail( String.format("Failed to execute operation: %s%n%s", op, Operations.getFailureDescription(result) .asString())); return new ModelNode(); diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java index 8793238b..67f2d594 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java @@ -7,21 +7,21 @@ import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ArchiveDeployer; import org.jboss.as.arquillian.container.ManagementClient; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests that the injected management client and archive deployer are usable on the appropriate container. * * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient -@Category(ManualMode.class) +@Tag("ManualMode") public class ClientManualModeTestCase extends AbstractManualModeTestCase { private static final String CONTAINER_NAME = "jboss"; diff --git a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java index 819eebae..10a6b21d 100644 --- a/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java +++ b/container-bootable/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java @@ -12,18 +12,18 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import com.sun.jdi.Bootstrap; import com.sun.jdi.VirtualMachine; @@ -33,8 +33,8 @@ /** * @author James R. Perkins */ -@Category(ManualMode.class) -@RunWith(Arquillian.class) +@Tag("ManualMode") +@ExtendWith(ArquillianExtension.class) @RunAsClient public class DebugManualModeTestCase { private static final String DEBUG_SUSPEND_CONTAINER_ID = "debug-config"; @@ -53,7 +53,7 @@ public static WebArchive createDeployment() { .addClass(ManualMode.class); } - @After + @AfterEach public void shutdown() { if (controller.isStarted(DEBUG_SUSPEND_CONTAINER_ID)) { controller.stop(DEBUG_SUSPEND_CONTAINER_ID); @@ -67,12 +67,12 @@ public void debugConfig() throws Exception { // Attach a debugger final VirtualMachine vm = attachDebugger(); try { - Assert.assertFalse("VM should be able to see all threads: " + vm, vm.allThreads().isEmpty()); + Assertions.assertFalse(vm.allThreads().isEmpty(), "VM should be able to see all threads: " + vm); // Check the server-state final ModelNode address = new ModelNode().setEmptyList(); final ModelNode op = Operations.createReadAttributeOperation(address, "server-state"); final ModelNode result = executeOperation(debugSuspendClient, op); - Assert.assertEquals("running", result.asString()); + Assertions.assertEquals("running", result.asString()); } finally { vm.dispose(); } @@ -81,7 +81,7 @@ public void debugConfig() throws Exception { private static ModelNode executeOperation(final ManagementClient client, final ModelNode op) throws IOException { final ModelNode result = client.getControllerClient().execute(op); if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } return Operations.readResult(result); } @@ -89,7 +89,7 @@ private static ModelNode executeOperation(final ManagementClient client, final M private static VirtualMachine attachDebugger() throws IllegalConnectorArgumentsException, IOException { final var manager = Bootstrap.virtualMachineManager(); final AttachingConnector connector = findSocket(manager.attachingConnectors()); - Assert.assertNotNull("Failed to find socket connector", connector); + Assertions.assertNotNull(connector, "Failed to find socket connector"); final var defaultArguments = connector.defaultArguments(); defaultArguments.get("port").setValue(System.getProperty("test.debug.port", "5005")); return connector.attach(defaultArguments); diff --git a/container-embedded/pom.xml b/container-embedded/pom.xml index 9fba624e..0bd50076 100644 --- a/container-embedded/pom.xml +++ b/container-embedded/pom.xml @@ -65,20 +65,19 @@ org.wildfly.core wildfly-protocol - - junit - junit + jakarta.enterprise + jakarta.enterprise.cdi-api test - jakarta.enterprise - jakarta.enterprise.cdi-api + org.jboss.arquillian.junit5 + arquillian-junit5-container test - org.jboss.arquillian.junit - arquillian-junit-container + org.junit.jupiter + junit-jupiter test diff --git a/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/CdiTestCase.java b/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/CdiTestCase.java index fae9591c..3fd7fa67 100644 --- a/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/CdiTestCase.java +++ b/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/CdiTestCase.java @@ -7,21 +7,21 @@ import jakarta.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.embedded.archive.GreetingService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests CDI and injection * * @author Andrew Lee Rubinger */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class CdiTestCase { @Deployment @@ -36,8 +36,8 @@ public static JavaArchive create() { @Test public void shouldBeAbleToInject() throws Exception { - Assert.assertNotNull(service); + Assertions.assertNotNull(service); final String name = "ALR"; - Assert.assertEquals(GreetingService.GREETING_PREPENDED + name, service.greet(name)); + Assertions.assertEquals(GreetingService.GREETING_PREPENDED + name, service.greet(name)); } } \ No newline at end of file diff --git a/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/DeploymentTestCase.java b/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/DeploymentTestCase.java index 2d671700..18a65b90 100644 --- a/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/DeploymentTestCase.java +++ b/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/DeploymentTestCase.java @@ -5,18 +5,18 @@ package org.jboss.as.arquillian.container.embedded; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.msc.service.ServiceActivator; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests basic deployment */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class DeploymentTestCase { @Deployment @@ -29,7 +29,7 @@ public static JavaArchive create() { @Test public void testSystemPropSet() throws Exception { - Assert.assertEquals(SystemPropertyServiceActivator.VALUE, + Assertions.assertEquals(SystemPropertyServiceActivator.VALUE, System.getProperty(SystemPropertyServiceActivator.TEST_PROPERTY)); } @@ -40,6 +40,6 @@ public void testSystemPropertyArgument() throws Exception { } private static void testSystemProperty(final String key) { - Assert.assertNotNull(String.format("Expected a value for property \"%s\"", key), System.getProperty(key)); + Assertions.assertNotNull(System.getProperty(key), String.format("Expected a value for property \"%s\"", key)); } } \ No newline at end of file diff --git a/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/EmbeddedContainerConfigurationTestCase.java b/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/EmbeddedContainerConfigurationTestCase.java index 384e06c3..bc3a41c4 100644 --- a/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/EmbeddedContainerConfigurationTestCase.java +++ b/container-embedded/src/test/java/org/jboss/as/arquillian/container/embedded/EmbeddedContainerConfigurationTestCase.java @@ -4,13 +4,14 @@ */ package org.jboss.as.arquillian.container.embedded; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; import org.jboss.arquillian.container.spi.ConfigurationException; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author Tommy Tynjä @@ -23,11 +24,11 @@ public void shouldValidateDefaultConfiguration() { conf.validate(); } - @Test(expected = ConfigurationException.class) + @Test public void shouldValidateThatModulePathIsNonExisting() { final EmbeddedContainerConfiguration conf = new EmbeddedContainerConfiguration(); conf.setModulePath(""); - validate(conf); + assertThrows(ConfigurationException.class, () -> validate(conf)); } @Test @@ -42,11 +43,11 @@ public void shouldValidateBundlePathIfExisting() { validate(conf); } - @Test(expected = ConfigurationException.class) + @Test public void shouldValidateThatJbossHomePathIsNonExisting() { final EmbeddedContainerConfiguration conf = new EmbeddedContainerConfiguration(); conf.setJbossHome(null); - conf.validate(); + assertThrows(ConfigurationException.class, () -> conf.validate()); } @Test @@ -66,7 +67,7 @@ private static void createDir(final String path) { if (path != null) { File dir = new File(path); if (!dir.exists()) { - assertTrue("Failed to create directory", dir.mkdirs()); + assertTrue(dir.mkdirs(), "Failed to create directory"); } } } diff --git a/container-managed-domain/pom.xml b/container-managed-domain/pom.xml index 0fcc4582..28381edb 100644 --- a/container-managed-domain/pom.xml +++ b/container-managed-domain/pom.xml @@ -53,16 +53,14 @@ org.wildfly.launcher wildfly-launcher - - - junit - junit + org.jboss.arquillian.junit5 + arquillian-junit5-container test - org.jboss.arquillian.junit - arquillian-junit-container + org.junit.jupiter + junit-jupiter test @@ -98,7 +96,7 @@ false - org.jboss.as.arquillian.container.domain.managed.test.ManualMode + ManualMode ${jboss.home} @@ -115,7 +113,7 @@ false - org.jboss.as.arquillian.container.domain.managed.test.ManualMode + ManualMode manual-arquillian.xml ${jboss.home} diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/AbstractDomainManualModeTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/AbstractDomainManualModeTestCase.java index a5530619..08fa0c59 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/AbstractDomainManualModeTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/AbstractDomainManualModeTestCase.java @@ -23,8 +23,8 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.wildfly.arquillian.domain.api.DomainContainerController; import org.wildfly.arquillian.domain.api.TargetsServerGroup; @@ -60,13 +60,13 @@ public void testServerControl() throws Exception { final String serverName = "server-two"; final String containerName = containerName(); controller.stopServer(containerName, hostName, serverName); - Assert.assertFalse("server-two on host " + hostName + " should not be started", - controller.isServerStarted(containerName, hostName, serverName)); + Assertions.assertFalse(controller.isServerStarted(containerName, hostName, serverName), + "server-two on host " + hostName + " should not be started"); // Attempt to start server-two controller.startServer(containerName, hostName, serverName); - Assert.assertTrue("server-two should not be started on host " + hostName + ", but was not", - controller.isServerStarted(containerName, hostName, serverName)); + Assertions.assertTrue(controller.isServerStarted(containerName, hostName, serverName), + "server-two should not be started on host " + hostName + ", but was not"); } @Test @@ -78,13 +78,15 @@ public void testServerGroupControl() throws Exception { // The servers should all be stopped for (String serverName : getServerGroupServers(serverGroupName)) { - Assert.assertFalse(String.format("Server %s should be stopped on host %s - server group %s", serverName, hostName, - serverGroupName), controller.isServerStarted(containerName, hostName, serverName)); + Assertions.assertFalse(controller.isServerStarted(containerName, hostName, serverName), + String.format("Server %s should be stopped on host %s - server group %s", serverName, hostName, + serverGroupName)); } controller.startServers(containerName, serverGroupName); for (String serverName : getServerGroupServers(serverGroupName)) { - Assert.assertTrue(String.format("Server %s should be stopped on host %s - server group %s", serverName, hostName, - serverGroupName), controller.isServerStarted(containerName, hostName, serverName)); + Assertions.assertTrue(controller.isServerStarted(containerName, hostName, serverName), + String.format("Server %s should be stopped on host %s - server group %s", serverName, hostName, + serverGroupName)); } TimeUnit.SECONDS.sleep(2L); } @@ -113,11 +115,11 @@ public void testDeploy() throws Exception { ModelNode result = executeForSuccess(builder.build()); // Read each result, we should have two results for the first op and one for the second final List step1Result = Operations.readResult(result.get("step-1")).asList(); - Assert.assertTrue("Expected 2 deployments found " + (step1Result.size() - currentMainServerGroupDeployments), - step1Result.size() == (2 + currentMainServerGroupDeployments)); + Assertions.assertEquals(step1Result.size(), (2 + currentMainServerGroupDeployments), + "Expected 2 deployments found " + (step1Result.size() - currentMainServerGroupDeployments)); final List step2Result = Operations.readResult(result.get("step-2")).asList(); - Assert.assertTrue("Expected 1 deployments found " + (step2Result.size() - currentOtherServerGroupDeployments), - step2Result.size() == (1 + currentOtherServerGroupDeployments)); + Assertions.assertEquals(step2Result.size(), (1 + currentOtherServerGroupDeployments), + "Expected 1 deployments found " + (step2Result.size() - currentOtherServerGroupDeployments)); } finally { deployer.undeploy("dep1"); deployer.undeploy("dep2"); @@ -139,7 +141,7 @@ ModelNode executeForSuccess(final Operation op) throws IOException { if (Operations.isSuccessfulOutcome(result)) { return Operations.readResult(result); } - Assert.fail( + Assertions.fail( String.format("Failed to execute operation: %s%n%s", op, Operations.getFailureDescription(result).asString())); return new ModelNode(); } diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ClientDeploymentTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ClientDeploymentTestCase.java index 24071802..a79203bd 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ClientDeploymentTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ClientDeploymentTestCase.java @@ -8,7 +8,7 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.domain.ArchiveDeployer; import org.jboss.as.arquillian.container.domain.ManagementClient; @@ -17,9 +17,9 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.wildfly.arquillian.domain.api.TargetsServerGroup; /** @@ -27,7 +27,7 @@ * * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ClientDeploymentTestCase { @@ -42,36 +42,36 @@ public static WebArchive create() { @Test public void globalDeploymentTest(@ArquillianResource ManagementClient client) throws Exception { - Assert.assertNotNull("Expected the ArchiveDeployer to be injected", deployer); + Assertions.assertNotNull(deployer, "Expected the ArchiveDeployer to be injected"); testDeploy(deployer, client); } @Test public void parameterDeploymentTest(@ArquillianResource ManagementClient client, @ArquillianResource ArchiveDeployer deployer) throws Exception { - Assert.assertNotNull("Expected the ArchiveDeployer to be injected", deployer); + Assertions.assertNotNull(deployer, "Expected the ArchiveDeployer to be injected"); testDeploy(deployer, client); } private void testDeploy(final ArchiveDeployer deployer, final ManagementClient client) throws Exception { final WebArchive deployment = createDeployment("test-client-deployment.war"); - Assert.assertEquals(deployment.getName(), deployer.deploy(deployment, Collections.singleton("main-server-group"))); + Assertions.assertEquals(deployment.getName(), deployer.deploy(deployment, Collections.singleton("main-server-group"))); // Check the server for the deployment final ModelNode address = Operations.createAddress("deployment", deployment.getName()); ModelNode result = client.getControllerClient().execute(Operations.createReadAttributeOperation(address, "name")); if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } - Assert.assertEquals(deployment.getName(), Operations.readResult(result).asString()); + Assertions.assertEquals(deployment.getName(), Operations.readResult(result).asString()); final ModelNode serverGroupAddress = Operations.createAddress("server-group", "main-server-group", "deployment", deployment.getName()); result = client.getControllerClient().execute(Operations.createReadAttributeOperation(serverGroupAddress, "enabled")); if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } - Assert.assertTrue("The deployment was expected to be enabled", Operations.readResult(result).asBoolean()); + Assertions.assertTrue(Operations.readResult(result).asBoolean(), "The deployment was expected to be enabled"); deployer.undeploy(deployment.getName(), "main-server-group"); } diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeClientTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeClientTestCase.java index abecf4ae..38531edb 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeClientTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeClientTestCase.java @@ -7,13 +7,13 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.domain.ManagementClient; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.extension.ExtendWith; /** * For Domain server DeployableContainer implementations, the DeployableContainer will register @@ -21,9 +21,9 @@ * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient -@Category(ManualMode.class) +@Tag("ManualMode") public class DomainManualModeClientTestCase extends AbstractDomainManualModeTestCase { private static final String CONTAINER_NAME = "jboss"; @@ -34,15 +34,15 @@ public class DomainManualModeClientTestCase extends AbstractDomainManualModeTest @ArquillianResource private Deployer deployer; - @AfterClass - public static void stop() throws Exception { + @AfterEach + public void stop() { if (controller.isStarted(CONTAINER_NAME)) { controller.stop(CONTAINER_NAME); } } - @Before - public void startOnce() throws Exception { + @BeforeEach + public void startOnce() { if (!controller.isStarted(CONTAINER_NAME)) { controller.start(CONTAINER_NAME); } diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInContainerTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInContainerTestCase.java index 429cbc4e..6f40f9c0 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInContainerTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInContainerTestCase.java @@ -7,10 +7,10 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.domain.ManagementClient; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.extension.ExtendWith; /** * For Domain server DeployableContainer implementations, the DeployableContainer will register @@ -18,7 +18,7 @@ * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class DomainManualModeInContainerTestCase extends AbstractDomainManualModeTestCase { private static final String CONTAINER_NAME = "jboss"; diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInjectionTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInjectionTestCase.java index 71776209..854ee905 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInjectionTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/DomainManualModeInjectionTestCase.java @@ -8,17 +8,17 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.domain.Domain; import org.jboss.as.arquillian.container.domain.ManagementClient; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.wildfly.arquillian.domain.api.DomainContainerController; import org.wildfly.arquillian.domain.api.TargetsServerGroup; @@ -28,8 +28,8 @@ * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) -@Category(ManualMode.class) +@ExtendWith(ArquillianExtension.class) +@Tag("ManualMode") public class DomainManualModeInjectionTestCase { static final String PRIMARY_CONTAINER = "jboss"; static final String SECONDARY_CONTAINER = "wildfly"; @@ -53,7 +53,7 @@ public static WebArchive create1() { .addClass(ManualMode.class); } - @After + @AfterEach public void stopAllContainers() throws Exception { if (controller.isStarted(PRIMARY_CONTAINER)) { controller.stop(PRIMARY_CONTAINER); @@ -92,8 +92,8 @@ public void testSecondaryClientAsClient() throws Exception { } private static void testClient(final ManagementClient client) { - Assert.assertTrue("The primary container should have been started", client.isDomainInRunningState()); - Assert.assertTrue( + Assertions.assertTrue(client.isDomainInRunningState(), "The primary container should have been started"); + Assertions.assertTrue( client.isServerStarted(new Domain.Server("server-one", client.getLocalHostName(), "main-server-group", true))); } } diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainControlTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainControlTestCase.java index 1b525091..1b4a5cba 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainControlTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainControlTestCase.java @@ -7,14 +7,16 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.junit.InSequence; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.extension.ExtendWith; import org.wildfly.arquillian.domain.api.DomainContainerController; import org.wildfly.arquillian.domain.api.TargetsServerGroup; @@ -24,7 +26,8 @@ * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class ManagedDomainControlTestCase { private static final String CONTAINER_NAME = "jboss"; @@ -38,47 +41,47 @@ public static WebArchive create1() { private DomainContainerController controller; @Test - @InSequence(1) + @Order(1) public void shouldNotBeAbleToStopContainerInContainer() throws Exception { // Should fail as this should be read-only try { controller.stopServer(CONTAINER_NAME, "master", "server-two"); - Assert.fail("Expected stop for server-two to fail as this should be a read-only DomainSupport"); + Assertions.fail("Expected stop for server-two to fail as this should be a read-only DomainSupport"); } catch (RuntimeException ignore) { } } @Test - @InSequence(2) + @Order(2) public void shouldNotBeAbleToStartContainerInContainer() throws Exception { // Should fail as this should be read-only try { controller.startServer(CONTAINER_NAME, "master", "server-two"); - Assert.fail("Expected start for server-two to fail as this should be a read-only DomainSupport"); + Assertions.fail("Expected start for server-two to fail as this should be a read-only DomainSupport"); } catch (RuntimeException ignore) { } } @Test - @InSequence(3) + @Order(3) @RunAsClient public void shouldNotBeAbleToStopContainerAsClient() throws Exception { // Should fail as this should be read-only try { controller.stopServer(CONTAINER_NAME, "master", "server-two"); - Assert.fail("Expected stop for server-two to fail as this should be a read-only DomainSupport"); + Assertions.fail("Expected stop for server-two to fail as this should be a read-only DomainSupport"); } catch (RuntimeException ignore) { } } @Test - @InSequence(4) + @Order(4) @RunAsClient public void shouldNotBeAbleToStartContainerAsClient() throws Exception { // Should fail as this should be read-only try { controller.startServer(CONTAINER_NAME, "master", "server-two"); - Assert.fail("Expected start for server-two to fail as this should be a read-only DomainSupport"); + Assertions.fail("Expected start for server-two to fail as this should be a read-only DomainSupport"); } catch (RuntimeException ignore) { } } diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainLegacyTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainLegacyTestCase.java index 57ae3e95..e705081d 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainLegacyTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainLegacyTestCase.java @@ -7,12 +7,12 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * For Domain server DeployableContainer implementations, the DeployableContainer will register @@ -20,7 +20,7 @@ * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class ManagedDomainLegacyTestCase { @Deployment(name = "dep1") @@ -35,8 +35,8 @@ public static WebArchive create1() { public void shouldRunInContainer1() throws Exception { // Get the logger path which should contain the name of the server final String logDir = System.getProperty("jboss.server.log.dir"); - Assert.assertNotNull("Could not determine the jboss.server.log.dir property", logDir); - Assert.assertTrue("Log dir should contain server-one: " + logDir, logDir.contains("server-one")); + Assertions.assertNotNull(logDir, "Could not determine the jboss.server.log.dir property"); + Assertions.assertTrue(logDir.contains("server-one"), "Log dir should contain server-one: " + logDir); } @Test @@ -44,7 +44,7 @@ public void shouldRunInContainer1() throws Exception { public void shouldRunInContainer2() throws Exception { // Get the logger path which should contain the name of the server final String logDir = System.getProperty("jboss.server.log.dir"); - Assert.assertNotNull("Could not determine the jboss.server.log.dir property", logDir); - Assert.assertTrue("Log dir should contain server-two: " + logDir, logDir.contains("server-two")); + Assertions.assertNotNull(logDir, "Could not determine the jboss.server.log.dir property"); + Assertions.assertTrue(logDir.contains("server-two"), "Log dir should contain server-two: " + logDir); } } diff --git a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainTestCase.java b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainTestCase.java index fad904df..b9846903 100644 --- a/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainTestCase.java +++ b/container-managed-domain/src/test/java/org/jboss/as/arquillian/container/domain/managed/test/ManagedDomainTestCase.java @@ -7,12 +7,12 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.wildfly.arquillian.domain.api.TargetsServerGroup; /** @@ -21,7 +21,7 @@ * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class ManagedDomainTestCase { @Deployment(name = "dep1") @@ -36,8 +36,8 @@ public static WebArchive create1() { public void shouldRunInContainer1() throws Exception { // Get the logger path which should contain the name of the server final String logDir = System.getProperty("jboss.server.log.dir"); - Assert.assertNotNull("Could not determine the jboss.server.log.dir property", logDir); - Assert.assertTrue("Log dir should contain server-one: " + logDir, logDir.contains("server-one")); + Assertions.assertNotNull(logDir, "Could not determine the jboss.server.log.dir property"); + Assertions.assertTrue(logDir.contains("server-one"), "Log dir should contain server-one: " + logDir); } @Test @@ -45,7 +45,7 @@ public void shouldRunInContainer1() throws Exception { public void shouldRunInContainer2() throws Exception { // Get the logger path which should contain the name of the server final String logDir = System.getProperty("jboss.server.log.dir"); - Assert.assertNotNull("Could not determine the jboss.server.log.dir property", logDir); - Assert.assertTrue("Log dir should contain server-two: " + logDir, logDir.contains("server-two")); + Assertions.assertNotNull(logDir, "Could not determine the jboss.server.log.dir property"); + Assertions.assertTrue(logDir.contains("server-two"), "Log dir should contain server-two: " + logDir); } } diff --git a/container-managed/pom.xml b/container-managed/pom.xml index 79840d93..b530c63d 100644 --- a/container-managed/pom.xml +++ b/container-managed/pom.xml @@ -66,20 +66,24 @@ org.wildfly.launcher wildfly-launcher - - junit - junit + org.jboss.arquillian.junit5 + arquillian-junit5-container test - org.jboss.arquillian.junit - arquillian-junit-container + org.jboss.arquillian.protocol + arquillian-protocol-servlet-jakarta test - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta + org.junit.jupiter + junit-jupiter + test + + + org.junit.platform + junit-platform-suite test @@ -190,13 +194,9 @@ **/*TestCase.java **/*TestSuite.java - org.jboss.as.arquillian.container.managed.manual.ManualMode + ManualMode,JmxProtocol **/AddAgentTestCase.java - **/ThreadContextClassloaderTest.java - **/ManagedInContainerTestCase.java - **/InContainerManualModeTestCase.java - **/app/*.java **/ServerSetup*TestCase.java @@ -228,11 +228,7 @@ false - - **/ThreadContextClassloaderTest.java - **/ManagedInContainerTestCase.java - **/InContainerManualModeTestCase.java - + JmxProtocol jmx-arquillian.xml @@ -246,7 +242,7 @@ false - org.jboss.as.arquillian.container.managed.manual.ManualMode + ManualMode manual-arquillian.xml ${jboss.home} diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java index 9db89812..e9e26998 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/AbstractContainerTestCase.java @@ -9,7 +9,7 @@ import javax.management.MBeanServerConnection; import javax.management.ObjectName; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author Kabir Khan diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java index b6d8a04b..cfc74555 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ClientDeploymentTestCase.java @@ -6,7 +6,7 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ArchiveDeployer; import org.jboss.as.arquillian.container.ManagementClient; @@ -14,16 +14,16 @@ import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Test deploying through an injected {@link ArchiveDeployer}. * * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ClientDeploymentTestCase { @@ -37,29 +37,29 @@ public static WebArchive create() { @Test public void globalDeploymentTest(@ArquillianResource ManagementClient client) throws Exception { - Assert.assertNotNull("Expected the ArchiveDeployer to be injected", deployer); + Assertions.assertNotNull(deployer, "Expected the ArchiveDeployer to be injected"); testDeploy(deployer, client); } @Test public void parameterDeploymentTest(@ArquillianResource ManagementClient client, @ArquillianResource ArchiveDeployer deployer) throws Exception { - Assert.assertNotNull("Expected the ArchiveDeployer to be injected", deployer); + Assertions.assertNotNull(deployer, "Expected the ArchiveDeployer to be injected"); testDeploy(deployer, client); } private void testDeploy(final ArchiveDeployer deployer, final ManagementClient client) throws Exception { final WebArchive deployment = createDeployment("test-client-deployment.war"); - Assert.assertEquals(deployment.getName(), deployer.deploy(deployment)); + Assertions.assertEquals(deployment.getName(), deployer.deploy(deployment)); // Check the server for the deployment final ModelNode address = Operations.createAddress("deployment", deployment.getName()); final ModelNode result = client.getControllerClient() .execute(Operations.createReadAttributeOperation(address, "status")); if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } - Assert.assertEquals("OK", Operations.readResult(result).asString()); + Assertions.assertEquals("OK", Operations.readResult(result).asString()); deployer.undeploy(deployment.getName()); } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java index a4b2732f..3a6beadd 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/DeploymentTestCase.java @@ -5,18 +5,18 @@ package org.jboss.as.arquillian.container.managed; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.msc.service.ServiceActivator; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests basic deployment */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class DeploymentTestCase { @Deployment @@ -29,7 +29,7 @@ public static JavaArchive create() { @Test public void testSystemPropSet() throws Exception { - Assert.assertEquals(SystemPropertyServiceActivator.VALUE, + Assertions.assertEquals(SystemPropertyServiceActivator.VALUE, System.getProperty(SystemPropertyServiceActivator.TEST_PROPERTY)); } } \ No newline at end of file diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java index c94f97f6..4a7d4f8e 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectJndiContextTestCase.java @@ -9,20 +9,20 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * AS7-3111 Ensures the JNDI Naming {@link Context} can be injected * * @author Andrew Lee Rubinger */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class InjectJndiContextTestCase { @@ -47,9 +47,9 @@ public static JavaArchive createDeployment() throws Exception { */ @Test public void shouldInjectJndiContext() throws NamingException { - Assert.assertNotNull("AS7-3111: JNDI Context must be injected", jndiContext); + Assertions.assertNotNull(jndiContext, "AS7-3111: JNDI Context must be injected"); // Attempt to look up the remote EJB final EjbBusiness ejb = (EjbBusiness) jndiContext.lookup(JNDI_NAME); - Assert.assertNotNull("Could not look up datasource using supplied JNDI Context", ejb); + Assertions.assertNotNull(ejb, "Could not look up datasource using supplied JNDI Context"); } } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java index 228a8614..4cfeaea9 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/InjectManagementClientTestCase.java @@ -5,21 +5,23 @@ package org.jboss.as.arquillian.container.managed; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * AS7-1415 Ensures injection of the {@link ManagementClient} is working correctly * * @author Andrew Lee Rubinger */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) +@Tag("JmxProtocol") public class InjectManagementClientTestCase { @ArquillianResource @@ -32,8 +34,8 @@ public static WebArchive createDeployment() throws Exception { @Test public void ensureManagementClientInjected() { - Assert.assertNotNull("Management client must be injected", managementClient); - Assert.assertTrue("Management client should report server as running", - managementClient.isServerInRunningState()); + Assertions.assertNotNull(managementClient, "Management client must be injected"); + Assertions.assertTrue(managementClient.isServerInRunningState(), + "Management client should report server as running"); } } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java index ed7f2923..d5623e93 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/IntegrationTestCase.java @@ -7,21 +7,21 @@ import jakarta.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.managed.archive.GreetingService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * IntegrationTestCase * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class IntegrationTestCase { @Deployment @@ -36,16 +36,16 @@ public static JavaArchive create() { @Test public void shouldBeAbleToInject() throws Exception { - Assert.assertNotNull(service); - Assert.assertEquals("Hello Earthling!", service.greet("Earthling")); + Assertions.assertNotNull(service); + Assertions.assertEquals("Hello Earthling!", service.greet("Earthling")); } @Test public void shouldBeAbleToFetchSystemProperties() throws Exception { final String prop1 = System.getProperties().getProperty("org.jboss.as.arquillian.container.managed.prop1"); final String prop2 = System.getProperties().getProperty("org.jboss.as.arquillian.container.managed.prop2"); - Assert.assertEquals("prop1", prop1); - Assert.assertEquals("prop2", prop2); + Assertions.assertEquals("prop1", prop1); + Assertions.assertEquals("prop2", prop2); } } \ No newline at end of file diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java index 39e10321..c3a682a9 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientEnterpriseArchiveServletTestCase.java @@ -10,14 +10,14 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * A client-side test case that verifies that the root deployment URL can be injected @@ -25,7 +25,7 @@ * * @author Dan Allen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ManagedAsClientEnterpriseArchiveServletTestCase { @@ -42,16 +42,16 @@ public static EnterpriseArchive createDeployment() throws Exception { @Test public void shouldBeAbleToInvokeServlet() throws Exception { - Assert.assertNotNull(deploymentUrl); + Assertions.assertNotNull(deploymentUrl); String result = getContent(new URL(deploymentUrl.toString() + HelloWorldServlet.URL_PATTERN.substring(1))); - Assert.assertEquals(HelloWorldServlet.GREETING, result); + Assertions.assertEquals(HelloWorldServlet.GREETING, result); } @Test public void testWebContext() { - Assert.assertTrue( - String.format("Expected context to start with /%s, but found %s", CONTEXT_NAME, deploymentUrl.getPath()), - deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME)); + Assertions.assertTrue( + deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME), + String.format("Expected context to start with /%s, but found %s", CONTEXT_NAME, deploymentUrl.getPath())); } private String getContent(URL url) throws Exception { diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java index 79632204..446f05a4 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientTestCase.java @@ -11,13 +11,14 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.MBeanServerConnectionProvider; import org.jboss.as.arquillian.container.managed.archive.ConfigService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.After; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.xnio.IoUtils; /** @@ -26,7 +27,7 @@ * @author Kabir Khan * @author Thomas.Diesler@jboss.com */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ManagedAsClientTestCase extends AbstractContainerTestCase { private MBeanServerConnectionProvider provider; @@ -48,12 +49,13 @@ protected MBeanServerConnection getMBeanServer() throws Exception { return provider.getConnection(); } - @After + @AfterEach public void closeProvider() { IoUtils.safeClose(provider); } @Override + @Test public void testDeployedService() throws Exception { super.testDeployedService(); } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java index a0cb4c0c..67305736 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedAsClientWebArchiveServletTestCase.java @@ -11,13 +11,13 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.OverProtocol; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * A client-side test case that verifies that the root deployment URL can be injected @@ -25,7 +25,7 @@ * * @author Dan Allen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ManagedAsClientWebArchiveServletTestCase { @@ -42,19 +42,19 @@ public static WebArchive createDeployment() throws Exception { @Test public void shouldBeAbleToInvokeServlet() throws Exception { - Assert.assertNotNull(deploymentUrl); - Assert.assertTrue("deploymentUrl should end with " + CONTEXT_NAME + "/, but is " + deploymentUrl + - ", the context URL seems to be wrong", - deploymentUrl.toString().endsWith(CONTEXT_NAME + "/")); + Assertions.assertNotNull(deploymentUrl); + Assertions.assertTrue(deploymentUrl.toString().endsWith(CONTEXT_NAME + "/"), + "deploymentUrl should end with " + CONTEXT_NAME + "/, but is " + deploymentUrl + + ", the context URL seems to be wrong"); String result = getContent(new URL(deploymentUrl.toString() + HelloWorldServlet.URL_PATTERN.substring(1))); - Assert.assertEquals(HelloWorldServlet.GREETING, result); + Assertions.assertEquals(HelloWorldServlet.GREETING, result); } @Test public void testWebContext() { - Assert.assertTrue( - String.format("Expected context to start with /%s but found %s", CONTEXT_NAME, deploymentUrl.getPath()), - deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME)); + Assertions.assertTrue( + deploymentUrl.getPath().startsWith("/" + CONTEXT_NAME), + String.format("Expected context to start with /%s but found %s", CONTEXT_NAME, deploymentUrl.getPath())); } private String getContent(URL url) throws Exception { diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java index dde8d5d1..8f1277e1 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ManagedInContainerTestCase.java @@ -12,11 +12,13 @@ import javax.management.MBeanServerConnection; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.managed.archive.ConfigService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * ManagedInContainerTestCase @@ -24,7 +26,8 @@ * @author Kabir Khan * @author Thomas.Diesler@jboss.com */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) +@Tag("JmxProtocol") public class ManagedInContainerTestCase extends AbstractContainerTestCase { @Deployment @@ -45,6 +48,7 @@ MBeanServerConnection getMBeanServer() throws Exception { } @Override + @Test public void testDeployedService() throws Exception { super.testDeployedService(); } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java index 308c87a5..158773c1 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAfterClassTestCase.java @@ -5,22 +5,22 @@ package org.jboss.as.arquillian.container.managed; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ServerSetupAfterClassTestCase extends TestOperations { @ArquillianResource @@ -70,7 +70,7 @@ public void testUnmanagedAssumptionViolated() { private void testInVMProperty(String property, String expected) { String value = System.getProperty(property, ""); System.clearProperty(property); // housekeeping - assertEquals("Unexpected value for " + property, expected, value); + assertEquals(expected, value, "Unexpected value for " + property); } @Override diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java index 092e37f3..72b0482d 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionTestBase.java @@ -5,7 +5,7 @@ package org.jboss.as.arquillian.container.managed; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.util.function.Function; @@ -13,8 +13,8 @@ import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.AssumptionViolatedException; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.opentest4j.TestAbortedException; abstract class ServerSetupAssumptionTestBase { @@ -61,7 +61,7 @@ static class AssumptionViolatedSetup implements ServerSetupTask { private final Function assumptionFailureProducer; AssumptionViolatedSetup(String property) { - this(property, AssumptionViolatedException::new); + this(property, TestAbortedException::new); } AssumptionViolatedSetup(String property, Function assumptionFailureProducer) { diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java index 0b8c420d..35a957f1 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupAssumptionViolationTestCase.java @@ -6,19 +6,18 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.AssumptionViolatedException; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.extension.ExtendWith; /** * In conjunction with {@link ServerSetupAfterClassTestCase#testAssumptionViolated()}, tests - * what happens when a {@link ServerSetupTask} throws {@link AssumptionViolatedException} + * what happens when a {@link ServerSetupTask} throws {@link org.opentest4j.TestAbortedException} * when it executes prior to Arquillian deploying a {@code @Deployment(managed=true)} deployment. */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient @ServerSetup({ ServerSetupAssumptionViolationTestCase.BeforeSetup.class, diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java index 95b3c4fe..72829906 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupDeploymentTestCase.java @@ -10,7 +10,7 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; @@ -19,13 +19,13 @@ import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @ServerSetup(ServerSetupDeploymentTestCase.SystemPropertySetupTask.class) @RunAsClient public class ServerSetupDeploymentTestCase extends TestOperations { diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java index b1a38343..7003f813 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupTestSuite.java @@ -5,16 +5,16 @@ package org.jboss.as.arquillian.container.managed; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; /** * Ensures the order of the tests to execute in the correct order. * * @author James R. Perkins */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ +@Suite +@SelectClasses({ ServerSetupDeploymentTestCase.class, ServerSetupAssumptionViolationTestCase.class, ServerSetupUnmanagedAssumptionViolationTestCase.class, diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java index 540abc07..b570b8b5 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ServerSetupUnmanagedAssumptionViolationTestCase.java @@ -7,21 +7,20 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.AssumptionViolatedException; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * In conjunction with {@link ServerSetupAfterClassTestCase#testAssumptionViolated()}, tests - * what happens when a {@link ServerSetupTask} throws {@link AssumptionViolatedException} + * what happens when a {@link ServerSetupTask} throws {@link org.opentest4j.TestAbortedException} * when it executes prior to Arquillian deploying a {@code @Deployment(managed=false)} deployment. */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient @ServerSetup({ ServerSetupUnmanagedAssumptionViolationTestCase.BeforeSetup.class, diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java index d64067fd..0010e709 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/TestOperations.java @@ -11,7 +11,7 @@ import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.dmr.ModelNode; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; /** * @author James R. Perkins @@ -25,15 +25,16 @@ void testSystemProperty(final String key) throws IOException { op.get("child-type").set("system-property"); final List result = executeForSuccess(getClient(), op).asList(); for (ModelNode property : result) { - Assert.assertNotEquals(String.format("The key '%s' should have been removed from the server", key), key, - property.asString()); + Assertions.assertNotEquals(key, + property.asString(), + String.format("The key '%s' should have been removed from the server", key)); } } void testSystemProperty(final String key, final String value) throws IOException { final ModelNode address = Operations.createAddress("system-property", key); final ModelNode result = executeForSuccess(getClient(), Operations.createReadResourceOperation(address)); - Assert.assertEquals(value, result.get("value").asString()); + Assertions.assertEquals(value, result.get("value").asString()); } static ModelNode executeForSuccess(final ManagementClient client, final ModelNode op) throws IOException { diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java index 8484820e..101995ce 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/ThreadContextClassloaderTest.java @@ -6,19 +6,23 @@ package org.jboss.as.arquillian.container.managed; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.modules.ModuleClassLoader; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(Arquillian.class) +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(ArquillianExtension.class) +@Tag("JmxProtocol") +@Disabled("WFARQ-153 - The enableThreadContextClassLoader setting does not work with JUnit 5") public class ThreadContextClassloaderTest { @Deployment @@ -27,22 +31,22 @@ public static JavaArchive deployment() { return archive; } - @BeforeClass + @BeforeAll public static void beforeClass() throws Exception { assertNoTCCL(); } - @AfterClass + @AfterAll public static void afterClass() throws Exception { assertNoTCCL(); } - @Before + @BeforeEach public void before() throws Exception { assertNoTCCL(); } - @After + @AfterEach public void after() throws Exception { assertNoTCCL(); } @@ -54,6 +58,6 @@ public void testClassLoader() throws Exception { private static void assertNoTCCL() { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - Assert.assertFalse("TCCL not ModuleClassLoader: " + tccl, tccl instanceof ModuleClassLoader); + Assertions.assertFalse(tccl instanceof ModuleClassLoader, "TCCL not ModuleClassLoader: " + tccl); } } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java index ac1cb67b..abf644a6 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/UnmanagedDeploymentTestCase.java @@ -7,8 +7,7 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.junit.InSequence; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.api.ServerSetup; import org.jboss.as.arquillian.api.ServerSetupTask; @@ -18,14 +17,18 @@ import org.jboss.msc.service.ServiceActivator; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests basic deployment */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @ServerSetup(UnmanagedDeploymentTestCase.SystemPropertyServerSetup.class) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) @RunAsClient public class UnmanagedDeploymentTestCase extends TestOperations { @@ -62,7 +65,7 @@ public static JavaArchive create() { } @Test - @InSequence(1) + @Order(1) public void undeployFirst() throws Exception { // Undeploy first which should not really do anything deployer.undeploy("test-deployment"); @@ -73,7 +76,7 @@ public void undeployFirst() throws Exception { } @Test - @InSequence(2) + @Order(2) public void contentDeployedThenUndeployed() throws Exception { // After the undeploy, the tearDown() won't happen until the class is complete deployer.undeploy("test-deployment"); diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/agent/AddAgentTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/agent/AddAgentTestCase.java index f819add5..586c922e 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/agent/AddAgentTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/agent/AddAgentTestCase.java @@ -12,18 +12,18 @@ import java.nio.file.Paths; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class AddAgentTestCase { @Deployment @@ -35,7 +35,7 @@ public static WebArchive create() { @Test public void agentSet() throws Exception { final Path logFile = Paths.get(System.getProperty("jboss.log.dir"), "server.log"); - Assert.assertTrue(String.format("Log file %s does not exist.", logFile), Files.exists(logFile)); + Assertions.assertTrue(Files.exists(logFile), String.format("Log file %s does not exist.", logFile)); try (BufferedReader reader = Files.newBufferedReader(logFile, StandardCharsets.UTF_8)) { boolean found = false; String line; @@ -45,8 +45,8 @@ public void agentSet() throws Exception { break; } } - Assert.assertTrue(String.format("Expected to filed line container \"%s\" in %s.", LoggingAgent.MSG, logFile), - found); + Assertions.assertTrue(found, + String.format("Expected to filed line container \"%s\" in %s.", LoggingAgent.MSG, logFile)); } } } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java index 79a42a86..8c9187c2 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/AbstractManualModeTestCase.java @@ -22,9 +22,9 @@ import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author James R. Perkins @@ -45,7 +45,7 @@ public static WebArchive createDeployment() { .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } - @After + @AfterEach public void stop() throws Exception { if (controller.isStarted(containerName())) { controller.stop(containerName()); @@ -57,11 +57,11 @@ public void serverControl() { final String containerName = containerName(); // The primary container should already be started controller.start(containerName, createConfig("server-control")); - Assert.assertTrue(String.format("The container \"%s\" should be started", containerName), - controller.isStarted(containerName)); + Assertions.assertTrue(controller.isStarted(containerName), + String.format("The container \"%s\" should be started", containerName)); controller.stop(containerName); - Assert.assertFalse(String.format("The container \"%s\" should be stopped", containerName), - controller.isStarted(containerName)); + Assertions.assertFalse(controller.isStarted(containerName), + String.format("The container \"%s\" should be stopped", containerName)); } @Test @@ -82,8 +82,9 @@ public void deploy() throws Exception { deployer().deploy(createDeployment()); // Read each result, we should have two results for the first op and one for the second final int newDeployments = getCurrentDeploymentCount(client()); - Assert.assertEquals("Expected 1 deployments found " + (newDeployments - currentDeployments) + " for container " - + containerName, newDeployments, (1 + currentDeployments)); + Assertions.assertEquals(newDeployments, (1 + currentDeployments), + "Expected 1 deployments found " + (newDeployments - currentDeployments) + " for container " + + containerName); } finally { deployer().undeploy("dep1"); controller.stop(containerName); @@ -109,7 +110,7 @@ static ModelNode executeForSuccess(final ManagementClient client, final Operatio if (Operations.isSuccessfulOutcome(result)) { return Operations.readResult(result); } - Assert.fail( + Assertions.fail( String.format("Failed to execute operation: %s%n%s", op, Operations.getFailureDescription(result) .asString())); return new ModelNode(); diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java index 8793238b..67f2d594 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ClientManualModeTestCase.java @@ -7,21 +7,21 @@ import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ArchiveDeployer; import org.jboss.as.arquillian.container.ManagementClient; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests that the injected management client and archive deployer are usable on the appropriate container. * * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) @RunAsClient -@Category(ManualMode.class) +@Tag("ManualMode") public class ClientManualModeTestCase extends AbstractManualModeTestCase { private static final String CONTAINER_NAME = "jboss"; diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java index 819eebae..10a6b21d 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/DebugManualModeTestCase.java @@ -12,18 +12,18 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import com.sun.jdi.Bootstrap; import com.sun.jdi.VirtualMachine; @@ -33,8 +33,8 @@ /** * @author James R. Perkins */ -@Category(ManualMode.class) -@RunWith(Arquillian.class) +@Tag("ManualMode") +@ExtendWith(ArquillianExtension.class) @RunAsClient public class DebugManualModeTestCase { private static final String DEBUG_SUSPEND_CONTAINER_ID = "debug-config"; @@ -53,7 +53,7 @@ public static WebArchive createDeployment() { .addClass(ManualMode.class); } - @After + @AfterEach public void shutdown() { if (controller.isStarted(DEBUG_SUSPEND_CONTAINER_ID)) { controller.stop(DEBUG_SUSPEND_CONTAINER_ID); @@ -67,12 +67,12 @@ public void debugConfig() throws Exception { // Attach a debugger final VirtualMachine vm = attachDebugger(); try { - Assert.assertFalse("VM should be able to see all threads: " + vm, vm.allThreads().isEmpty()); + Assertions.assertFalse(vm.allThreads().isEmpty(), "VM should be able to see all threads: " + vm); // Check the server-state final ModelNode address = new ModelNode().setEmptyList(); final ModelNode op = Operations.createReadAttributeOperation(address, "server-state"); final ModelNode result = executeOperation(debugSuspendClient, op); - Assert.assertEquals("running", result.asString()); + Assertions.assertEquals("running", result.asString()); } finally { vm.dispose(); } @@ -81,7 +81,7 @@ public void debugConfig() throws Exception { private static ModelNode executeOperation(final ManagementClient client, final ModelNode op) throws IOException { final ModelNode result = client.getControllerClient().execute(op); if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } return Operations.readResult(result); } @@ -89,7 +89,7 @@ private static ModelNode executeOperation(final ManagementClient client, final M private static VirtualMachine attachDebugger() throws IllegalConnectorArgumentsException, IOException { final var manager = Bootstrap.virtualMachineManager(); final AttachingConnector connector = findSocket(manager.attachingConnectors()); - Assert.assertNotNull("Failed to find socket connector", connector); + Assertions.assertNotNull(connector, "Failed to find socket connector"); final var defaultArguments = connector.defaultArguments(); defaultArguments.get("port").setValue(System.getProperty("test.debug.port", "5005")); return connector.attach(defaultArguments); diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/InContainerManualModeTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/InContainerManualModeTestCase.java index eaaf5bc8..8bbac25f 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/InContainerManualModeTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/InContainerManualModeTestCase.java @@ -8,19 +8,23 @@ import java.util.Map; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ArchiveDeployer; import org.jboss.as.arquillian.container.ManagementClient; -import org.junit.Ignore; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Tests that * * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) +@Tag("ManualMode") +@Disabled("The ArchiveDeployer does not work because of missing dependencies. This should be resolved with WFARQ-148.") public class InContainerManualModeTestCase extends AbstractManualModeTestCase { private static final String CONTAINER_NAME = "wildfly"; @@ -34,7 +38,7 @@ protected Map createConfig(final String suffix) { } @Override - @Ignore("The ArchiveDeployer does not work because of missing dependencies. This should be resolved with WFARQ-148.") + @Test public void deploy() throws Exception { } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ReadOnlyServerConfigTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ReadOnlyServerConfigTestCase.java index 855a05b6..bb591b6f 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ReadOnlyServerConfigTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/ReadOnlyServerConfigTestCase.java @@ -11,24 +11,24 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@Category(ManualMode.class) -@RunWith(Arquillian.class) +@Tag("ManualMode") +@ExtendWith(ArquillianExtension.class) @RunAsClient public class ReadOnlyServerConfigTestCase { private static final String DEFAULT_CONTAINER_ID = "jboss"; @@ -55,7 +55,7 @@ public static WebArchive createDeployment() { .addClass(ManualMode.class); } - @After + @AfterEach public void shutdown() { if (controller.isStarted(READ_ONLY_CONTAINER_ID)) { controller.stop(READ_ONLY_CONTAINER_ID); @@ -112,11 +112,11 @@ private static void executeOperation(final ManagementClient client, final ModelN throws IOException { final ModelNode result = client.getControllerClient().execute(op); if (expectFailure) { - Assert.assertFalse(String.format("Expected operation %s to fail: %n%s", op, result), - Operations.isSuccessfulOutcome(result)); + Assertions.assertFalse(Operations.isSuccessfulOutcome(result), + String.format("Expected operation %s to fail: %n%s", op, result)); } else { if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } } } diff --git a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/YamlConfigTestCase.java b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/YamlConfigTestCase.java index 4111084d..71072866 100644 --- a/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/YamlConfigTestCase.java +++ b/container-managed/src/test/java/org/jboss/as/arquillian/container/managed/manual/YamlConfigTestCase.java @@ -15,24 +15,24 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.dmr.ModelNode; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@Category(ManualMode.class) -@RunWith(Arquillian.class) +@Tag("ManualMode") +@ExtendWith(ArquillianExtension.class) @RunAsClient public class YamlConfigTestCase { private static final String CONTAINER_ID = "yaml"; @@ -54,7 +54,7 @@ public static WebArchive createDeployment() { .addClass(ManualMode.class); } - @After + @AfterEach public void shutdown() { if (controller.isStarted(CONTAINER_ID)) { controller.stop(CONTAINER_ID); @@ -68,7 +68,7 @@ public void singleYamlFile() throws Exception { // Check the system property ModelNode address = Operations.createAddress("system-property", "test-yaml1"); ModelNode op = Operations.createReadAttributeOperation(address, "value"); - Assert.assertEquals("yaml1", executeOperation(defaultClient, op).asString()); + Assertions.assertEquals("yaml1", executeOperation(defaultClient, op).asString()); // Stop the container and restart it, the system property should exist controller.stop(CONTAINER_ID); @@ -78,7 +78,7 @@ public void singleYamlFile() throws Exception { address = Operations.createAddress("system-property", "test-yaml2"); op = Operations.createReadAttributeOperation(address, "value"); - Assert.assertEquals("yaml2", executeOperation(defaultClient, op).asString()); + Assertions.assertEquals("yaml2", executeOperation(defaultClient, op).asString()); } @Test @@ -97,11 +97,11 @@ private void multipleYamlFile(final String delimiter) throws Exception { // Check the system properties ModelNode address = Operations.createAddress("system-property", "test-yaml1"); ModelNode op = Operations.createReadAttributeOperation(address, "value"); - Assert.assertEquals("yaml1", executeOperation(defaultClient, op).asString()); + Assertions.assertEquals("yaml1", executeOperation(defaultClient, op).asString()); address = Operations.createAddress("system-property", "test-yaml2"); op = Operations.createReadAttributeOperation(address, "value"); - Assert.assertEquals("yaml2", executeOperation(defaultClient, op).asString()); + Assertions.assertEquals("yaml2", executeOperation(defaultClient, op).asString()); } private static ModelNode executeOperation(final ManagementClient client, final ModelNode op) throws IOException { @@ -112,19 +112,19 @@ private static ModelNode executeOperation(final ManagementClient client, final M throws IOException { final ModelNode result = client.getControllerClient().execute(op); if (expectFailure) { - Assert.assertFalse(String.format("Expected operation %s to fail: %n%s", op, result), - Operations.isSuccessfulOutcome(result)); + Assertions.assertFalse(Operations.isSuccessfulOutcome(result), + String.format("Expected operation %s to fail: %n%s", op, result)); return result; } if (!Operations.isSuccessfulOutcome(result)) { - Assert.fail(Operations.getFailureDescription(result).asString()); + Assertions.fail(Operations.getFailureDescription(result).asString()); } return Operations.readResult(result); } private static String resolveYamlFile(final String name) throws URISyntaxException { final URL resource = YamlConfigTestCase.class.getResource("/" + name); - Assert.assertNotNull("Could not find " + name, resource); + Assertions.assertNotNull(resource, "Could not find " + name); return Path.of(resource.toURI()).toString(); } diff --git a/container-managed/src/test/resources/jmx-arquillian.xml b/container-managed/src/test/resources/jmx-arquillian.xml index abda80aa..060393b6 100644 --- a/container-managed/src/test/resources/jmx-arquillian.xml +++ b/container-managed/src/test/resources/jmx-arquillian.xml @@ -8,7 +8,8 @@ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> - false + + @@ -26,16 +27,5 @@ false - - - ${jboss.home} - true - false - - 10090 - ${jvm.args} -Djboss.socket.binding.port-offset=100 - ${wildfly.standalone.config} - - diff --git a/container-remote-domain/pom.xml b/container-remote-domain/pom.xml index c1aec8ef..598c2736 100644 --- a/container-remote-domain/pom.xml +++ b/container-remote-domain/pom.xml @@ -45,16 +45,14 @@ org.wildfly.arquillian wildfly-arquillian-common-domain - - - junit - junit + org.jboss.arquillian.junit5 + arquillian-junit5-container test - org.jboss.arquillian.junit - arquillian-junit-container + org.junit.jupiter + junit-jupiter test diff --git a/container-remote-domain/src/test/java/org/jboss/as/arquillian/container/domain/remote/test/RemoteDomainTestCase.java b/container-remote-domain/src/test/java/org/jboss/as/arquillian/container/domain/remote/test/RemoteDomainTestCase.java index 41fbe036..a1e29234 100644 --- a/container-remote-domain/src/test/java/org/jboss/as/arquillian/container/domain/remote/test/RemoteDomainTestCase.java +++ b/container-remote-domain/src/test/java/org/jboss/as/arquillian/container/domain/remote/test/RemoteDomainTestCase.java @@ -8,14 +8,16 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.junit.InSequence; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.extension.ExtendWith; /** * For Domain server DeployableContianer implementations, the DeployableContainer will register @@ -23,7 +25,8 @@ * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class RemoteDomainTestCase { @ArquillianResource @@ -36,19 +39,19 @@ public static JavaArchive create1() { } @Test - @InSequence(1) + @Order(1) @OperateOnDeployment("dep1") @TargetsContainer("master:server-one") public void shouldRunInContainer1() throws Exception { - Assert.assertTrue(controller.isStarted("master:server-one")); + Assertions.assertTrue(controller.isStarted("master:server-one")); System.out.println("in..container"); } @Test - @InSequence(2) + @Order(2) @OperateOnDeployment("dep1") @TargetsContainer("master:server-two") public void shouldRunInContainer2() throws Exception { - Assert.assertTrue(controller.isStarted("master:server-two")); + Assertions.assertTrue(controller.isStarted("master:server-two")); } } diff --git a/container-remote/pom.xml b/container-remote/pom.xml index 2292910e..7a1ea5cf 100644 --- a/container-remote/pom.xml +++ b/container-remote/pom.xml @@ -45,13 +45,6 @@ org.wildfly.arquillian wildfly-arquillian-common - - - - junit - junit - test - jakarta.enterprise jakarta.enterprise.cdi-api @@ -68,8 +61,13 @@ test - org.jboss.arquillian.junit - arquillian-junit-container + org.jboss.arquillian.junit5 + arquillian-junit5-container + test + + + org.junit.jupiter + junit-jupiter test diff --git a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/AbstractContainerTestCase.java b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/AbstractContainerTestCase.java index 3962dd7f..b1866c53 100644 --- a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/AbstractContainerTestCase.java +++ b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/AbstractContainerTestCase.java @@ -9,7 +9,7 @@ import javax.management.MBeanServerConnection; import javax.management.ObjectName; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author Kabir Khan diff --git a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/IntegrationTestCase.java b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/IntegrationTestCase.java index 731c56d7..ab877ed4 100644 --- a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/IntegrationTestCase.java +++ b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/IntegrationTestCase.java @@ -7,14 +7,14 @@ import jakarta.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.remote.archive.GreetingService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * IntegrationTestCase @@ -22,7 +22,7 @@ * @author Aslak Knutsen * @version $Revision: $ */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class IntegrationTestCase { @Deployment @@ -37,7 +37,7 @@ public static JavaArchive create() { @Test public void shouldBeAbleToInject() throws Exception { - Assert.assertNotNull(service); - Assert.assertEquals("Hello Earthling!", service.greet("Earthling")); + Assertions.assertNotNull(service); + Assertions.assertEquals("Hello Earthling!", service.greet("Earthling")); } } \ No newline at end of file diff --git a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteAsClientTestCase.java b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteAsClientTestCase.java index 84ccc4aa..3c089bc3 100644 --- a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteAsClientTestCase.java +++ b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteAsClientTestCase.java @@ -10,13 +10,13 @@ import javax.management.MBeanServerConnection; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.MBeanServerConnectionProvider; import org.jboss.as.arquillian.container.remote.archive.ConfigService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Ignore; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.extension.ExtendWith; /** * JBossASRemoteIntegrationTestCase @@ -24,8 +24,8 @@ * @author Kabir Khan * @author Thomas.Diesler@jboss.com */ -@RunWith(Arquillian.class) -@Ignore // Disable until JMX over Remoting is implemented +@ExtendWith(ArquillianExtension.class) +@Disabled // Disable until JMX over Remoting is implemented public class RemoteAsClientTestCase extends AbstractContainerTestCase { @Deployment(testable = false) diff --git a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteInContainerTestCase.java b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteInContainerTestCase.java index 43243e26..f1160a3a 100644 --- a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteInContainerTestCase.java +++ b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/RemoteInContainerTestCase.java @@ -11,11 +11,11 @@ import javax.management.MBeanServerConnection; import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.as.arquillian.container.remote.archive.ConfigService; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.extension.ExtendWith; /** * ManagedInContainerTestCase @@ -23,7 +23,7 @@ * @author Kabir Khan * @author Thomas.Diesler@jboss.com */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class RemoteInContainerTestCase extends AbstractContainerTestCase { @Deployment diff --git a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/ServletClientTestCase.java b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/ServletClientTestCase.java index 7ea033f9..7418373d 100644 --- a/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/ServletClientTestCase.java +++ b/container-remote/src/test/java/org/jboss/as/arquillian/container/remote/ServletClientTestCase.java @@ -10,7 +10,7 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.remote.servlet.Servlet1; import org.jboss.as.arquillian.container.remote.servlet.Servlet2; @@ -18,16 +18,16 @@ import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * Test to verify correct Protocol Metadata returned from Deployment * * @author Aslak Knutsen */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class ServletClientTestCase { @Deployment(name = "war", testable = false) @@ -56,10 +56,10 @@ public static WebArchive createNoContextWebDeployment() { @Test @OperateOnDeployment("war") public void shouldBeAbleToLookupServletURLInAWar(@ArquillianResource URL baseURL) throws Exception { - Assert.assertNotNull("Should have injected Base URL for deployed WebContext", - baseURL); + Assertions.assertNotNull(baseURL, + "Should have injected Base URL for deployed WebContext"); - Assert.assertEquals(Servlet1.class.getName(), getContent(new URL(baseURL, Servlet1.PATTERN))); + Assertions.assertEquals(Servlet1.class.getName(), getContent(new URL(baseURL, Servlet1.PATTERN))); } @Test @@ -68,22 +68,22 @@ public void shouldBeAbleToLookupServletURLInAEar( @ArquillianResource(Servlet1.class) URL servlet1BaseURL, @ArquillianResource(Servlet2.class) URL servlet2BaseURL) throws Exception { - Assert.assertNotNull("Should have injected Base URL for deployed WebContext", - servlet1BaseURL); - Assert.assertEquals(Servlet1.class.getName(), getContent(new URL(servlet1BaseURL, Servlet1.PATTERN))); + Assertions.assertNotNull(servlet1BaseURL, + "Should have injected Base URL for deployed WebContext"); + Assertions.assertEquals(Servlet1.class.getName(), getContent(new URL(servlet1BaseURL, Servlet1.PATTERN))); - Assert.assertNotNull("Should have injected Base URL for deployed WebContext", - servlet2BaseURL); - Assert.assertEquals(Servlet2.class.getName(), getContent(new URL(servlet2BaseURL, Servlet2.PATTERN))); + Assertions.assertNotNull(servlet2BaseURL, + "Should have injected Base URL for deployed WebContext"); + Assertions.assertEquals(Servlet2.class.getName(), getContent(new URL(servlet2BaseURL, Servlet2.PATTERN))); } @Test @OperateOnDeployment("war-no-servlet") public void shouldBeAbleToDeployWarWithNoServlets(@ArquillianResource URL baseURL) throws Exception { - Assert.assertNotNull("Should have injected Base URL for deployed WebContext", - baseURL); + Assertions.assertNotNull(baseURL, + "Should have injected Base URL for deployed WebContext"); - Assert.assertEquals("JSP", getContent(new URL(baseURL, "index.jsp"))); + Assertions.assertEquals("JSP", getContent(new URL(baseURL, "index.jsp"))); } private String getContent(URL url) throws Exception { diff --git a/container-remote/src/test/resources/arquillian.xml b/container-remote/src/test/resources/arquillian.xml index ee448f56..9d56ebaf 100644 --- a/container-remote/src/test/resources/arquillian.xml +++ b/container-remote/src/test/resources/arquillian.xml @@ -7,7 +7,5 @@ - - false - + diff --git a/integration-tests/elytron/domain/pom.xml b/integration-tests/elytron/domain/pom.xml index c58d9082..5e4ff634 100644 --- a/integration-tests/elytron/domain/pom.xml +++ b/integration-tests/elytron/domain/pom.xml @@ -18,8 +18,8 @@ - org.jboss.arquillian.junit - arquillian-junit-container + org.jboss.arquillian.junit5 + arquillian-junit5-container test @@ -27,6 +27,11 @@ arquillian-protocol-servlet-jakarta test + + org.junit.jupiter + junit-jupiter + test + jakarta.ejb jakarta.ejb-api diff --git a/integration-tests/elytron/domain/src/test/java/org/wildfly/arquillian/integration/test/domain/ElytronIntegrationTestCase.java b/integration-tests/elytron/domain/src/test/java/org/wildfly/arquillian/integration/test/domain/ElytronIntegrationTestCase.java index c44e75c0..35ea4dc7 100644 --- a/integration-tests/elytron/domain/src/test/java/org/wildfly/arquillian/integration/test/domain/ElytronIntegrationTestCase.java +++ b/integration-tests/elytron/domain/src/test/java/org/wildfly/arquillian/integration/test/domain/ElytronIntegrationTestCase.java @@ -9,7 +9,7 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.domain.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; @@ -17,16 +17,16 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.wildfly.arquillian.domain.api.TargetsServerGroup; /** * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class ElytronIntegrationTestCase { @Deployment @@ -41,20 +41,22 @@ public static JavaArchive deployment() { @RunAsClient public void testClientUser(@ArquillianResource ManagementClient client) throws IOException { final ModelNode result = client.getControllerClient().execute(Operations.createOperation("whoami")); - Assert.assertTrue(Operations.isSuccessfulOutcome(result)); + Assertions.assertTrue(Operations.isSuccessfulOutcome(result)); final ModelNode identity = Operations.readResult(result); - Assert.assertEquals("Expected the connected user to be test-admin", "test-admin", - identity.get("identity", "username").asString()); + Assertions.assertEquals("test-admin", + identity.get("identity", "username").asString(), + "Expected the connected user to be test-admin"); } @Test @TargetsServerGroup("main-server-group") - @Ignore("Currently domain does not allow injecting clients into in container tests") + @Disabled("Currently domain does not allow injecting clients into in container tests") public void testInContainerClientUser(@ArquillianResource ManagementClient client) throws IOException { final ModelNode result = client.getControllerClient().execute(Operations.createOperation("whoami")); - Assert.assertTrue(Operations.isSuccessfulOutcome(result)); + Assertions.assertTrue(Operations.isSuccessfulOutcome(result)); final ModelNode identity = Operations.readResult(result); - Assert.assertEquals("Expected the connected user to be test-admin", "test-admin", - identity.get("identity", "username").asString()); + Assertions.assertEquals("test-admin", + identity.get("identity", "username").asString(), + "Expected the connected user to be test-admin"); } } diff --git a/integration-tests/elytron/pom.xml b/integration-tests/elytron/pom.xml index 8fc04bda..7ae1379a 100644 --- a/integration-tests/elytron/pom.xml +++ b/integration-tests/elytron/pom.xml @@ -22,12 +22,6 @@ domain - - - junit - junit - test - org.wildfly.arquillian wildfly-arquillian-protocol-jmx diff --git a/integration-tests/elytron/standalone/pom.xml b/integration-tests/elytron/standalone/pom.xml index 6c88788e..ff719e2d 100644 --- a/integration-tests/elytron/standalone/pom.xml +++ b/integration-tests/elytron/standalone/pom.xml @@ -19,8 +19,8 @@ - org.jboss.arquillian.junit - arquillian-junit-container + org.jboss.arquillian.junit5 + arquillian-junit5-container test @@ -28,6 +28,11 @@ arquillian-protocol-servlet-jakarta test + + org.junit.jupiter + junit-jupiter + test + jakarta.ejb jakarta.ejb-api diff --git a/integration-tests/elytron/standalone/src/test/java/org/wildfly/arquillian/integration/test/standalone/ElytronIntegrationTestCase.java b/integration-tests/elytron/standalone/src/test/java/org/wildfly/arquillian/integration/test/standalone/ElytronIntegrationTestCase.java index c99bff47..78aefbfe 100644 --- a/integration-tests/elytron/standalone/src/test/java/org/wildfly/arquillian/integration/test/standalone/ElytronIntegrationTestCase.java +++ b/integration-tests/elytron/standalone/src/test/java/org/wildfly/arquillian/integration/test/standalone/ElytronIntegrationTestCase.java @@ -9,7 +9,7 @@ import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.junit5.ArquillianExtension; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.as.arquillian.container.ManagementClient; import org.jboss.as.controller.client.helpers.Operations; @@ -17,14 +17,14 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; /** * @author James R. Perkins */ -@RunWith(Arquillian.class) +@ExtendWith(ArquillianExtension.class) public class ElytronIntegrationTestCase { @Deployment @@ -38,18 +38,20 @@ public static JavaArchive deployment() { @RunAsClient public void testClientUser(@ArquillianResource ManagementClient client) throws IOException { final ModelNode result = client.getControllerClient().execute(Operations.createOperation("whoami")); - Assert.assertTrue(Operations.isSuccessfulOutcome(result)); + Assertions.assertTrue(Operations.isSuccessfulOutcome(result)); final ModelNode identity = Operations.readResult(result); - Assert.assertEquals("Expected the connected user to be test-admin", "test-admin", - identity.get("identity", "username").asString()); + Assertions.assertEquals("test-admin", + identity.get("identity", "username").asString(), + "Expected the connected user to be test-admin"); } @Test public void testInContainerClientUser(@ArquillianResource ManagementClient client) throws IOException { final ModelNode result = client.getControllerClient().execute(Operations.createOperation("whoami")); - Assert.assertTrue(Operations.isSuccessfulOutcome(result)); + Assertions.assertTrue(Operations.isSuccessfulOutcome(result)); final ModelNode identity = Operations.readResult(result); - Assert.assertEquals("Expected the connected user to be test-admin", "test-admin", - identity.get("identity", "username").asString()); + Assertions.assertEquals("test-admin", + identity.get("identity", "username").asString(), + "Expected the connected user to be test-admin"); } }