[ 
https://issues.apache.org/jira/browse/AVRO-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16708665#comment-16708665
 ] 

ASF GitHub Bot commented on AVRO-1939:
--------------------------------------

nandorKollar closed pull request #399: AVRO-1939: Add missing Apache license 
header
URL: https://github.com/apache/avro/pull/399
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java 
b/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java
index 642b56371..2574b11a2 100644
--- a/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java
+++ b/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java
@@ -210,7 +210,7 @@ public String getName() {
 
   @Override
   public String getShortDescription() {
-    return "extracts samples from files";
+    return "Extracts samples from files";
   }
 
 }
diff --git 
a/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
 
b/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
index 1cd63c710..28fb74b89 100644
--- 
a/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
+++ 
b/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.avro.tool;
 
 import java.io.BufferedInputStream;
@@ -12,9 +29,12 @@
 import org.apache.avro.Schema;
 import org.apache.avro.SchemaNormalization;
 
+/**
+ * Utility to convert an Avro @{Schema} to its canonical form.
+ */
 public class SchemaNormalizationTool implements Tool {
   @Override
-  public String getName() { return "schemacanonical"; }
+  public String getName() { return "canonical"; }
 
   @Override
   public String getShortDescription() { return "Converts an Avro Schema to its 
canonical form"; }
diff --git a/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java 
b/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java
index 5a2acc008..f4ee46d96 100644
--- a/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java
+++ b/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java
@@ -22,8 +22,8 @@
 import org.junit.Test;
 
 public class TestMain {
-  @Test
   /** Make sure that tool descriptions fit in 80 characters. */
+  @Test
   public void testToolDescriptionLength() {
     Main m = new Main();
     for (Tool t : m.tools.values()) {
@@ -32,4 +32,22 @@ public void testToolDescriptionLength() {
       }
     }
   }
+
+  /**
+   * Make sure that the tool name is not too long, otherwise space for
+   * description is too short because they are rebalanced in the CLI.
+   */
+  @Test
+  public void testToolNameLength() {
+    // 13 chosen for backwards compatibility
+    final int MAX_NAME_LENGTH = 13;
+
+    Main m = new Main();
+    for (Tool t : m.tools.values()) {
+      if (t.getName().length() > MAX_NAME_LENGTH) {
+        fail("Tool name too long (" + t.getName().length() + "): " +
+          t.getName() + ". Max length is: " + MAX_NAME_LENGTH);
+      }
+    }
+  }
 }


 

----------------------------------------------------------------
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:
us...@infra.apache.org


> Add command line tool for generating canonical form of schema
> -------------------------------------------------------------
>
>                 Key: AVRO-1939
>                 URL: https://issues.apache.org/jira/browse/AVRO-1939
>             Project: Apache Avro
>          Issue Type: Improvement
>            Reporter: Erik Forsberg
>            Assignee: Daniel Kulp
>            Priority: Major
>             Fix For: 1.9.0
>
>
> Being able to generate canonical form of schemas from avro-tools would be 
> useful, especially when writing canonical schema support in other languages 
> (i.e AVRO-1938).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to