tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject tajo git commit: TAJO-1862: TSQL gives user wrong URL of documentation.
Date Thu, 26 Nov 2015 00:25:41 GMT
Repository: tajo
Updated Branches:
  refs/heads/master b3d4a3402 -> 8457d85a3


TAJO-1862: TSQL gives user wrong URL of documentation.

Closes #867


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

Branch: refs/heads/master
Commit: 8457d85a3d138f62dd7803ea1aacc7bffdc66cdd
Parents: b3d4a34
Author: Dongkyu Hwangbo <hwangbodk@gmail.com>
Authored: Wed Nov 25 16:23:44 2015 -0800
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Wed Nov 25 16:24:03 2015 -0800

----------------------------------------------------------------------
 CHANGES                                         |  3 +++
 .../tajo/cli/tsql/commands/HelpCommand.java     |  6 +++---
 .../org/apache/tajo/cli/tsql/TestTajoCli.java   | 22 ++++++++++++++++++++
 3 files changed, 28 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/8457d85a/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index be0a699..a401989 100644
--- a/CHANGES
+++ b/CHANGES
@@ -42,6 +42,9 @@ Release 0.12.0 - unreleased
 
   BUG FIXES
 
+    TAJO-1862: TSQL gives user wrong URL of documentation. 
+    (Contributed by Dongkyu Hwangbo, committed by hyunsik)
+
     TAJO-1980: Printout the usage of TajoShellCommand.
     (Contributed by Dongkyu Hwangbo, committed by jaehwa)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/8457d85a/tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/HelpCommand.java
----------------------------------------------------------------------
diff --git a/tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/HelpCommand.java b/tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/HelpCommand.java
index ce56d12..f051e6a 100644
--- a/tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/HelpCommand.java
+++ b/tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/HelpCommand.java
@@ -107,15 +107,15 @@ public class HelpCommand extends TajoShellCommand {
 
     int delimiterIdx = tajoFullVersion.indexOf("-");
     if (delimiterIdx > -1) {
-      tajoVersion =  tajoFullVersion.substring(0, delimiterIdx);
+      tajoVersion = tajoFullVersion.substring(0, delimiterIdx);
     } else {
       tajoVersion = tajoFullVersion;
     }
     
-    if(tajoVersion.equalsIgnoreCase("")) {
+    if(tajoVersion.equalsIgnoreCase("") || tajoFullVersion.contains("SNAPSHOT")) {
       docVersion = docDefaultVersion;
     } else {
-    	docVersion = tajoVersion;
+      docVersion = tajoVersion;
     }
 
     return docVersion;

http://git-wip-us.apache.org/repos/asf/tajo/blob/8457d85a/tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java b/tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
index 68c2441..886c280 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
@@ -39,6 +39,7 @@ import org.apache.tajo.rpc.RpcConstants;
 import org.apache.tajo.storage.StorageUtil;
 import org.apache.tajo.storage.TablespaceManager;
 import org.apache.tajo.util.FileUtil;
+import org.apache.tajo.util.VersionInfo;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -565,6 +566,27 @@ public class TestTajoCli {
   }
 
   @Test
+  public void testPrintVersion() {
+    tajoCli.executeMetaCommand("\\?");
+    String consoleResult = new String(out.toByteArray());
+    String tajoFullVersion = VersionInfo.getVersion();
+    String tajoVersion;
+
+    int delimiterIdx = tajoFullVersion.indexOf("-");
+    if (delimiterIdx > -1) {
+      tajoVersion = tajoFullVersion.substring(0, delimiterIdx);
+    } else {
+      tajoVersion = tajoFullVersion;
+    }
+
+    if (tajoVersion.equalsIgnoreCase("") || tajoFullVersion.contains("SNAPSHOT")) {
+      assertTrue(consoleResult.contains("docs/current/"));
+    } else {
+      assertTrue(consoleResult.contains("docs/" + tajoVersion + "/"));
+    }
+  }
+
+  @Test
   public void testDefaultPrintHelp() throws IOException, NoSuchMethodException {
     for (Map.Entry<String, TajoShellCommand> entry : tajoCli.getContext().getCommands().entrySet())
{
       TajoShellCommand shellCommand = entry.getValue();


Mime
View raw message