8319265: TestLoadLibraryDeadlock.java fails on windows-x64 "Unable to load b.jar"
Reviewed-by: jpai, rriggs
This commit is contained in:
parent
e6f46a4326
commit
6ad093ef12
@ -33,6 +33,7 @@
|
|||||||
* triggered from JNI.
|
* triggered from JNI.
|
||||||
*/
|
*/
|
||||||
import java.lang.*;
|
import java.lang.*;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
public class LoadLibraryDeadlock {
|
public class LoadLibraryDeadlock {
|
||||||
|
|
||||||
@ -78,6 +79,11 @@ public class LoadLibraryDeadlock {
|
|||||||
private static String getLocation(Class<?> c) {
|
private static String getLocation(Class<?> c) {
|
||||||
var pd = c.getProtectionDomain();
|
var pd = c.getProtectionDomain();
|
||||||
var cs = pd != null ? pd.getCodeSource() : null;
|
var cs = pd != null ? pd.getCodeSource() : null;
|
||||||
return cs != null ? cs.getLocation().getPath() : null;
|
try {
|
||||||
|
// same format as returned by TestLoadLibraryDeadlock::getLocation
|
||||||
|
return cs != null ? cs.getLocation().toURI().getPath() : null;
|
||||||
|
} catch (URISyntaxException ex) {
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,15 +169,20 @@ public class TestLoadLibraryDeadlock {
|
|||||||
"Unable to load native library.");
|
"Unable to load native library.");
|
||||||
|
|
||||||
Asserts.assertTrue(
|
Asserts.assertTrue(
|
||||||
countLines(outputAnalyzer, "Class1 loaded from " + bJar) > 0,
|
countLines(outputAnalyzer, "Class1 loaded from " + toLocationString(bJar)) > 0,
|
||||||
"Unable to load b.jar.");
|
"Unable to load " + toLocationString(bJar));
|
||||||
|
|
||||||
Asserts.assertTrue(
|
Asserts.assertTrue(
|
||||||
countLines(outputAnalyzer, "Class2 loaded from " + cJar) > 0,
|
countLines(outputAnalyzer, "Class2 loaded from " + toLocationString(cJar)) > 0,
|
||||||
"Unable to load signed c.jar.");
|
"Unable to load signed " + toLocationString(cJar));
|
||||||
|
|
||||||
Asserts.assertTrue(
|
Asserts.assertTrue(
|
||||||
countLines(outputAnalyzer, "Signed jar loaded from native library.") > 0,
|
countLines(outputAnalyzer, "Signed jar loaded from native library.") > 0,
|
||||||
"Unable to load signed jar from native library.");
|
"Unable to load signed jar from native library.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String toLocationString(Path path) {
|
||||||
|
// same format as returned by LoadLibraryDeadlock::getLocation
|
||||||
|
return path.toUri().getPath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user