.addUserName("user")
.addPassword("pass")
.addUrl(new URL("http://localhost:8080/business-central"))
.buildFactory();
RuntimeEngine runtimeEngine = factory.newRuntimeEngine();
try {
runtimeEngine.getTaskService().claim(23l, "user");
} catch( RemoteCommunicationException rce ) {
// expected
}
try {
runtimeEngine.getAuditLogService().clear();
fail( "This should have failed because there's no server running... ");
} catch( RemoteCommunicationException rce ) {
// expected
}
// This will throw a MissingRequiredInfoException because the deployment id is required here
try {
runtimeEngine.getKieSession().startProcess("org.test.process");
fail( "This should have failed because no deployment id has been provided. ");
} catch( MissingRequiredInfoException mrie ) {
// expected
}
factory =
RemoteJmsRuntimeEngineFactory.newBuilder()
.addUserName("user")
.addPassword("pass")
.addRemoteInitialContext(remoteInitialContext)
.addHostName("localhost")
.addJmsConnectorPort(5446)
.addKeystorePassword("R")
.addKeystoreLocation("ssl/client_keystore.jks")
.useKeystoreAsTruststore()
.useSsl(true)
.buildFactory();
runtimeEngine = factory.newRuntimeEngine();
try {
runtimeEngine.getTaskService().claim(23l, "user");
fail( "This should have failed because there's no server running... ");
} catch( RemoteCommunicationException rce ) {
logger.info("The " + NoSuchAlgorithmException.class.getSimpleName() + " above is expected, nothing is wrong.");
// expected
}
try {
runtimeEngine.getAuditLogService().clear();
fail( "This should have failed because there's no server running... ");
} catch( RemoteCommunicationException rce ) {
logger.info("The " + NoSuchAlgorithmException.class.getSimpleName() + " above is expected, nothing is wrong.");
// expected
}
// This will throw a MissingRequiredInfoException because the deployment id is required here
try {
runtimeEngine.getKieSession().startProcess("org.test.process");
} catch( MissingRequiredInfoException mrie ) {
// expected
}
}