Skip to content

Commit

Permalink
8288186: [lw4] Many runtime/cds/appcds/ tests are still referring to …
Browse files Browse the repository at this point in the history
…IdentityObject
  • Loading branch information
Srikanth Adayapalam committed Jun 10, 2022
1 parent 0298556 commit 22bb547
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public static void main(String[] args) throws Exception {
String classlist[] = new String[] {
"CheckCachedMirrorApp", // built-in app loader
"java/lang/Object id: 1", // boot loader
"java/lang/IdentityObject id: 2", // boot loader
"Hello id: 3 super: 1 interfaces: 2 source: " + helloJarPath // custom loader
"Hello id: 2 super: 1 source: " + helloJarPath // custom loader
};

TestCommon.testDump(appJar, classlist, use_whitebox_jar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public static void main(String[] args) throws Exception {
String classlist[] = new String[] {
"CheckCachedResolvedReferencesApp", // built-in app loader
"java/lang/Object id: 1", // boot loader
"java/lang/IdentityObject id: 2", // boot loader
"Hello id: 3 super: 1 interfaces: 2 source: " + helloJarPath // custom loader
"Hello id: 2 super: 1 source: " + helloJarPath // custom loader
};

TestCommon.testDump(appJar, classlist, use_whitebox_jar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ appJar, classlist(
appJar, classlist(
"Hello ", // trailing spaces
"java/lang/Object\tid:\t1", // \t instead of ' '
"java/lang/IdentityObject id: 2",
"CustomLoadee id: 3 super: 1 interfaces: 2 source: " + customJarPath,
"CustomInterface2_ia id: 4 super: 1 source: " + customJarPath + " ",
"CustomInterface2_ib id: 5 super: 1 source: " + customJarPath + "\t\t\r" ,
"CustomLoadee2 id: 6 super: 1 interfaces: 2 4 5 source: " + customJarPath // preceding spaces
"CustomLoadee id: 2 super: 1 source: " + customJarPath,
"CustomInterface2_ia id: 3 super: 1 source: " + customJarPath + " ",
"CustomInterface2_ib id: 4 super: 1 source: " + customJarPath + "\t\t\r" ,
"CustomLoadee2 id: 5 super: 1 interfaces: 3 4 source: " + customJarPath // preceding spaces
));

int _max_allowed_line = 4096; // Must match ClassListParser::_max_allowed_line in C code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public static void main(String[] args) throws Throwable {
appJar, classlist(
"Hello",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"CustomLoadee id: 1 super: 1 interfaces: 2 source: " + customJarPath
"CustomLoadee id: 1 super: 1 source: " + customJarPath
),
"Duplicated ID 1 for class CustomLoadee");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ appJar, classlist(
appJar, classlist(
"Hello",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"CustomInterface2_ia id: 3 super: 1 source: " + customJarPath,
"CustomInterface2_ib id: 4 super: 1 source: " + customJarPath,
"CustomLoadee id: 5 super: 1 interfaces: 2 source: " + customJarPath,
"CustomLoadee2 id: 6 super: 5 interfaces: 2 3 4 source: " + customJarPath
"CustomInterface2_ia id: 2 super: 1 source: " + customJarPath,
"CustomInterface2_ib id: 3 super: 1 source: " + customJarPath,
"CustomLoadee id: 4 super: 1 source: " + customJarPath,
"CustomLoadee2 id: 5 super: 4 interfaces: 2 3 source: " + customJarPath
),
"The specified super class CustomLoadee (id 5) does not match actual super class java.lang.Object");
"The specified super class CustomLoadee (id 4) does not match actual super class java.lang.Object");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ public static void run(String... extra_runtime_args) throws Exception {
String classlist[] = new String[] {
"HelloUnload",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"CustomLoadee id: 3 super: 1 interfaces: 2 source: " + customJarPath
"CustomLoadee id: 2 super: 1 source: " + customJarPath
};

OutputAnalyzer output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,17 @@ public static void main(String[] args) throws Exception {
String classlist[] = new String[] {
"LoaderSegregation",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",

// These are the UNREGISTERED classes: they have "source:"
// but they don't have "loader:".
"CustomLoadee id: 3 super: 1 interfaces: 2 source: " + customJarPath,
"CustomLoadee id: 2 super: 1 source: " + customJarPath,

"CustomInterface2_ia id: 4 super: 1 source: " + customJarPath,
"CustomInterface2_ib id: 5 super: 1 source: " + customJarPath,
"CustomLoadee2 id: 6 super: 1 interfaces: 2 4 5 source: " + customJarPath,
"CustomInterface2_ia id: 3 super: 1 source: " + customJarPath,
"CustomInterface2_ib id: 4 super: 1 source: " + customJarPath,
"CustomLoadee2 id: 5 super: 1 interfaces: 3 4 source: " + customJarPath,

"CustomLoadee3 id: 7 super: 1 interfaces: 2 source: " + customJarPath,
"CustomLoadee3Child id: 8 super: 7 source: " + customJarPath,
"CustomLoadee3 id: 6 super: 1 source: " + customJarPath,
"CustomLoadee3Child id: 7 super: 6 source: " + customJarPath,

// At dump time, the following BUILTIN classes are loaded after the UNREGISTERED
// classes from above. However, at dump time, they cannot use the UNREGISTERED classes are their
Expand All @@ -100,7 +99,7 @@ public static void main(String[] args) throws Exception {
// Check that BUILTIN and UNREGISTERED classes can be loaded only by their
// corresponding type of loaders.
"OnlyBuiltin",
"OnlyUnregistered id: 10 super: 1 interfaces: 2 source: " + customJarPath,
"OnlyUnregistered id: 9 super: 1 source: " + customJarPath,
};

OutputAnalyzer output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ public static void run(String[] args, int loaderType, int mode) throws Exception

for (int i = 0, n=0; i<MAX_CLASSES; i++) {
int super_id = 1;
int identity_object_interf_id = 2;
if (mode == FINGERPRINT_MODE) {
// fingerprint mode -- no need to use the "loader:" option.
int id = i + 3;
cust_list[i] = cust_classes[i] + " id: " + id + " super: " + super_id + " interfaces: " + identity_object_interf_id + " source: " + customJarPath;
int id = i + 2;
cust_list[i] = cust_classes[i] + " id: " + id + " super: " + super_id + " source: " + customJarPath;
} else {
throw new RuntimeException("Only FINGERPRINT_MODE is supported");
}
Expand All @@ -76,7 +75,6 @@ public static void run(String[] args, int loaderType, int mode) throws Exception
"ParallelLoadWatchdog");
app_list = new String[] {
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"ParallelLoad",
"ParallelLoadThread",
"ParallelLoadWatchdog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public static void run(String... extra_runtime_args) throws Exception {
String classlist[] = new String[] {
"HelloUnload",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"CustomLoadee id: 3 super: 1 interfaces: 2 source: " + customJarPath
"CustomLoadee id: 2 super: 1 source: " + customJarPath
};

OutputAnalyzer output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public static void main(String[] args) throws Exception {
"ProtDomainClassForArchive", "ProtDomainNotForArchive");
String[] classlist = new String[] {
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"ProtDomain id: 3 super: 1 interfaces: 2 source: " + appJar,
"ProtDomainClassForArchive id: 4 super: 1 interfaces: 2 source: " + customJar
"ProtDomain id: 2 super: 1 source: " + appJar,
"ProtDomainClassForArchive id: 3 super: 1 source: " + customJar
};

TestCommon.testDump(appJar, classlist);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ private static String[] getClassList_FP() {
return new String[] {
"SameNameUnrelatedLoaders",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"CustomLoadee id: 10 super: 1 interfaces: 2 source: " + customJar,
"CustomLoadee id: 10 super: 1 source: " + customJar,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ public static void main(String[] args) throws Exception {
String classlist[] = new String[] {
"UnintendedLoadersTest",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",

// Without "loader:" keyword.
"CustomLoadee id: 3 super: 1 interfaces: 2 source: " + customJarPath,
"CustomLoadee id: 2 super: 1 source: " + customJarPath,
};

OutputAnalyzer output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public static void main(String[] args) throws Exception {
"jdk/test/lib/classloader/ClassUnloadCommon$1",
"jdk/test/lib/classloader/ClassUnloadCommon$TestFailure",
"java/lang/Object id: 1",
"java/lang/IdentityObject id: 2",
"CustomLoadee id: 3 super: 1 interfaces: 2 source: " + customJarPath,
"CustomLoadee id: 2 super: 1 source: " + customJarPath,
};

OutputAnalyzer output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,16 @@ private String[] getCustomClassList(String loaderType, String customJar) {
return new String[] {
"CustomLoaderApp",
"java/lang/Object id: 0",
"java/lang/IdentityObject id: 1",
parent + " id: 2 super: 0 interfaces: 1 source: " + customJar,
child + " id: 3 super: 2 source: " + customJar,
parent + " id: 1 super: 0 source: " + customJar,
child + " id: 2 super: 1 source: " + customJar,
};

case "Implementor-unregistered":
return new String[] {
"CustomLoaderApp",
"java/lang/Object id: 0",
"java/lang/IdentityObject id: 1",
parent + " id: 2 super: 0 source: " + customJar,
child + " id: 3 super: 0 interfaces: 1 2 source: " + customJar,
parent + " id: 1 super: 0 source: " + customJar,
child + " id: 2 super: 0 interfaces: 1 source: " + customJar,
};

default:
Expand Down

0 comments on commit 22bb547

Please sign in to comment.