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);
}
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);
}
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);
}
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();
}
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"));
}
Aggregations