drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhe...@apache.org
Subject [04/14] drill git commit: DRILL-5112: Fix config in PopUnitTestBase
Date Tue, 13 Dec 2016 00:40:01 GMT
DRILL-5112: Fix config in PopUnitTestBase

Tests rely on command-line settings in the pom.xml file. Those
settings are not available when tests are run in Eclipse.
Replicated required settings into the base test class (as in
BaseTestQuery).

closes #681


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/963955b9
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/963955b9
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/963955b9

Branch: refs/heads/master
Commit: 963955b94ab75ce52894582791f6669d578af562
Parents: fb32bfe
Author: Paul Rogers <progers@maprtech.com>
Authored: Tue Dec 6 21:11:56 2016 -0800
Committer: Sudheesh Katkam <sudheesh@apache.org>
Committed: Mon Dec 12 15:40:02 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/drill/exec/server/Drillbit.java |  2 +-
 .../impl/mergereceiver/TestMergingReceiver.java     |  3 +--
 .../org/apache/drill/exec/pop/PopUnitTestBase.java  | 16 +++++++++++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/963955b9/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
index a28dc91..547915e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
@@ -64,7 +64,7 @@ public class Drillbit implements AutoCloseable {
     Environment.logEnv("Drillbit environment: ", logger);
   }
 
-  private final static String SYSTEM_OPTIONS_NAME = "org.apache.drill.exec.server.Drillbit.system_options";
+  public final static String SYSTEM_OPTIONS_NAME = "org.apache.drill.exec.server.Drillbit.system_options";
 
   private boolean isClosed = false;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/963955b9/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/mergereceiver/TestMergingReceiver.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/mergereceiver/TestMergingReceiver.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/mergereceiver/TestMergingReceiver.java
index 537a583..71a5070 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/mergereceiver/TestMergingReceiver.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/mergereceiver/TestMergingReceiver.java
@@ -37,7 +37,6 @@ import org.apache.drill.exec.vector.ValueVector;
 import org.junit.Test;
 
 import com.google.common.base.Charsets;
-import com.google.common.collect.Lists;
 import com.google.common.io.Files;
 
 public class TestMergingReceiver extends PopUnitTestBase {
@@ -95,7 +94,7 @@ public class TestMergingReceiver extends PopUnitTestBase {
         final int batchRowCount = queryData.getRowCount();
         count += batchRowCount;
         batchLoader.load(queryData.getDef(), b.getData());
-        for (final VectorWrapper vw : batchLoader) {
+        for (final VectorWrapper<?> vw : batchLoader) {
           final ValueVector vv = vw.getValueVector();
           final ValueVector.Accessor va = vv.getAccessor();
           final MaterializedField materializedField = vv.getField();

http://git-wip-us.apache.org/repos/asf/drill/blob/963955b9/exec/java-exec/src/test/java/org/apache/drill/exec/pop/PopUnitTestBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/PopUnitTestBase.java b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/PopUnitTestBase.java
index 56543ca..b76aad3 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/PopUnitTestBase.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/PopUnitTestBase.java
@@ -18,9 +18,12 @@
 package org.apache.drill.exec.pop;
 
 import java.io.IOException;
+import java.util.Properties;
 
+import org.apache.drill.QueryTestUtil;
 import org.apache.drill.common.config.DrillConfig;
 import org.apache.drill.common.util.FileUtils;
+import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.ExecTest;
 import org.apache.drill.exec.exception.FragmentSetupException;
 import org.apache.drill.exec.physical.PhysicalPlan;
@@ -29,6 +32,7 @@ import org.apache.drill.exec.planner.PhysicalPlanReader;
 import org.apache.drill.exec.planner.fragment.Fragment;
 import org.apache.drill.exec.planner.fragment.Fragment.ExchangeFragmentPair;
 import org.apache.drill.exec.planner.fragment.MakeFragmentsVisitor;
+import org.apache.drill.exec.server.Drillbit;
 import org.apache.drill.exec.work.foreman.ForemanSetupException;
 import org.junit.BeforeClass;
 
@@ -42,7 +46,17 @@ public abstract class PopUnitTestBase  extends ExecTest{
 
   @BeforeClass
   public static void setup() {
-    CONFIG = DrillConfig.create();
+    Properties props = new Properties();
+
+    // Properties here mimic those in drill-root/pom.xml, Surefire plugin
+    // configuration. They allow tests to run successfully in Eclipse.
+
+    props.put(ExecConstants.SYS_STORE_PROVIDER_LOCAL_ENABLE_WRITE, "false");
+    props.put(ExecConstants.HTTP_ENABLE, "false");
+    props.put(Drillbit.SYSTEM_OPTIONS_NAME, "org.apache.drill.exec.compile.ClassTransformer.scalar_replacement=on");
+    props.put(QueryTestUtil.TEST_QUERY_PRINTING_SILENT, "true");
+    props.put("drill.catastrophic_to_standard_out", "true");
+    CONFIG = DrillConfig.create(props);
   }
 
 


Mime
View raw message