Search in sources :

Example 31 with InSequence

use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.

the class StatefulEJBRemoteHomeRuntimeNameTestCase method testStatefulLocalHome.

@Test
@InSequence(value = 2)
public void testStatefulLocalHome() throws Exception {
    SimpleStatefulHome home = (SimpleStatefulHome) context.lookup(getEJBHomeJNDIBinding());
    SimpleInterface ejbInstance = home.createSimple("Hello World");
    Assert.assertEquals("Hello World", ejbInstance.sayHello());
    home = (SimpleStatefulHome) ejbInstance.getEJBHome();
    ejbInstance = home.createSimple("Hello World");
    Assert.assertEquals("Hello World", ejbInstance.sayHello());
}
Also used : SimpleInterface(org.jboss.as.test.integration.ejb.home.remotehome.SimpleInterface) SimpleStatefulHome(org.jboss.as.test.integration.ejb.home.remotehome.SimpleStatefulHome) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 32 with InSequence

use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.

the class StatelessEJBRemoteHomeRuntimeNameTestCase method testStepByStep.

@Test
@InSequence(value = 3)
public void testStepByStep() throws Exception {
    ModelNode readResource = new ModelNode();
    readResource.get(ModelDescriptionConstants.ADDRESS).add(ModelDescriptionConstants.DEPLOYMENT, DEPLOYMENT_NAME);
    readResource.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_RESOURCE_OPERATION);
    readResource.get(ModelDescriptionConstants.INCLUDE_RUNTIME).set(true);
    ModelNode result = controllerClient.execute(readResource);
    // just to blow up
    Assert.assertTrue("Failed to list resources: " + result, Operations.isSuccessfulOutcome(result));
    readResource.get(ModelDescriptionConstants.ADDRESS).add(ModelDescriptionConstants.SUBDEPLOYMENT, SUB_DEPLOYMENT_NAME);
    result = controllerClient.execute(readResource);
    // just to blow up
    Assert.assertTrue("Failed to list resources: " + result, Operations.isSuccessfulOutcome(result));
    readResource.get(ModelDescriptionConstants.ADDRESS).add(ModelDescriptionConstants.SUBSYSTEM, "ejb3");
    result = controllerClient.execute(readResource);
    // just to blow up
    Assert.assertTrue("Failed to list resources: " + result, Operations.isSuccessfulOutcome(result));
    readResource.get(ModelDescriptionConstants.ADDRESS).add(EJB_TYPE, BEAN_CLASS.getSimpleName());
    result = controllerClient.execute(readResource);
    // just to blow up
    Assert.assertTrue("Failed to list resources: " + result, Operations.isSuccessfulOutcome(result));
}
Also used : ModelNode(org.jboss.dmr.ModelNode) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 33 with InSequence

use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.

the class StatelessEJBRemoteHomeRuntimeNameTestCase method testRecursive.

@Test
@InSequence(value = 4)
public void testRecursive() throws Exception {
    ModelNode readResource = new ModelNode();
    readResource.get(ModelDescriptionConstants.ADDRESS).add(ModelDescriptionConstants.DEPLOYMENT, DEPLOYMENT_NAME);
    readResource.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_RESOURCE_OPERATION);
    readResource.get(ModelDescriptionConstants.INCLUDE_RUNTIME).set(true);
    readResource.get(ModelDescriptionConstants.RECURSIVE).set(true);
    ModelNode result = controllerClient.execute(readResource);
    // just to blow up
    Assert.assertTrue("Failed to list resources: " + result, Operations.isSuccessfulOutcome(result));
}
Also used : ModelNode(org.jboss.dmr.ModelNode) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 34 with InSequence

use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.

the class ServletRunAsTestCase method runServletWithIncorrectRole.

/**
     * Access Servlet which uses RunAs with different role than in needed for secured EJB invocation.
     * <p>
     * This method will run init() and doGet() method and stores results.
     *
     * @param url
     * @throws Exception
     */
@Test
@InSequence(4)
@OperateOnDeployment(DEPLOYMENT)
public void runServletWithIncorrectRole(@ArquillianResource URL url) throws Exception {
    final URL servletUrl = new URL(url.toExternalForm() + RunAsUserServlet.SERVLET_PATH.substring(1) + "?" + Utils.encodeQueryParam(CallProtectedEjbServlet.FILE_PARAM, INCORRECT_ROLE_AND_UNDEPLOY.getAbsolutePath()));
    incorrectRoleResult = Utils.makeCall(servletUrl.toURI(), HTTP_OK);
}
Also used : URL(java.net.URL) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 35 with InSequence

use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.

the class ClusteredJPA2LCTestCase method setupCacheContainer.

@Test
@InSequence(-1)
public void setupCacheContainer() throws IOException {
    NodeUtil.start(controller, CONTAINERS);
    final ModelNode createEntityReplicatedCacheOp = new ModelNode();
    createEntityReplicatedCacheOp.get(ADDRESS).set(CACHE_ADDRESS);
    createEntityReplicatedCacheOp.get(OP).set(ADD);
    createEntityReplicatedCacheOp.get("mode").set("sync");
    client0 = createClient0();
    client1 = createClient1();
    final ModelNode result0 = client0.execute(createEntityReplicatedCacheOp);
    Assert.assertTrue(result0.toJSONString(false), result0.get(OUTCOME).asString().equals(SUCCESS));
    final ModelNode result1 = client1.execute(createEntityReplicatedCacheOp);
    Assert.assertTrue(result1.toJSONString(false), result1.get(OUTCOME).asString().equals(SUCCESS));
    NodeUtil.deploy(this.deployer, DEPLOYMENTS);
}
Also used : ModelNode(org.jboss.dmr.ModelNode) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Aggregations

InSequence (org.jboss.arquillian.junit.InSequence)157 Test (org.junit.Test)157 Faker (com.github.javafaker.Faker)21 Simple (org.apache.deltaspike.data.test.ee7.domain.Simple)18 ModelNode (org.jboss.dmr.ModelNode)14 URL (java.net.URL)13 HttpResponse (org.apache.http.HttpResponse)10 TakeOffer (io.bisq.api.model.TakeOffer)9 HttpGet (org.apache.http.client.methods.HttpGet)8 ModelControllerClient (org.jboss.as.controller.client.ModelControllerClient)8 OfferToCreate (io.bisq.api.model.OfferToCreate)7 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)7 PartitionManager (org.picketlink.idm.PartitionManager)7 Response (javax.ws.rs.core.Response)6 IdentityManager (org.picketlink.idm.IdentityManager)6 StringTokenizer (java.util.StringTokenizer)5 RouteBuilder (org.apache.camel.builder.RouteBuilder)5 House (org.apache.deltaspike.data.test.ee7.domain.House)5 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)5 ManagementClient (org.jboss.as.arquillian.container.ManagementClient)5