drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arina-ielchiieva <...@git.apache.org>
Subject [GitHub] drill pull request #1225: DRILL-6272: Refactor dynamic UDFs and function ini...
Date Wed, 02 May 2018 11:22:40 GMT
Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1225#discussion_r185459187
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java
---
    @@ -43,27 +44,32 @@
     import java.util.concurrent.Future;
     import java.util.concurrent.atomic.AtomicInteger;
     
    +import static org.apache.drill.test.TestTools.getResourceFile;
     import static org.junit.Assert.assertEquals;
     import static org.junit.Assert.assertTrue;
    -import static org.mockito.Matchers.any;
    -import static org.mockito.Mockito.doAnswer;
    -import static org.mockito.Mockito.spy;
     
    -@RunWith(MockitoJUnitRunner.class)
     @Category(SqlFunctionTest.class)
     public class FunctionInitializerTest {
     
    -  private static final String CLASS_NAME = "com.drill.udf.CustomLowerFunction";
    +  @ClassRule
    +  public static final BaseDirTestWatcher dirTestWatcher = new BaseDirTestWatcher();
    +
    +  private static final String CLASS_NAME = "org.apache.drill.udf.dynamic.CustomLowerFunction";
       private static URLClassLoader classLoader;
     
       @BeforeClass
       public static void init() throws Exception {
    -    Path jars = TestTools.WORKING_PATH
    -      .resolve(TestTools.TEST_RESOURCES)
    -      .resolve("jars");
    -    String binaryName = "DrillUDF-1.0.jar";
    -    String sourceName = JarUtil.getSourceName(binaryName);
    -    URL[] urls = {jars.resolve(binaryName).toUri().toURL(), jars.resolve(sourceName).toUri().toURL()};
    +    File projectDir = dirTestWatcher.makeSubDir(Paths.get("drill-udf"));
    +    FileUtils.copyDirectory(getResourceFile(Paths.get(projectDir.getName())), projectDir);
    --- End diff --
    
    Done, thanks.


---

Mime
View raw message