use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.
the class TestGCResourceGroup method testGetGCResourceList_SeveralSeries.
@Test
public void testGetGCResourceList_SeveralSeries() throws Exception {
File file1 = temporaryFolder.newFile();
File file2 = temporaryFolder.newFile();
File file3 = temporaryFolder.newFile();
List<GCResource> resourcesForSeries1 = Arrays.asList(new GcResourceFile(file1), new GcResourceFile(file2), new GcResourceFile(file3));
File file4 = temporaryFolder.newFile();
File file5 = temporaryFolder.newFile();
File file6 = temporaryFolder.newFile();
String resourceNameGroup1 = file1.toURI().toURL().toString() + ">" + file2.toURI().toURL().toString() + ">" + file3.toURI().toURL().toString();
String resourceNameGroup2 = file4.toURI().toURL().toString() + ">" + file5.toURI().toURL().toString() + ">" + file6.toURI().toURL().toString();
GCResourceGroup group = new GCResourceGroup(resourceNameGroup1 + ";" + resourceNameGroup2);
List<GCResource> resourcesForSeries2 = Arrays.asList(new GcResourceFile(file4), new GcResourceFile(file5), new GcResourceFile(file6));
assertThat(group.getGCResourceList(), contains(new GcResourceSeries(resourcesForSeries1), new GcResourceSeries(resourcesForSeries2)));
}
use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.
the class GCModelLoaderControllerImpl method openAsSeries.
@Override
public void openAsSeries(List<GCResource> gcResourceList) {
GcResourceSeries resourceSeries = new GcResourceSeries(gcResourceList);
GCModelLoader loader = GCModelLoaderFactory.createFor(resourceSeries);
openGCResource(loader.getGcResource(), loader);
getRecentGCResourcesModel().add(Collections.singletonList(resourceSeries));
}
use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.
the class GCViewerTest method singleArgumentWithSeriesOpensGui.
@Test
public void singleArgumentWithSeriesOpensGui() throws Exception {
GCViewerGuiController controller = mock(GCViewerGuiController.class);
GCViewer gcViewer = new GCViewer(controller, new GCViewerArgsParser());
String[] args = { "some_gc.log.0;some_gc.log.1;some_gc.log.2" };
gcViewer.doMain(args);
verify(controller).startGui(new GcResourceSeries(Arrays.asList(new GcResourceFile("some_gc.log.0"), new GcResourceFile("some_gc.log.1"), new GcResourceFile("some_gc.log.2"))));
assertThat(outContent.toString(), isEmptyString());
assertThat(errContent.toString(), isEmptyString());
}
use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.
the class TestGCModelLoaderController method open_GcResourceSeries.
@Test
public void open_GcResourceSeries() throws Exception {
List<GCResource> resources = getGcResourcesForSeries();
GCResource series = new GcResourceSeries(resources);
controller.open(series);
assertThat(getOpenResources(), contains(series));
}
use of com.tagtraum.perf.gcviewer.model.GcResourceSeries in project GCViewer by chewiebug.
the class TestGCViewerArgsParser method onlyGcLogSeries.
@Test
public void onlyGcLogSeries() throws Exception {
String[] args = { "some_gc.log.0;some_gc.log.1;some_gc.log.2" };
GCViewerArgsParser gcViewerArgsParser = new GCViewerArgsParser();
gcViewerArgsParser.parseArguments(args);
assertEquals(gcViewerArgsParser.getArgumentCount(), 1);
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.getType(), DataWriterType.SUMMARY);
}
Aggregations