Search in sources :

Example 11 with MOProfile

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");
    }
}
Also used : JSONObject(org.json.JSONObject) MOProfile(es.bsc.compss.scheduler.multiobjective.types.MOProfile) Test(org.junit.Test)

Aggregations

MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)11 Implementation (es.bsc.compss.types.implementations.Implementation)8 MethodResourceDescription (es.bsc.compss.types.resources.MethodResourceDescription)4 CloudMethodResourceDescription (es.bsc.compss.types.resources.description.CloudMethodResourceDescription)4 Gap (es.bsc.compss.scheduler.multiobjective.types.Gap)3 AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)3 ResourceDescription (es.bsc.compss.types.resources.ResourceDescription)3 WorkerResourceDescription (es.bsc.compss.types.resources.WorkerResourceDescription)3 CloudInstanceTypeDescription (es.bsc.compss.types.resources.description.CloudInstanceTypeDescription)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 LinkedList (java.util.LinkedList)2 JSONObject (org.json.JSONObject)2 Test (org.junit.Test)2 ActionNotFoundException (es.bsc.compss.scheduler.exceptions.ActionNotFoundException)1 MOResourceScheduler (es.bsc.compss.scheduler.multiobjective.MOResourceScheduler)1 MOScore (es.bsc.compss.scheduler.multiobjective.types.MOScore)1 OptimizationAction (es.bsc.compss.scheduler.multiobjective.types.OptimizationAction)1 SchedulingEvent (es.bsc.compss.scheduler.multiobjective.types.SchedulingEvent)1 ResourceCreationRequest (es.bsc.compss.types.ResourceCreationRequest)1