You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by rk...@apache.org on 2013/04/18 18:38:56 UTC

svn commit: r1469419 - in /oozie/trunk: ./ core/src/test/java/org/apache/oozie/test/ core/src/test/resources/ sharelib/ sharelib/hive/ sharelib/hive/src/test/java/org/apache/oozie/action/hadoop/ sharelib/hive/src/test/resources/ sharelib/pig/ sharelib/...

Author: rkanter
Date: Thu Apr 18 16:38:55 2013
New Revision: 1469419

URL: http://svn.apache.org/r1469419
Log:
OOZIE-1326 sharelib tests failing saying error on fork after OOZIE-1311 refactor (rohini via rkanter)

Added:
    oozie/trunk/sharelib/hive/src/test/resources/
    oozie/trunk/sharelib/hive/src/test/resources/HiveMain.txt
    oozie/trunk/sharelib/pig/src/test/resources/
    oozie/trunk/sharelib/pig/src/test/resources/PigMain.txt
Removed:
    oozie/trunk/core/src/test/resources/PigMain.txt
    oozie/trunk/tests/
Modified:
    oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java
    oozie/trunk/pom.xml
    oozie/trunk/release-log.txt
    oozie/trunk/sharelib/hive/pom.xml
    oozie/trunk/sharelib/hive/src/test/java/org/apache/oozie/action/hadoop/TestHiveMain.java
    oozie/trunk/sharelib/pig/pom.xml
    oozie/trunk/sharelib/pom.xml

Modified: oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java
URL: http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java?rev=1469419&r1=1469418&r2=1469419&view=diff
==============================================================================
--- oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java (original)
+++ oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java Thu Apr 18 16:38:55 2013
@@ -21,9 +21,11 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileReader;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -267,21 +269,27 @@ public abstract class XTestCase extends 
         File source = (customOozieSite.startsWith("/"))
                       ? new File(customOozieSite) : new File(OOZIE_SRC_DIR, customOozieSite);
         source = source.getAbsoluteFile();
