Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/cmdLineTests/CDSAdaptorTest/resources/readme.txt
6004 views
1
*******************************************************************************
2
* Copyright (c) 2001, 2020 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************
22
23
This file explains the working of org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest.java
24
This test verifies that a class modified by a weaving hook is stored as ORPHAN in shared class cache.
25
26
Usage:
27
Only describes the arguments accepted by this program. For complete command, please refer cdsadaptortest.xml.
28
CDSAdaptorOrphanTest <arguments>
29
Following arguments are mandatory:
30
-frameworkBundleLocation <location> - location to install bundles required by the framework
31
-testBundleLocation <location> - location to install bundles required by the test
32
Optional arguments:
33
-ignoreWeavingHookBundle - if present, do not install bundle that performs weaving
34
35
Operation:
36
It requires two bundles for its operation:
37
38
1) org.openj9.test.testbundle: This is a simple bundle that consists of two classes:
39
org.openj9.test.testbundle.SomeMessageV1: Loaded by the bundle when it starts up.
40
It has a method printMessage() that prints a message M1.
41
This method is called by the bundle when it starts up.
42
org.openj9.test.testbundle.SomeMessageV2: Identical to org.openj9.test.testbundle.SomeMessageV2 except that its printMessage() method prints a message M2.
43
Its class bytes are used by weaving hook to replace class bytes of org.openj9.test.testbundle.SomeMessageV1.
44
45
2) org.openj9.test.weavinghooktest: This is the weaving hook that transforms class bytes of org.openj9.test.testbundle.SomeMessageV1 to org.openj9.test.testbundle.SomeMessageV2.
46
47
As mentioned in "Usage" section, org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest accepts an argument "-ignoreWeavingHookBundle".
48
If this argument is specified org.openj9.test.weavinghooktest bundle is not installed. By default, both the bundles mentioned above are installed.
49
50
If "-ignoreWeavingHookBundle" is not specified, weaving hook replaces class bytes of org.openj9.test.testbundle.SomeMessageV1 with org.openj9.test.testbundle.SomeMessageV2.
51
Hence the output message is M2 printed by printMessage() org.openj9.test.testbundle.SomeMessageV2 class.
52
53
If "-ignoreWeavingHookBundle" is specified, weaving hook is not installed.
54
Hence the output message is M1 printed by printMessage() org.openj9.test.testbundle.SomeMessageV1 class.
55
56
How to run:
57
This test is available in the builds at jvmtest/VM/cdsadaptortest/cdsadaptortest.jar.
58
Unzip the cdsadaptortest.jar and run following command:
59
60
java -Xshareclasses -cp .:./org.eclipse.osgi-3.16.100.jar org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest -frameworkBundleLocation ./FrameworkBundles -testBundleLocation ./CDSAdaptorOrphanTestBundles
61
62
Version of org.eclipse.osgi and org.openj9.test.cds bundles in the above command may not be correct.
63
Please use the same version as present in cdsadaptortest.jar.
64
65
Tests 1-a to 1-e in cdsadaptortest.xml use org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest.
66
Please check these tests in the job output for more information.
67
68
Eclipse version:
69
Eclipse version used to create the two bundles org.openj9.test.testbundle and org.openj9.test.weavinghooktest is:
70
Eclipse Juno M5
71
Version: 4.2.0
72
Build id: I20120127-1145
73