Search in sources :

Example 1 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project oxAuth by GluuFederation.

the class GluuConfigurationWSTest method getConfigurationTest.

@RunAsClient
@Parameters({ "gluuConfigurationPath", "webTarget" })
@Consumes(MediaType.APPLICATION_JSON)
@Test
public void getConfigurationTest(String gluuConfigurationPath, @Optional @ArquillianResteasyResource("seam/resource") final WebTarget webTarget) throws Exception {
    Response response = webTarget.path(gluuConfigurationPath).request().get();
    String entity = response.readEntity(String.class);
    BaseTest.showResponse("UMA : TConfiguration.configuration", response, entity);
    assertEquals(response.getStatus(), 200, "Unexpected response code.");
    try {
        GluuConfiguration appConfiguration = ServerUtil.createJsonMapper().readValue(entity, GluuConfiguration.class);
        System.err.println(appConfiguration.getIdGenerationEndpoint());
        assertNotNull(appConfiguration, "Meta data configuration is null");
        assertNotNull(appConfiguration.getIdGenerationEndpoint());
        assertNotNull(appConfiguration.getIntrospectionEndpoint());
        assertNotNull(appConfiguration.getAuthLevelMapping());
        assertNotNull(appConfiguration.getScopeToClaimsMapping());
    } catch (IOException e) {
        e.printStackTrace();
        fail();
    }
}
Also used : Response(javax.ws.rs.core.Response) IOException(java.io.IOException) GluuConfiguration(org.xdi.oxauth.model.gluu.GluuConfiguration) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Parameters(org.testng.annotations.Parameters) Consumes(javax.ws.rs.Consumes) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 2 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project kie-wb-common by kiegroup.

the class StandaloneControllerIT method testEmbeddedRestEndpoint.

@Test
@RunAsClient
@OperateOnDeployment("workbench")
public void testEmbeddedRestEndpoint(@ArquillianResource final URL baseURL) throws Exception {
    final String controllerURL = baseURL + "rest/controller";
    try {
        KieServerControllerClient client = KieServerControllerClientFactory.newRestClient(controllerURL, USER, PASSWORD);
        client.listServerTemplates();
        fail("Connection to embedded controller endpoint should fail");
    } catch (KieServerControllerHTTPClientException ex) {
        assertEquals(404, ex.getResponseCode());
    }
}
Also used : KieServerControllerClient(org.kie.server.controller.client.KieServerControllerClient) KieServerControllerHTTPClientException(org.kie.server.controller.client.exception.KieServerControllerHTTPClientException) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 3 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly-swarm by wildfly-swarm.

the class SWARM582Test method testServletAsWebServiceClientWithHandler.

@Test
@RunAsClient
public void testServletAsWebServiceClientWithHandler() throws Exception {
    URL url = new URL("http://localhost:8080/clientWithHandler?message=" + URLEncoder.encode(MESSAGE, StandardCharsets.UTF_8.name()));
    final String response = readResponse(url);
    assertThat(response).isEqualTo("ECHO:" + MESSAGE);
}
Also used : URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 4 with RunAsClient

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

the class LoginTest method loginAsNewUser.

/**
 * Create a new user and try to login with its credentials.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void loginAsNewUser(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    // create a random user
    UserRestClient userClient = new UserRestClient(deploymentUrl);
    UserVO user = userClient.createRandomUser();
    // load dmz
    loginPage.assertOnLoginPage();
    // login
    loginPage.loginAs(user.getLogin(), user.getPassword());
}
Also used : UserVO(org.olat.user.restapi.UserVO) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 5 with RunAsClient

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

the class UserTest method movePortletToTheTop.

/**
 * Go to the portal, edit it, move the notes to the
 * top, quit editing, check the notes are the first
 * portlet in the view mode.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void movePortletToTheTop(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
    loginPage.loginAs(user.getLogin(), user.getPassword());
    PortalPage portal = navBar.openPortal().assertPortlet(PortalPage.notesBy).edit().moveLeft(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveRight(PortalPage.quickStartBy).moveDown(PortalPage.quickStartBy);
    // finish editing
    portal.finishEditing();
    // no inactive panel -> we are in view mode
    List<WebElement> portalInactive = browser.findElements(PortalPage.inactiveBy);
    Assert.assertTrue(portalInactive.isEmpty());
    // notes must be first
    List<WebElement> portlets = browser.findElements(By.className("o_portlet"));
    Assert.assertFalse(portlets.isEmpty());
    WebElement notesPortlet = portlets.get(0);
    String cssClass = notesPortlet.getAttribute("class");
    Assert.assertNotNull(cssClass);
    Assert.assertTrue(cssClass.contains("o_portlet_notes"));
}
Also used : UserVO(org.olat.user.restapi.UserVO) WebElement(org.openqa.selenium.WebElement) PortalPage(org.olat.selenium.page.user.PortalPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)908 Test (org.junit.Test)893 URL (java.net.URL)499 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)84 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