Search in sources :

Example 1 with VersionControlSystem

use of de.dagere.peass.vcs.VersionControlSystem 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);
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) TestDependencyTester(de.dagere.peass.measurement.analysis.TestDependencyTester) DependencyTester(de.dagere.peass.measurement.dependencyprocessors.DependencyTester) GitUtils(de.dagere.peass.vcs.GitUtils) ExecutorCreator(de.dagere.peass.dependency.ExecutorCreator) VersionControlSystem(de.dagere.peass.vcs.VersionControlSystem) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.Test)

Example 2 with VersionControlSystem

use of de.dagere.peass.vcs.VersionControlSystem in project peass by DaGeRe.

the class AdaptiveExecutorMoreParameterIT method testOneMethodExecution.

@Test
public void testOneMethodExecution() throws IOException, XmlPullParserException, InterruptedException, ViewNotFoundException, AnalysisConfigurationException, JAXBException {
    try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
        MockedStatic<GitUtils> mockedGitUtils = Mockito.mockStatic(GitUtils.class)) {
        VCSTestUtils.mockGetVCS(mockedVCS);
        VCSTestUtils.mockGoToTagAny(mockedGitUtils, SOURCE_DIR);
        CauseSearchFolders folders = new CauseSearchFolders(projectFolder);
        executor = new CauseTester(folders, TestConstants.SIMPLE_MEASUREMENT_CONFIG_KIEKER, TestConstants.SIMPLE_CAUSE_CONFIG_TESTME, new EnvironmentVariables());
        testSuccessfull();
    }
}
Also used : CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) GitUtils(de.dagere.peass.vcs.GitUtils) VersionControlSystem(de.dagere.peass.vcs.VersionControlSystem) Test(org.junit.Test)

Example 3 with VersionControlSystem

use of de.dagere.peass.vcs.VersionControlSystem in project peass by DaGeRe.

the class AdaptiveExecutorMoreParameterIT method testFullMethodExecution.

@Test
public void testFullMethodExecution() throws IOException, XmlPullParserException, InterruptedException, ViewNotFoundException, AnalysisConfigurationException, JAXBException {
    try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
        MockedStatic<GitUtils> mockedGitUtils = Mockito.mockStatic(GitUtils.class)) {
        VCSTestUtils.mockGetVCS(mockedVCS);
        VCSTestUtils.mockGoToTagAny(mockedGitUtils, SOURCE_DIR);
        CauseSearchFolders folders = new CauseSearchFolders(projectFolder);
        executor = new CauseTester(folders, TestConstants.SIMPLE_MEASUREMENT_CONFIG_KIEKER, FULL_CASE_CONFIG, new EnvironmentVariables());
        testSuccessfull();
    }
}
Also used : CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) GitUtils(de.dagere.peass.vcs.GitUtils) VersionControlSystem(de.dagere.peass.vcs.VersionControlSystem) Test(org.junit.Test)

Example 4 with VersionControlSystem

use of de.dagere.peass.vcs.VersionControlSystem in project peass by DaGeRe.

the class AdaptiveExecutorTest method testOneMethodExecution.

@Test
public void testOneMethodExecution() throws IOException, XmlPullParserException, InterruptedException, ViewNotFoundException, AnalysisConfigurationException, JAXBException {
    try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
        MockedStatic<GitUtils> mockedGitUtils = Mockito.mockStatic(GitUtils.class)) {
        VCSTestUtils.mockGetVCS(mockedVCS);
        VCSTestUtils.mockGoToTagAny(mockedGitUtils, SOURCE_DIR);
        final CallTreeNode nodeWithDuration = new CallTreeNode("defaultpackage.NormalDependency#child1", "public void defaultpackage.NormalDependency.child1()", "public void defaultpackage.NormalDependency.child1()", new MeasurementConfig(5));
        measureNode(nodeWithDuration);
        executor.getDurations(0);
        Assert.assertEquals(2, nodeWithDuration.getStatistics("000001").getN());
        Assert.assertEquals(2, nodeWithDuration.getStatistics("000001~1").getN());
        Assert.assertEquals(8, nodeWithDuration.getCallCount("000001"));
        Assert.assertEquals(8, nodeWithDuration.getCallCount("000001~1"));
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) GitUtils(de.dagere.peass.vcs.GitUtils) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode) VersionControlSystem(de.dagere.peass.vcs.VersionControlSystem) Test(org.junit.Test)

Example 5 with VersionControlSystem

use of de.dagere.peass.vcs.VersionControlSystem in project peass by DaGeRe.

the class AdaptiveExecutorTest method testConstructorExecution.

@Test
public void testConstructorExecution() throws IOException, XmlPullParserException, InterruptedException, ViewNotFoundException, AnalysisConfigurationException, JAXBException {
    try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
        MockedStatic<GitUtils> mockedGitUtils = Mockito.mockStatic(GitUtils.class)) {
        VCSTestUtils.mockGetVCS(mockedVCS);
        VCSTestUtils.mockGoToTagAny(mockedGitUtils, SOURCE_DIR);
        final CallTreeNode nodeWithDuration = new CallTreeNode("defaultpackage.NormalDependency#<init>", "public new defaultpackage.NormalDependency.<init>()", "public new defaultpackage.NormalDependency.<init>()", new MeasurementConfig(5));
        measureNode(nodeWithDuration);
        executor.getDurations(1);
        Assert.assertEquals(2, nodeWithDuration.getStatistics("000001").getN());
        Assert.assertEquals(2, nodeWithDuration.getStatistics("000001~1").getN());
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) GitUtils(de.dagere.peass.vcs.GitUtils) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode) VersionControlSystem(de.dagere.peass.vcs.VersionControlSystem) Test(org.junit.Test)

Aggregations

VersionControlSystem (de.dagere.peass.vcs.VersionControlSystem)9 Test (org.junit.Test)8 GitUtils (de.dagere.peass.vcs.GitUtils)7 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)6 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)4 ExecutorCreator (de.dagere.peass.dependency.ExecutorCreator)3 CauseSearchFolders (de.dagere.peass.folders.CauseSearchFolders)3 PeassFolders (de.dagere.peass.folders.PeassFolders)2 DependencyTester (de.dagere.peass.measurement.dependencyprocessors.DependencyTester)2 CallTreeNode (de.dagere.peass.measurement.rca.data.CallTreeNode)2 File (java.io.File)2 Result (de.dagere.kopeme.generated.Result)1 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)1 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)1 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)1 ResultsFolders (de.dagere.peass.folders.ResultsFolders)1 TestDependencyTester (de.dagere.peass.measurement.analysis.TestDependencyTester)1 AdaptiveTester (de.dagere.peass.measurement.dependencyprocessors.AdaptiveTester)1 BothTreeReader (de.dagere.peass.measurement.rca.kieker.BothTreeReader)1 CauseSearcher (de.dagere.peass.measurement.rca.searcher.CauseSearcher)1