Browse Source

HDFS-17804. [JDK17] Recover test for hadoop-hdfs-native-client (#7782) Contributed by Cheng Pan.

* HDFS-17804. [JDK17] Recover test for hadoop-hdfs-native-client.

Reviewed-by: Gautham Banasandra <gaurava@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
Cheng Pan 5 days ago
parent
commit
6b75775c17

+ 25 - 0
hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml

@@ -77,6 +77,31 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-params</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.platform</groupId>
+      <artifactId>junit-platform-launcher</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/exception.c

@@ -263,8 +263,8 @@ jthrowable newRuntimeError(JNIEnv *env, const char *fmt, ...)
         // Too bad...
         return getPendingExceptionAndClear(env);
     }
-    exc = constructNewObjectOfClass(env, &out, "RuntimeException",
-        "(java/lang/String;)V", jstr);
+    exc = constructNewObjectOfClass(env, &out, "java/lang/RuntimeException",
+        "(Ljava/lang/String;)V", jstr);
     (*env)->DeleteLocalRef(env, jstr);
     // Again, we'll either get an out of memory exception or the
     // RuntimeException we wanted.