use of org.ow2.proactive.scheduler.task.executors.forked.env.command.JavaPrefixCommandExtractor in project scheduling by ow2-proactive.
the class ForkedJvmTaskExecutionCommandCreatorTest method replaceJavaPrefixCommandCreatorWithMock.
/**
* Replaces the java prefix command creator service with a mock
*
* @param forkedJvmTaskExecutionCommandCreator Instance which will have the service replaced.
* @throws IllegalAccessException
* @throws NoSuchFieldException
*/
private void replaceJavaPrefixCommandCreatorWithMock(ForkedJvmTaskExecutionCommandCreator forkedJvmTaskExecutionCommandCreator) throws IllegalAccessException, NoSuchFieldException {
JavaPrefixCommandExtractor javaPrefixCommandExtractor = mock(JavaPrefixCommandExtractor.class);
given(javaPrefixCommandExtractor.extractJavaPrefixCommandToCommandListFromScriptResult(any(ScriptResult.class))).willReturn(Arrays.asList(testPreJaveCommandString));
setPrivateField(ForkedJvmTaskExecutionCommandCreator.class.getDeclaredField("javaPrefixCommandExtractor"), forkedJvmTaskExecutionCommandCreator, javaPrefixCommandExtractor);
}
Aggregations