use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.
the class TestResultOrganizerParallel method initFolders.
private PeassFolders initFolders() {
File parallelProjectFolder = new File(folders.getTempProjectFolder(), PARALLEL_VERSION);
PeassFolders parallelProjectFolders = new PeassFolders(parallelProjectFolder);
methodFolder = new File(parallelProjectFolders.getTempMeasurementFolder(), TestResultOrganizer.searchedTest.getClazz());
methodFolder.mkdir();
return parallelProjectFolders;
}
use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.
the class TestResultOrganizerParallel method testKoPeMeFileSaving.
@Test
public void testKoPeMeFileSaving() throws JAXBException, IOException {
organizer = new ResultOrganizerParallel(folders, TestResultOrganizer.VERSION_NAME, 1, false, false, TestResultOrganizer.searchedTest, TestResult.BOUNDARY_SAVE_FILE * 2);
PeassFolders parallelProjectFolders = initFolders();
DummyKoPeMeDataCreator.initDummyTestfile(methodFolder, TestResult.BOUNDARY_SAVE_FILE * 2, TestResultOrganizer.searchedTest);
organizer.addVersionFolders(PARALLEL_VERSION, parallelProjectFolders);
Assert.assertTrue(organizer.testSuccess("1"));
organizer.saveResultFiles(PARALLEL_VERSION, 0);
testXMLFileIsCorrect();
}
use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.
the class TestResultOrganizerParams method testReading.
@Test
public void testReading() throws JAXBException, IOException {
TestCase testcase = new TestCase("de.dagere.peass.ExampleBenchmarkClazz#calleeMethod");
PeassFolders folders = mockFolders(testcase);
for (int i = 0; i < 3; i++) {
ResultOrganizer organizer = new ResultOrganizer(folders, VERSION, 15 + i, false, false, testcase, 10);
organizer.saveResultFiles(VERSION, i);
organizer.saveResultFiles(VERSION_OLD, i);
}
File expectedResultFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1).xml");
File expectedResultFile2 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2).xml");
Assert.assertTrue(expectedResultFile1.exists());
Assert.assertTrue(expectedResultFile2.exists());
Kopemedata data = XMLDataLoader.loadData(expectedResultFile1);
List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk().get(0).getResult();
MatcherAssert.assertThat(results, IsIterableWithSize.iterableWithSize(2));
File expectedFulldataFile = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2)_0_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
Kopemedata fulldata = XMLDataLoader.loadData(expectedFulldataFile);
Assert.assertEquals(1, fulldata.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
File expectedFulldataFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1)_2_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
Kopemedata fulldata1 = XMLDataLoader.loadData(expectedFulldataFile1);
Assert.assertEquals(1, fulldata1.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
}
use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.
the class TestParallelMeasurement method testFiles.
@Test
public void testFiles() throws Exception {
try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
MockedStatic<ExecutorCreator> mockedExecutor = Mockito.mockStatic(ExecutorCreator.class);
MockedStatic<GitUtils> gitUtils = Mockito.mockStatic(GitUtils.class)) {
VCSTestUtils.mockGetVCS(mockedVCS);
VCSTestUtils.mockGoToTagEmpty(gitUtils);
final PeassFolders folders = new PeassFolders(folder.getRoot());
final MeasurementConfig configuration = new MeasurementConfig(4, "2", "1");
configuration.setMeasurementStrategy(MeasurementStrategy.PARALLEL);
MavenTestExecutorMocker.mockExecutor(mockedExecutor, folders, configuration);
DependencyTester spiedTester = createTesterNoThreads(folders, configuration);
spiedTester.evaluate(TestDependencyTester.EXAMPLE_TESTCASE);
TestDependencyTester.checkResult(folders);
}
}
use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.
the class ParallelExecutionRunnable method cloneProjectFolder.
private PeassFolders cloneProjectFolder() throws IOException, InterruptedException {
PeassFolders temporaryFolders = tester.getFolders().getTempFolder("parallel_" + version);
organizer.addVersionFolders(version, temporaryFolders);
return temporaryFolders;
}
Aggregations