use of objectFaker.propertyGenerator.PrefixPropertyGenerator in project scheduling by ow2-proactive.
the class GetJobResultCommandTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
DataFaker<JobResultData> jobResultFaker = new DataFaker<JobResultData>(JobResultData.class);
jobResultFaker.setGenerator("id.readableName", new PrefixPropertyGenerator("job", 1));
jobResultFaker.setGenerator("allResults.key", new PrefixPropertyGenerator("task", 1));
jobResultFaker.setGenerator("allResults.value.id.readableName", new PrefixPropertyGenerator("task", 1));
jobResultFaker.setGenerator("allResults.value.serializedValue", new FixedPropertyGenerator(ObjectByteConverter.serializableToBase64String("Hello")));
jobResult = jobResultFaker.fake();
DataFaker<TaskResultData> taskResultsDataFaker = new DataFaker<TaskResultData>(TaskResultData.class);
taskResultsDataFaker.setGenerator("id.readableName", new PrefixPropertyGenerator("task", 4));
taskResultsDataFaker.setGenerator("serializedValue", new FixedPropertyGenerator(ObjectByteConverter.serializableToBase64String("Hello")));
taskResults = taskResultsDataFaker.fakeList(3);
}
use of objectFaker.propertyGenerator.PrefixPropertyGenerator in project scheduling by ow2-proactive.
the class AbstractSchedulerCommandTest method setUp.
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
jobIdFaker = new DataFaker<JobIdData>(JobIdData.class);
jobIdFaker.setGenerator("readableName", new PrefixPropertyGenerator("job", 1));
when(context.getRestClient()).thenReturn(restClient);
when(restClient.getScheduler()).thenReturn(restApi);
when(context.resultStack()).thenReturn(stack);
capturedOutput = new ByteArrayOutputStream();
userInput = new StringBuffer();
ScriptEngineManager mgr = new ScriptEngineManager();
engine = mgr.getEngineByExtension("js");
when(context.getEngine()).thenReturn(engine);
when(context.getProperty(eq(AbstractIModeCommand.TERMINATE), any(Class.class), anyBoolean())).thenReturn(false);
// Mockito.when(ApplicationContextImpl.currentContext()).thenReturn(context);
ApplicationContextImpl.mockCurrentContext(context.newApplicationContextHolder());
}
use of objectFaker.propertyGenerator.PrefixPropertyGenerator in project scheduling by ow2-proactive.
the class ListTaskStatesCommandTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
JobIdData jobId = jobIdFaker.fake();
taskStateFaker = new DataFaker<TaskStateData>(TaskStateData.class);
taskStateFaker.setGenerator("taskInfo.jobId", new FixedPropertyGenerator<JobIdData>(jobId));
taskStateFaker.setGenerator("taskInfo.taskId.readableName", new PrefixPropertyGenerator("task", 1));
taskStateFaker.setGenerator("name", new PrefixPropertyGenerator("task", 1));
taskStateFaker.setGenerator("tag", new FixedPropertyGenerator("LOOP-T2-1"));
this.taskData = this.taskStateFaker.fakeList(6);
this.taskDataFiltered = new ArrayList<>();
this.taskDataFiltered.add(this.taskData.get(0));
this.taskDataFiltered.add(this.taskData.get(1));
this.taskDataFiltered.add(this.taskData.get(2));
}
Aggregations