Github user vrozov commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1225#discussion_r185384630
  
    --- 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 --
    
    Consider using `<directory>` in pom.xml if the goal here is to avoid 
creating files in the `src` path.


---

Reply via email to