Repository: incubator-drill Updated Branches: refs/heads/master 4198a17a8 -> f86639c31
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestInjectionValue.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestInjectionValue.java b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestInjectionValue.java index 43fce83..ac03f7a 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestInjectionValue.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestInjectionValue.java @@ -17,7 +17,7 @@ */ package org.apache.drill.exec.pop; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import java.util.List; http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/exec/java-exec/src/test/java/org/apache/drill/exec/record/vector/TestDateTypes.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/record/vector/TestDateTypes.java b/exec/java-exec/src/test/java/org/apache/drill/exec/record/vector/TestDateTypes.java index f4fd7ae..46e721d 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/record/vector/TestDateTypes.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/record/vector/TestDateTypes.java @@ -17,52 +17,25 @@ */ package org.apache.drill.exec.record.vector; -import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; -import mockit.Injectable; -import mockit.NonStrictExpectations; +import java.util.Iterator; +import java.util.List; -import org.apache.drill.common.config.DrillConfig; -import org.apache.drill.common.expression.ExpressionPosition; -import org.apache.drill.common.expression.SchemaPath; import org.apache.drill.common.util.FileUtils; import org.apache.drill.exec.client.DrillClient; -import org.apache.drill.exec.expr.fn.FunctionImplementationRegistry; -import org.apache.drill.exec.memory.BufferAllocator; -import org.apache.drill.exec.memory.TopLevelAllocator; -import org.apache.drill.exec.ops.FragmentContext; -import org.apache.drill.exec.physical.PhysicalPlan; -import org.apache.drill.exec.physical.base.FragmentRoot; -import org.apache.drill.exec.physical.impl.OperatorCreatorRegistry; -import org.apache.drill.exec.physical.impl.ImplCreator; -import org.apache.drill.exec.physical.impl.SimpleRootExec; -import org.apache.drill.exec.planner.PhysicalPlanReader; import org.apache.drill.exec.pop.PopUnitTestBase; -import org.apache.drill.exec.proto.BitControl; -import org.apache.drill.exec.proto.CoordinationProtos; -import org.apache.drill.exec.proto.ExecProtos.FragmentHandle; -import org.apache.drill.exec.proto.UserProtos; import org.apache.drill.exec.record.RecordBatchLoader; import org.apache.drill.exec.record.VectorWrapper; import org.apache.drill.exec.rpc.user.QueryResultBatch; -import org.apache.drill.exec.rpc.user.UserServer.UserClientConnection; import org.apache.drill.exec.server.Drillbit; -import org.apache.drill.exec.server.DrillbitContext; import org.apache.drill.exec.server.RemoteServiceSet; -import org.apache.drill.exec.vector.BigIntVector; -import org.apache.drill.exec.vector.Float8Vector; - import org.apache.drill.exec.vector.ValueVector; -import org.junit.Ignore; import org.junit.Test; import com.google.common.base.Charsets; import com.google.common.io.Files; -import com.codahale.metrics.MetricRegistry; - -import java.util.Iterator; -import java.util.List; /* This class tests the existing date types. Simply using date types * by casting from VarChar, performing basic functions and converting http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/exec/java-exec/src/test/java/org/apache/drill/exec/util/MiniZooKeeperCluster.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/util/MiniZooKeeperCluster.java b/exec/java-exec/src/test/java/org/apache/drill/exec/util/MiniZooKeeperCluster.java index 64a15b7..7e9dbbd 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/util/MiniZooKeeperCluster.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/util/MiniZooKeeperCluster.java @@ -17,14 +17,12 @@ */ package org.apache.drill.exec.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.fs.FileUtil; -import org.apache.zookeeper.server.NIOServerCnxnFactory; -import org.apache.zookeeper.server.ZooKeeperServer; -import org.apache.zookeeper.server.persistence.FileTxnLog; - -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.Reader; import java.net.BindException; import java.net.InetSocketAddress; import java.net.Socket; @@ -32,6 +30,13 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.fs.FileUtil; +import org.apache.zookeeper.server.NIOServerCnxnFactory; +import org.apache.zookeeper.server.ZooKeeperServer; +import org.apache.zookeeper.server.persistence.FileTxnLog; + /** * Mostly Copied from HBase's MiniZooKeeperCluster, but without the Hadoop dependency. */ http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/exec/java-exec/src/test/java/org/apache/drill/exec/work/batch/FileTest.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/work/batch/FileTest.java b/exec/java-exec/src/test/java/org/apache/drill/exec/work/batch/FileTest.java index 6248f57..b98317f 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/work/batch/FileTest.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/work/batch/FileTest.java @@ -17,17 +17,20 @@ */ package org.apache.drill.exec.work.batch; -import com.google.common.base.Stopwatch; -import org.apache.drill.exec.store.LocalSyncableFileSystem; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.*; - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.concurrent.TimeUnit; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FSDataInputStream; +import org.apache.hadoop.fs.FSDataOutputStream; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; + +import com.google.common.base.Stopwatch; + public class FileTest { public static void main(String[] args) throws IOException { Configuration conf = new Configuration(); http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java ---------------------------------------------------------------------- diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java index 311b3a5..44cba3d 100644 --- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java +++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java @@ -17,38 +17,17 @@ */ package org.apache.drill.jdbc.test; -import java.io.File; -import java.lang.Exception; -import java.lang.RuntimeException; -import java.nio.file.Paths; -import java.sql.*; +import static org.junit.Assert.assertEquals; + import java.sql.Connection; -import java.sql.DriverManager; import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.io.FileUtils; -import org.apache.drill.common.util.TestTools; -import org.apache.drill.exec.store.hive.HiveTestDataGenerator; -import org.apache.drill.jdbc.Driver; -import org.apache.drill.jdbc.JdbcTest; -import org.junit.Assert; -import org.junit.BeforeClass; + import org.junit.Ignore; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.TestRule; import com.google.common.base.Function; -import com.google.common.base.Stopwatch; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; public class TestJdbcQuery extends JdbcTestQueryBase{ static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestJdbcQuery.class); http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 2fa4778..2844a10 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ <executions> <execution> <id>rat-checks</id> - <phase>compile</phase> + <phase>validate</phase> <goals> <goal>check</goal> </goals> @@ -136,6 +136,7 @@ <exclude>**/*.iml</exclude> <exclude>**/*.tdd</exclude> <exclude>**/*.project</exclude> + <exclude>**/*.checkstyle</exclude> <exclude>.*/**</exclude> <exclude>*.patch</exclude> <exclude>**/*.pb.cc</exclude> @@ -143,7 +144,30 @@ </excludes> </configuration> </plugin> - + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.12.1</version> + <executions> + <execution> + <id>checkstyle-validation</id> + <phase>validate</phase> + <configuration> + <encoding>UTF-8</encoding> + <failsOnError>true</failsOnError> + <consoleOutput>true</consoleOutput> + <includeTestSourceDirectory>true</includeTestSourceDirectory> + <configLocation>src/main/resources/checkstyle-config.xml</configLocation> + <suppressionsLocation>src/main/resources/checkstyle-suppressions.xml</suppressionsLocation> + </configuration> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/src/main/resources/checkstyle-config.xml ---------------------------------------------------------------------- diff --git a/src/main/resources/checkstyle-config.xml b/src/main/resources/checkstyle-config.xml new file mode 100644 index 0000000..6743466 --- /dev/null +++ b/src/main/resources/checkstyle-config.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- 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. --> +<!DOCTYPE module PUBLIC + "-//Puppy Crawl//DTD Check Configuration 1.2//EN" + "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> + +<!-- Checkstyle configuration for Apache Drill --> + +<module name="Checker"> + + <module name="TreeWalker"> + + <module name="IllegalImport"> + <property name="illegalPkgs" value="com.google.hive12,com.beust.jcommander.internal,jersey.repackaged"/> + </module> + + <module name="AvoidStarImport"> + <property name="allowStaticMemberImports" value="true"/> + </module> + + </module> +</module> http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/5da52cb5/src/main/resources/checkstyle-suppressions.xml ---------------------------------------------------------------------- diff --git a/src/main/resources/checkstyle-suppressions.xml b/src/main/resources/checkstyle-suppressions.xml new file mode 100644 index 0000000..c30ff09 --- /dev/null +++ b/src/main/resources/checkstyle-suppressions.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- 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. --> +<!DOCTYPE suppressions PUBLIC + "-//Puppy Crawl//DTD Suppressions 1.1//EN" + "suppressions_1_1.dtd"> + +<!-- Checkstyle Suppressions for Apache Drill --> +<suppressions> + <suppress files="[\\/]generated-sources[\\/]" checks="AvoidStarImport"/> +</suppressions>
