req = new JaxbCommandsRequest(command); } else { req = new JaxbCommandsRequest(deploymentId, command); correlationKeyString.append(":").append(iter.next()); req.setCorrelationKeyString(correlationKeyString.toString()); req.setProcessInstanceId(processInstanceId); req.setUser(userName); req.setVersion(VERSION);
public JaxbCommandsResponse(JaxbCommandsRequest request) { super(); this.deploymentId = request.getDeploymentId(); this.processInstanceId = request.getProcessInstanceId(); this.version = request.getVersion(); }
private JaxbCommandsRequest createRequest() { String depId = UUID.randomUUID().toString(); JaxbCommandsRequest req = new JaxbCommandsRequest(); req.setDeploymentId(depId); req.setVersion(ServicesVersion.VERSION); req.setUser("test"); return req; }
public JaxbCommandsRequest(Command command) { checkThatCommandIsAccepted(command); this.commands = new ArrayList<Command>(); this.commands.add(command); checkThatCommandsContainDeploymentIdIfNeeded(this.commands); }
stCmd.setTaskId(taskId); stCmd.setUserId("krisv"); org.kie.remote.client.jaxb.JaxbCommandsRequest clientReq = new org.kie.remote.client.jaxb.JaxbCommandsRequest("test", stCmd); Command<?> newCmd = ((JaxbCommandsRequest) clientServicesRoundTrip(clientReq)).getCommands().get(0); assertNotNull(newCmd); assertEquals("userId is not equal", userId, getField("userId", TaskCommand.class, newCmd)); clientReq = new org.kie.remote.client.jaxb.JaxbCommandsRequest(); clientReq.setUser("krampus"); List<Command> cmds = new ArrayList<Command>(); clientReq.setCommands(cmds); clientReq.setDeploymentId("depId"); clientReq.setProcessInstanceId(43l); clientReq.setVersion("6.0.1.0"); AbortProcessInstanceCommand apCmd = new AbortProcessInstanceCommand(); apCmd.setProcessInstanceId(23l); clientReq.getCommands().add(apCmd); String corrPropVal2 = "prop"; gpibckCmd.setCorrelationKey(corrPropVal1 + ":" + corrPropVal2); clientReq = new org.kie.remote.client.jaxb.JaxbCommandsRequest("test", gpibckCmd); JaxbCommandsRequest serviceReq = (JaxbCommandsRequest) clientServicesRoundTrip(clientReq);
private JaxbCommandsResponse sendJmsCommands(String deploymentId, Long processInstanceId, String user, JaxbCommandsRequest req, ConnectionFactory factory, Queue sendQueue, Queue responseQueue, String jmsUser, String jmsPassword, int timeout) { req.setProcessInstanceId(processInstanceId); req.setUser(user);
@Test public void unsupportedCommandsTest() { try { new JaxbCommandsRequest(new HaltCommand()); fail("An exception should have been thrown"); } catch( Exception e ) { assertTrue(e instanceof UnsupportedOperationException); } Command[] cmdArrs = { new HaltCommand() }; List<Command> cmds = Arrays.asList(cmdArrs); try { new JaxbCommandsRequest(cmds); fail("An exception should have been thrown"); } catch( Exception e ) { assertTrue(e instanceof UnsupportedOperationException); } JaxbCommandsRequest req = new JaxbCommandsRequest(); try { req.setCommands(cmds); fail("An exception should have been thrown"); } catch( Exception e ) { assertTrue(e instanceof UnsupportedOperationException); } } }
@Test public void serializingPrimitiveArraysTest() throws Exception { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("url", "http://soaptest.parasoft.com/calculator.wsdl"); parameters.put("namespace", "http://www.parasoft.com/wsdl/calculator/"); parameters.put("interface", "Calculator"); parameters.put("operation", "add"); Float [] arrayParam = new Float[] { 9.0f, 12.0f }; parameters.put("parameters", arrayParam); addClassesToSerializationProvider(arrayParam.getClass()); org.kie.remote.jaxb.gen.StartProcessCommand cmd = new org.kie.remote.jaxb.gen.StartProcessCommand(); cmd.setProcessId("proc.with.array.params"); cmd.setParameter(ConversionUtil.convertMapToJaxbStringObjectPairArray(parameters)); org.kie.remote.client.jaxb.JaxbCommandsRequest clientReq = new org.kie.remote.client.jaxb.JaxbCommandsRequest("test", cmd); JaxbCommandsRequest serviceReq = (JaxbCommandsRequest) clientServicesRoundTrip(clientReq); StartProcessCommand newCmd = (StartProcessCommand) serviceReq.getCommands().get(0); assertNotNull(newCmd); Float [] arrayParamCopy = (Float[]) newCmd.getParameters().get("parameters"); assertArrayEquals(arrayParam, arrayParamCopy); }
((StartProcessCommand) cmd).setProcessId(PROCESS_ID_1); int oompaProcessingResultIndex = 0; JaxbCommandsRequest req = new JaxbCommandsRequest(DEPLOYMENT_ID, cmd); cmd = new GetTaskAssignedAsPotentialOwnerCommand(); ((GetTaskAssignedAsPotentialOwnerCommand) cmd).setUserId(USER); req.getCommands().add(cmd); int loompaMonitoringResultIndex = 1;
assertEquals("Deployment id", req.getDeploymentId(), resp.getDeploymentId());
private void checkThatCommandsAreAccepted(Collection<Command> cmds) { for( Object cmd : cmds ) { checkThatCommandIsAccepted(cmd); } }
= new org.kie.remote.client.jaxb.JaxbCommandsRequest("org.deployment.id", spCmd); JaxbCommandsRequest serviceReq = (JaxbCommandsRequest) clientServicesRoundTrip(clientReq);
public JaxbCommandsRequest(String deploymentId, Command command) { checkThatCommandIsAccepted(command); this.deploymentId = deploymentId; this.commands = new ArrayList<Command>(); this.commands.add(command); }
JaxbCommandResponse cmdResp = cmdServiceClient.execute(new JaxbCommandsRequest()).getResponses().get(0);