use of com.tagtraum.perf.gcviewer.ctrl.impl.GCViewerGuiController in project GCViewer by chewiebug.
the class GCViewerTest method singleArgumentOpensGui.
@Test
public void singleArgumentOpensGui() throws Exception {
GCViewerGuiController controller = mock(GCViewerGuiController.class);
GCViewer gcViewer = new GCViewer(controller, new GCViewerArgsParser());
String[] args = { "some_gc.log" };
gcViewer.doMain(args);
verify(controller).startGui(new GcResourceFile("some_gc.log"));
assertThat(outContent.toString(), isEmptyString());
assertThat(errContent.toString(), isEmptyString());
}
use of com.tagtraum.perf.gcviewer.ctrl.impl.GCViewerGuiController in project GCViewer by chewiebug.
the class GCViewerTest method moreThan3ArgumentsPrintsUsage.
@Test
public void moreThan3ArgumentsPrintsUsage() throws Exception {
GCViewerGuiController controller = mock(GCViewerGuiController.class);
GCViewer gcViewer = new GCViewer(controller, new GCViewerArgsParser());
String[] args = { "argument1", "argument2", "argument3", "argument4" };
gcViewer.doMain(args);
verify(controller, never()).startGui(any(GCResource.class));
assertThat(outContent.toString(), containsString("Welcome to GCViewer with cmdline"));
assertThat(errContent.toString(), isEmptyString());
}
use of com.tagtraum.perf.gcviewer.ctrl.impl.GCViewerGuiController 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());
}
Aggregations