GraalReflectionFileGenerator { public void generateReflection(CommandLineParser<CommandInvocation> parser, Writer w) throws IOException { w.append('[').append(getLineSeparator()); processCommand(parser, w); appendOptions(w); w.append(getLineSeparator()).append("]"); } GraalReflectionFileGenerator(); void generateReflection(CommandLineParser<CommandInvocation> parser, Writer w);  }
@Test public void testSimpleCommand() throws IOException { GraalReflectionFileGenerator generator = new GraalReflectionFileGenerator(); CommandLineParser<CommandInvocation> parser = getParser(TestCommand1.class); StringWriter writer = new StringWriter(); generator.generateReflection(parser, writer); assertEquals(readFile("src/test/resources/graal1"), writer.toString()); }
@Test public void testCommand() throws IOException { GraalReflectionFileGenerator generator = new GraalReflectionFileGenerator(); CommandLineParser<CommandInvocation> parser = getParser(TestCommand2.class); StringWriter writer = new StringWriter(); generator.generateReflection(parser, writer); assertEquals(readFile("src/test/resources/graal2"), writer.toString()); }
@Test public void testCommandWithFileOption() throws IOException { GraalReflectionFileGenerator generator = new GraalReflectionFileGenerator(); CommandLineParser<CommandInvocation> parser = getParser(TestCommand3.class); StringWriter writer = new StringWriter(); generator.generateReflection(parser, writer); assertEquals(readFile("src/test/resources/graal3"), writer.toString()); }