From notifications-return-3137-archive-asf-public=cust-asf.ponee.io@fluo.apache.org Mon Jul 9 16:50:24 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 41F2C18062A for ; Mon, 9 Jul 2018 16:50:24 +0200 (CEST) Received: (qmail 56339 invoked by uid 500); 9 Jul 2018 14:50:23 -0000 Mailing-List: contact notifications-help@fluo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fluo.apache.org Delivered-To: mailing list notifications@fluo.apache.org Received: (qmail 56330 invoked by uid 99); 9 Jul 2018 14:50:23 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2018 14:50:23 +0000 From: GitBox To: notifications@fluo.apache.org Subject: [GitHub] kpm1985 commented on a change in pull request #1043: FLUO-1002 Create integration test for `FluoAdmin.remove()` Message-ID: <153114782280.20234.1333827148445953095.gitbox@gitbox.apache.org> Date: Mon, 09 Jul 2018 14:50:22 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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