All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pitest.classpath.CodeSource Maven / Gradle / Ivy

There is a newer version: 1.17.1
Show newest version
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);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy