use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class VisualizeRCA method analyzeFile.
private void analyzeFile(final File versionResultFolder, final File treeFile) throws JsonParseException, JsonMappingException, IOException, JsonProcessingException, FileNotFoundException, JAXBException {
final CauseSearchFolders folders = getCauseSearchFolders(treeFile);
final RCAGenerator rcaGenerator = new RCAGenerator(treeFile, versionResultFolder, folders);
final File propertyFolder = getPropertyFolder(projectName);
rcaGenerator.setPropertyFolder(propertyFolder);
if (visualizeFull) {
final CauseSearchData data = rcaGenerator.getData();
final File treeFolder = folders.getTreeCacheFolder(data.getMeasurementConfig().getExecutionConfig().getVersion(), data.getCauseConfig().getTestCase());
getFullTree(rcaGenerator, data, treeFolder);
}
rcaGenerator.createVisualization();
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class RCALevelContinueStarter method call.
@Override
public Void call() throws Exception {
final CauseSearchFolders folders = new CauseSearchFolders(projectFolder);
final File resultFile = getResultFile(folders);
final File resultFileFull = getFullResultFile(folders);
if (resultFile != null && resultFileFull != null) {
final CauseSearchData data = Constants.OBJECTMAPPER.readValue(resultFile, CauseSearchData.class);
final CauseSearchData dataFull = Constants.OBJECTMAPPER.readValue(resultFileFull, CauseSearchData.class);
final CauseSearchFolders alternateFolders = createAlternateFolders(folders);
final BothTreeReader reader = new BothTreeReader(data.getCauseConfig(), data.getMeasurementConfig(), folders, new EnvironmentVariables());
reader.readCachedTrees();
CausePersistenceManager persistenceManager = new CausePersistenceManager(data, dataFull, alternateFolders);
EnvironmentVariables emptyEnv = new EnvironmentVariables();
final CauseTester measurer = new CauseTester(alternateFolders, data.getMeasurementConfig(), data.getCauseConfig(), emptyEnv);
final LevelCauseSearcher tester = new LevelCauseSearcher(measurer, persistenceManager, emptyEnv);
final List<CallTreeNode> currentVersionNodeList = new LinkedList<>();
final List<CallTreeNode> currentPredecessorNodeList = new LinkedList<>();
new LevelManager(currentVersionNodeList, currentPredecessorNodeList, reader).goToLastMeasuredLevel(data.getNodes());
tester.isLevelDifferent(currentPredecessorNodeList, currentVersionNodeList);
}
return null;
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class RCALevelContinueStarter method createAlternateFolders.
private CauseSearchFolders createAlternateFolders(final CauseSearchFolders folders) throws InterruptedException, IOException {
final File nowFolder = new File(folders.getTempProjectFolder(), "continue");
GitUtils.clone(folders, nowFolder);
final CauseSearchFolders alternateFolders = new CauseSearchFolders(nowFolder);
return alternateFolders;
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class CauseSearcherIT method testSlowerState.
@Test
public void testSlowerState() throws InterruptedException, IOException, IllegalStateException, XmlPullParserException, AnalysisConfigurationException, ViewNotFoundException, JAXBException {
try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
MockedStatic<GitUtils> mockedGitUtils = Mockito.mockStatic(GitUtils.class)) {
mockEnvironment(mockedVCS, mockedGitUtils);
final MeasurementConfig measurementConfiguration = new MeasurementConfig(5, VERSION, "000001~1");
measurementConfiguration.setUseKieker(true);
final CauseSearcherConfig causeSearcherConfig = CAUSE_CONFIG_TESTME_COMPLETE;
final CauseSearchFolders folders = new CauseSearchFolders(DependencyTestConstants.CURRENT);
final BothTreeReader reader = new BothTreeReader(causeSearcherConfig, measurementConfiguration, folders, new EnvironmentVariables());
EnvironmentVariables emptyEnv = new EnvironmentVariables();
final CauseTester measurer = new CauseTester(folders, measurementConfiguration, causeSearcherConfig, emptyEnv);
final CauseSearcher searcher = new CauseSearcherComplete(reader, causeSearcherConfig, measurer, measurementConfiguration, folders, emptyEnv);
final Set<ChangedEntity> changedEntities = searcher.search();
checkChangelistContainsChild12(changedEntities);
File expectedResultLogFolder = folders.getExistingRCALogFolder(VERSION, TESTCASE, 0);
File expectedResultLogFile = new File(expectedResultLogFolder, "vm_0_" + VERSION);
Assert.assertTrue("File " + expectedResultLogFolder.getAbsolutePath() + " does not exist ", expectedResultLogFolder.exists());
Assert.assertTrue("File " + expectedResultLogFile.getAbsolutePath() + " does not exist ", expectedResultLogFile.exists());
}
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class TestCausePersistenceManager method testCallTreeToMeasuredNode.
@Test
public void testCallTreeToMeasuredNode() throws Exception {
final CauseSearchFolders folders = new CauseSearchFolders(TestConstants.CURRENT_FOLDER);
testConfig(folders, TestConstants.SIMPLE_MEASUREMENT_CONFIG);
}
Aggregations