From 562a03a0a80097f89ad6a9eb027f6af15a58c812 Mon Sep 17 00:00:00 2001 From: Julien Le Dem Date: Fri, 21 Aug 2015 10:56:55 -0700 Subject: [PATCH] remove deprecated constructor and related test code duplication --- .../exec/planner/PhysicalPlanReader.java | 8 ----- .../apache/drill/exec/SimpleTestFactory.java | 30 +++++++++++++++++++ .../drill/exec/TestOpSerialization.java | 3 +- .../apache/drill/exec/client/DumpCatTest.java | 3 +- .../drill/exec/fn/impl/TestMathFunctions.java | 3 +- .../exec/fn/impl/TestNewMathFunctions.java | 3 +- .../exec/fn/impl/TestRepeatedFunction.java | 3 +- .../config/TestParsePhysicalPlan.java | 4 ++- .../exec/physical/impl/TestCastFunctions.java | 17 ++++++----- .../impl/TestComparisonFunctions.java | 4 ++- .../impl/TestImplicitCastFunctions.java | 4 ++- .../physical/impl/TestSimpleFunctions.java | 7 +++-- .../physical/impl/TestStringFunctions.java | 3 +- .../drill/exec/physical/impl/agg/TestAgg.java | 4 ++- .../physical/impl/common/TestHashTable.java | 4 ++- .../impl/filter/TestSimpleFilter.java | 5 ++-- .../exec/physical/impl/join/TestHashJoin.java | 3 +- .../physical/impl/join/TestMergeJoin.java | 5 ++-- .../physical/impl/limit/TestSimpleLimit.java | 5 ++-- .../impl/project/TestSimpleProjection.java | 3 +- .../physical/impl/sort/TestSimpleSort.java | 5 ++-- .../impl/trace/TestTraceMultiRecordBatch.java | 5 ++-- .../impl/trace/TestTraceOutputDump.java | 3 +- .../physical/impl/union/TestSimpleUnion.java | 3 +- .../drill/exec/pop/TestFragmentChecker.java | 3 +- .../apache/drill/exec/pop/TestFragmenter.java | 5 ++-- .../drill/exec/pop/TestInjectionValue.java | 3 +- 27 files changed, 100 insertions(+), 48 deletions(-) create mode 100644 exec/java-exec/src/test/java/org/apache/drill/exec/SimpleTestFactory.java diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/PhysicalPlanReader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/PhysicalPlanReader.java index 8d77136e14d..2a808271279 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/PhysicalPlanReader.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/PhysicalPlanReader.java @@ -70,14 +70,6 @@ public PhysicalPlanReader(DrillConfig config, ObjectMapper mapper, final Drillbi this.logicalPlanReader = mapper.reader(LogicalPlan.class).with(injectables); } - // TODO - we do not want to storage engine registry generated here in production, this was created to keep old - // tests passing, this constructor should be removed and the tests should be updated to use the contstructor - // that takes a storage engine registry - @Deprecated - public PhysicalPlanReader(DrillConfig config, ObjectMapper mapper, final DrillbitEndpoint endpoint) { - this(config, mapper, endpoint, null); - } - public String writeJson(OptionList list) throws JsonProcessingException{ return mapper.writeValueAsString(list); } diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/SimpleTestFactory.java b/exec/java-exec/src/test/java/org/apache/drill/exec/SimpleTestFactory.java new file mode 100644 index 00000000000..15007b5e4f6 --- /dev/null +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/SimpleTestFactory.java @@ -0,0 +1,30 @@ +/** + * 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.drill.exec; + +import org.apache.drill.common.config.DrillConfig; +import org.apache.drill.exec.planner.PhysicalPlanReader; +import org.apache.drill.exec.proto.CoordinationProtos; + +public class SimpleTestFactory { + + public static PhysicalPlanReader newPhysicalPlanReader(DrillConfig c) { + return new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance(), null); + } +} diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/TestOpSerialization.java b/exec/java-exec/src/test/java/org/apache/drill/exec/TestOpSerialization.java index 05105fc09c8..96a4a5a37a0 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/TestOpSerialization.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/TestOpSerialization.java @@ -18,6 +18,7 @@ package org.apache.drill.exec; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import java.util.List; @@ -44,7 +45,7 @@ public class TestOpSerialization { @Test public void testSerializedDeserialize() throws Throwable { DrillConfig c = DrillConfig.create(); - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); MockSubScanPOP s = new MockSubScanPOP("abc", null); s.setOperatorId(3); Filter f = new Filter(s, new ValueExpressions.BooleanExpression("true", ExpressionPosition.UNKNOWN), 0.1f); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/client/DumpCatTest.java b/exec/java-exec/src/test/java/org/apache/drill/exec/client/DumpCatTest.java index 7c58b19f5b6..c7d9edfad74 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/client/DumpCatTest.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/client/DumpCatTest.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.client; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertTrue; import java.io.FileInputStream; @@ -74,7 +75,7 @@ public void testDumpCat(@Injectable final DrillbitContext bitContext, @Injectabl bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/trace/simple_trace.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestMathFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestMathFunctions.java index 4f06a9d5bf0..c83fa2acf8d 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestMathFunctions.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestMathFunctions.java @@ -18,6 +18,7 @@ package org.apache.drill.exec.fn.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -69,7 +70,7 @@ public void testBasicMathFunctions(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/simple_math_functions.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, BitControl.PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewMathFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewMathFunctions.java index 880184eee1e..72de2d5daf8 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewMathFunctions.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewMathFunctions.java @@ -18,6 +18,7 @@ package org.apache.drill.exec.fn.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -89,7 +90,7 @@ public void runTest(@Injectable final DrillbitContext bitContext, String planString = Resources.toString(Resources.getResource(planPath), Charsets.UTF_8); if (reader == null) { - reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + reader = newPhysicalPlanReader(c); } if (registry == null) { registry = new FunctionImplementationRegistry(c); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestRepeatedFunction.java b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestRepeatedFunction.java index 73c750833b2..81b5839bc61 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestRepeatedFunction.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestRepeatedFunction.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.fn.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -68,7 +69,7 @@ public void testRepeated(@Injectable final DrillbitContext bitContext, @Injectab }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/physical_repeated_1.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/config/TestParsePhysicalPlan.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/config/TestParsePhysicalPlan.java index 4ad181f0111..e7b6a838cbd 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/config/TestParsePhysicalPlan.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/config/TestParsePhysicalPlan.java @@ -17,6 +17,8 @@ */ package org.apache.drill.exec.physical.config; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; + import org.apache.drill.common.config.DrillConfig; import org.apache.drill.common.util.FileUtils; import org.apache.drill.exec.ExecTest; @@ -37,7 +39,7 @@ public class TestParsePhysicalPlan extends ExecTest { @Test public void parseSimplePlan() throws Exception{ DrillConfig c = DrillConfig.create(); - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); ObjectReader r = c.getMapper().reader(PhysicalPlan.class); ObjectWriter writer = c.getMapper().writer(); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/physical_test1.json"), Charsets.UTF_8)); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestCastFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestCastFunctions.java index ffa87650575..deb170b814c 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestCastFunctions.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestCastFunctions.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -89,7 +90,7 @@ public void testCastBigInt(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastBigInt.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -137,7 +138,7 @@ public void testCastInt(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastInt.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -183,7 +184,7 @@ public void testCastFloat4(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastFloat4.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -230,7 +231,7 @@ public void testCastFloat8(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastFloat8.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -277,7 +278,7 @@ public void testCastVarChar(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastVarChar.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -325,7 +326,7 @@ public void testCastVarBinary(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastVarBinary.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -371,7 +372,7 @@ public void testCastNested(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastNested.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -419,7 +420,7 @@ public void testCastNumException(@Injectable final DrillbitContext bitContext, bitContext.getOperatorCreatorRegistry(); result = new OperatorCreatorRegistry(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/cast/testCastNumException.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestComparisonFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestComparisonFunctions.java index c69c6f59c41..daced0ec749 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestComparisonFunctions.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestComparisonFunctions.java @@ -17,6 +17,8 @@ */ package org.apache.drill.exec.physical.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -62,7 +64,7 @@ public void runTest(@Injectable final DrillbitContext bitContext, String planString = Resources.toString(Resources.getResource(COMPARISON_TEST_PHYSICAL_PLAN), Charsets.UTF_8).replaceAll("EXPRESSION", expression); if (reader == null) { - reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + reader = newPhysicalPlanReader(c); } if (registry == null) { registry = new FunctionImplementationRegistry(c); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestImplicitCastFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestImplicitCastFunctions.java index 03c6f412b3d..cd89324b52e 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestImplicitCastFunctions.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestImplicitCastFunctions.java @@ -17,8 +17,10 @@ */ package org.apache.drill.exec.physical.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; + import mockit.Injectable; import mockit.NonStrictExpectations; @@ -77,7 +79,7 @@ public void runTest(@Injectable final DrillbitContext bitContext, String planString = Resources.toString(Resources.getResource(planPath), Charsets.UTF_8); if (reader == null) { - reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + reader = newPhysicalPlanReader(c); } if (registry == null) { registry = new FunctionImplementationRegistry(c); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFunctions.java index d551319ea98..567dc65ba85 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFunctions.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFunctions.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -161,7 +162,7 @@ public void testSubstring(@Injectable final DrillbitContext bitContext, bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/testSubstring.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -203,7 +204,7 @@ public void testSubstringNegative(@Injectable final DrillbitContext bitContext, bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/testSubstringNegative.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -246,7 +247,7 @@ public void testByteSubstring(@Injectable final DrillbitContext bitContext, bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/functions/testByteSubstring.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestStringFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestStringFunctions.java index d72c1e1e321..1397ce4d7b4 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestStringFunctions.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestStringFunctions.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -81,7 +82,7 @@ public void runTest(@Injectable final DrillbitContext bitContext, String planString = Resources.toString(Resources.getResource(planPath), Charsets.UTF_8); if (reader == null) { - reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + reader = newPhysicalPlanReader(c); } if (registry == null) { registry = new FunctionImplementationRegistry(c); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/agg/TestAgg.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/agg/TestAgg.java index d2616a8baf5..edfdf980f0e 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/agg/TestAgg.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/agg/TestAgg.java @@ -17,8 +17,10 @@ */ package org.apache.drill.exec.physical.impl.agg; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; + import mockit.Injectable; import mockit.NonStrictExpectations; @@ -62,7 +64,7 @@ private SimpleRootExec doTest(final DrillbitContext bitContext, UserClientConnec bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile(file), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/common/TestHashTable.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/common/TestHashTable.java index b02249d3147..ca05c5a302f 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/common/TestHashTable.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/common/TestHashTable.java @@ -17,6 +17,8 @@ */ package org.apache.drill.exec.physical.impl.common; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; + import mockit.NonStrictExpectations; import org.apache.drill.common.config.DrillConfig; @@ -57,7 +59,7 @@ private SimpleRootExec doTest(final DrillbitContext bitContext, UserClientConnec - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile(plan_path), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java index a069078ef7d..7a2ace2b30a 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.filter; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -65,7 +66,7 @@ public void testFilter(@Injectable final DrillbitContext bitContext, @Injectable }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/filter/test1.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -94,7 +95,7 @@ public void testSV4Filter(@Injectable final DrillbitContext bitContext, @Injecta bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/filter/test_sv4.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestHashJoin.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestHashJoin.java index 6c067febea3..9ea5097b9eb 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestHashJoin.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestHashJoin.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.join; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -83,7 +84,7 @@ private void testHJMockScanCommon(final DrillbitContext bitContext, UserServer.U bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile(physicalPlan), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoin.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoin.java index 18555c753cb..9ecf5ff7f48 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoin.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestMergeJoin.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.join; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -77,7 +78,7 @@ public void simpleEqualityJoin(@Injectable final DrillbitContext bitContext, bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/join/merge_join.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -302,7 +303,7 @@ public void testJoinBatchSize(@Injectable final DrillbitContext bitContext, @Inj bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/join/join_batchsize.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/limit/TestSimpleLimit.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/limit/TestSimpleLimit.java index 7cdb41a31cf..8797821b6a6 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/limit/TestSimpleLimit.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/limit/TestSimpleLimit.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.limit; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -102,7 +103,7 @@ public void testLimitAcrossBatches(@Injectable final DrillbitContext bitContext, } private void verifyLimitCount(DrillbitContext bitContext, UserServer.UserClientConnection connection, String testPlan, int expectedCount) throws Throwable { - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/limit/" + testPlan), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -122,7 +123,7 @@ private void verifyLimitCount(DrillbitContext bitContext, UserServer.UserClientC } private void verifySum(DrillbitContext bitContext, UserServer.UserClientConnection connection, String testPlan, int expectedCount, long expectedSum) throws Throwable { - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/limit/" + testPlan), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java index 43c430a8805..8cfd16ed0e7 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.project; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -64,7 +65,7 @@ public void project(@Injectable final DrillbitContext bitContext, @Injectable Us bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/project/test1.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/sort/TestSimpleSort.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/sort/TestSimpleSort.java index d51a017d7e3..5c24be71ccb 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/sort/TestSimpleSort.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/sort/TestSimpleSort.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.sort; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -65,7 +66,7 @@ public void sortOneKeyAscending(@Injectable final DrillbitContext bitContext, @I bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - final PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + final PhysicalPlanReader reader = newPhysicalPlanReader(c); final PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/sort/one_key_sort.json"), Charsets.UTF_8)); final FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); final FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -109,7 +110,7 @@ public void sortTwoKeysOneAscendingOneDescending(@Injectable final DrillbitConte bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - final PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + final PhysicalPlanReader reader = newPhysicalPlanReader(c); final PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/sort/two_key_sort.json"), Charsets.UTF_8)); final FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); final FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceMultiRecordBatch.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceMultiRecordBatch.java index b82846e6d4a..05d3190aa55 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceMultiRecordBatch.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceMultiRecordBatch.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.trace; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertTrue; import mockit.Injectable; import mockit.NonStrictExpectations; @@ -70,7 +71,7 @@ public void testFilter(@Injectable final DrillbitContext bitContext, @Injectable bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/trace/multi_record_batch_trace.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); @@ -89,4 +90,4 @@ public void testFilter(@Injectable final DrillbitContext bitContext, @Injectable } assertTrue(!context.isFailed()); } -} \ No newline at end of file +} diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceOutputDump.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceOutputDump.java index 1cb72ffa65e..b7cb80280e6 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceOutputDump.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/trace/TestTraceOutputDump.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.trace; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertTrue; import mockit.Injectable; import mockit.NonStrictExpectations; @@ -84,7 +85,7 @@ public void testFilter(@Injectable final DrillbitContext bitContext, @Injectable bitContext.getCompiler(); result = CodeCompiler.getTestCompiler(c); }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/trace/simple_trace.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/union/TestSimpleUnion.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/union/TestSimpleUnion.java index 07de27f394b..3197f7878a1 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/union/TestSimpleUnion.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/union/TestSimpleUnion.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.physical.impl.union; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import mockit.Injectable; @@ -63,7 +64,7 @@ public void testUnion(@Injectable final DrillbitContext bitContext, @Injectable }}; - PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader reader = newPhysicalPlanReader(c); PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/union/test1.json"), Charsets.UTF_8)); FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c); FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java index 0fbf0bd259f..518af3b1314 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.pop; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import java.util.List; import org.apache.drill.exec.planner.PhysicalPlanReader; @@ -48,7 +49,7 @@ public void checkSimpleExchangePlan() throws Exception{ private void print(String fragmentFile, int bitCount, int expectedFragmentCount) throws Exception{ System.out.println(String.format("=================Building plan fragments for [%s]. Allowing %d total Drillbits.==================", fragmentFile, bitCount)); - PhysicalPlanReader ppr = new PhysicalPlanReader(CONFIG, CONFIG.getMapper(), DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader ppr = newPhysicalPlanReader(CONFIG); Fragment fragmentRoot = getRootFragment(ppr, fragmentFile); SimpleParallelizer par = new SimpleParallelizer(1000*1000, 5, 10, 1.2); List endpoints = Lists.newArrayList(); diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmenter.java b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmenter.java index 6491df6a1d6..b619648659a 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmenter.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmenter.java @@ -17,6 +17,7 @@ */ package org.apache.drill.exec.pop; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -36,7 +37,7 @@ public class TestFragmenter extends PopUnitTestBase { @Test public void ensureOneFragment() throws FragmentSetupException, IOException, ForemanSetupException { - PhysicalPlanReader ppr = new PhysicalPlanReader(CONFIG, CONFIG.getMapper(), DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader ppr = newPhysicalPlanReader(CONFIG); Fragment b = getRootFragment(ppr, "/physical_test1.json"); assertEquals(1, getFragmentCount(b)); assertEquals(0, b.getReceivingExchangePairs().size()); @@ -45,7 +46,7 @@ public void ensureOneFragment() throws FragmentSetupException, IOException, Fore @Test public void ensureThreeFragments() throws FragmentSetupException, IOException, ForemanSetupException { - PhysicalPlanReader ppr = new PhysicalPlanReader(CONFIG, CONFIG.getMapper(), DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader ppr = newPhysicalPlanReader(CONFIG); Fragment b = getRootFragment(ppr, "/physical_double_exchange.json"); logger.debug("Fragment Node {}", b); assertEquals(3, getFragmentCount(b)); 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 ac03f7aecaa..de1b1516e8c 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,6 +17,7 @@ */ package org.apache.drill.exec.pop; +import static org.apache.drill.exec.SimpleTestFactory.newPhysicalPlanReader; import static org.junit.Assert.assertEquals; import java.util.List; @@ -47,7 +48,7 @@ public static void setup(){ @Test public void testInjected() throws Exception{ - PhysicalPlanReader r = new PhysicalPlanReader(config, config.getMapper(), DrillbitEndpoint.getDefaultInstance()); + PhysicalPlanReader r = newPhysicalPlanReader(config); PhysicalPlan p = r.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile("/physical_screen.json"), Charsets.UTF_8)); List o = p.getSortedOperators(false);