Base class for every TestCase that uses an AST
| 28 | * Base class for every TestCase that uses an AST |
| 29 | */ |
| 30 | public abstract class ASTTest extends TestCase { |
| 31 | |
| 32 | public ModuleNode getAST(String source, int untilPhase) { |
| 33 | SourceUnit unit = SourceUnit.create("Test", source); |
| 34 | CompilationUnit compUnit = new CompilationUnit(); |
| 35 | compUnit.addSource(unit); |
| 36 | compUnit.compile(untilPhase); |
| 37 | return unit.getAST(); |
| 38 | } |
| 39 | |
| 40 | public ModuleNode getAST(String source) { |
| 41 | return getAST(source, Phases.SEMANTIC_ANALYSIS); |
| 42 | } |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected