[jira] [Commented] (APEXCORE-817) StramLocalCluster.testDynamicLoading test failing on travis

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (APEXCORE-817) StramLocalCluster.testDynamicLoading test failing on travis

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/APEXCORE-817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16517745#comment-16517745 ]

ASF GitHub Bot commented on APEXCORE-817:
-----------------------------------------

vrozov closed pull request #602: APEXCORE-817: Specifying full path for the java command line programs
URL: https://github.com/apache/apex-core/pull/602
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/engine/src/test/java/com/datatorrent/stram/StramLocalClusterTest.java b/engine/src/test/java/com/datatorrent/stram/StramLocalClusterTest.java
index 56641f8c1c..fd475c8c69 100644
--- a/engine/src/test/java/com/datatorrent/stram/StramLocalClusterTest.java
+++ b/engine/src/test/java/com/datatorrent/stram/StramLocalClusterTest.java
@@ -60,7 +60,7 @@
 import com.datatorrent.stram.plan.physical.PTOperator;
 import com.datatorrent.stram.support.ManualScheduledExecutorService;
 import com.datatorrent.stram.support.StramTestSupport;
-
+import com.datatorrent.stram.util.VersionInfo;
 
 public class StramLocalClusterTest
 {
@@ -381,14 +381,18 @@ private String generatejar(String pojoClassName) throws IOException, Interrupted
     String sourceDir = "src/test/resources/dynamicJar/";
     String destDir = testMeta.getPath();
 
+    // The compiled java class should be loadable by the current java runtime hence setting the compile target version
+    // to be the same
+    String binLocation = getJavaBinLocation();
+
     Process p = Runtime.getRuntime()
-        .exec(new String[] {"javac", "-d", destDir, sourceDir + pojoClassName + ".java"}, null, null);
+        .exec(new String[] {binLocation + "javac", "-d", destDir, sourceDir + pojoClassName + ".java"}, null, null);
     IOUtils.copy(p.getInputStream(), System.out);
     IOUtils.copy(p.getErrorStream(), System.err);
     Assert.assertEquals(0, p.waitFor());
 
     p = Runtime.getRuntime()
-        .exec(new String[] {"jar", "-cf", pojoClassName + ".jar", pojoClassName + ".class"}, null, new File(destDir));
+        .exec(new String[] {binLocation + "jar", "-cf", pojoClassName + ".jar", pojoClassName + ".class"}, null, new File(destDir));
     IOUtils.copy(p.getInputStream(), System.out);
     IOUtils.copy(p.getErrorStream(), System.err);
     Assert.assertEquals(0, p.waitFor());
@@ -396,6 +400,12 @@ private String generatejar(String pojoClassName) throws IOException, Interrupted
     return new File(destDir, pojoClassName + ".jar").getAbsolutePath();
   }
 
+  private String getJavaBinLocation()
+  {
+    String javaHome = System.getProperty("java.home");
+    return VersionInfo.compare(System.getProperty("java.version"), "1.9") < 0 ? javaHome + "/../bin/" : javaHome + "/bin/";
+  }
+
   @Test
   public void testAppPath() throws Exception
   {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


> StramLocalCluster.testDynamicLoading test failing on travis
> -----------------------------------------------------------
>
>                 Key: APEXCORE-817
>                 URL: https://issues.apache.org/jira/browse/APEXCORE-817
>             Project: Apache Apex Core
>          Issue Type: Bug
>            Reporter: Pramod Immaneni
>            Assignee: Pramod Immaneni
>            Priority: Major
>             Fix For: 4.0.0
>
>
> The test is failing with the following logs
>  
> Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 14.843 sec <<< FAILURE! - in com.datatorrent.stram.StramLocalClusterTest
> testDynamicLoading(com.datatorrent.stram.StramLocalClusterTest) Time elapsed: 1.375 sec <<< ERROR!
> java.lang.UnsupportedClassVersionError: POJO has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
>  at com.datatorrent.stram.StramLocalClusterTest.testDynamicLoading(StramLocalClusterTest.java:296)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)