incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1330497 - in /incubator/hcatalog/branches/branch-0.4: CHANGES.txt src/test/e2e/hcatalog/tools/generate/generate_data.pl
Date Wed, 25 Apr 2012 19:20:44 GMT
Author: gates
Date: Wed Apr 25 19:20:44 2012
New Revision: 1330497

URL: http://svn.apache.org/viewvc?rev=1330497&view=rev
Log:
HCATALOG-386 e2e tests should respect JAVA_HOME when it's set

Modified:
    incubator/hcatalog/branches/branch-0.4/CHANGES.txt
    incubator/hcatalog/branches/branch-0.4/src/test/e2e/hcatalog/tools/generate/generate_data.pl

Modified: incubator/hcatalog/branches/branch-0.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/CHANGES.txt?rev=1330497&r1=1330496&r2=1330497&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/CHANGES.txt (original)
+++ incubator/hcatalog/branches/branch-0.4/CHANGES.txt Wed Apr 25 19:20:44 2012
@@ -114,6 +114,8 @@ Release 0.4.0 - Unreleased
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-386 e2e tests should respect JAVA_HOME when it's set (gates)
+
   HCAT-363 HCat leaks metastore connection (rohini via toffer)
 
   HCAT-314 HCatOutputFormat.setOutput is called more than once by HCatStorer (avandana via
toffer)

Modified: incubator/hcatalog/branches/branch-0.4/src/test/e2e/hcatalog/tools/generate/generate_data.pl
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/src/test/e2e/hcatalog/tools/generate/generate_data.pl?rev=1330497&r1=1330496&r2=1330497&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/src/test/e2e/hcatalog/tools/generate/generate_data.pl
(original)
+++ incubator/hcatalog/branches/branch-0.4/src/test/e2e/hcatalog/tools/generate/generate_data.pl
Wed Apr 25 19:20:44 2012
@@ -368,8 +368,19 @@ sub findHiveJars()
     return ($execJar, $cliJar);
 }
 
-
-
+sub getJavaCmd() 
+{
+    if (defined $ENV{'JAVA_HOME'}) {
+        return "$ENV{'JAVA_HOME'}/bin/java";
+    } else {
+        my $java = `which java`;
+        if ($?) {
+            die "Unable to find java executable;"
+        } else {
+            return $java;
+        }
+    }
+}
 
 # main
 {
@@ -422,7 +433,7 @@ sub findHiveJars()
             my ($hadoopCoreJar, $commonsLoggingJar, $commonsConfigJar,
                 $commonsLangJar, $commonsCliJar) = findHadoopJars();
             my ($hiveExecJar, $hiveCliJar) = findHiveJars();
-            my @cmd = ('java', '-cp',
+            my @cmd = (getJavaCmd(), '-cp',
                 "../tools/generate/java/hive-gen.jar:$hadoopCoreJar:" .
                 "$commonsLoggingJar:$commonsConfigJar:$commonsLangJar:" .
                 "$hiveExecJar",



Mime
View raw message