String jobDefinitionFile = "src/main/resources/examples/jobs/exJob.xml";
cmdLineUtility.run(("--url http://localhost:9000"
+ " --operation --submitJob --def "
+ jobDefinitionFile).split(" "));
JobSpec spec = JobBuilder.buildJobSpec(jobDefinitionFile);
MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
assertEquals("submitJob", methodCallDetails.getMethodName());
Job actualJob = (Job) methodCallDetails.getArgs().get(0);
assertEquals(spec.getJob().getJobInstanceClassName(), actualJob.getJobInstanceClassName());
assertEquals(spec.getJob().getJobInputClassName(), actualJob.getJobInputClassName());
assertEquals(spec.getJob().getQueueName(), actualJob.getQueueName());
assertEquals(spec.getJob().getLoadValue(), actualJob.getLoadValue());
JobInput actualJobInput = (JobInput) methodCallDetails.getArgs().get(1);
assertEquals(spec.getIn().getClass(), actualJobInput.getClass());
assertEquals(2, methodCallDetails.getArgs().size());
OptionPropertyRegister.clearRegister();
String url = "http://localhost:9000";
cmdLineUtility.run(("--url http://localhost:9000"
+ " --operation --submitJob --def "
+ jobDefinitionFile + " --nodeUrl " + url).split(" "));
methodCallDetails = client.getLastMethodCallDetails();
assertEquals("submitJob", methodCallDetails.getMethodName());
actualJob = (Job) methodCallDetails.getArgs().get(0);
assertEquals(spec.getJob().getJobInstanceClassName(), actualJob.getJobInstanceClassName());
assertEquals(spec.getJob().getJobInputClassName(), actualJob.getJobInputClassName());
assertEquals(spec.getJob().getQueueName(), actualJob.getQueueName());
assertEquals(spec.getJob().getLoadValue(), actualJob.getLoadValue());
actualJobInput = (JobInput) methodCallDetails.getArgs().get(1);
assertEquals(spec.getIn().getClass(), actualJobInput.getClass());
assertEquals(new URL(url), methodCallDetails.getArgs().get(2));
assertEquals(3, methodCallDetails.getArgs().size());
}