You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@fluo.apache.org by GitBox <gi...@apache.org> on 2018/07/09 14:50:22 UTC

[GitHub] kpm1985 commented on a change in pull request #1043: FLUO-1002 Create integration test for `FluoAdmin.remove()`

kpm1985 commented on a change in pull request #1043: FLUO-1002 Create integration test for `FluoAdmin.remove()`
URL: https://github.com/apache/fluo/pull/1043#discussion_r201030638
 
 

 ##########
 File path: modules/integration/src/test/java/org/apache/fluo/integration/client/FluoAdminImplIT.java
 ##########
 @@ -184,4 +191,72 @@ public void testInitializeLongChroot() throws Exception {
     }
   }
 
+  @Test
+  public void testRemove() throws Exception {
+
+    try (FluoAdmin admin = new FluoAdminImpl(config)) {
+      admin.remove();
+      fail("This should fail with the oracle server running");
+    } catch (FluoException e) {
+    }
+
+    // write/verify some data
+    String row = "Logicians";
+    Column fname = new Column("name", "first");
+    Column lname = new Column("name", "last");
+
+    try (FluoClient client = FluoFactory.newClient(config)) {
+      try (Transaction tx = client.newTransaction()) {
+        tx.set(row, fname, "Kurt");
+        tx.set(row, lname, "Godel");
+        tx.commit();
+      }
+      // read it for sanity
+      try (Snapshot snap = client.newSnapshot()) {
+        System.out.println("First name: " + snap.gets(row, fname));
+        System.out.println("Last name: " + snap.gets(row, lname));
+        System.out.println("Iterables size: " + Iterables.size(snap.scanner().build()));
+      }
+    }
+
+    oserver.stop();
+
+    try (FluoAdmin admin = new FluoAdminImpl(config)) {
+      admin.remove(); // pass with oracle stopped
+    }
+
+    try (FluoAdmin admin = new FluoAdminImpl(config)) {
+      InitializationOptions opts =
+          new InitializationOptions().setClearTable(false).setClearZookeeper(false);
+      admin.initialize(opts); 
+    }
+
+    oserver.start();
 
 Review comment:
   @keith-turner That was just what was needed!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services