use of es.bsc.compss.scheduler.multiobjective.types.MOProfile in project compss by bsc-wdc.
the class MOProfileTest method toJSONObjectTest.
@Test
public void toJSONObjectTest() {
MOProfile original = new MOProfile(new JSONObject("{" + "\"executions\":" + SET_EXECUTION_COUNT + "," + "\"maxTime\":" + SET_MAX_EXECUTION_TIME + "," + "\"minTime\":" + SET_MIN_EXECUTION_TIME + "," + "\"avgTime\":" + SET_AVG_EXECUTION_TIME + "," + "\"power\":" + SET_POWER + "," + "\"price\":" + SET_PRICE + "}"));
JSONObject jsonObject = original.toJSONObject();
MOProfile p = new MOProfile(jsonObject);
if (p.getExecutionCount() != SET_EXECUTION_COUNT) {
fail("Invalid execution count on complete JSON constructor");
}
if (p.getMinExecutionTime() != SET_MIN_EXECUTION_TIME) {
fail("Invalid default min execution time on complete JSON constructor");
}
if (p.getAverageExecutionTime() != SET_AVG_EXECUTION_TIME) {
fail("Invalid default average execution time on complete JSON constructor");
}
if (p.getMaxExecutionTime() != SET_MAX_EXECUTION_TIME) {
fail("Invalid default max execution time on complete JSON constructor");
}
if (p.getPower() != SET_POWER) {
fail("Invalid default power on complete JSON constructor");
}
if (p.getPrice() != SET_PRICE) {
fail("Invalid default price on complete JSON constructor");
}
}
Aggregations