RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine(); KieSession ksession = engine.getKieSession(); TaskService taskService = engine.getTaskService(); AuditLogService auditLogService = engine.getAuditLogService();
@Test public void notAceptedMethodTest() throws Exception { URL deploymentUrl = new URL( "http://localhost:8080/kie-wb/" ); RemoteRestRuntimeEngineFactory restSessionFactory = RemoteRuntimeEngineFactory.newRestBuilder() .addDeploymentId("deployment") .addUrl(deploymentUrl) .addUserName("mary") .addPassword("pass") .buildFactory(); WorkItemHandler wih = new DoNothingWorkItemHandler(); try { restSessionFactory.newRuntimeEngine().getKieSession().getWorkItemManager().registerWorkItemHandler("test", wih); fail( "The above call should have failed."); } catch( UnsupportedOperationException uoe ) { assertTrue("Incorrect error message: " + uoe.getMessage(), uoe.getMessage().contains("not supported on the Remote Client instance.")); } }
@Test public void notAceptedMethodTest() throws Exception { URL deploymentUrl = new URL( "http://localhost:8080/kie-wb/" ); RemoteRestRuntimeEngineFactory restSessionFactory = RemoteRestRuntimeEngineFactory.newBuilder() .addDeploymentId("deployment") .addUrl(deploymentUrl) .addUserName("mary") .addPassword("pass") .build(); WorkItemHandler wih = new DoNothingWorkItemHandler(); try { restSessionFactory.newRuntimeEngine().getKieSession().getWorkItemManager().registerWorkItemHandler("test", wih); fail( "The above call should have failed."); } catch( UnsupportedOperationException uoe ) { assertEquals("The .registerWorkItemHandler(..) method is not supported on the remote api.", uoe.getMessage()); } }
KieSession ksession = engine.getKieSession(); TaskService taskService = engine.getTaskService();
KieSession ksession = engine.getKieSession(); TaskService taskService = engine.getTaskService();
runtimeEngine.getKieSession().startProcess("org.test.process"); fail( "This should have failed because no deployment id has been provided. "); } catch( MissingRequiredInfoException mrie ) { runtimeEngine.getKieSession().startProcess("org.test.process"); } catch( MissingRequiredInfoException mrie ) {
runtimeEngine.getKieSession().startProcess("org.test.process"); fail( "This should have failed because no deployment id has been provided. "); } catch( MissingRequiredInfoException mrie ) { runtimeEngine.getKieSession().startProcess("org.test.process"); } catch( MissingRequiredInfoException mrie ) {
.buildFactory(); jmsRuntimeFactory.newRuntimeEngine().getKieSession(); fail( "A ksession queue is required for a ksession!"); } catch( MissingRequiredInfoException e) {
.build(); jmsRuntimeFactory.newRuntimeEngine().getKieSession(); fail( "A ksession queue is required for a ksession!"); } catch( MissingRequiredInfoException e) {
.buildFactory(); jmsRuntimeFactory.newRuntimeEngine().getKieSession(); fail( "A ksession queue is required for a ksession!"); } catch( MissingRequiredInfoException e) {