Search in sources :

Example 21 with GCResource

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

the class TestGCModelLoader method loadExistingFile.

@Test
public void loadExistingFile() throws Exception {
    GCResource gcResource = new GcResourceFile(UnittestHelper.getResourceAsString(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_6_0CMS.txt"));
    GCModelLoaderImpl loader = new GCModelLoaderImpl(gcResource);
    loader.execute();
    GCModel model = loader.get();
    assertThat("model", model, notNullValue());
    assertThat("model.size", model.size(), not(0));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 22 with GCResource

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

the class TestGCModelLoaderController method getGcResourcesForSeries.

private ArrayList<GCResource> getGcResourcesForSeries() throws IOException {
    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()));
    return gcResourceList;
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) ArrayList(java.util.ArrayList) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile)

Example 23 with GCResource

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

the class GCModelLoaderFactoryTest method createFor_GcResourceUnknown.

@Test
public void createFor_GcResourceUnknown() throws Exception {
    expectedException.expect(IllegalArgumentException.class);
    GCResource gcResource = mock(GCResource.class);
    GCModelLoaderFactory.createFor(gcResource);
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) Test(org.junit.Test)

Example 24 with GCResource

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

the class GCModelLoaderFactoryTest method createFor_GcResourceFile.

@Test
public void createFor_GcResourceFile() throws Exception {
    GCResource gcResource = mock(GcResourceFile.class);
    assertThat(GCModelLoaderFactory.createFor(gcResource), instanceOf(GCModelLoaderImpl.class));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) Test(org.junit.Test)

Example 25 with GCResource

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

the class GCModelSeriesLoaderImplTest method loadGcModel.

@Test
public void loadGcModel() 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()));
    GCModelSeriesLoaderImpl loader = new GCModelSeriesLoaderImpl(new GcResourceSeries(gcResourceList));
    assertThat(loader.loadGcModel(), notNullValue());
}
Also used : 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)

Aggregations

GCResource (com.tagtraum.perf.gcviewer.model.GCResource)65 GcResourceFile (com.tagtraum.perf.gcviewer.model.GcResourceFile)55 Test (org.junit.Test)54 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)40 ByteArrayInputStream (java.io.ByteArrayInputStream)15 GCEvent (com.tagtraum.perf.gcviewer.model.GCEvent)13 GcResourceSeries (com.tagtraum.perf.gcviewer.model.GcResourceSeries)10 InputStream (java.io.InputStream)9 ArrayList (java.util.ArrayList)8 File (java.io.File)4 GCModelLoader (com.tagtraum.perf.gcviewer.ctrl.GCModelLoader)2 LogRecord (java.util.logging.LogRecord)2 GCModelLoaderGroupTracker (com.tagtraum.perf.gcviewer.ctrl.GCModelLoaderGroupTracker)1 Before (org.junit.Before)1 Ignore (org.junit.Ignore)1