accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject git commit: ACCUMULO-1507 - updating test to use @Ignore instead of commented out
Date Tue, 29 Oct 2013 23:39:51 GMT
Updated Branches:
  refs/heads/master 5c1078e37 -> 21382d30b


ACCUMULO-1507 - updating test to use @Ignore instead of commented out


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/21382d30
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/21382d30
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/21382d30

Branch: refs/heads/master
Commit: 21382d30b60275e2a1dec1d497c3a50a66fdf05c
Parents: 5c1078e
Author: John Vines <jvines@gmail.com>
Authored: Tue Oct 29 19:39:30 2013 -0400
Committer: John Vines <jvines@gmail.com>
Committed: Tue Oct 29 19:39:30 2013 -0400

----------------------------------------------------------------------
 .../AccumuloReloadingVFSClassLoaderTest.java    | 85 ++++++++++----------
 1 file changed, 43 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/21382d30/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
----------------------------------------------------------------------
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
index 06c914b..eb99297 100644
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
+++ b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
@@ -28,6 +28,7 @@ import org.apache.log4j.Logger;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
@@ -127,48 +128,48 @@ public class AccumuloReloadingVFSClassLoaderTest {
   //
   // This is caused by the filed being deleted and then readded in the same monitor tick.
This causes the file to ultimately register the deletion over any
   // other events.
-//  @Test
-//  public void testFastDeleteAndReAdd() throws Exception {
-//    FileObject testDir = vfs.resolveFile(folder1.getRoot().toURI().toString());
-//    FileObject[] dirContents = testDir.getChildren();
-//
-//    AccumuloReloadingVFSClassLoader arvcl = new AccumuloReloadingVFSClassLoader(folderPath,
vfs, new ReloadingClassLoader() {
-//
-//      @Override
-//      public ClassLoader getClassLoader() {
-//        return ClassLoader.getSystemClassLoader();
-//      }
-//    }, 1000, true);
-//
-//    FileObject[] files = ((VFSClassLoader) arvcl.getClassLoader()).getFileObjects();
-//    Assert.assertArrayEquals(createFileSystems(dirContents), files);
-//
-//    Class<?> clazz1 = arvcl.getClassLoader().loadClass("test.HelloWorld");
-//    Object o1 = clazz1.newInstance();
-//    Assert.assertEquals("Hello World!", o1.toString());
-//
-//    // Check that the class is the same before the update
-//    Class<?> clazz1_5 = arvcl.getClassLoader().loadClass("test.HelloWorld");
-//    Assert.assertEquals(clazz1, clazz1_5);
-//
-//    new File(folder1.getRoot(), "HelloWorld.jar").delete();
-//
-//    // Update the class
-//    FileUtils.copyURLToFile(this.getClass().getResource("/HelloWorld.jar"), folder1.newFile("HelloWorld.jar"));
-//
-//    // Wait for the monitor to notice
-//    Thread.sleep(2000);
-//
-//    Class<?> clazz2 = arvcl.getClassLoader().loadClass("test.HelloWorld");
-//    Object o2 = clazz2.newInstance();
-//    Assert.assertEquals("Hello World!", o2.toString());
-//
-//    // This is false because they are loaded by a different classloader
-//    Assert.assertFalse(clazz1.equals(clazz2));
-//    Assert.assertFalse(o1.equals(o2));
-//
-//    arvcl.close();
-//  }
+  @Test @Ignore
+  public void testFastDeleteAndReAdd() throws Exception {
+    FileObject testDir = vfs.resolveFile(folder1.getRoot().toURI().toString());
+    FileObject[] dirContents = testDir.getChildren();
+
+    AccumuloReloadingVFSClassLoader arvcl = new AccumuloReloadingVFSClassLoader(folderPath,
vfs, new ReloadingClassLoader() {
+
+      @Override
+      public ClassLoader getClassLoader() {
+        return ClassLoader.getSystemClassLoader();
+      }
+    }, 1000, true);
+
+    FileObject[] files = ((VFSClassLoader) arvcl.getClassLoader()).getFileObjects();
+    Assert.assertArrayEquals(createFileSystems(dirContents), files);
+
+    Class<?> clazz1 = arvcl.getClassLoader().loadClass("test.HelloWorld");
+    Object o1 = clazz1.newInstance();
+    Assert.assertEquals("Hello World!", o1.toString());
+
+    // Check that the class is the same before the update
+    Class<?> clazz1_5 = arvcl.getClassLoader().loadClass("test.HelloWorld");
+    Assert.assertEquals(clazz1, clazz1_5);
+
+    new File(folder1.getRoot(), "HelloWorld.jar").delete();
+
+    // Update the class
+    FileUtils.copyURLToFile(this.getClass().getResource("/HelloWorld.jar"), folder1.newFile("HelloWorld.jar"));
+
+    // Wait for the monitor to notice
+    Thread.sleep(2000);
+
+    Class<?> clazz2 = arvcl.getClassLoader().loadClass("test.HelloWorld");
+    Object o2 = clazz2.newInstance();
+    Assert.assertEquals("Hello World!", o2.toString());
+
+    // This is false because they are loaded by a different classloader
+    Assert.assertFalse(clazz1.equals(clazz2));
+    Assert.assertFalse(o1.equals(o2));
+
+    arvcl.close();
+  }
 
   @Test
   public void testModifiedClass() throws Exception {


Mime
View raw message