Path: blob/master/test/functional/cmdLineTests/CDSAdaptorTest/resources/readme.txt
6004 views
*******************************************************************************1* Copyright (c) 2001, 2020 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************2122This file explains the working of org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest.java23This test verifies that a class modified by a weaving hook is stored as ORPHAN in shared class cache.2425Usage:26Only describes the arguments accepted by this program. For complete command, please refer cdsadaptortest.xml.27CDSAdaptorOrphanTest <arguments>28Following arguments are mandatory:29-frameworkBundleLocation <location> - location to install bundles required by the framework30-testBundleLocation <location> - location to install bundles required by the test31Optional arguments:32-ignoreWeavingHookBundle - if present, do not install bundle that performs weaving3334Operation:35It requires two bundles for its operation:36371) org.openj9.test.testbundle: This is a simple bundle that consists of two classes:38org.openj9.test.testbundle.SomeMessageV1: Loaded by the bundle when it starts up.39It has a method printMessage() that prints a message M1.40This method is called by the bundle when it starts up.41org.openj9.test.testbundle.SomeMessageV2: Identical to org.openj9.test.testbundle.SomeMessageV2 except that its printMessage() method prints a message M2.42Its class bytes are used by weaving hook to replace class bytes of org.openj9.test.testbundle.SomeMessageV1.43442) 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.4546As mentioned in "Usage" section, org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest accepts an argument "-ignoreWeavingHookBundle".47If this argument is specified org.openj9.test.weavinghooktest bundle is not installed. By default, both the bundles mentioned above are installed.4849If "-ignoreWeavingHookBundle" is not specified, weaving hook replaces class bytes of org.openj9.test.testbundle.SomeMessageV1 with org.openj9.test.testbundle.SomeMessageV2.50Hence the output message is M2 printed by printMessage() org.openj9.test.testbundle.SomeMessageV2 class.5152If "-ignoreWeavingHookBundle" is specified, weaving hook is not installed.53Hence the output message is M1 printed by printMessage() org.openj9.test.testbundle.SomeMessageV1 class.5455How to run:56This test is available in the builds at jvmtest/VM/cdsadaptortest/cdsadaptortest.jar.57Unzip the cdsadaptortest.jar and run following command:5859java -Xshareclasses -cp .:./org.eclipse.osgi-3.16.100.jar org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest -frameworkBundleLocation ./FrameworkBundles -testBundleLocation ./CDSAdaptorOrphanTestBundles6061Version of org.eclipse.osgi and org.openj9.test.cds bundles in the above command may not be correct.62Please use the same version as present in cdsadaptortest.jar.6364Tests 1-a to 1-e in cdsadaptortest.xml use org.openj9.test.cdsadaptortest.CDSAdaptorOrphanTest.65Please check these tests in the job output for more information.6667Eclipse version:68Eclipse version used to create the two bundles org.openj9.test.testbundle and org.openj9.test.weavinghooktest is:69Eclipse Juno M570Version: 4.2.071Build id: I20120127-11457273