use of org.jboss.as.test.integration.ee.appclient.util.AppClientWrapper in project wildfly by wildfly.
the class SimpleApplicationClientTestCase method descriptorBasedAppClientTest.
/**
* Tests an app client with a deployment descriptor, that injects an env-entry and an EJB.
*
* @throws Exception
*/
@Test
public void descriptorBasedAppClientTest() throws Exception {
final StatelessEJBLocator<AppClientSingletonRemote> locator = new StatelessEJBLocator(AppClientSingletonRemote.class, APP_NAME, MODULE_NAME, AppClientStateSingleton.class.getSimpleName(), "");
final AppClientSingletonRemote remote = EJBClient.createProxy(locator);
remote.reset();
final AppClientWrapper wrapper = new AppClientWrapper(archive, "--host=" + managementClient.getRemoteEjbURL(), "client-dd.jar", "");
try {
final String result = remote.awaitAppClientCall();
assertTrue("App client call failed. App client output: " + wrapper.readAllUnformated(1000), result != null);
assertEquals("EnvEntry", result);
} finally {
wrapper.quit();
}
}
use of org.jboss.as.test.integration.ee.appclient.util.AppClientWrapper in project wildfly by wildfly.
the class SimpleApplicationClientTestCase method testAppClientJBossDescriptor.
/**
* Tests an app client with a deployment descriptor, that injects an env-entry and an EJB.
*
* @throws Exception
*/
@Test
public void testAppClientJBossDescriptor() throws Exception {
final StatelessEJBLocator<AppClientSingletonRemote> locator = new StatelessEJBLocator(AppClientSingletonRemote.class, APP_NAME, MODULE_NAME, AppClientStateSingleton.class.getSimpleName(), "");
final AppClientSingletonRemote remote = EJBClient.createProxy(locator);
remote.reset();
URL props = getClass().getClassLoader().getResource("jboss-ejb-client.properties");
final AppClientWrapper wrapper = new AppClientWrapper(archive, " -Dnode0=" + managementClient.getMgmtAddress() + " --ejb-client-properties=" + props, "client-override.jar", "");
try {
final String result = remote.awaitAppClientCall();
assertTrue("App client call failed. App client output: " + wrapper.readAllUnformated(1000), result != null);
assertEquals("OverridenEnvEntry", result);
} finally {
wrapper.quit();
}
}
use of org.jboss.as.test.integration.ee.appclient.util.AppClientWrapper in project wildfly by wildfly.
the class SimpleApplicationClientTestCase method simpleAppClientTest.
/**
* Tests a simple app client that calls an ejb with its command line parameters
*/
@Test
public void simpleAppClientTest() throws Exception {
final StatelessEJBLocator<AppClientSingletonRemote> locator = new StatelessEJBLocator(AppClientSingletonRemote.class, APP_NAME, MODULE_NAME, AppClientStateSingleton.class.getSimpleName(), "");
final AppClientSingletonRemote remote = EJBClient.createProxy(locator);
remote.reset();
final AppClientWrapper wrapper = new AppClientWrapper(archive, "--host=" + managementClient.getRemoteEjbURL(), "client-annotation.jar", "cmdLineParam");
try {
final String result = remote.awaitAppClientCall();
assertTrue("App client call failed. App client output: " + wrapper.readAllUnformated(1000), result != null);
assertEquals("cmdLineParam", result);
} finally {
wrapper.quit();
}
}
Aggregations