use of de.dagere.peass.ci.logs.RTSLogFileReader in project peass-ci-plugin by jenkinsci.
the class RTSLogFileTestUtil method initializeReader.
RTSLogFileReader initializeReader() {
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, projectName));
RTSLogFileReader reader = new RTSLogFileReader(visualizationFolders, peassDemoConfig);
return reader;
}
use of de.dagere.peass.ci.logs.RTSLogFileReader in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReader method testReading.
@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
RTSLogFileReader reader = util.initializeReader();
Map<String, File> testcases = reader.findProcessSuccessRuns();
Assert.assertEquals(1, testcases.size());
File testRunningFile = testcases.get("a23e385264c31def8dcda86c3cf64faa698c62d8");
Assert.assertTrue(testRunningFile.exists());
Assert.assertTrue(reader.isLogsExisting());
Map<TestCase, RTSLogData> rtsVmRuns = reader.getRtsVmRuns("a23e385264c31def8dcda86c3cf64faa698c62d8");
Assert.assertEquals(2, rtsVmRuns.size());
checkFirstTest(rtsVmRuns);
checkSecondTest(reader);
String rtsLog = reader.getRTSLog();
Assert.assertEquals("This is a rts log test", rtsLog);
}
use of de.dagere.peass.ci.logs.RTSLogFileReader in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReaderMultimodule method testReading.
@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
RTSLogFileReader reader = util.initializeReader();
Map<String, File> testcases = reader.findProcessSuccessRuns();
Assert.assertEquals(1, testcases.size());
File testRunningFile = testcases.get(RTSLogFileTestUtil.VERSION);
Assert.assertTrue(testRunningFile.exists());
Assert.assertTrue(reader.isLogsExisting());
Map<TestCase, RTSLogData> rtsVmRuns = reader.getRtsVmRuns(RTSLogFileTestUtil.VERSION);
Assert.assertEquals(2, rtsVmRuns.size());
File dataFile1 = rtsVmRuns.get(TestRTSLogFileReader.TEST1).getMethodFile();
Assert.assertTrue(dataFile1.exists());
RTSLogData logDataTest2 = rtsVmRuns.get(TestRTSLogFileReader.TEST2);
File dataFile2 = logDataTest2.getMethodFile();
Assert.assertTrue(dataFile2.exists());
Assert.assertFalse(logDataTest2.isSuccess());
Map<TestCase, RTSLogData> rtsVmRunsPredecessor = reader.getRtsVmRuns(RTSLogFileTestUtil.VERSION_OLD);
Assert.assertEquals(2, rtsVmRunsPredecessor.size());
RTSLogData rtsLogData = rtsVmRunsPredecessor.get(TestRTSLogFileReader.TEST1);
Assert.assertEquals(RTSLogFileTestUtil.VERSION_OLD, rtsLogData.getVersion());
Assert.assertTrue(rtsLogData.isSuccess());
String rtsLog = reader.getRTSLog();
Assert.assertEquals("This is a rts log test", rtsLog);
}
use of de.dagere.peass.ci.logs.RTSLogFileReader in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReaderParameterized method testParameterizedReading.
@Test
public void testParameterizedReading() {
VisualizationFolderManager visualizationFoldersMock = Mockito.mock(VisualizationFolderManager.class);
Mockito.when(visualizationFoldersMock.getResultsFolders()).thenReturn(new ResultsFolders(currentDir, "parameterized-demo"));
Mockito.when(visualizationFoldersMock.getPeassFolders()).thenReturn(new PeassFolders(new File(currentDir, "parameterized-demo_peass")));
MeasurementConfig measurementConfig = Mockito.mock(MeasurementConfig.class);
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.setVersion(VERSION);
executionConfig.setVersionOld(VERSION_OLD);
Mockito.when(measurementConfig.getExecutionConfig()).thenReturn(executionConfig);
RTSLogFileReader reader = new RTSLogFileReader(visualizationFoldersMock, measurementConfig);
Map<TestCase, RTSLogData> rtsVmRuns = reader.getRtsVmRuns(VERSION);
RTSLogData data = rtsVmRuns.get(new TestCase("de.dagere.peass.ExampleTest", "test", "", "JUNIT_PARAMETERIZED-1"));
Assert.assertNotNull(data);
Assert.assertFalse(data.isParameterizedWithoutIndex());
Assert.assertTrue(data.isSuccess());
Map<TestCase, RTSLogData> rtsVmRunsPredecessor = reader.getRtsVmRuns(VERSION_OLD);
RTSLogData dataImplicitParameterized = rtsVmRunsPredecessor.get(new TestCase("de.dagere.peass.ExampleTest", "test", ""));
Assert.assertNotNull(dataImplicitParameterized);
Assert.assertTrue(dataImplicitParameterized.isParameterizedWithoutIndex());
Assert.assertFalse(dataImplicitParameterized.isSuccess());
}
use of de.dagere.peass.ci.logs.RTSLogFileReader in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReader method testReadingOnlyOverviewExists.
@Test
public void testReadingOnlyOverviewExists() throws IOException {
FileUtils.deleteDirectory(RTSLogFileTestUtil.testFolder);
RTSLogFileReader reader = util.initializeReader();
Assert.assertTrue(reader.isLogsExisting());
}
Aggregations