Search in sources :

Example 1 with FixedPropertyGenerator

use of objectFaker.propertyGenerator.FixedPropertyGenerator 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);
}
Also used : PrefixPropertyGenerator(objectFaker.propertyGenerator.PrefixPropertyGenerator) JobResultData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobResultData) DataFaker(objectFaker.DataFaker) TaskResultData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.TaskResultData) FixedPropertyGenerator(objectFaker.propertyGenerator.FixedPropertyGenerator) Before(org.junit.Before)

Example 2 with FixedPropertyGenerator

use of objectFaker.propertyGenerator.FixedPropertyGenerator 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));
}
Also used : PrefixPropertyGenerator(objectFaker.propertyGenerator.PrefixPropertyGenerator) JobIdData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData) TaskStateData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.TaskStateData) FixedPropertyGenerator(objectFaker.propertyGenerator.FixedPropertyGenerator) Before(org.junit.Before)

Aggregations

FixedPropertyGenerator (objectFaker.propertyGenerator.FixedPropertyGenerator)2 PrefixPropertyGenerator (objectFaker.propertyGenerator.PrefixPropertyGenerator)2 Before (org.junit.Before)2 DataFaker (objectFaker.DataFaker)1 JobIdData (org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData)1 JobResultData (org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobResultData)1 TaskResultData (org.ow2.proactive_grid_cloud_portal.scheduler.dto.TaskResultData)1 TaskStateData (org.ow2.proactive_grid_cloud_portal.scheduler.dto.TaskStateData)1