// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/engine/TestCompiler.java
// public interface TestCompiler {
// 
//     /**
//      * Produces a {@link CompilationResult} from the given {@link TestSource}
//      *
//      * @param testSources    test sources to compile
//      * @param settings       plugin settings to use
//      * @return               compilation result
//      */
//     @NotNull
//     CompilationResult compile(@NotNull Collection<TestSource> testSources, @NotNull TrautePluginSettings settings);
// 
//     /**
//      * Behaves like {@link #compile(Collection, TrautePluginSettings)} but additionally checks
//      * resulting {@link CompilationResult} against the given {@link Expectation}
//      *
//      * @param testSources    test sources to compile
//      * @param settings       plugin settings to use
//      * @param expectation    a compilation result's expectation
//      * @return               compilation result for the given test sources
//      */
//     @NotNull
//     default CompilationResult compile(@NotNull Collection<TestSource> testSources,
//                                       @NotNull TrautePluginSettings settings,
//                                       @NotNull Expectation<CompilationResult> expectation)
//     {
//         CompilationResult result = compile(testSources, settings);
//         expectation.match(result);
//         return result;
//     }
// 
//     /**
//      * @param result    notifies that given compilation result is not needed anymore and all resources associated
//      *                  with it can be released
//      */
//     void release(@NotNull CompilationResult result);
// }
// 
// 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/suite/AbstractTrauteTest.java
// @SuppressWarnings("NullableProblems")
// @ExtendWith(TestDurationPrinter.class)
// public abstract class AbstractTrauteTest {
// 
//     public static final String ACTIVATION_PROPERTY = AbstractTrauteTest.class.getName();
// 
//     @NotNull protected TestCompiler                        compiler;
//     @NotNull protected TestRunner                          runner;
//     @NotNull protected TrautePluginSettingsBuilder         settingsBuilder;
//     @NotNull protected CompilationResultExpectationBuilder expectCompilationResult;
//     @NotNull protected RunResultExpectationBuilder         expectRunResult;
// 
//     @BeforeEach
//     public void commonSetUp() {
//         settingsBuilder = TrautePluginSettingsBuilder.settingsBuilder();
//         expectCompilationResult = CompilationResultExpectationBuilder.expectCompilationResult();
//         expectRunResult = RunResultExpectationBuilder.expectRunResult();
// 
//         Assumptions.assumeTrue(Boolean.getBoolean(ACTIVATION_PROPERTY));
//     }
// 
//     protected void doTest(@NotNull String testSource) {
//         doTest(TestUtil.QUALIFIED_CLASS_NAME, testSource);
//     }
// 
//     protected void doTest(@NotNull TestSource ... testSources) {
//         CompilationResult compilationResult = compiler.compile(asList(testSources),
//                                                                settingsBuilder.build(),
//                                                                expectCompilationResult.build());
//         try {
//             runner.run(compilationResult, expectRunResult.build());
//         } finally {
//             compiler.release(compilationResult);
//         }
//     }
// 
//     protected void doTest(@NotNull String qualifiedClassName, @NotNull String testSource) {
//         CompilationResult compilationResult = doCompile(qualifiedClassName, testSource);
//         try {
//             runner.run(compilationResult, expectRunResult.build());
//         } finally {
//             compiler.release(compilationResult);
//         }
//     }
// 
//     @NotNull
//     protected void doCompile(@NotNull String testSource) {
//         doCompile(TestUtil.QUALIFIED_CLASS_NAME, testSource);
//     }
// 
//     @NotNull
//     protected CompilationResult doCompile(@NotNull String qualifiedClassName, @NotNull String testSource) {
//         return compiler.compile(singleton(new TestSourceImpl(testSource, qualifiedClassName)),
//                                 settingsBuilder.build(),
//                                 expectCompilationResult.build());
//     }
// }


import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.TestInstancePostProcessor;
import tech.harmonysoft.oss.traute.test.api.engine.TestCompiler;
import tech.harmonysoft.oss.traute.test.api.engine.TestRunner;
import tech.harmonysoft.oss.traute.test.suite.AbstractTrauteTest;
import java.lang.reflect.Field;
package tech.harmonysoft.oss.traute.test.impl.engine;



public abstract class AbstractTrauteExtension implements TestInstancePostProcessor {

    public AbstractTrauteExtension() {
        System.setProperty(AbstractTrauteTest.ACTIVATION_PROPERTY, Boolean.TRUE.toString());
    }

