use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderFacade method testLoadModel_forSeries.
@Test
public void testLoadModel_forSeries() 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.loadModelFromSeries(series);
assertThat(result.toString(), is(expectedModel.toString()));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderFacade method loadModelStringFileExistsNoWarnings.
/**
* Tests {@link DataReaderFacade#loadModel(GCResource)}
* with filename that does exist.
*/
@Test
public void loadModelStringFileExistsNoWarnings() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile(PARENT_PATH + SAMPLE_GCLOG_SUN1_6_0);
gcResource.getLogger().addHandler(handler);
final GCModel model = dataReaderFacade.loadModel(gcResource);
assertEquals("has no errors", 0, handler.getCount());
assertNotNull("Model returned", model);
assertNotNull("Model returned contains URL", model.getURL());
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderIBM_J9_R28 method testConcurrentMinimal.
@Test
public void testConcurrentMinimal() throws Exception {
// there are minimal concurrent blocks, that don't contain any information, that the parser can use (at least, at the moment)
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleIBMJ9_R28_concurrentMinimal.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("model size", model.size(), is(0));
assertThat("number of errors", handler.getCount(), is(0));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderIBM_J9_R28 method testConcurrentCollection.
@Test
@Ignore
public void testConcurrentCollection() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleIBMJ9_R28_concurrent_collection.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("model size", model.size(), is(1));
assertThat("duration", model.get(0).getPause(), closeTo(1.182375, 0.00000001));
assertThat("number of errors", handler.getCount(), is(0));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderIBM_J9_R28 method testSysGlobal.
@Test
public void testSysGlobal() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleIBMJ9_R28_sys_global.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("model size", model.size(), is(1));
GCEvent event = (GCEvent) model.get(0);
assertThat("pause", event.getPause(), closeTo(0.097756, 0.0000001));
assertThat("type", event.getTypeAsString(), equalTo("sys explicit global; nursery; tenure"));
assertThat("number of errors", handler.getCount(), is(0));
}
Aggregations