use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class TestMerging method testMerging.
@Test
public void testMerging() {
List<GitCommit> commits = ParallelTestUtil.getCommits();
VersionComparator.setVersions(commits);
StaticTestSelection deps1 = new StaticTestSelection(), deps2 = new StaticTestSelection();
deps1.setInitialversion(new InitialVersion());
deps1.getInitialversion().setVersion("0");
for (GitCommit commit : commits.subList(1, 6)) {
deps1.getVersions().put(commit.getTag(), null);
}
deps2.setInitialversion(new InitialVersion());
deps2.getInitialversion().setVersion("5");
for (GitCommit commit : commits.subList(5, 10)) {
deps2.getVersions().put(commit.getTag(), null);
}
StaticTestSelection merged = DependencyReaderUtil.mergeDependencies(deps1, deps2);
Assert.assertEquals(9, merged.getVersions().size());
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class TestMerging method testMergingStrangeDistribution.
@Test
public void testMergingStrangeDistribution() {
List<GitCommit> commits = ParallelTestUtil.getCommits();
VersionComparator.setVersions(commits);
StaticTestSelection deps1 = new StaticTestSelection(), deps2 = new StaticTestSelection();
deps1.setInitialversion(new InitialVersion());
deps1.getInitialversion().setVersion("0");
for (GitCommit commit : commits.subList(1, 8)) {
deps1.getVersions().put(commit.getTag(), null);
}
deps2.setInitialversion(new InitialVersion());
deps2.getInitialversion().setVersion("7");
for (GitCommit commit : commits.subList(8, 10)) {
deps2.getVersions().put(commit.getTag(), null);
}
StaticTestSelection merged = DependencyReaderUtil.mergeDependencies(deps1, deps2);
Assert.assertEquals(9, merged.getVersions().size());
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class TestMerging method testAlphabetic.
@Test
public void testAlphabetic() {
List<GitCommit> commits = new LinkedList<>();
commits.add(new GitCommit("A", "", "", ""));
commits.add(new GitCommit("C", "", "", ""));
commits.add(new GitCommit("B", "", "", ""));
commits.add(new GitCommit("G", "", "", ""));
commits.add(new GitCommit("E", "", "", ""));
commits.add(new GitCommit("F", "", "", ""));
VersionComparator.setVersions(commits);
StaticTestSelection deps1 = new StaticTestSelection(), deps2 = new StaticTestSelection();
deps1.setInitialversion(new InitialVersion());
deps1.getInitialversion().setVersion("A");
deps1.getVersions().put("C", null);
deps1.getVersions().put("B", null);
deps1.getVersions().put("G", null);
deps2.setInitialversion(new InitialVersion());
deps2.getInitialversion().setVersion("G");
deps2.getVersions().put("E", null);
deps2.getVersions().put("F", null);
StaticTestSelection merged = DependencyReaderUtil.mergeDependencies(deps1, deps2);
System.out.println(merged.getVersions().keySet());
Assert.assertEquals(5, merged.getVersions().size());
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class TestDependencies method testRunningersions.
@Test
public void testRunningersions() {
StaticTestSelection dependencies = new StaticTestSelection();
dependencies.setInitialversion(new InitialVersion());
dependencies.getInitialversion().setVersion("0");
VersionStaticSelection running1 = new VersionStaticSelection();
running1.setRunning(true);
dependencies.getVersions().put("1", running1);
VersionStaticSelection nonRunning2 = new VersionStaticSelection();
nonRunning2.setRunning(false);
dependencies.getVersions().put("2", nonRunning2);
VersionStaticSelection running3 = new VersionStaticSelection();
running3.setRunning(true);
dependencies.getVersions().put("3", running3);
String[] versionNames = dependencies.getRunningVersionNames();
Assert.assertEquals("0", versionNames[0]);
Assert.assertEquals("1", versionNames[1]);
Assert.assertEquals("3", versionNames[2]);
Assert.assertEquals("3", dependencies.getNewestVersion());
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class TestContinuousDependencyReader method testNoChangeHappened.
@Test
public void testNoChangeHappened() throws JsonGenerationException, JsonMappingException, IOException {
ResultsFolders resultsFolders = new ResultsFolders(new File("target/current_results"), "current");
StaticTestSelection value = new StaticTestSelection();
value.setInitialversion(new InitialVersion());
value.getVersions().put("A", new VersionStaticSelection());
Constants.OBJECTMAPPER.writeValue(resultsFolders.getStaticTestSelectionFile(), value);
ContinuousDependencyReader reader = new ContinuousDependencyReader(new TestSelectionConfig(1, false), new ExecutionConfig(), new KiekerConfig(), new PeassFolders(new File("target/current")), resultsFolders, new EnvironmentVariables());
reader.getDependencies(null, "git:dummyUrl");
}
Aggregations