# HG changeset patch # User dmeetry # Date 1354736899 -14400 # Node ID c84d318736e48c832985b6dc9c655e8331bef2e8 # Parent 1d37792f52db64e7133ec1613cbf8efe39a9d738 7192449: fix up tests to accommodate jtreg spec change Reviewed-by: jjg diff -r 1d37792f52db -r c84d318736e4 test/tools/javac/processing/6414633/T6414633.java --- a/test/tools/javac/processing/6414633/T6414633.java Wed Dec 05 23:44:21 2012 +0400 +++ b/test/tools/javac/processing/6414633/T6414633.java Wed Dec 05 23:48:19 2012 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,20 +43,20 @@ public static void main(String... args) { String testSrc = System.getProperty("test.src", "."); String testClasses = System.getProperty("test.classes", "."); + String testClassPath = System.getProperty("test.class.path", testClasses); JavacTool tool = JavacTool.create(); MyDiagListener dl = new MyDiagListener(); StandardJavaFileManager fm = tool.getStandardFileManager(dl, null, null); try { - fm.setLocation(StandardLocation.CLASS_PATH, Arrays.asList(new File(testClasses))); + fm.setLocation(StandardLocation.CLASS_PATH, pathToFiles(testClassPath)); } catch (IOException e) { throw new AssertionError(e); } Iterable files = fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(testSrc, A.class.getName()+".java"))); String[] opts = { "-proc:only", - "-processor", A.class.getName(), - "-classpath", testClasses + System.getProperty("path.separator") + "../../lib" }; + "-processor", A.class.getName() }; JavacTask task = tool.getTask(null, fm, dl, Arrays.asList(opts), null, files); task.call(); @@ -65,6 +65,15 @@ throw new AssertionError(dl.diags + " diagnostics reported"); } + private static List pathToFiles(String path) { + List list = new ArrayList(); + for (String s: path.split(File.pathSeparator)) { + if (!s.isEmpty()) + list.add(new File(s)); + } + return list; + } + private static class MyDiagListener implements DiagnosticListener { public void report(Diagnostic d) {