Search in sources :

Example 11 with ClazzFileFinder

use of de.dagere.peass.dependency.ClazzFileFinder in project peass by DaGeRe.

the class JUnitTestShortener method shortenParent.

public void shortenParent(final File module, final ChangedEntity callee, final File calleeClazzFile, final CompilationUnit calleeUnit, final ClassOrInterfaceDeclaration clazz) throws IOException {
    LOG.debug("Shortening: {}", callee);
    if (clazz.getExtendedTypes().size() > 0) {
        final ChangedEntity parentEntity = getParentEntity(callee, calleeUnit, clazz);
        ClazzFileFinder finder = new ClazzFileFinder(transformer.getConfig().getExecutionConfig());
        final File parentClazzFile = finder.getClazzFile(module, parentEntity);
        if (parentClazzFile != null) {
            shortenTestClazz(parentEntity, parentClazzFile);
        }
        final int version = transformer.getVersion(calleeClazzFile);
        if (version == 3 || version == 34) {
            final String simpleClazzName = callee.getSimpleClazzName();
            addSuperclasses(simpleClazzName);
        }
    }
}
Also used : ClazzFileFinder(de.dagere.peass.dependency.ClazzFileFinder) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File)

Aggregations

ClazzFileFinder (de.dagere.peass.dependency.ClazzFileFinder)11 File (java.io.File)8 CompilationUnit (com.github.javaparser.ast.CompilationUnit)4 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)4 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)4 ClassOrInterfaceDeclaration (com.github.javaparser.ast.body.ClassOrInterfaceDeclaration)2 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)2 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)2 LinkedList (java.util.LinkedList)2 Test (org.junit.jupiter.api.Test)2 MethodDeclaration (com.github.javaparser.ast.body.MethodDeclaration)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1