// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/engine/TestRunner.java
// public interface TestRunner {
// 
//     @NotNull
//     RunResult run(@NotNull CompilationResult compilationResult);
// 
//     default void run(@NotNull CompilationResult compilationResult, @NotNull Expectation<RunResult> expectation) {
//         expectation.match(run(compilationResult));
//     }
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/ClassFile.java
// public interface ClassFile {
// 
//     @NotNull String getName();
// 
//     @NotNull byte[] getBinaries();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/CompilationResult.java
// public interface CompilationResult extends Result<Collection<TestSource>> {
// 
//     /**
//      * @return      compiled classes. We use a {@link Supplier} here because there is a possible case that
//      *              compilation is failed and the test wants to check its {@code stderr}. We return a collection
//      *              of {@link ClassFile} because a single source file might result in multiple binaries after
//      *              compilation, e.g. when an inner/anonymous classes are involved
//      */
//     @NotNull
//     Supplier<Collection<ClassFile>> getCompiledClassesSupplier();
// 
//     /**
//      * @return      compiler's output generated during processing {@link #getInput() target binaries}
//      */
//     @NotNull
//     String getCompilationOutput();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/RunResult.java
// public interface RunResult extends Result<CompilationResult> {
// 
//     @NotNull
//     Optional<Throwable> getException();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/TestSource.java
// public interface TestSource {
// 
//     /**
//      * @return  complete test source
//      */
//     @NotNull
//     String getSourceText();
// 
//     /**
//      * @return  qualified class name for the given test source
//      */
//     @NotNull
//     String getQualifiedClassName();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/impl/model/RunResultImpl.java
// public class RunResultImpl implements RunResult {
// 
//     @NotNull private final  CompilationResult input;
//     @Nullable private final Throwable         exception;
// 
//     public RunResultImpl(@NotNull CompilationResult input, @Nullable Throwable exception) {
//         this.input = input;
//         this.exception = exception;
//     }
// 
//     @Override
//     @NotNull
//     public Optional<Throwable> getException() {
//         return Optional.ofNullable(exception);
//     }
// 
//     @NotNull
//     @Override
//     public CompilationResult getInput() {
//         return input;
//     }
// }
// 
// Path: core/common/src/main/java/tech/harmonysoft/oss/traute/common/util/TrauteConstants.java
// public static final String PACKAGE_INFO = "package-info";


import org.jetbrains.annotations.NotNull;
import tech.harmonysoft.oss.traute.test.api.engine.TestRunner;
import tech.harmonysoft.oss.traute.test.api.model.ClassFile;
import tech.harmonysoft.oss.traute.test.api.model.CompilationResult;
import tech.harmonysoft.oss.traute.test.api.model.RunResult;
import tech.harmonysoft.oss.traute.test.api.model.TestSource;
import tech.harmonysoft.oss.traute.test.impl.model.RunResultImpl;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Map;
import static java.util.stream.Collectors.toMap;
import static tech.harmonysoft.oss.traute.common.util.TrauteConstants.PACKAGE_INFO;
package tech.harmonysoft.oss.traute.test.impl.engine;




public class TrauteInMemoryTestRunner implements TestRunner {

    public static final TrauteInMemoryTestRunner INSTANCE = new TrauteInMemoryTestRunner();

    /** Arguments to call {@code main()} in the compiled test sources. */
    private static final Object[] MAIN_ARGUMENTS = { new String[0]};

    @Override
    @NotNull
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/engine/TestRunner.java
// public interface TestRunner {
// 
//     @NotNull
//     RunResult run(@NotNull CompilationResult compilationResult);
// 
//     default void run(@NotNull CompilationResult compilationResult, @NotNull Expectation<RunResult> expectation) {
//         expectation.match(run(compilationResult));
//     }
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/ClassFile.java
// public interface ClassFile {
// 
//     @NotNull String getName();
// 
//     @NotNull byte[] getBinaries();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/CompilationResult.java
// public interface CompilationResult extends Result<Collection<TestSource>> {
// 
//     /**
//      * @return      compiled classes. We use a {@link Supplier} here because there is a possible case that
//      *              compilation is failed and the test wants to check its {@code stderr}. We return a collection
//      *              of {@link ClassFile} because a single source file might result in multiple binaries after
//      *              compilation, e.g. when an inner/anonymous classes are involved
//      */
//     @NotNull
//     Supplier<Collection<ClassFile>> getCompiledClassesSupplier();
// 
//     /**
//      * @return      compiler's output generated during processing {@link #getInput() target binaries}
//      */
//     @NotNull
//     String getCompilationOutput();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/RunResult.java
// public interface RunResult extends Result<CompilationResult> {
// 
//     @NotNull
//     Optional<Throwable> getException();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/model/TestSource.java
// public interface TestSource {
// 
//     /**
//      * @return  complete test source
//      */
//     @NotNull
//     String getSourceText();
// 
//     /**
//      * @return  qualified class name for the given test source
//      */
//     @NotNull
//     String getQualifiedClassName();
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/impl/model/RunResultImpl.java
// public class RunResultImpl implements RunResult {
// 
//     @NotNull private final  CompilationResult input;
//     @Nullable private final Throwable         exception;
// 
//     public RunResultImpl(@NotNull CompilationResult input, @Nullable Throwable exception) {
//         this.input = input;
//         this.exception = exception;
//     }
// 
//     @Override
//     @NotNull
//     public Optional<Throwable> getException() {
//         return Optional.ofNullable(exception);
//     }
// 
//     @NotNull
//     @Override
//     public CompilationResult getInput() {
//         return input;
//     }
// }
// 
// Path: core/common/src/main/java/tech/harmonysoft/oss/traute/common/util/TrauteConstants.java
// public static final String PACKAGE_INFO = "package-info";


// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/impl/engine/TrauteInMemoryTestRunner.java
import org.jetbrains.annotations.NotNull;
import tech.harmonysoft.oss.traute.test.api.engine.TestRunner;
import tech.harmonysoft.oss.traute.test.api.model.ClassFile;
import tech.harmonysoft.oss.traute.test.api.model.CompilationResult;
import tech.harmonysoft.oss.traute.test.api.model.RunResult;
import tech.harmonysoft.oss.traute.test.api.model.TestSource;
import tech.harmonysoft.oss.traute.test.impl.model.RunResultImpl;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Map;
import static java.util.stream.Collectors.toMap;
import static tech.harmonysoft.oss.traute.common.util.TrauteConstants.PACKAGE_INFO;

package tech.harmonysoft.oss.traute.test.impl.engine;




public class TrauteInMemoryTestRunner implements TestRunner {

    public static final TrauteInMemoryTestRunner INSTANCE = new TrauteInMemoryTestRunner();

    /** Arguments to call {@code main()} in the compiled test sources. */
    private static final Object[] MAIN_ARGUMENTS = { new String[0]};

    @Override
    @NotNull
    public RunResult run(@NotNull CompilationResult compilationResult) {