/** * Tests -s is used by annotation processor code generation. */ public void testOutputDirectory() { final WebServiceAp ap = new WebServiceAp(); final boolean result = runCompiler(options, ap); Assert.assertTrue(result); File generatedSourceDirFiles = new File(destDir, "com/sun/tools/ws/processor/modeler/annotation/jaxws"); final File[] contents = generatedSourceDirFiles.listFiles(); Assert.assertTrue(4 == contents.length); final List<String> expectedSourceNames = Arrays.asList("SayHello.java", "SayHello.class", "SayHelloResponse.java", "SayHelloResponse.class"); for (File generated : contents) { Assert.assertTrue(expectedSourceNames.contains(generated.getName())); } }
/** * Test if -Averbose=true is propagated from javac to processor. */ public void testVerboseArg() { options.add("-Averbose=true"); final WebServiceAp ap = new WebServiceAp(); final boolean result = runCompiler(options, ap); Assert.assertTrue(ap.getOptions().verbose); Assert.assertTrue(result); }
private JavaCompiler.CompilationTask getCompilationTask(final String compilationUnit, List<String> javacOptions, WsgenOptions wsgenOptions, DiagnosticCollector<JavaFileObject> diagnostics) { Iterable<? extends JavaFileObject> compilationUnits = new HashSet<JavaFileObject>() { { add(new JavaSourceFromString(compilationUnit)); } }; JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); JavaCompiler.CompilationTask task = compiler.getTask( null, null, diagnostics, javacOptions, null, compilationUnits); WebServiceAp wsap = new WebServiceAp(wsgenOptions, System.out); task.setProcessors(Collections.singleton(wsap)); return task; }
Collections.singleton(endpoint.replaceAll("\\$", ".")), null); task.setProcessors(Collections.singleton(new WebServiceAp(options, out))); boolean result = task.call();
Collections.singleton(endpoint.replaceAll("\\$", ".")), null); task.setProcessors(Collections.singleton(new WebServiceAp(options, out))); boolean result = task.call();
Collections.singleton(endpoint.replaceAll("\\$", ".")), null); task.setProcessors(Collections.singleton(new WebServiceAp(options, out))); boolean result = task.call();
Collections.singleton(endpoint.replaceAll("\\$", ".")), null); task.setProcessors(Collections.singleton(new WebServiceAp(options, out))); boolean result = task.call();