CloudletSchedulerTimeShared extends CloudletSchedulerAbstract { @Override public double cloudletResume(final Cloudlet cloudlet) { return findCloudletInList(cloudlet, getCloudletPausedList()) .map(this::movePausedCloudletToExecListAndGetExpectedFinishTime) .orElse(0.0); }  @Override List<CloudletExecution> getCloudletWaitingList(); @Override double cloudletResume(final Cloudlet cloudlet);  }
@Test public void testCloudletResumeWhenEmptyPausedList() { final int cloudletId = 0; final double expResult = 0.0; final double result = instance.cloudletResume(new CloudletSimple(cloudletId, 1, 1)); assertEquals(expResult, result); }
@Test public void testCloudletResumeWhenCloudletNotInPausedList() { final int cloudletIdInTheList = 1; instance.getCloudletPausedList().add(CloudletSchedulerTimeSharedTestUtil.createCloudletExecInfo(cloudletIdInTheList)); final double expResult = 0.0; final int cloudletIdSearched = 2; final double result = instance.cloudletResume(new CloudletSimple(cloudletIdSearched, 1, 1)); assertEquals(expResult, result); }
@Test public void testCloudletResumeWhenCloudletInPausedList() { final int cloudletId = 1; final int schedulerPes = 1; final long mips = 1000; final long cloudletLength = 10000; final CloudletSchedulerTimeShared instance = CloudletSchedulerTimeSharedTestUtil.createCloudletSchedulerWithMipsList(schedulerPes, mips); CloudletSchedulerTimeSharedTestUtil.createCloudletAndAddItToPausedList(instance, cloudletId, cloudletLength); final double expResult = 10; final double result = instance.cloudletResume(new CloudletSimple(cloudletId, 1, 1)); assertEquals(expResult, result); }