-        // If we can't find it, try using the class loader (useful if we're using XTestCase from outside core)
-        if (!source.exists()) {
-            source = new File(getClass().getClassLoader().getResource(oozieTestDB + "-oozie-site.xml").getPath());
-            source = source.getAbsoluteFile();
+        InputStream oozieSiteSourceStream = null;
+        if (source.exists()) {
+            oozieSiteSourceStream = new FileInputStream(source);
         }
-        // If we still can't find it, then exit
-        if (!source.exists()) {
-            System.err.println();
-            System.err.println(XLog.format("Custom configuration file for testing does no exist [{0}]",
-                                           source.getAbsolutePath()));
-            System.err.println();
-            System.exit(-1);
+        else {
+            // If we can't find it, try using the class loader (useful if we're using XTestCase from outside core)
+            URL sourceURL = getClass().getClassLoader().getResource(oozieTestDB + "-oozie-site.xml");
+            if (sourceURL != null) {
+                oozieSiteSourceStream = sourceURL.openStream();
+            }
+            else {
+                // If we still can't find it, then exit
+                System.err.println();
+                System.err.println(XLog.format("Custom configuration file for testing does no exist [{0}]",
+                                               source.getAbsolutePath()));
+                System.err.println();
+                System.exit(-1);
+            }
         }
         File target = new File(testCaseConfDir, "oozie-site.xml");
-        IOUtils.copyStream(new FileInputStream(source), new FileOutputStream(target));
+        IOUtils.copyStream(oozieSiteSourceStream, new FileOutputStream(target));
 
         File hadoopConfDir = new File(testCaseConfDir, "hadoop-conf");
         hadoopConfDir.mkdir();

Modified: oozie/trunk/pom.xml
URL: http://svn.apache.org/viewvc/oozie/trunk/pom.xml?rev=1469419&r1=1469418&r2=1469419&view=diff
==============================================================================
--- oozie/trunk/pom.xml (original)
+++ oozie/trunk/pom.xml Thu Apr 18 16:38:55 2013
@@ -928,7 +928,8 @@
                         <exclude>docs/src/site/twiki/*.twiki</exclude>
                         <exclude>examples/src/main/data/*</exclude>
                         <exclude>core/src/test/resources/test-ioutils.txt</exclude>
-                        <exclude>core/src/test/resources/PigMain.txt</exclude>
+                        <exclude>sharelib/pig/src/test/resources/PigMain.txt</exclude>
+                        <exclude>sharelib/hive/src/test/resources/HiveMain.txt</exclude>
                         <exclude>webapp/src/main/resources/.gitignore</exclude>
                         <exclude>**/target/**</exclude>
                         <exclude>**/build/**</exclude>

Modified: oozie/trunk/release-log.txt
URL: http://svn.apache.org/viewvc/oozie/trunk/release-log.txt?rev=1469419&r1=1469418&r2=1469419&view=diff
==============================================================================
--- oozie/trunk/release-log.txt (original)
+++ oozie/trunk/release-log.txt Thu Apr 18 16:38:55 2013
@@ -1,5 +1,6 @@
 -- Oozie 4.1.0 release (trunk - unreleased)
 
+OOZIE-1326 sharelib tests failing saying error on fork after OOZIE-1311 refactor (rohini via rkanter)
 OOZIE-1235 Client API for retrieving topic and jms connection related details (virag)
 OOZIE-1234 JMS Event Listeners for publishing notifications related to workflow and coordinator (virag)
 OOZIE-1281  Hiveaction should populate externalChildIDs (rohini via virag)

Modified: oozie/trunk/sharelib/hive/pom.xml
URL: http://svn.apache.org/viewvc/oozie/trunk/sharelib/hive/pom.xml?rev=1469419&r1=1469418&r2=1469419&view=diff
==============================================================================
--- oozie/trunk/sharelib/hive/pom.xml (original)
+++ oozie/trunk/sharelib/hive/pom.xml Thu Apr 18 16:38:55 2013
@@ -225,6 +225,17 @@
                     </descriptors>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludeSubProjects>false</excludeSubProjects>
+                    <excludes>
+                        <!-- excluding all as the root POM does the full check -->
+                        <exclude>**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

Modified: oozie/trunk/sharelib/hive/src/test/java/org/apache/oozie/action/hadoop/TestHiveMain.java
URL: http://svn.apache.org/viewvc/oozie/trunk/sharelib/hive/src/test/java/org/apache/oozie/action/hadoop/TestHiveMain.java?rev=1469419&r1=1469418&r2=1469419&view=diff
==============================================================================
--- oozie/trunk/sharelib/hive/src/test/java/org/apache/oozie/action/hadoop/TestHiveMain.java (original)
+++ oozie/trunk/sharelib/hive/src/test/java/org/apache/oozie/action/hadoop/TestHiveMain.java Thu Apr 18 16:38:55 2013
@@ -104,7 +104,7 @@ public class TestHiveMain extends MainTe
             os.close();
 
             //needed in the testcase classpath
-            URL url = Thread.currentThread().getContextClassLoader().getResource("PigMain.txt");
+            URL url = Thread.currentThread().getContextClassLoader().getResource("HiveMain.txt");
             File classPathDir = new File(url.getPath()).getParentFile();
             assertTrue(classPathDir.exists());
             File hiveSite = new File(classPathDir, "hive-site.xml");

Added: oozie/trunk/sharelib/hive/src/test/resources/HiveMain.txt
URL: http://svn.apache.org/viewvc/oozie/trunk/sharelib/hive/src/test/resources/HiveMain.txt?rev=1469419&view=auto
==============================================================================
--- oozie/trunk/sharelib/hive/src/test/resources/HiveMain.txt (added)
+++ oozie/trunk/sharelib/hive/src/test/resources/HiveMain.txt Thu Apr 18 16:38:55 2013
@@ -0,0 +1 @@
+Dummy file to find a directory in the classpath
\ No newline at end of file

Modified: oozie/trunk/sharelib/pig/pom.xml
URL: http://svn.apache.org/viewvc/oozie/trunk/sharelib/pig/pom.xml?rev=1469419&r1=1469418&r2=1469419&view=diff
==============================================================================
--- oozie/trunk/sharelib/pig/pom.xml (original)
+++ oozie/trunk/sharelib/pig/pom.xml Thu Apr 18 16:38:55 2013
@@ -176,6 +176,17 @@
                     </descriptors>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludeSubProjects>false</excludeSubProjects>
+                    <excludes>
+                        <!-- excluding all as the root POM does the full check -->
+                        <exclude>**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

Added: oozie/trunk/sharelib/pig/src/test/resources/PigMain.txt
URL: http://svn.apache.org/viewvc/oozie/trunk/sharelib/pig/src/test/resources/PigMain.txt?rev=1469419&view=auto
==============================================================================
--- oozie/trunk/sharelib/pig/src/test/resources/PigMain.txt (added)
+++ oozie/trunk/sharelib/pig/src/test/resources/PigMain.txt Thu Apr 18 16:38:55 2013
@@ -0,0 +1 @@
+Dummy file to find a directory in the classpath
\ No newline at end of file

Modified: oozie/trunk/sharelib/pom.xml
URL: http://svn.apache.org/viewvc/oozie/trunk/sharelib/pom.xml?rev=1469419&r1=1469418&r2=1469419&view=diff
==============================================================================
--- oozie/trunk/sharelib/pom.xml (original)
+++ oozie/trunk/sharelib/pom.xml Thu Apr 18 16:38:55 2013
@@ -78,6 +78,17 @@
                     <skip>true</skip>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludeSubProjects>false</excludeSubProjects>
+                    <excludes>
+                        <!-- excluding all as the root POM does the full check -->
+                        <exclude>**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
         </plugins>
     </build>