Search in sources :

Example 11 with GcResourceSeries

use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.

the class TestGCViewerArgsParser method gcSeriesAndExportFile.

@Test
public void gcSeriesAndExportFile() throws Exception {
    String[] args = { "some_gc.log.0;some_gc.log.1;some_gc.log.2", "export_to.csv" };
    GCViewerArgsParser gcViewerArgsParser = new GCViewerArgsParser();
    gcViewerArgsParser.parseArguments(args);
    assertEquals(gcViewerArgsParser.getArgumentCount(), 2);
    List<GCResource> resources = Arrays.asList(new GcResourceFile("some_gc.log.0"), new GcResourceFile("some_gc.log.1"), new GcResourceFile("some_gc.log.2"));
    assertEquals(gcViewerArgsParser.getGcResource(), new GcResourceSeries(resources));
    assertEquals(gcViewerArgsParser.getSummaryFilePath(), "export_to.csv");
    assertEquals(gcViewerArgsParser.getType(), DataWriterType.SUMMARY);
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Example 12 with GcResourceSeries

use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.

the class GCModelSeriesLoaderImplTest method GCModelSeriesLoaderImpl_ForEmptySeries.

@Test
public void GCModelSeriesLoaderImpl_ForEmptySeries() throws Exception {
    expectedException.expect(IllegalArgumentException.class);
    new GCModelSeriesLoaderImpl(new GcResourceSeries(new ArrayList<>()));
}
Also used : ArrayList(java.util.ArrayList) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Example 13 with GcResourceSeries

use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.

the class GCModelSeriesLoaderImplTest method getGcResource.

@Test
public void getGcResource() throws Exception {
    ArrayList<GCResource> gcResourceList = new ArrayList<>();
    gcResourceList.add(new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part1.txt").getPath()));
    gcResourceList.add(new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part2.txt").getPath()));
    gcResourceList.add(new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part3.txt").getPath()));
    GCModelLoader loader = new GCModelSeriesLoaderImpl(new GcResourceSeries(gcResourceList));
    assertThat(loader.getGcResource(), notNullValue());
}
Also used : GCModelLoader(com.tagtraum.perf.gcviewer.ctrl.GCModelLoader) GCResource(com.tagtraum.perf.gcviewer.model.GCResource) ArrayList(java.util.ArrayList) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Example 14 with GcResourceSeries

use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.

the class TestDataReaderFacade method testLoadModelFromSeries.

@Test
public void testLoadModelFromSeries() throws IOException, DataReaderException {
    GCResource file1 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part1.txt").getPath());
    GCResource file2 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part2.txt").getPath());
    GCResource file3 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part3.txt").getPath());
    GCResource file4 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part4.txt").getPath());
    GCResource file5 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part5.txt").getPath());
    GCResource file6 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part6.txt").getPath());
    GCResource file7 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part7.txt").getPath());
    GCResource expectedResult = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-ManuallyMerged.txt").getPath());
    GCModel expectedModel = dataReaderFacade.loadModel(expectedResult);
    List<GCResource> resources = new ArrayList<>();
    resources.add(file4);
    resources.add(file3);
    resources.add(file6);
    resources.add(file1);
    resources.add(file7);
    resources.add(file2);
    resources.add(file5);
    GcResourceSeries series = new GcResourceSeries(resources);
    GCModel result = dataReaderFacade.loadModel(series);
    assertThat(result.toString(), is(expectedModel.toString()));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) ArrayList(java.util.ArrayList) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Aggregations

GcResourceSeries (com.tagtraum.perf.gcviewer.model.GcResourceSeries)14 GcResourceFile (com.tagtraum.perf.gcviewer.model.GcResourceFile)11 Test (org.junit.Test)11 GCResource (com.tagtraum.perf.gcviewer.model.GCResource)10 ArrayList (java.util.ArrayList)6 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)3 GCModelLoader (com.tagtraum.perf.gcviewer.ctrl.GCModelLoader)2 File (java.io.File)2 GCViewerGuiController (com.tagtraum.perf.gcviewer.ctrl.impl.GCViewerGuiController)1 IOException (java.io.IOException)1 Logger (java.util.logging.Logger)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Matchers.isEmptyString (org.hamcrest.Matchers.isEmptyString)1