[pitboss] phase 14: Track B — Java harness emitter shapes

This commit is contained in:
pitboss 2026-05-14 16:54:56 -05:00
parent 7628c48930
commit bd1bd0ce84
36 changed files with 1793 additions and 155 deletions

View file

@ -0,0 +1,26 @@
// Phase 14 fixture stub Spring-injected helper service.
// The fixture's controller declares `@Autowired CommandRunner runner;`
// so the harness exercises the Phase 09 import-extraction path
// (`@Autowired` is the marker that flags `org.springframework` as a
// transitive dep). At runtime the harness instantiates the controller
// via reflection's default ctor the @Autowired field stays null
// because there is no Spring container; the controller's handler
// guards against null and constructs a fresh CommandRunner on demand.
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class CommandRunner {
public String run(String cmd) throws Exception {
Process p = Runtime.getRuntime().exec(new String[] {"/bin/sh", "-c", cmd});
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
StringBuilder out = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
out.append(line);
out.append('\n');
}
p.waitFor();
return out.toString();
}
}