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);
}
}
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();
}
}
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();
}
}
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"));
}
}
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());
}
}
Aggregations