use of de.dagere.peass.vcs.GitUtils in project peass by DaGeRe.
the class JmhDependencyReaderTest method testVersionReading.
@ParameterizedTest
@ArgumentsSource(KiekerConfigurationProvider.class)
public void testVersionReading(final KiekerConfig kiekerConfig) throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
try (MockedStatic<GitUtils> gitUtilsMock = Mockito.mockStatic(GitUtils.class)) {
FakeGitUtil.prepareGitUtils(gitUtilsMock);
FakeFileIterator iterator = mockIterator();
ResultsFolders resultsFolders = new ResultsFolders(TraceGettingIT.VIEW_IT_PROJECTFOLDER, "test");
TestSelectionConfig dependencyConfig = new TestSelectionConfig(1, false, true, false);
ExecutionConfig jmhConfig = new ExecutionConfig();
jmhConfig.setTestTransformer("de.dagere.peass.dependency.jmh.JmhTestTransformer");
jmhConfig.setTestExecutor("de.dagere.peass.dependency.jmh.JmhTestExecutor");
DependencyReader reader = new DependencyReader(dependencyConfig, new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, "", iterator, new VersionKeeper(new File("/dev/null")), jmhConfig, kiekerConfig, new EnvironmentVariables());
reader.readInitialVersion();
checkInitialVersion(resultsFolders);
reader.readDependencies();
checkChangedVersion(resultsFolders);
}
}
use of de.dagere.peass.vcs.GitUtils 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.GitUtils 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.GitUtils 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.GitUtils 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