falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: FALCON-2193 Fix ExtensionStoreTest
Date Tue, 22 Nov 2016 05:08:07 GMT
Repository: falcon
Updated Branches:
  refs/heads/master fd384a7a3 -> 1b7708fa1


FALCON-2193 Fix ExtensionStoreTest

Fixes UTs failing after FALCON-2188

Author: Pallavi Rao <pallavi.rao@inmobi.com>

Reviewers: @sandeepSamudrala

Closes #305 from pallavi-rao/2193


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/1b7708fa
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/1b7708fa
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/1b7708fa

Branch: refs/heads/master
Commit: 1b7708fa1e2258c0aca759684dad1d0dbe91bd5b
Parents: fd384a7
Author: Pallavi Rao <pallavi.rao@inmobi.com>
Authored: Tue Nov 22 10:37:57 2016 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Tue Nov 22 10:37:57 2016 +0530

----------------------------------------------------------------------
 .../extensions/store/ExtensionStoreTest.java    | 33 +++++++++++---------
 1 file changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/1b7708fa/extensions/src/test/java/org/apache/falcon/extensions/store/ExtensionStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/src/test/java/org/apache/falcon/extensions/store/ExtensionStoreTest.java
b/extensions/src/test/java/org/apache/falcon/extensions/store/ExtensionStoreTest.java
index 98a8cb5..27bea53 100644
--- a/extensions/src/test/java/org/apache/falcon/extensions/store/ExtensionStoreTest.java
+++ b/extensions/src/test/java/org/apache/falcon/extensions/store/ExtensionStoreTest.java
@@ -19,7 +19,16 @@
 package org.apache.falcon.extensions.store;
 
 import com.google.common.collect.ImmutableMap;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.URISyntaxException;
+import java.util.Map;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
 import org.apache.falcon.FalconException;
+import org.apache.falcon.entity.parser.ValidationException;
 import org.apache.falcon.entity.store.StoreAccessException;
 import org.apache.falcon.extensions.jdbc.ExtensionMetaStore;
 import org.apache.falcon.extensions.mirroring.hdfs.HdfsMirroringExtension;
@@ -33,16 +42,6 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.io.OutputStreamWriter;
-import java.io.BufferedWriter;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URISyntaxException;
-import java.util.Map;
-
 /**
  *  Tests for extension store.
  */
@@ -95,11 +94,17 @@ public class ExtensionStoreTest extends AbstractTestExtensionStore {
 
     @BeforeMethod
     public void clean() {
-        clear();
+        clearDB();
+        // Clean up FS
+        try {
+            fs.delete(new Path(extensionStorePath + "/hdfs-mirroring"), true);
+        } catch (IOException e) {
+            // Ignore
+        }
     }
 
 
-    @Test(enabled = false)
+    @Test
     public void testRegisterExtensionMetadata() throws IOException, URISyntaxException, FalconException{
         createlibs();
         createReadmeAndJar();
@@ -110,7 +115,7 @@ public class ExtensionStoreTest extends AbstractTestExtensionStore {
         Assert.assertEquals(metaStore.getAllExtensions().size(), 1);
     }
 
-    @Test(expectedExceptions=FileNotFoundException.class)
+    @Test(expectedExceptions=ValidationException.class)
     public void testFailureCaseRegisterExtensionMetadata() throws IOException, URISyntaxException,
FalconException{
         store = ExtensionStore.get();
         createlibs();
@@ -160,7 +165,7 @@ public class ExtensionStoreTest extends AbstractTestExtensionStore {
         br.close();
     }
 
-    private void clear() {
+    private void clearDB() {
         EntityManager em = FalconJPAService.get().getEntityManager();
         em.getTransaction().begin();
         try {


Mime
View raw message