Author: philz
Date: Tue Jan 19 19:56:56 2010
New Revision: 900932
URL: http://svn.apache.org/viewvc?rev=900932&view=rev
Log:
AVRO-351. Shorten induce tool description; add check to avoid overly verbose
descriptions. (philz)
Added:
hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/tool/TestMain.java
Modified:
hadoop/avro/trunk/CHANGES.txt
hadoop/avro/trunk/lang/java/src/java/org/apache/avro/reflect/InduceSchemaTool.java
hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java
Modified: hadoop/avro/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=900932&r1=900931&r2=900932&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Tue Jan 19 19:56:56 2010
@@ -640,6 +640,9 @@
AVRO-68. Add license headers to C sources and improve C packaging.
(Matt Massie via cutting)
+ AVRO-351. Shorten induce tool description; add check to avoid overly
verbose
+ descriptions. (philz)
+
OPTIMIZATIONS
BUG FIXES
Modified:
hadoop/avro/trunk/lang/java/src/java/org/apache/avro/reflect/InduceSchemaTool.java
URL:
http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/java/org/apache/avro/reflect/InduceSchemaTool.java?rev=900932&r1=900931&r2=900932&view=diff
==============================================================================
---
hadoop/avro/trunk/lang/java/src/java/org/apache/avro/reflect/InduceSchemaTool.java
(original)
+++
hadoop/avro/trunk/lang/java/src/java/org/apache/avro/reflect/InduceSchemaTool.java
Tue Jan 19 19:56:56 2010
@@ -71,7 +71,6 @@
@Override
public String getShortDescription() {
- return "Use reflection to induce a schema from a class"
- + " or a protocol from an interface.";
+ return "Induce schema/protocol from Java class/interface via reflection.";
}
}
Modified: hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java
URL:
http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java?rev=900932&r1=900931&r2=900932&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java
(original)
+++ hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java Tue Jan
19 19:56:56 2010
@@ -31,11 +31,11 @@
/**
* Available tools, initialized in constructor.
*/
- private final Map<String, Tool> tools;
+ final Map<String, Tool> tools;
int maxLen = 0;
- private Main() {
+ Main() {
tools = new TreeMap<String, Tool>();
for (Tool tool : new Tool[] {
new SpecificCompilerTool(),
Added:
hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/tool/TestMain.java
URL:
http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/tool/TestMain.java?rev=900932&view=auto
==============================================================================
---
hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/tool/TestMain.java
(added)
+++
hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/tool/TestMain.java
Tue Jan 19 19:56:56 2010
@@ -0,0 +1,35 @@
+/**
+ * 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 static org.junit.Assert.fail;
+
+import org.junit.Test;
+
+public class TestMain {
+ @Test
+ /** Make sure that tool descriptions fit in 80 characters. */
+ public void testToolDescriptionLength() {
+ Main m = new Main();
+ for (Tool t : m.tools.values()) {
+ if (m.maxLen + 2 + t.getShortDescription().length() > 80) {
+ fail("Tool description too long: " + t.getName());
+ }
+ }
+ }
+}