use of com.tagtraum.perf.gcviewer.model.GCResource 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);
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class GCModelLoaderFactoryTest method createFor_GcResourceSeries.
@Test
public void createFor_GcResourceSeries() throws Exception {
GCResource gcResource = mock(GcResourceSeries.class);
assertThat(GCModelLoaderFactory.createFor(gcResource), instanceOf(GCModelSeriesLoaderImpl.class));
}
use of com.tagtraum.perf.gcviewer.model.GCResource 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());
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class ChartPanelView method propertyChange.
@Override
public void propertyChange(PropertyChangeEvent evt) {
// TODO if there were parser warnings, change color of parser tab
if (evt.getSource() instanceof GCResource && GcResourceFile.PROPERTY_MODEL.equals(evt.getPropertyName())) {
GCResource gcResource = (GCResource) evt.getSource();
updateModel(gcResource);
updateTabDisplay(gcResource);
}
}
use of com.tagtraum.perf.gcviewer.model.GCResource 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()));
}
Aggregations