use of de.dagere.peass.ci.logs.LogFileReader in project peass-ci-plugin by jenkinsci.
the class TestRCALogFileReaderMultimodule method testReading.
@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
MeasurementConfig peassDemoConfig = new MeasurementConfig(2, RTSLogFileTestUtil.VERSION, RTSLogFileTestUtil.VERSION_OLD);
VisualizationFolderManager visualizationFolders = Mockito.mock(VisualizationFolderManager.class);
Mockito.when(visualizationFolders.getPeassFolders()).thenReturn(new PeassFolders(testFolder));
Mockito.when(visualizationFolders.getPeassRCAFolders()).thenReturn(new CauseSearchFolders(testFolder));
Mockito.when(visualizationFolders.getResultsFolders()).thenReturn(new ResultsFolders(localFolder, "demo-vis2"));
LogFileReader reader = new LogFileReader(visualizationFolders, peassDemoConfig);
Map<TestCase, List<RCALevel>> rcaTestcases = reader.getRCATestcases();
List<RCALevel> levels = rcaTestcases.get(test);
Assert.assertEquals(1, levels.size());
MatcherAssert.assertThat(levels.get(0).getLogFiles(), Matchers.hasSize(3));
String rtsLog = reader.getRCALog();
Assert.assertEquals("This is a rca log test", rtsLog);
}
use of de.dagere.peass.ci.logs.LogFileReader in project peass-ci-plugin by jenkinsci.
the class TestLogFileReader method testReading.
@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
MeasurementConfig peassDemoConfig = new MeasurementConfig(2, VERSION, VERSION_OLD);
VisualizationFolderManager visualizationFolders = Mockito.mock(VisualizationFolderManager.class);
Mockito.when(visualizationFolders.getPeassFolders()).thenReturn(new PeassFolders(testFolder));
Mockito.when(visualizationFolders.getResultsFolders()).thenReturn(new ResultsFolders(localFolder, "demo-vis2"));
LogFileReader reader = new LogFileReader(visualizationFolders, peassDemoConfig);
ProjectStatistics statistics = Constants.OBJECTMAPPER.readValue(new File("src/test/resources/demo-results-logs/statistics.json"), ProjectStatistics.class);
Map<TestCase, List<LogFiles>> testcases = reader.readAllTestcases(statistics.getStatistics().get(VERSION).keySet());
Assert.assertEquals(1, testcases.size());
TestCase test = new TestCase("de.test.CalleeTest#onlyCallMethod2");
List<LogFiles> logFiles = testcases.get(test);
Assert.assertEquals(2, logFiles.size());
String measureLog = reader.getMeasureLog();
Assert.assertEquals("This is a measurement log test", measureLog);
}
use of de.dagere.peass.ci.logs.LogFileReader in project peass-ci-plugin by jenkinsci.
the class TestLogFileReader method testReadingIterationChanged.
@Test
public void testReadingIterationChanged() throws JsonParseException, JsonMappingException, IOException {
MeasurementConfig peassDemoConfig = new MeasurementConfig(2, VERSION, VERSION_OLD);
VisualizationFolderManager visualizationFolders = Mockito.mock(VisualizationFolderManager.class);
Mockito.when(visualizationFolders.getPeassFolders()).thenReturn(new PeassFolders(testFolder));
Mockito.when(visualizationFolders.getResultsFolders()).thenReturn(new ResultsFolders(localFolder, "demo-vis2"));
LogFileReader reader = new LogFileReader(visualizationFolders, peassDemoConfig);
ProjectStatistics statistics = Constants.OBJECTMAPPER.readValue(new File("src/test/resources/demo-results-logs/statistics.json"), ProjectStatistics.class);
Map<TestCase, List<LogFiles>> testcases = reader.readAllTestcases(statistics.getStatistics().get(VERSION).keySet());
Assert.assertEquals(1, testcases.size());
TestCase test = new TestCase("de.test.CalleeTest#onlyCallMethod2");
List<LogFiles> logFiles = testcases.get(test);
Assert.assertEquals(2, logFiles.size());
Assert.assertFalse(logFiles.get(0).isCurrentSuccess());
Assert.assertTrue(logFiles.get(0).isPredecessorSuccess());
Assert.assertTrue(logFiles.get(1).isCurrentSuccess());
Assert.assertTrue(logFiles.get(1).isPredecessorSuccess());
}
use of de.dagere.peass.ci.logs.LogFileReader in project peass-ci-plugin by jenkinsci.
the class TestRCALogFileReader method testReading.
@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
MeasurementConfig peassDemoConfig = new MeasurementConfig(2, RTSLogFileTestUtil.VERSION, RTSLogFileTestUtil.VERSION_OLD);
VisualizationFolderManager visualizationFolders = Mockito.mock(VisualizationFolderManager.class);
Mockito.when(visualizationFolders.getPeassFolders()).thenReturn(new PeassFolders(testFolder));
Mockito.when(visualizationFolders.getPeassRCAFolders()).thenReturn(new CauseSearchFolders(testFolder));
Mockito.when(visualizationFolders.getResultsFolders()).thenReturn(new ResultsFolders(localFolder, "demo-vis2"));
LogFileReader reader = new LogFileReader(visualizationFolders, peassDemoConfig);
TestCase test = new TestCase("de.test.CalleeTest#onlyCallMethod2");
Map<TestCase, List<RCALevel>> rcaTestcases = reader.getRCATestcases();
List<RCALevel> levels = rcaTestcases.get(test);
Assert.assertEquals(1, levels.size());
MatcherAssert.assertThat(levels.get(0).getLogFiles(), Matchers.hasSize(3));
String rtsLog = reader.getRCALog();
Assert.assertEquals("This is a rca log test", rtsLog);
}
Aggregations