diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java index 0249566..c257535 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java @@ -1085,21 +1085,7 @@ public void testAddJarConstructorUnCaching() throws Exception { // This test assumes the hive-contrib JAR has been built as part of the Hive build. // Also dependent on the UDFExampleAdd class within that JAR. setReflectionUtilCache(); - String udfClassName = "org.apache.hadoop.hive.contrib.udf.example.UDFExampleAdd"; - String mvnRepo = System.getProperty("maven.local.repository"); - String hiveVersion = System.getProperty("hive.version"); - String jarFileName = "hive-contrib-" + hiveVersion + ".jar"; - String[] pathParts = { - "org", "apache", "hive", - "hive-contrib", hiveVersion, jarFileName - }; - - // Create path to hive-contrib JAR on local filesystem - Path jarFilePath = new Path(mvnRepo); - for (String pathPart : pathParts) { - jarFilePath = new Path(jarFilePath, pathPart); - } - + Path jarFilePath = new Path(dataFileDir, "identity_udf.jar"); Connection conn = getConnection(miniHS2.getJdbcURL(), "foo", "bar"); String tableName = "testAddJar"; Statement stmt = conn.createStatement(); @@ -1126,7 +1112,7 @@ public void testAddJarConstructorUnCaching() throws Exception { // Add the jar file stmt.execute("ADD JAR " + jarFilePath.toString()); // Create a temporary function using the jar - stmt.execute("CREATE TEMPORARY FUNCTION func AS '" + udfClassName + "'"); + stmt.execute("CREATE TEMPORARY FUNCTION func AS 'IdentityStringUDF'"); // Execute the UDF res = stmt.executeQuery("SELECT func(value) from " + tableName); assertTrue(res.next()); @@ -1134,7 +1120,7 @@ public void testAddJarConstructorUnCaching() throws Exception { // Check to make sure the cache is now being used cacheAfterAddJar = getReflectionUtilCacheSize(); System.out.println("CONSTRUCTOR_CACHE size after add jar: " + cacheAfterAddJar); - Assert.assertTrue("FAILED: CONSTRUCTOR_CACHE size after connection close: " + cacheAfterAddJar, + Assert.assertTrue("FAILED: CONSTRUCTOR_CACHE size after add jar: " + cacheAfterAddJar, cacheAfterAddJar > 0); conn.close(); TimeUnit.SECONDS.sleep(10);