Path: blob/master/test/functional/cmdLineTests/URLClassLoaderTests/SignedSealed/readme.txt
12877 views
1#2# Copyright (c) 2001, 2018 IBM Corp. and others3#4# This program and the accompanying materials are made available under5# the terms of the Eclipse Public License 2.0 which accompanies this6# 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 and8# is available at https://www.apache.org/licenses/LICENSE-2.0.9#10# This Source Code may also be made available under the following11# Secondary Licenses when the conditions for such availability set12# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13# General Public License, version 2 with the GNU Classpath14# Exception [1] and GNU General Public License, version 2 with the15# OpenJDK Assembly Exception [2].16#17# [1] https://www.gnu.org/software/classpath/license.html18# [2] http://openjdk.java.net/legal/assembly-exception.html19#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-exception21#2223These tests ensure that package sealing and Jar signing work correctly for shared classes2425SignedSealed.BuildInitial126Builds AB.jar, which contains A classes and B classes from a sealed package and C classes from an unsealed package27Builds B1.jar, which contains B classes from a sealed package, but which is not sealed and C classes from an unsealed package28Builds B2.jar, which contains a single B class from the sealed package, but which is not sealed2930Sealed.success31Runs A_Main which loads classes from classpath AB.jar;B1.jar32This should work because all the sealed classes come from the same jar (AB.jar)3334Sealed.failure135Runs A_Main with classpath B1.jar;AB.jar which should fail because the classes loaded from B1 are not sealed.36Expect a SecurityException3738Sealed.failure239Runs A_Main with classpath B2.jar;AB.jar which should fail because the classes loaded from B1 are not sealed.40This is different from failure1 because only the second B class is loaded from B2, the first is loaded from AB.jar.41Expect a SecurityException4243(Note that the above 3 tests each get their own cache)4445Sealed.verify146Runs A_Main again with the failure1 classpath to ensure that it still throws a SecurityException4748Sealed.verify249Runs A_Main again with the failure2 classpath to ensure that it still throws a SecurityException5051SignedSealed.BuildInitial252Builds A.jar, B.jar and C.jar and then signs them using jarsigner to produce sA.jar, sB.jar and sC.jar53C.jar contains classes from one package. A.jar and B.jar contain classes from a different package.5455Signed.success1Store56Runs A_Main and stores classes using sA.jar;sB.jar;sC.jar in the cache5758Signed.success1Find59Runs the same test as success1Store to ensure that no error is thrown loading classes out of the cache6061Signed.success2Store62Runs A_Main and stores classes using sA.jar;sB.jar;C.jar in the cache63This should work because the unsigned classes in C are from a different package than A or B.6465Signed.success2Find66Runs the same test as success2Store to ensure that no error is thrown loading classes out of the cache6768Signed.success3Store69Runs A_Main and stores classes using A.jar;B.jar;sC.jar in the cache70This should work because the signed classes in C are from a different package than A or B.7172Signed.success3Find73Runs the same test as success3Store to ensure that no error is thrown loading classes out of the cache7475Signed.failure1Store76Runs A_Main and stores classes using A.jar;sB.jar;C.jar in the cache77This should throw a SecurityException because A is offering unsigned classes in sB's signed package7879Signed.failure1Find80Runs the same test as failure1Store to ensure that an exception is still thrown8182Signed.failure2Store83Runs A_Main and stores classes using sA.jar;B.jar;C.jar in the cache84This should throw a SecurityException because B is offering unsigned classes in sA's signed package8586Signed.failure2Find87Runs the same test as failure1Store to ensure that an exception is still thrown8889