use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class InitialVersionReader method createInitialVersion.
private InitialVersion createInitialVersion() {
int jdkversion = dependencyManager.getExecutor().getJDKVersion();
final InitialVersion initialversion = new InitialVersion();
initialversion.setVersion(iterator.getTag());
initialversion.setJdk(jdkversion);
LOG.debug("Starting writing: {}", dependencyMap.getDependencyMap().size());
for (final Entry<TestCase, CalledMethods> dependencyEntry : dependencyMap.getDependencyMap().entrySet()) {
final TestCase testcase = dependencyEntry.getKey();
for (final Map.Entry<ChangedEntity, Set<String>> calledClassEntry : dependencyEntry.getValue().getCalledMethods().entrySet()) {
final ChangedEntity dependentclass = calledClassEntry.getKey();
if (!dependentclass.getJavaClazzName().contains("junit") && !dependentclass.getJavaClazzName().contains("log4j")) {
for (final String dependentmethod : calledClassEntry.getValue()) {
final ChangedEntity callee = new ChangedEntity(dependentclass.getClazz(), dependentclass.getModule(), dependentmethod);
initialversion.addDependency(testcase, callee);
}
}
}
initialversion.sort(testcase);
}
return initialversion;
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class InitialVersionReader method readInitialVersion.
public boolean readInitialVersion() throws IOException, InterruptedException, XmlPullParserException {
if (!dependencyManager.initialyGetTraces(iterator.getTag())) {
return false;
}
final InitialVersion initialversion = createInitialVersion();
dependencyResult.setInitialversion(initialversion);
return true;
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class InitialVersionReader method readCompletedVersions.
public void readCompletedVersions() {
fillInitialTestDependencies();
checkCorrectness();
final InitialVersion initialversion = createInitialVersion();
dependencyResult.setInitialversion(initialversion);
if (dependencyResult.getVersions().size() > 0) {
for (final Map.Entry<String, VersionStaticSelection> version : dependencyResult.getVersions().entrySet()) {
String tag = version.getKey();
String startTag = iterator.getTag();
if (VersionComparator.isBefore(tag, startTag) || tag.equals(startTag)) {
addVersionTestDependencies(version.getValue());
}
}
}
checkCorrectness();
LOG.debug("Analyzing {} commits", iterator.getRemainingSize());
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class TestDependencies method testOnlyStartversion.
@Test
public void testOnlyStartversion() {
StaticTestSelection dependencies = new StaticTestSelection();
dependencies.setInitialversion(new InitialVersion());
dependencies.getInitialversion().setVersion("0");
String[] versionNames = dependencies.getVersionNames();
Assert.assertEquals("0", versionNames[0]);
Assert.assertEquals("0", dependencies.getNewestVersion());
}
use of de.dagere.peass.dependency.persistence.InitialVersion in project peass by DaGeRe.
the class TestDependencies method testWithVersions.
@Test
public void testWithVersions() {
StaticTestSelection dependencies = new StaticTestSelection();
dependencies.setInitialversion(new InitialVersion());
dependencies.getInitialversion().setVersion("0");
dependencies.getVersions().put("1", new VersionStaticSelection());
dependencies.getVersions().put("2", new VersionStaticSelection());
dependencies.getVersions().put("3", new VersionStaticSelection());
String[] versionNames = dependencies.getVersionNames();
Assert.assertEquals("0", versionNames[0]);
Assert.assertEquals("1", versionNames[1]);
Assert.assertEquals("2", versionNames[2]);
Assert.assertEquals("3", versionNames[3]);
Assert.assertEquals("3", dependencies.getNewestVersion());
}
Aggregations