Search in sources :

Example 6 with IJobCapacityController

use of org.apache.hyracks.api.job.resource.IJobCapacityController in project asterixdb by apache.

the class JobManagerTest method testNullJob.

@Test
public void testNullJob() throws HyracksException {
    IJobCapacityController jobCapacityController = mock(IJobCapacityController.class);
    IJobManager jobManager = new JobManager(ccConfig, mockClusterControllerService(), jobCapacityController);
    boolean invalidParameter = false;
    try {
        jobManager.add(null);
    } catch (HyracksException e) {
        invalidParameter = e.getErrorCode() == ErrorCode.INVALID_INPUT_PARAMETER;
    }
    Assert.assertTrue(invalidParameter);
    Assert.assertTrue(jobManager.getRunningJobs().isEmpty());
    Assert.assertTrue(jobManager.getPendingJobs().isEmpty());
}
Also used : IJobCapacityController(org.apache.hyracks.api.job.resource.IJobCapacityController) HyracksException(org.apache.hyracks.api.exceptions.HyracksException) Test(org.junit.Test)

Aggregations

IJobCapacityController (org.apache.hyracks.api.job.resource.IJobCapacityController)6 Test (org.junit.Test)5 JobSpecification (org.apache.hyracks.api.job.JobSpecification)4 HyracksException (org.apache.hyracks.api.exceptions.HyracksException)3 ArrayList (java.util.ArrayList)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 CCServiceContext (org.apache.hyracks.control.cc.application.CCServiceContext)1 IJobManager (org.apache.hyracks.control.cc.job.IJobManager)1 JobManager (org.apache.hyracks.control.cc.job.JobManager)1 CCConfig (org.apache.hyracks.control.common.controllers.CCConfig)1