Search in sources :

Example 16 with CauseSearchFolders

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();
}
Also used : CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) CauseSearchData(de.dagere.peass.measurement.rca.data.CauseSearchData) File(java.io.File)

Example 17 with CauseSearchFolders

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;
}
Also used : CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) CausePersistenceManager(de.dagere.peass.measurement.rca.CausePersistenceManager) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) CauseTester(de.dagere.peass.measurement.rca.CauseTester) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode) CauseSearchData(de.dagere.peass.measurement.rca.data.CauseSearchData) LevelCauseSearcher(de.dagere.peass.measurement.rca.searcher.LevelCauseSearcher) LevelManager(de.dagere.peass.measurement.rca.LevelManager) BothTreeReader(de.dagere.peass.measurement.rca.kieker.BothTreeReader) File(java.io.File) LinkedList(java.util.LinkedList)

Example 18 with CauseSearchFolders

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;
}
Also used : CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) File(java.io.File)

Example 19 with CauseSearchFolders

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());
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) CauseSearcherComplete(de.dagere.peass.measurement.rca.searcher.CauseSearcherComplete) GitUtils(de.dagere.peass.vcs.GitUtils) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) BothTreeReader(de.dagere.peass.measurement.rca.kieker.BothTreeReader) VersionControlSystem(de.dagere.peass.vcs.VersionControlSystem) CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) CauseSearcher(de.dagere.peass.measurement.rca.searcher.CauseSearcher) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) File(java.io.File) Test(org.junit.Test)

Example 20 with CauseSearchFolders

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);
}
Also used : CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) Test(org.junit.jupiter.api.Test)

Aggregations

CauseSearchFolders (de.dagere.peass.folders.CauseSearchFolders)25 File (java.io.File)14 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)11 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)10 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)8 BothTreeReader (de.dagere.peass.measurement.rca.kieker.BothTreeReader)7 Test (org.junit.jupiter.api.Test)7 CauseSearcher (de.dagere.peass.measurement.rca.searcher.CauseSearcher)4 LevelCauseSearcher (de.dagere.peass.measurement.rca.searcher.LevelCauseSearcher)4 List (java.util.List)4 CauseSearcherConfig (de.dagere.peass.measurement.rca.CauseSearcherConfig)3 CallTreeNode (de.dagere.peass.measurement.rca.data.CallTreeNode)3 CauseSearchData (de.dagere.peass.measurement.rca.data.CauseSearchData)3 GitUtils (de.dagere.peass.vcs.GitUtils)3 VersionControlSystem (de.dagere.peass.vcs.VersionControlSystem)3 IOException (java.io.IOException)3 LinkedList (java.util.LinkedList)3 Test (org.junit.Test)3 VisualizationFolderManager (de.dagere.peass.ci.helper.VisualizationFolderManager)2 LogFileReader (de.dagere.peass.ci.logs.LogFileReader)2