test/hotspot/jtreg/runtime/appcds/jigsaw/overridetests/src/test/jdk/test/Main.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
open Cdiff test/hotspot/jtreg/runtime/appcds/jigsaw/overridetests/src/test/jdk/test/Main.java
test/hotspot/jtreg/runtime/appcds/jigsaw/overridetests/src/test/jdk/test/Main.java
Print this page
rev 49875 : [mq]: AppCDS_tests_update
*** 1,7 ****
/*
! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 71,85 ****
// Load the class with the default ClassLoader.
Class<?> clazz = Class.forName(className, true, loader);
// Make sure we got the expected defining ClassLoader
testLoader(clazz, loader);
// Create an instance and see what toString() returns
! String s = clazz.newInstance().toString();
// The overridden version of the class should return "hi". Make sure
// it does only if we are expecting to have loaded the overridden version.
! assertTrue(s.equals("hi") == shouldOverride);
}
/**
* Asserts that given class has the expected defining loader.
*/
--- 71,89 ----
// Load the class with the default ClassLoader.
Class<?> clazz = Class.forName(className, true, loader);
// Make sure we got the expected defining ClassLoader
testLoader(clazz, loader);
+
+ String s = null;
+ if (shouldOverride) {
// Create an instance and see what toString() returns
! clazz.newInstance().toString();
! }
// The overridden version of the class should return "hi". Make sure
// it does only if we are expecting to have loaded the overridden version.
! assertTrue("hi".equals(s) == shouldOverride);
}
/**
* Asserts that given class has the expected defining loader.
*/
test/hotspot/jtreg/runtime/appcds/jigsaw/overridetests/src/test/jdk/test/Main.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File