req = new JaxbCommandsRequest(command); } else { req = new JaxbCommandsRequest(deploymentId, command);
private JaxbCommandsRequest createRequest() { String depId = UUID.randomUUID().toString(); JaxbCommandsRequest req = new JaxbCommandsRequest(); req.setDeploymentId(depId); req.setVersion(ServicesVersion.VERSION); req.setUser("test"); return req; }
@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); }
= new org.kie.remote.client.jaxb.JaxbCommandsRequest("org.deployment.id", spCmd); JaxbCommandsRequest serviceReq = (JaxbCommandsRequest) clientServicesRoundTrip(clientReq);
@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); } } }
((StartProcessCommand) cmd).setProcessId(PROCESS_ID_1); int oompaProcessingResultIndex = 0; JaxbCommandsRequest req = new JaxbCommandsRequest(DEPLOYMENT_ID, cmd); cmd = new GetTaskAssignedAsPotentialOwnerCommand(); ((GetTaskAssignedAsPotentialOwnerCommand) cmd).setUserId(USER);
JaxbCommandResponse cmdResp = cmdServiceClient.execute(new JaxbCommandsRequest()).getResponses().get(0);
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>(); String corrPropVal2 = "prop"; gpibckCmd.setCorrelationKey(corrPropVal1 + ":" + corrPropVal2); clientReq = new org.kie.remote.client.jaxb.JaxbCommandsRequest("test", gpibckCmd); JaxbCommandsRequest serviceReq = (JaxbCommandsRequest) clientServicesRoundTrip(clientReq);