You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by tu...@apache.org on 2012/03/01 19:46:57 UTC

svn commit: r1295731 - in /incubator/oozie/trunk: examples/pom.xml examples/src/test/java/org/apache/oozie/example/TestLocalOozieExample.java pom.xml release-log.txt

Author: tucu
Date: Thu Mar  1 18:46:57 2012
New Revision: 1295731

URL: http://svn.apache.org/viewvc?rev=1295731&view=rev
Log:
OOZIE-715 Fix TestLocalOozieExample (angeloh via tucu)

Modified:
    incubator/oozie/trunk/examples/pom.xml
    incubator/oozie/trunk/examples/src/test/java/org/apache/oozie/example/TestLocalOozieExample.java
    incubator/oozie/trunk/pom.xml
    incubator/oozie/trunk/release-log.txt

Modified: incubator/oozie/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/examples/pom.xml?rev=1295731&r1=1295730&r2=1295731&view=diff
==============================================================================
--- incubator/oozie/trunk/examples/pom.xml (original)
+++ incubator/oozie/trunk/examples/pom.xml Thu Mar  1 18:46:57 2012
@@ -59,6 +59,12 @@
         </dependency>
 
         <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.oozie</groupId>
             <artifactId>oozie-client</artifactId>
             <scope>provided</scope>

Modified: incubator/oozie/trunk/examples/src/test/java/org/apache/oozie/example/TestLocalOozieExample.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/examples/src/test/java/org/apache/oozie/example/TestLocalOozieExample.java?rev=1295731&r1=1295730&r2=1295731&view=diff
==============================================================================
--- incubator/oozie/trunk/examples/src/test/java/org/apache/oozie/example/TestLocalOozieExample.java (original)
+++ incubator/oozie/trunk/examples/src/test/java/org/apache/oozie/example/TestLocalOozieExample.java Thu Mar  1 18:46:57 2012
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,26 +21,30 @@ import junit.framework.TestCase;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.oozie.DagEngine;
 import org.apache.oozie.service.Services;
 import org.apache.oozie.service.WorkflowAppService;
+import org.apache.oozie.test.XFsTestCase;
 import org.apache.oozie.test.XTestCase;
 import org.apache.oozie.util.IOUtils;
 import org.apache.oozie.util.ParamChecker;
 import org.apache.oozie.util.XLog;
 import org.apache.oozie.util.XConfiguration;
 import org.apache.oozie.action.hadoop.DoAs;
+import org.apache.oozie.client.OozieClient;
 
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.concurrent.Callable;
 
-public class TestLocalOozieExample extends XTestCase {
+public class TestLocalOozieExample extends XFsTestCase {
     private String oozieLocalLog;
     private String testDir;
     private FileSystem fileSystem;
     private Path fsTestDir;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         File dir = new File(System.getProperty("oozie.test.dir", "/tmp"));
@@ -49,47 +53,8 @@ public class TestLocalOozieExample exten
         dir = new File(dir, getName());
         dir.mkdirs();
         testDir = dir.getAbsolutePath();
-        final Configuration conf = new Configuration();
-        conf.set(WorkflowAppService.HADOOP_USER, getTestUser());
-        conf.set("mapred.job.tracker", getJobTrackerUri());
-        conf.set("fs.default.name", getNameNodeUri());
-        injectKerberosInfo(conf);
-
-        // TODO restore this when getting rid of DoAs trick
-
-//        if (System.getProperty("oozie.test.kerberos", "off").equals("on")) {
-//            Configuration c = new Configuration();
-//            c.set("hadoop.security.authentication", "kerberos");
-//            UserGroupInformation.setConfiguration(c);
-//            String principal = System.getProperty("oozie.test.kerberos.oozie.principal",
-//                                                  System.getProperty("user.name") + "/localhost") + "@"
-//                    + System.getProperty("oozie.test.kerberos.realm", "LOCALHOST");
-//            String defaultFile = new File(System.getProperty("user.home"), "oozie.keytab").getAbsolutePath();
-//            String keytabFile = System.getProperty("oozie.test.kerberos.keytab.file", defaultFile);
-//            UserGroupInformation.loginUserFromKeytab(principal, keytabFile);
-////            System.setProperty("oozie.service.HadoopAccessorService.kerberos.enabled", "kerberos");
-//        }
-
-        Class klass;
-        try {
-            klass = Class.forName("org.apache.oozie.action.hadoop.KerberosDoAs");
-        }
-        catch (ClassNotFoundException ex) {
-            klass = DoAs.class;
-        }
-        DoAs doAs = (DoAs) klass.newInstance();
-        final FileSystem[] fs = new FileSystem[1];
-        doAs.setCallable(new Callable<Void>() {
-            public Void call() throws Exception {
-                Configuration defaultConf = new Configuration();
-                XConfiguration.copy(conf, defaultConf);
-                fs[0] = FileSystem.get(defaultConf);
-                return null;
-            }
-        });
-        doAs.setUser(getTestUser());
-        doAs.call();
-        fileSystem = fs[0];
+
+        fileSystem = getFileSystem();
 
         Path path = new Path(fileSystem.getWorkingDirectory(), "oozietests/" + getClass().getName() + "/" + getName());
         fsTestDir = fileSystem.makeQualified(path);
@@ -115,6 +80,7 @@ public class TestLocalOozieExample exten
         System.setProperty(Services.OOZIE_HOME_DIR, testCaseDir);
     }
 
+    @Override
     protected void delete(File file) throws IOException {
         ParamChecker.notNull(file, "file");
         if (file.getAbsolutePath().length() < 5) {
@@ -144,6 +110,7 @@ public class TestLocalOozieExample exten
         return dir.getAbsolutePath();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         fileSystem = null;
         fsTestDir = null;

Modified: incubator/oozie/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/pom.xml?rev=1295731&r1=1295730&r2=1295731&view=diff
==============================================================================
--- incubator/oozie/trunk/pom.xml (original)
+++ incubator/oozie/trunk/pom.xml Thu Mar  1 18:46:57 2012
@@ -140,6 +140,7 @@
                 <enabled>false</enabled>
             </snapshots>
         </repository>
+
     </repositories>
 
     <pluginRepositories>
@@ -614,6 +615,13 @@
                 <version>1.8.5</version>
             </dependency>
 
+            <!-- examples -->
+            <dependency>
+                <groupId>commons-httpclient</groupId>
+                <artifactId>commons-httpclient</artifactId>
+                <version>3.0.1</version>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
 

Modified: incubator/oozie/trunk/release-log.txt
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/release-log.txt?rev=1295731&r1=1295730&r2=1295731&view=diff
==============================================================================
--- incubator/oozie/trunk/release-log.txt (original)
+++ incubator/oozie/trunk/release-log.txt Thu Mar  1 18:46:57 2012
@@ -1,5 +1,6 @@
 -- Oozie 3.2.0 release
 
+OOZIE-715 Fix TestLocalOozieExample (angeloh via tucu)
 OOZIE-701 Oozie notification URLs don't get replaced with the taken transition (tucu)
 OOZIE-724 TestClassUtils fails as looks for hadoop-core (tucu)
 OOZIE-725 Increase JVM MaxPermSize value for the testcases (tucu)