Search in sources :

Example 1 with DataFaker

use of objectFaker.DataFaker 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)

Aggregations

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