ACCUMULO-1989 Use default namespace name explicitly in shell

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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: a8f154e45d60304827e681d6a74cc7f9dc3aab94
Parents: ec4bc2f
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Wed Feb 5 18:59:56 2014 -0500
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Wed Feb 5 18:59:56 2014 -0500

----------------------------------------------------------------------
 .../org/apache/accumulo/core/util/shell/Shell.java     |  4 ++--
 .../core/util/shell/commands/NamespacesCommand.java    |  2 +-
 .../java/org/apache/accumulo/test/ShellServerIT.java   | 13 +++++++------
 3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a8f154e4/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java 
b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
index e4a01f9..7f1b8dc 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
@@ -751,8 +751,7 @@ public class Shell extends ShellOptions {
       modifiedUserlist.add(a.replaceAll("([\\s'\"])", "\\\\$1"));
     for (String a : namespaces) {
       String b = a.replaceAll("([\\s'\"])", "\\\\$1");
-      if (!b.isEmpty())
-        modifiedNamespaces.add(b);
+      modifiedNamespaces.add(b.isEmpty() ? "\"\"" : b);
     }
 
     options.put(Command.CompletionSet.USERNAMES, modifiedUserlist);
@@ -881,6 +880,7 @@ public class Shell extends ShellOptions {
 
   public interface PrintLine {
     void print(String s);
+
     void close();
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a8f154e4/core/src/main/java/org/apache/accumulo/core/util/shell/commands/NamespacesCommand.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/NamespacesCommand.java
 
b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/NamespacesCommand.java
index 7f41c32..16ee645 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/NamespacesCommand.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/NamespacesCommand.java
@@ -37,7 +37,7 @@ import com.google.common.collect.Iterators;
 public class NamespacesCommand extends Command {
   private Option disablePaginationOpt, namespaceIdOption;
 
-  private static final String DEFAULT_NAMESPACE_DISPLAY_NAME = "(default)";
+  private static final String DEFAULT_NAMESPACE_DISPLAY_NAME = "\"\"";
 
   @Override
   public int execute(final String fullCommand, final CommandLine cl, final 
Shell shellState) throws AccumuloException, AccumuloSecurityException, 
IOException {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a8f154e4/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java 
b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
index 58652c7..5e6a353 100644
--- a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
@@ -415,9 +415,9 @@ public class ShellServerIT extends SimpleMacIT {
     tableName = tableName + "1";
 
     exec("createtable " + tableName, true);
- 
+
     input.set("customcfcounter\nname1 value1\nname2 value2\n\n");
- 
+
     // Name on the CLI should override OptionDescriber (or user input name, in 
this case)
     exec("setiter -scan -class 
org.apache.accumulo.core.iterators.ColumnFamilyCounter -p 30", true);
     expectedKey = "table.iterator.scan.customcfcounter";
@@ -432,7 +432,7 @@ public class ShellServerIT extends SimpleMacIT {
 
     exec("deletetable " + tableName, true);
     tableName = tableName + "1";
- 
+
     exec("createtable " + tableName, true);
 
     input.set("\nname1 value1.1,value1.2,value1.3\nname2 value2\n\n");
@@ -449,7 +449,7 @@ public class ShellServerIT extends SimpleMacIT {
     expectedValue = "value2";
     checkTableForProperty(tops, tableName, expectedKey, expectedValue);
   }
-  
+
   protected void checkTableForProperty(TableOperations tops, String tableName, 
String expectedKey, String expectedValue) throws Exception {
     for (int i = 0; i < 5; i++) {
       for (Entry<String,String> entry : tops.getProperties(tableName)) {
@@ -460,7 +460,7 @@ public class ShellServerIT extends SimpleMacIT {
       }
       Thread.sleep(500);
     }
-    
+
     fail("Failed to find expected property on " + tableName + ": " + 
expectedKey + "=" + expectedValue);
   }
 
@@ -662,6 +662,7 @@ public class ShellServerIT extends SimpleMacIT {
       exec("help " + c, true);
     }
   }
+
   // @Test(timeout = 30000)
   public void history() throws Exception {
     exec("history -c", true);
@@ -927,7 +928,7 @@ public class ShellServerIT extends SimpleMacIT {
 
   @Test(timeout = 30000)
   public void namespaces() throws Exception {
-    exec("namespaces", true, "(default)", true); // default namespace for 
display purposes only
+    exec("namespaces", true, "\"\"", true); // default namespace, displayed as 
quoted empty string
     exec("namespaces", true, Namespaces.ACCUMULO_NAMESPACE, true);
     exec("createnamespace thing1", true);
     String namespaces = exec("namespaces");

Reply via email to