JobMetaData { public final ResourceSkyline getResourceSkyline() { return resourceSkyline; } JobMetaData(final long jobSubmissionTimeConfig); final JobMetaData setJobFinishTime(final long jobFinishTimeConfig); final JobMetaData setContainerStart(final String containerId,
      final long time); final JobMetaData setContainerEnd(final String containerId,
      final long time); final RecurrenceId getRecurrenceId(); final JobMetaData setRecurrenceId(
      final RecurrenceId recurrenceIdConfig); final ResourceSkyline getResourceSkyline(); final void createSkyline();  }
@Test public final void testGetContainerSpec() { final Resource containerAlloc = jobMetaData.getResourceSkyline().getContainerSpec(); final Resource containerAlloc2 = Resource.newInstance(1, 1); Assert.assertEquals(containerAlloc.getMemorySize(), containerAlloc2.getMemorySize()); Assert.assertEquals(containerAlloc.getVirtualCores(), containerAlloc2.getVirtualCores()); }
@Test public final void testGetJobSize() { Assert.assertEquals(jobMetaData.getResourceSkyline().getJobInputDataSize(), 1024.5, 0); }
@Test public final void testStringToUnixTimestamp() throws ParseException { final long submissionTime = logParserUtil.stringToUnixTimestamp("17/07/16 16:27:25"); Assert.assertEquals(jobMetaData.getResourceSkyline().getJobSubmissionTime(), submissionTime); }
@Test public final void testResourceSkyline() { final RLESparseResourceAllocation skylineList = jobMetaData.getResourceSkyline().getSkylineList(); final int containerCPU = jobMetaData.getResourceSkyline().getContainerSpec().getVirtualCores(); int k; for (k = 0; k < 5; k++) { Assert.assertEquals(0, skylineList.getCapacityAtTime(k).getVirtualCores() / containerCPU); } for (k = 5; k < 15; k++) { Assert.assertEquals(1, skylineList.getCapacityAtTime(k).getVirtualCores() / containerCPU); } for (k = 15; k < 605; k++) { Assert.assertEquals(2, skylineList.getCapacityAtTime(k).getVirtualCores() / containerCPU); } for (k = 605; k < 615; k++) { Assert.assertEquals(1, skylineList.getCapacityAtTime(k).getVirtualCores() / containerCPU); } Assert.assertEquals(0, skylineList.getCapacityAtTime(615).getVirtualCores() / containerCPU); }