Class JvmTestExecutor

java.lang.Object
org.ek9lang.cli.JvmTestExecutor
All Implemented Interfaces:
TestExecutor

final class JvmTestExecutor extends Object implements TestExecutor
Executes JVM bytecode test programs in-process.

This executor uses BytecodeExecutor to run compiled EK9 bytecode within the current JVM. This is significantly faster than spawning external JVM processes for each test.

Thread-safe: multiple tests can be executed in parallel, each with independent output capture via thread-local PrintStreams.

  • Constructor Details

    • JvmTestExecutor

      JvmTestExecutor(Path bytecodeDir)
      Create a JVM test executor.
      Parameters:
      bytecodeDir - Directory containing compiled .class files
  • Method Details

    • execute

      Description copied from interface: TestExecutor
      Execute a test program and capture its output.
      Specified by:
      execute in interface TestExecutor
      Parameters:
      test - The test program to execute
      Returns:
      Execution result with captured output and status
    • execute

      public TestExecutor.ExecutionResult execute(TestProgram test, List<String> arguments)
      Description copied from interface: TestExecutor
      Execute a test program with command line arguments.

      Used for parameterized black-box tests where arguments are read from commandline_arg_*.txt files.

      Specified by:
      execute in interface TestExecutor
      Parameters:
      test - The test program to execute
      arguments - Command line arguments to pass
      Returns:
      Execution result with captured output and status