[
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463183#comment-16463183
]
ASF GitHub Bot commented on DRILL-6272:
---------------------------------------
vrozov commented on a change in pull request #1225: DRILL-6272: Refactor
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185960865
##########
File path:
exec/java-exec/src/test/java/org/apache/drill/exec/udf/dynamic/TestDynamicUDFSupport.java
##########
@@ -76,23 +73,35 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-@RunWith(MockitoJUnitRunner.class)
@Category({SlowTest.class, SqlFunctionTest.class})
public class TestDynamicUDFSupport extends BaseTestQuery {
+ private static final String DEFAULT_JAR_NAME = "drill-custom-lower";
- private static final Path jars = TestTools.WORKING_PATH
- .resolve(TestTools.TEST_RESOURCES)
- .resolve("jars");
- private static final String default_binary_name = "DrillUDF-1.0.jar";
- private static final String UDF_SUB_DIR = "udf";
- private static final String default_source_name =
JarUtil.getSourceName(default_binary_name);
private static URI fsUri;
private static File udfDir;
+ private static File jarsDir;
+ private static File buildDirectory;
+ private static JarBuilder jarBuilder;
+
+ private static String defaultBinaryJar;
+ private static String defaultSourceJar;
@BeforeClass
- public static void setup() throws IOException {
- udfDir = dirTestWatcher.makeSubDir(Paths.get(UDF_SUB_DIR));
+ public static void buildAndStoreDefaultJars() throws IOException {
+ jarsDir = dirTestWatcher.makeSubDir(Paths.get("jars"));
+ buildDirectory = dirTestWatcher.makeSubDir(Paths.get("drill-udf"));
+
+ jarBuilder = new JarBuilder("src/test/resources/drill-udf");
+ defaultBinaryJar = buildJars(DEFAULT_JAR_NAME,
"**/CustomLowerFunction.java", null);
+ defaultSourceJar = JarUtil.getSourceName(defaultBinaryJar);
+
+ FileUtils.copyFileToDirectory(new File(buildDirectory, defaultBinaryJar),
jarsDir);
+ FileUtils.copyFileToDirectory(new File(buildDirectory, defaultSourceJar),
jarsDir);
+ }
+ @BeforeClass
Review comment:
Consider `@Before` instead of calling it from `reset()`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Remove binary jars files from source distribution
> -------------------------------------------------
>
> Key: DRILL-6272
> URL: https://issues.apache.org/jira/browse/DRILL-6272
> Project: Apache Drill
> Issue Type: Task
> Reporter: Vlad Rozov
> Assignee: Arina Ielchiieva
> Priority: Critical
> Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under
> exec/java-exec/src/test/resources/jars
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)