org.pitest.classpath.CodeSource Maven / Gradle / Ivy
package org.pitest.classpath;
import java.util.Collection;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
import org.pitest.bytecode.analysis.ClassTree;
import org.pitest.classinfo.ClassByteArraySource;
import org.pitest.classinfo.ClassHash;
import org.pitest.classinfo.ClassHashSource;
import org.pitest.classinfo.ClassName;
/**
* Provides access to code and tests on the classpath
*/
public interface CodeSource extends ClassHashSource, ClassByteArraySource {
Stream codeTrees();
default Set getAllClassAndTestNames() {
final Set names = new HashSet<>();
names.addAll(getCodeUnderTestNames());
names.addAll(getTestClassNames());
return names;
}
Set getCodeUnderTestNames();
Set getTestClassNames();
Stream testTrees();
ClassPath getClassPath();
Optional findTestee(String className);
Optional fetchClassBytes(ClassName clazz);
Optional fetchClassHash(ClassName clazz);
Collection fetchClassHashes(Collection classes);
@Override
Optional getBytes(String clazz);
}