Search in sources :

Example 81 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project core by weld.

the class FlowMultipleWarTest method testFlows.

@Test
@RunAsClient
public void testFlows(@ArquillianResource @OperateOnDeployment(WAR1) URL war1Context, @ArquillianResource @OperateOnDeployment(WAR2) URL war2Context) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
    WebClient client = new WebClient();
    testFlow(client, war1Context);
    testFlow(client, war2Context);
}
Also used : WebClient(com.gargoylesoftware.htmlunit.WebClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 82 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project core by weld.

the class ManagedBeansWithCDITest method testManagedBeansWithCDI.

@Test
@RunAsClient
public void testManagedBeansWithCDI(@ArquillianResource URL url) throws Exception {
    WebClient client = new WebClient();
    client.getPage(url + "/index.faces");
}
Also used : WebClient(com.gargoylesoftware.htmlunit.WebClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 83 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project core by weld.

the class Weld1037Test method testRedirectInPreRenderViewAction.

@Test
@RunAsClient
public void testRedirectInPreRenderViewAction(@ArquillianResource URL url) throws Exception {
    WebClient client = new WebClient();
    client.setRedirectEnabled(false);
    client.setThrowExceptionOnFailingStatusCode(false);
    Page page = client.getPage(url + "/doRedirect.faces");
    assertEquals("Expected redirect:", HttpServletResponse.SC_MOVED_TEMPORARILY, page.getWebResponse().getStatusCode());
}
Also used : Page(com.gargoylesoftware.htmlunit.Page) WebClient(com.gargoylesoftware.htmlunit.WebClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 84 with RunAsClient

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

the class RestServiceInvokeTest method testPost.

@Test
@RunAsClient
public void testPost() throws Exception {
    System.out.println("### Running proccess ...");
    KieSession ksession = getSession(rrs.getResource(RegisterRestService.BPMN_CALL_REST_SERVICE));
    ksession.getWorkItemManager().registerWorkItemHandler("REST", new RESTWorkItemHandler());
    HashMap<String, Object> arguments = new HashMap<String, Object>();
    arguments.put("Url", RegisterRestService.SERVICE_URL + "PersonList/add");
    arguments.put("Method", "POST");
    arguments.put("ContentType", "application/json");
    arguments.put("Content", "{ \"name\": \"Marek\",  \"middlename\": \"-\", \"surname\": \"Baluch\" }");
    WorkflowProcessInstance pi = (WorkflowProcessInstance) ksession.startProcess(RegisterRestService.PROCESS_CALL_REST_SERVICE, arguments);
    Assertions.assertThat(pi.getVariable("Result")).as("REST call failed - Wrong response.").isEqualTo("Ok");
    Assertions.assertThat(pi.getVariable("Status")).as("REST call failed - Wrong status code.").isEqualTo(200);
    Assertions.assertThat(pi.getState()).as("Process did not finish").isEqualTo(ProcessInstance.STATE_COMPLETED);
}
Also used : HashMap(java.util.HashMap) RESTWorkItemHandler(org.jbpm.process.workitem.rest.RESTWorkItemHandler) 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 85 with RunAsClient

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

the class RestServiceInvokeTest method testGet.

@Test
@RunAsClient
public void testGet() throws Exception {
    System.out.println("### Running proccess ...");
    KieSession ksession = getSession(rrs.getResource(RegisterRestService.BPMN_CALL_REST_SERVICE_SIMPLE));
    ksession.getWorkItemManager().registerWorkItemHandler("REST", new RESTWorkItemHandler());
    HashMap<String, Object> arguments = new HashMap<String, Object>();
    arguments.put("Url", RegisterRestService.SERVICE_URL + "PersonList/ping");
    WorkflowProcessInstance pi = (WorkflowProcessInstance) ksession.startProcess(RegisterRestService.PROCESS_CALL_REST_SERVICE_SIMPLE, arguments);
    Assertions.assertThat(pi.getVariable("Result")).as("REST call failed - Wrong response.").isEqualTo("pong");
    Assertions.assertThat(pi.getVariable("Status")).as("REST call failed - Wrong status code.").isEqualTo(200);
    Assertions.assertThat(pi.getState()).as("Process did not finish").isEqualTo(ProcessInstance.STATE_COMPLETED);
}
Also used : HashMap(java.util.HashMap) RESTWorkItemHandler(org.jbpm.process.workitem.rest.RESTWorkItemHandler) 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)

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