jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r1127467 - /incubator/jena/Jena2/jena/trunk/src/test/java/jena/test/Test_schemagen.java
Date Wed, 25 May 2011 10:32:44 GMT
Author: ijd
Date: Wed May 25 10:32:44 2011
New Revision: 1127467

URL: http://svn.apache.org/viewvc?rev=1127467&view=rev
Log:
Added guard against failing to resolve javax compiler methods (possibly openjdk vs. Sun jdk
is the root cause)

Modified:
    incubator/jena/Jena2/jena/trunk/src/test/java/jena/test/Test_schemagen.java

Modified: incubator/jena/Jena2/jena/trunk/src/test/java/jena/test/Test_schemagen.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/jena/trunk/src/test/java/jena/test/Test_schemagen.java?rev=1127467&r1=1127466&r2=1127467&view=diff
==============================================================================
--- incubator/jena/Jena2/jena/trunk/src/test/java/jena/test/Test_schemagen.java (original)
+++ incubator/jena/Jena2/jena/trunk/src/test/java/jena/test/Test_schemagen.java Wed May 25
10:32:44 2011
@@ -649,11 +649,16 @@ public class Test_schemagen
             Class<?> jc = Class.forName( "javax.tools.JavaCompiler" );
             Method jcRun = jc.getMethod( "run", new Class[] {InputStream.class, OutputStream.class,
OutputStream.class, String[].class} );
 
-            // build the args list for javac
-            String[] args = new String[] {"-classpath", getClassPath( tmpDir ), "-d", tmpDir.getPath(),
srcFile.getPath()};
+            if (sjc != null && jcRun != null) {
+                // build the args list for javac
+                String[] args = new String[] {"-classpath", getClassPath( tmpDir ), "-d",
tmpDir.getPath(), srcFile.getPath()};
 
-            int success = (Integer) jcRun.invoke( sjc, null, null, null, args );
-            assertEquals( "Errors reported from compilation of schemagen output", 0, success
);
+                int success = (Integer) jcRun.invoke( sjc, null, null, null, args );
+                assertEquals( "Errors reported from compilation of schemagen output", 0,
success );
+            }
+            else {
+                log.debug( "Could not resolve javax.tools.JavaCompiler.run() method. Is the
CLASSPATH defined correctly?" );
+            }
         }
         catch (ClassNotFoundException nf) {
             log.debug( "javax.tools not found (no tools.jar on classpath?). schemagen compilation
test skipped." );



Mime
View raw message