    @Override
    public final void postProcessTestInstance(Object testInstance, ExtensionContext context) throws Exception {
        for (Class<?> clazz = testInstance.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
            Field[] fields = clazz.getDeclaredFields();
            for (Field field : fields) {
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/api/engine/TestCompiler.java
// public interface TestCompiler {
// 
//     /**
//      * Produces a {@link CompilationResult} from the given {@link TestSource}
//      *
//      * @param testSources    test sources to compile
//      * @param settings       plugin settings to use
//      * @return               compilation result
//      */
//     @NotNull
//     CompilationResult compile(@NotNull Collection<TestSource> testSources, @NotNull TrautePluginSettings settings);
// 
//     /**
//      * Behaves like {@link #compile(Collection, TrautePluginSettings)} but additionally checks
//      * resulting {@link CompilationResult} against the given {@link Expectation}
//      *
//      * @param testSources    test sources to compile
//      * @param settings       plugin settings to use
//      * @param expectation    a compilation result's expectation
//      * @return               compilation result for the given test sources
//      */
//     @NotNull
//     default CompilationResult compile(@NotNull Collection<TestSource> testSources,
//                                       @NotNull TrautePluginSettings settings,
//                                       @NotNull Expectation<CompilationResult> expectation)
//     {
//         CompilationResult result = compile(testSources, settings);
//         expectation.match(result);
//         return result;
//     }
// 
//     /**
//      * @param result    notifies that given compilation result is not needed anymore and all resources associated
//      *                  with it can be released
//      */
//     void release(@NotNull CompilationResult result);
// }
// 
// 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/suite/AbstractTrauteTest.java
// @SuppressWarnings("NullableProblems")
// @ExtendWith(TestDurationPrinter.class)
// public abstract class AbstractTrauteTest {
// 
//     public static final String ACTIVATION_PROPERTY = AbstractTrauteTest.class.getName();
// 
//     @NotNull protected TestCompiler                        compiler;
//     @NotNull protected TestRunner                          runner;
//     @NotNull protected TrautePluginSettingsBuilder         settingsBuilder;
//     @NotNull protected CompilationResultExpectationBuilder expectCompilationResult;
//     @NotNull protected RunResultExpectationBuilder         expectRunResult;
// 
//     @BeforeEach
//     public void commonSetUp() {
//         settingsBuilder = TrautePluginSettingsBuilder.settingsBuilder();
//         expectCompilationResult = CompilationResultExpectationBuilder.expectCompilationResult();
//         expectRunResult = RunResultExpectationBuilder.expectRunResult();
// 
//         Assumptions.assumeTrue(Boolean.getBoolean(ACTIVATION_PROPERTY));
//     }
// 
//     protected void doTest(@NotNull String testSource) {
//         doTest(TestUtil.QUALIFIED_CLASS_NAME, testSource);
//     }
// 
//     protected void doTest(@NotNull TestSource ... testSources) {
//         CompilationResult compilationResult = compiler.compile(asList(testSources),
//                                                                settingsBuilder.build(),
//                                                                expectCompilationResult.build());
//         try {
//             runner.run(compilationResult, expectRunResult.build());
//         } finally {
//             compiler.release(compilationResult);
//         }
//     }
// 
//     protected void doTest(@NotNull String qualifiedClassName, @NotNull String testSource) {
//         CompilationResult compilationResult = doCompile(qualifiedClassName, testSource);
//         try {
//             runner.run(compilationResult, expectRunResult.build());
//         } finally {
//             compiler.release(compilationResult);
//         }
//     }
// 
//     @NotNull
//     protected void doCompile(@NotNull String testSource) {
//         doCompile(TestUtil.QUALIFIED_CLASS_NAME, testSource);
//     }
// 
//     @NotNull
//     protected CompilationResult doCompile(@NotNull String qualifiedClassName, @NotNull String testSource) {
//         return compiler.compile(singleton(new TestSourceImpl(testSource, qualifiedClassName)),
//                                 settingsBuilder.build(),
//                                 expectCompilationResult.build());
//     }
// }


// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/impl/engine/AbstractTrauteExtension.java
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.TestInstancePostProcessor;
import tech.harmonysoft.oss.traute.test.api.engine.TestCompiler;
import tech.harmonysoft.oss.traute.test.api.engine.TestRunner;
import tech.harmonysoft.oss.traute.test.suite.AbstractTrauteTest;
import java.lang.reflect.Field;

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



public abstract class AbstractTrauteExtension implements TestInstancePostProcessor {

    public AbstractTrauteExtension() {
        System.setProperty(AbstractTrauteTest.ACTIVATION_PROPERTY, Boolean.TRUE.toString());
    }

    @Override
    public final void postProcessTestInstance(Object testInstance, ExtensionContext context) throws Exception {
        for (Class<?> clazz = testInstance.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
            Field[] fields = clazz.getDeclaredFields();
            for (Field field : fields) {
                if (field.getType() == TestCompiler.class) {