flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [05/12] flink git commit: [FLINK-7188] [java] Activate checkstyle flink-java/summarize
Date Mon, 31 Jul 2017 11:59:12 GMT
http://git-wip-us.apache.org/repos/asf/flink/blob/8bd537fd/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortSummaryAggregatorTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortSummaryAggregatorTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortSummaryAggregatorTest.java
index ebbf627..fe29582 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortSummaryAggregatorTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortSummaryAggregatorTest.java
@@ -19,10 +19,13 @@
 package org.apache.flink.api.java.summarize.aggregation;
 
 import org.apache.flink.api.java.summarize.NumericColumnSummary;
+
 import org.junit.Assert;
 import org.junit.Test;
 
-
+/**
+ * Tests for {@link ShortSummaryAggregator}.
+ */
 public class ShortSummaryAggregatorTest {
 
 	@Test
@@ -70,7 +73,7 @@ public class ShortSummaryAggregatorTest {
 	@Test
 	public void testMax() throws Exception {
 		Assert.assertEquals(1001, summarize(-1000, 0, 1, 50, 999, 1001).getMax().shortValue());
-		Assert.assertEquals(0, summarize((int)Short.MIN_VALUE, -1000, 0).getMax().shortValue());
+		Assert.assertEquals(0, summarize((int) Short.MIN_VALUE, -1000, 0).getMax().shortValue());
 		Assert.assertEquals(11, summarize(1, 8, 7, 6, 9, 10, 2, 3, 5, 0, 11, -2, 3).getMax().shortValue());
 		Assert.assertEquals(11, summarize(1, 8, 7, 6, 9, null, 10, 2, 3, 5, null, 0, 11, -2, 3).getMax().shortValue());
 		Assert.assertNull(summarize().getMax());
@@ -79,46 +82,46 @@ public class ShortSummaryAggregatorTest {
 	@Test
 	public void testMin() throws Exception {
 		Assert.assertEquals(-1000, summarize(-1000, 0, 1, 50, 999, 1001).getMin().shortValue());
-		Assert.assertEquals(Short.MIN_VALUE, summarize((int)Short.MIN_VALUE, -1000, 0).getMin().shortValue());
+		Assert.assertEquals(Short.MIN_VALUE, summarize((int) Short.MIN_VALUE, -1000, 0).getMin().shortValue());
 		Assert.assertEquals(-2, summarize(1, 8, 7, 6, 9, 10, 2, 3, 5, 0, 11, -2, 3).getMin().shortValue());
 		Assert.assertEquals(-2, summarize(1, 8, 7, 6, 9, null, 10, 2, 3, 5, null, 0, 11, -2, 3).getMin().shortValue());
 		Assert.assertNull(summarize().getMin());
 	}
 
 	/**
-	 * Helper method for summarizing a list of values
+	 * Helper method for summarizing a list of values.
 	 */
 	protected NumericColumnSummary<Short> summarize(Integer... values) {
 
 		// cast everything to short here
 		Short[] shortValues = new Short[values.length];
-		for(int i = 0; i < values.length; i++) {
+		for (int i = 0; i < values.length; i++) {
 			if (values[i] != null) {
 				shortValues[i] = values[i].shortValue();
 			}
 		}
 
-		return new AggregateCombineHarness<Short,NumericColumnSummary<Short>,ShortSummaryAggregator>()
{
+		return new AggregateCombineHarness<Short, NumericColumnSummary<Short>, ShortSummaryAggregator>()
{
 
 			@Override
 			protected void compareResults(NumericColumnSummary<Short> result1, NumericColumnSummary<Short>
result2) {
 
-				Assert.assertEquals(result1.getTotalCount(),result2.getTotalCount());
-				Assert.assertEquals(result1.getNullCount(),result2.getNullCount());
-				Assert.assertEquals(result1.getMissingCount(),result2.getMissingCount());
-				Assert.assertEquals(result1.getNonMissingCount(),result2.getNonMissingCount());
-				Assert.assertEquals(result1.getInfinityCount(),result2.getInfinityCount());
-				Assert.assertEquals(result1.getNanCount(),result2.getNanCount());
+				Assert.assertEquals(result1.getTotalCount(), result2.getTotalCount());
+				Assert.assertEquals(result1.getNullCount(), result2.getNullCount());
+				Assert.assertEquals(result1.getMissingCount(), result2.getMissingCount());
+				Assert.assertEquals(result1.getNonMissingCount(), result2.getNonMissingCount());
+				Assert.assertEquals(result1.getInfinityCount(), result2.getInfinityCount());
+				Assert.assertEquals(result1.getNanCount(), result2.getNanCount());
 
-				Assert.assertEquals(result1.containsNull(),result2.containsNull());
-				Assert.assertEquals(result1.containsNonNull(),result2.containsNonNull());
+				Assert.assertEquals(result1.containsNull(), result2.containsNull());
+				Assert.assertEquals(result1.containsNonNull(), result2.containsNonNull());
 
-				Assert.assertEquals(result1.getMin().shortValue(),result2.getMin().shortValue());
+				Assert.assertEquals(result1.getMin().shortValue(), result2.getMin().shortValue());
 				Assert.assertEquals(result1.getMax().shortValue(), result2.getMax().shortValue());
-				Assert.assertEquals(result1.getSum().shortValue(),result2.getSum().shortValue());
+				Assert.assertEquals(result1.getSum().shortValue(), result2.getSum().shortValue());
 				Assert.assertEquals(result1.getMean().doubleValue(), result2.getMean().doubleValue(),
1e-12d);
-				Assert.assertEquals(result1.getVariance().doubleValue(),result2.getVariance().doubleValue(),
1e-9d);
-				Assert.assertEquals(result1.getStandardDeviation().doubleValue(),result2.getStandardDeviation().doubleValue(),
1e-12d);
+				Assert.assertEquals(result1.getVariance().doubleValue(), result2.getVariance().doubleValue(),
1e-9d);
+				Assert.assertEquals(result1.getStandardDeviation().doubleValue(), result2.getStandardDeviation().doubleValue(),
1e-12d);
 			}
 		}.summarize(shortValues);
 	}

http://git-wip-us.apache.org/repos/asf/flink/blob/8bd537fd/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortValueSummaryAggregatorTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortValueSummaryAggregatorTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortValueSummaryAggregatorTest.java
index 8a8e7aa..6e60aea 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortValueSummaryAggregatorTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/ShortValueSummaryAggregatorTest.java
@@ -20,43 +20,47 @@ package org.apache.flink.api.java.summarize.aggregation;
 
 import org.apache.flink.api.java.summarize.NumericColumnSummary;
 import org.apache.flink.types.ShortValue;
+
 import org.junit.Assert;
 
+/**
+ * Tests for {@link ValueSummaryAggregator.ShortValueSummaryAggregator}.
+ */
 public class ShortValueSummaryAggregatorTest extends ShortSummaryAggregatorTest {
 
 	/**
-	 * Helper method for summarizing a list of values
+	 * Helper method for summarizing a list of values.
 	 */
 	protected NumericColumnSummary<Short> summarize(Integer... values) {
 
 		ShortValue[] shortValues = new ShortValue[values.length];
-		for(int i = 0; i < values.length; i++) {
+		for (int i = 0; i < values.length; i++) {
 			if (values[i] != null) {
 				shortValues[i] = new ShortValue(values[i].shortValue());
 			}
 		}
 
-		return new AggregateCombineHarness<ShortValue,NumericColumnSummary<Short>,ValueSummaryAggregator.ShortValueSummaryAggregator>()
{
+		return new AggregateCombineHarness<ShortValue, NumericColumnSummary<Short>, ValueSummaryAggregator.ShortValueSummaryAggregator>()
{
 
 			@Override
 			protected void compareResults(NumericColumnSummary<Short> result1, NumericColumnSummary<Short>
result2) {
 
 				Assert.assertEquals(result1.getTotalCount(), result2.getTotalCount());
-				Assert.assertEquals(result1.getNullCount(),result2.getNullCount());
-				Assert.assertEquals(result1.getMissingCount(),result2.getMissingCount());
-				Assert.assertEquals(result1.getNonMissingCount(),result2.getNonMissingCount());
-				Assert.assertEquals(result1.getInfinityCount(),result2.getInfinityCount());
-				Assert.assertEquals(result1.getNanCount(),result2.getNanCount());
+				Assert.assertEquals(result1.getNullCount(), result2.getNullCount());
+				Assert.assertEquals(result1.getMissingCount(), result2.getMissingCount());
+				Assert.assertEquals(result1.getNonMissingCount(), result2.getNonMissingCount());
+				Assert.assertEquals(result1.getInfinityCount(), result2.getInfinityCount());
+				Assert.assertEquals(result1.getNanCount(), result2.getNanCount());
 
-				Assert.assertEquals(result1.containsNull(),result2.containsNull());
-				Assert.assertEquals(result1.containsNonNull(),result2.containsNonNull());
+				Assert.assertEquals(result1.containsNull(), result2.containsNull());
+				Assert.assertEquals(result1.containsNonNull(), result2.containsNonNull());
 
-				Assert.assertEquals(result1.getMin().shortValue(),result2.getMin().shortValue());
+				Assert.assertEquals(result1.getMin().shortValue(), result2.getMin().shortValue());
 				Assert.assertEquals(result1.getMax().shortValue(), result2.getMax().shortValue());
-				Assert.assertEquals(result1.getSum().shortValue(),result2.getSum().shortValue());
+				Assert.assertEquals(result1.getSum().shortValue(), result2.getSum().shortValue());
 				Assert.assertEquals(result1.getMean().doubleValue(), result2.getMean().doubleValue(),
1e-12d);
-				Assert.assertEquals(result1.getVariance().doubleValue(),result2.getVariance().doubleValue(),
1e-9d);
-				Assert.assertEquals(result1.getStandardDeviation().doubleValue(),result2.getStandardDeviation().doubleValue(),
1e-12d);
+				Assert.assertEquals(result1.getVariance().doubleValue(), result2.getVariance().doubleValue(),
1e-9d);
+				Assert.assertEquals(result1.getStandardDeviation().doubleValue(), result2.getStandardDeviation().doubleValue(),
1e-12d);
 			}
 		}.summarize(shortValues);
 	}

http://git-wip-us.apache.org/repos/asf/flink/blob/8bd537fd/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringSummaryAggregatorTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringSummaryAggregatorTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringSummaryAggregatorTest.java
index 02fc125..db12fac 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringSummaryAggregatorTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringSummaryAggregatorTest.java
@@ -19,10 +19,13 @@
 package org.apache.flink.api.java.summarize.aggregation;
 
 import org.apache.flink.api.java.summarize.StringColumnSummary;
+
 import org.junit.Assert;
 import org.junit.Test;
 
-
+/**
+ * Tests for {@link StringSummaryAggregator}.
+ */
 public class StringSummaryAggregatorTest {
 
 	@Test
@@ -64,12 +67,12 @@ public class StringSummaryAggregatorTest {
 	/**
 	 * Helper method for summarizing a list of values.
 	 *
-	 * This method breaks the rule of "testing only one thing" by aggregating and combining
+	 * <p>This method breaks the rule of "testing only one thing" by aggregating and combining
 	 * a bunch of different ways.
 	 */
 	protected StringColumnSummary summarize(String... values) {
 
-		return new AggregateCombineHarness<String,StringColumnSummary,StringSummaryAggregator>(){
+		return new AggregateCombineHarness<String, StringColumnSummary, StringSummaryAggregator>(){
 
 			@Override
 			protected void compareResults(StringColumnSummary result1, StringColumnSummary result2)
{

http://git-wip-us.apache.org/repos/asf/flink/blob/8bd537fd/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringValueSummaryAggregatorTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringValueSummaryAggregatorTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringValueSummaryAggregatorTest.java
index 19bfd52..544e285 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringValueSummaryAggregatorTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/StringValueSummaryAggregatorTest.java
@@ -20,27 +20,31 @@ package org.apache.flink.api.java.summarize.aggregation;
 
 import org.apache.flink.api.java.summarize.StringColumnSummary;
 import org.apache.flink.types.StringValue;
+
 import org.junit.Assert;
 
+/**
+ * Tests for {@link ValueSummaryAggregator.StringValueSummaryAggregator}.
+ */
 public class StringValueSummaryAggregatorTest extends StringSummaryAggregatorTest {
 
 	/**
 	 * Helper method for summarizing a list of values.
 	 *
-	 * This method breaks the rule of "testing only one thing" by aggregating and combining
+	 * <p>This method breaks the rule of "testing only one thing" by aggregating and combining
 	 * a bunch of different ways.
 	 */
 	@Override
 	protected StringColumnSummary summarize(String... values) {
 
 		StringValue[] stringValues = new StringValue[values.length];
-		for(int i = 0; i < values.length; i++) {
+		for (int i = 0; i < values.length; i++) {
 			if (values[i] != null) {
 				stringValues[i] = new StringValue(values[i]);
 			}
 		}
 
-		return new AggregateCombineHarness<StringValue,StringColumnSummary,ValueSummaryAggregator.StringValueSummaryAggregator>(){
+		return new AggregateCombineHarness<StringValue, StringColumnSummary, ValueSummaryAggregator.StringValueSummaryAggregator>(){
 
 			@Override
 			protected void compareResults(StringColumnSummary result1, StringColumnSummary result2)
{

http://git-wip-us.apache.org/repos/asf/flink/blob/8bd537fd/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/SummaryAggregatorFactoryTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/SummaryAggregatorFactoryTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/SummaryAggregatorFactoryTest.java
index 8134a90..bf3a100 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/SummaryAggregatorFactoryTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/summarize/aggregation/SummaryAggregatorFactoryTest.java
@@ -18,13 +18,22 @@
 
 package org.apache.flink.api.java.summarize.aggregation;
 
-import org.apache.flink.types.*;
+import org.apache.flink.types.BooleanValue;
+import org.apache.flink.types.DoubleValue;
+import org.apache.flink.types.FloatValue;
+import org.apache.flink.types.IntValue;
+import org.apache.flink.types.LongValue;
+import org.apache.flink.types.ShortValue;
+import org.apache.flink.types.StringValue;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.List;
 
-
+/**
+ * Tests for {@link SummaryAggregatorFactory}.
+ */
 public class SummaryAggregatorFactoryTest {
 
 	@Test

http://git-wip-us.apache.org/repos/asf/flink/blob/8bd537fd/tools/maven/suppressions-java.xml
----------------------------------------------------------------------
diff --git a/tools/maven/suppressions-java.xml b/tools/maven/suppressions-java.xml
index 99aef69..6b63bb1 100644
--- a/tools/maven/suppressions-java.xml
+++ b/tools/maven/suppressions-java.xml
@@ -32,14 +32,6 @@ under the License.
 		checks="UnusedImports|AvoidStarImport"/>
 
 	<suppress
-		files="(.*)api[/\\]java[/\\]summarize[/\\](.*)"
-		checks="NewlineAtEndOfFile|RegexpSingleline|TodoComment|RedundantImport|ImportOrder|RedundantModifier|JavadocMethod|JavadocParagraph|JavadocType|JavadocStyle|PackageName|TypeNameCheck|ConstantNameCheck|StaticVariableNameCheck|MemberNameCheck|MethodNameCheck|ParameterName|LocalFinalVariableName|LocalVariableName|LeftCurly|UpperEll|FallThrough|reliefPattern|SimplifyBooleanExpression|EmptyStatement|ModifierOrder|EmptyLineSeparator|WhitespaceAround|WhitespaceAfter|NoWhitespaceAfter|NoWhitespaceBefore|OperatorWrap|ParenPad"/>
-	<!--Only additional checks for test sources. Those checks were present in the "pre-strict"
checkstyle but were not applied to test sources. We do not want to suppress them for sources
directory-->
-	<suppress
-		files="(.*)test[/\\](.*)api[/\\]java[/\\]summarize[/\\](.*)"
-		checks="AvoidStarImport"/>
-
-	<suppress
 		files="(.*)api[/\\]java[/\\]aggregation[/\\](.*)"
 		checks="NewlineAtEndOfFile|RegexpSingleline|TodoComment|RedundantImport|ImportOrder|RedundantModifier|JavadocMethod|JavadocParagraph|JavadocType|JavadocStyle|PackageName|TypeNameCheck|ConstantNameCheck|StaticVariableNameCheck|MemberNameCheck|MethodNameCheck|ParameterName|LocalFinalVariableName|LocalVariableName|LeftCurly|UpperEll|FallThrough|reliefPattern|SimplifyBooleanExpression|EmptyStatement|ModifierOrder|EmptyLineSeparator|WhitespaceAround|WhitespaceAfter|NoWhitespaceAfter|NoWhitespaceBefore|OperatorWrap|ParenPad"/>
 


Mime
View raw message