| 38 | import org.junit.runner.RunWith; |
| 39 | |
| 40 | @RunWith(RunForEachFileInDirRunner.class) |
| 41 | public class AliasTest extends RunForEachFileInDirRunner.SourceFileBasedTester { |
| 42 | @Override |
| 43 | protected Collection<DirDescriptor> getDirDescriptors() { |
| 44 | return Collections.singleton(DirDescriptor.of(new File("test/resources/idempotency"), true).withMirror(new File("test/resources/alias"))); |
| 45 | } |
| 46 | |
| 47 | @Test |
| 48 | public void testContentEqualsAfterParsePrintCycle(String expected, Source actual) throws IOException { |
| 49 | actual.parseCompilationUnit(); |
| 50 | |
| 51 | if (!actual.getProblems().isEmpty()) { |
| 52 | fail(actual.getProblems().get(0).toString()); |
| 53 | } |
| 54 | |
| 55 | Node node = actual.getNodes().get(0); |
| 56 | TextFormatter formatter = new TextFormatter(); |
| 57 | node.accept(new SourcePrinter(formatter)); |
| 58 | String actualString = formatter.finish(); |
| 59 | |
| 60 | assertEquals(fixLineEndings(expected), fixLineEndings(actualString)); |
| 61 | } |
| 62 | } |
nothing calls this directly
no outgoing calls
no test coverage detected