use of org.jboss.arquillian.container.test.api.RunAsClient in project deltaspike by apache.
the class NavigationParameterTest method testNavigationActionOverview.
@Test
@RunAsClient
public void testNavigationActionOverview() throws MalformedURLException {
driver.get(new URL(contextPath, "origin.xhtml").toString());
WebElement button = driver.findElement(By.id("parameter:pb005Overview"));
button.click();
Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("overviewPage"), "You arrived at overview page").apply(driver));
System.out.println(driver.getCurrentUrl());
Assert.assertTrue(driver.getCurrentUrl().contains("param1=staticValue2"));
Assert.assertTrue(driver.getCurrentUrl().contains("param2=aValue"));
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.
the class AnalyzerTransactionTimeoutTestCase method testTransactionTimeoutDisabled.
@Test
@RunAsClient
public void testTransactionTimeoutDisabled(@ArquillianResource URL url) throws Exception {
final UrlBuilder builder = UrlBuilder.of(url, "start");
builder.addParameter(StartBatchServlet.JOB_XML_PARAMETER, "analyzer-job");
final String result = performCall(builder.build(), 20);
final JobExecution jobExecution = JobExecutionMarshaller.unmarshall(result);
assertEquals("COMPLETED", jobExecution.getBatchStatus().name());
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.
the class ChunkPartitionTestCase method chunks.
@RunAsClient
@Test
public void chunks(@ArquillianResource final URL url) throws Exception {
for (int i = 10; i >= 8; i--) {
final UrlBuilder builder = UrlBuilder.of(url, "start");
builder.addParameter(StartBatchServlet.JOB_XML_PARAMETER, "chunkPartition");
builder.addParameter("thread.count", i);
builder.addParameter("writer.sleep.time", 100);
final String result = performCall(builder.build());
final JobExecution jobExecution = JobExecutionMarshaller.unmarshall(result);
Assert.assertEquals(BatchStatus.COMPLETED, jobExecution.getBatchStatus());
// final String exitStatus = stepExecution0.getExitStatus();
// Assert.assertTrue(exitStatus.startsWith("PASS"));
}
final UrlBuilder builder = UrlBuilder.of(url, "start");
builder.addParameter(StartBatchServlet.JOB_XML_PARAMETER, "chunkPartition");
builder.addParameter("thread.count", 1);
builder.addParameter("skip.thread.check", "true");
builder.addParameter("writer.sleep.time", 0);
final String result = performCall(builder.build());
final JobExecution jobExecution = JobExecutionMarshaller.unmarshall(result);
Assert.assertEquals(BatchStatus.COMPLETED, jobExecution.getBatchStatus());
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.
the class EJBClientInterceptorTestCase method testEJBClientInterceptionFromRemoteClient.
/**
* @throws Exception
*/
@Test
// run as a truly remote client
@RunAsClient
public void testEJBClientInterceptionFromRemoteClient() throws Exception {
// create some data that the client side interceptor will pass along during the EJB invocation
final Map<String, Object> interceptorData = new HashMap<String, Object>();
final String keyOne = "foo";
final Object valueOne = "bar";
final String keyTwo = "blah";
final Object valueTwo = new Integer("12");
interceptorData.put(keyOne, valueOne);
interceptorData.put(keyTwo, valueTwo);
final SimpleEJBClientInterceptor clientInterceptor = new SimpleEJBClientInterceptor(interceptorData);
// get hold of the EJBClientContext and register the client side interceptor
final EJBClientContext ejbClientContext = EJBClientContext.getCurrent().withAddedInterceptors(clientInterceptor);
final Hashtable props = new Hashtable();
props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
final Context jndiContext = new InitialContext(props);
ejbClientContext.runCallable(() -> {
final RemoteSFSB remoteSFSB = (RemoteSFSB) jndiContext.lookup("ejb:" + APP_NAME + "/" + MODULE_NAME + "/" + DISTINCT_NAME + "/" + SimpleSFSB.class.getSimpleName() + "!" + RemoteSFSB.class.getName() + "?stateful");
// invoke the bean and ask it for the invocation data that it saw on the server side
final Map<String, Object> valuesSeenOnServerSide = remoteSFSB.getInvocationData(keyOne, keyTwo);
// make sure the server side bean was able to get the data which was passed on by the client side
// interceptor
Assert.assertNotNull("Server side context data was expected to be non-null", valuesSeenOnServerSide);
Assert.assertFalse("Server side context data was expected to be non-empty", valuesSeenOnServerSide.isEmpty());
for (final Map.Entry<String, Object> clientInterceptorDataEntry : interceptorData.entrySet()) {
final String key = clientInterceptorDataEntry.getKey();
final Object expectedValue = clientInterceptorDataEntry.getValue();
Assert.assertEquals("Unexpected value in bean, on server side, via InvocationContext.getContextData() for key " + key, expectedValue, valuesSeenOnServerSide.get(key));
}
return null;
});
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.
the class TwoModulesFlatTestCase method testConnection2.
/**
* Tests connection in pool
*
* @throws Exception in case of error
*/
@Test
@RunAsClient
public void testConnection2() throws Exception {
final ModelNode address1 = ModuleAcDeploymentTestCaseSetup.address1.clone();
address1.add("connection-definitions", cf1);
address1.protect();
final ModelNode operation1 = new ModelNode();
operation1.get(OP).set("test-connection-in-pool");
operation1.get(OP_ADDR).set(address1);
executeOperation(operation1);
}
Aggregations