Search in sources :

Example 86 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbpm by kiegroup.

the class WebServiceInvokeTest method testWebServiceAsync.

@Test
@RunAsClient
public void testWebServiceAsync() throws Exception {
    System.out.println("### Running proccess ...");
    KieSession ksession = getSession(hws.getResource(HelloWebService.BPMN_CALL_WEB_SERVICE_NO_INTERFACE));
    ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new WebServiceWorkItemHandler(ksession));
    HashMap<String, Object> arguments = new HashMap<String, Object>();
    arguments.put("parameter", "Fredy");
    arguments.put("mode", "ASYNC");
    /*
         * WebService has been called in mode ASYNC so ksession should return
         * control to our program.
         */
    WorkflowProcessInstance pi = (WorkflowProcessInstance) ksession.startProcess(HelloWebService.PROCESS_CALL_WEB_SERVICE, arguments);
    Assertions.assertThat(pi.getVariable("result")).as("Result variable should not yet be set!").isNull();
    Assertions.assertThat(pi.getState()).as("Process finished prematurely.").isEqualTo(ProcessInstance.STATE_ACTIVE);
    /*
         * Wait for the process to complete
         */
    Thread.sleep(4000);
    /*
         * Make sure we got the response back.
         */
    Assertions.assertThat(pi.getVariable("result")).as("WebService call failed.").isEqualTo("Hello Fredy");
    Assertions.assertThat(pi.getState()).as("Process did not finish").isEqualTo(ProcessInstance.STATE_COMPLETED);
}
Also used : HashMap(java.util.HashMap) WebServiceWorkItemHandler(org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler) KieSession(org.kie.api.runtime.KieSession) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) JbpmContainerTest(org.jbpm.test.container.JbpmContainerTest) Test(org.junit.Test)

Example 87 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbpm by kiegroup.

the class WebServiceInvokeTest method testWebServiceOneWay.

@Test
@RunAsClient
public void testWebServiceOneWay() throws Exception {
    System.out.println("### Running proccess ...");
    KieSession ksession = getSession(hws.getResource(HelloWebService.BPMN_CALL_WEB_SERVICE_NO_INTERFACE));
    ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new WebServiceWorkItemHandler(ksession));
    HashMap<String, Object> arguments = new HashMap<String, Object>();
    arguments.put("parameter", "Fredy");
    arguments.put("mode", "ONEWAY");
    WorkflowProcessInstance pi = (WorkflowProcessInstance) ksession.startProcess(HelloWebService.PROCESS_CALL_WEB_SERVICE, arguments);
    Assertions.assertThat(pi.getVariable("result")).as("WebService call failed.").isEqualTo(null);
    Assertions.assertThat(pi.getState()).as("Process did not finish").isEqualTo(ProcessInstance.STATE_COMPLETED);
}
Also used : HashMap(java.util.HashMap) WebServiceWorkItemHandler(org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler) KieSession(org.kie.api.runtime.KieSession) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) JbpmContainerTest(org.jbpm.test.container.JbpmContainerTest) Test(org.junit.Test)

Example 88 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbpm by kiegroup.

the class WebServiceInvokeTest method testMultipleImports.

@Test
@RunAsClient
public void testMultipleImports() throws Exception {
    System.out.println("### Running proccess ...");
    KieSession ksession = getSession(hws.getResource(HelloWebService.BPMN_CALL_WEB_SERVICE_MULTI_IMPORTS));
    ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new WebServiceWorkItemHandler(ksession));
    HashMap<String, Object> arguments = new HashMap<String, Object>();
    arguments.put("parameter", "Many Imports");
    arguments.put("mode", "SYNC");
    WorkflowProcessInstance pi = (WorkflowProcessInstance) ksession.startProcess(HelloWebService.PROCESS_CALL_WEB_SERVICE, arguments);
    Assertions.assertThat(pi.getVariable("result")).as("WebService call failed.").isEqualTo("Hello Many Imports");
    Assertions.assertThat(pi.getState()).as("Process did not finish.").isEqualTo(ProcessInstance.STATE_COMPLETED);
}
Also used : HashMap(java.util.HashMap) WebServiceWorkItemHandler(org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler) KieSession(org.kie.api.runtime.KieSession) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) JbpmContainerTest(org.jbpm.test.container.JbpmContainerTest) Test(org.junit.Test)

Example 89 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project engine by Lumeer.

the class IntegrationTestBase method startEmbeddedMongoDb.

@RunAsClient
@BeforeDeploy
public static void startEmbeddedMongoDb() {
    embeddedMongoDb = new EmbeddedMongoDb();
    embeddedMongoDb.start();
}
Also used : EmbeddedMongoDb(io.lumeer.storage.mongodb.EmbeddedMongoDb) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) BeforeDeploy(io.lumeer.test.arquillian.annotation.BeforeDeploy)

Example 90 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbossws-cxf by jbossws.

the class WSSecurityPolicyExamples21xTestCase method test2111.

/**
 * 2.1.1.1 UsernameToken with plain text password
 *
 * @throws Exception
 */
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test2111() throws Exception {
    Service service = Service.create(new URL(baseURL + "/SecurityService2111?wsdl"), serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService2111Port"), ServiceIface.class);
    setupWsse(proxy, true);
    assertTrue(proxy.sayHello().equals("Hello - UsernameToken with plain text password"));
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)878 Test (org.junit.Test)862 URL (java.net.URL)492 JBossWSTest (org.jboss.wsf.test.JBossWSTest)410 QName (javax.xml.namespace.QName)289 UserVO (org.olat.user.restapi.UserVO)260 Service (javax.xml.ws.Service)254 UserRestClient (org.olat.test.rest.UserRestClient)254 LoginPage (org.olat.selenium.page.LoginPage)116 NavigationPage (org.olat.selenium.page.NavigationPage)112 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)102 File (java.io.File)99 QTI21Page (org.olat.selenium.page.qti.QTI21Page)96 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)86 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)82 WebElement (org.openqa.selenium.WebElement)78 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)60 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)46 Bus (org.apache.cxf.Bus)44 HashMap (java.util.HashMap)41