Path: blob/master/test/functional/CacheManagement/readme.txt
6000 views
<!--1Copyright (c) 2010, 2019 IBM Corp. and others23This program and the accompanying materials are made available under4the terms of the Eclipse Public License 2.0 which accompanies this5distribution and is available at https://www.eclipse.org/legal/epl-2.0/6or the Apache License, Version 2.0 which accompanies this distribution and7is available at https://www.apache.org/licenses/LICENSE-2.0.89This Source Code may also be made available under the following10Secondary Licenses when the conditions for such availability set11forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12General Public License, version 2 with the GNU Classpath13Exception [1] and GNU General Public License, version 2 with the14OpenJDK Assembly Exception [2].1516[1] https://www.gnu.org/software/classpath/license.html17[2] http://openjdk.java.net/legal/assembly-exception.html1819SPDX-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 project contains an infrastructure and tests for exercising the shared classes command line options.2324The infrastructure is all in 'tests.sharedclasses' and the most important class there is25TestUtils. It provides a lot of infrastructure that subclasses can use. The subclasses26are in tests.sharedclasses.options and each of those is a single test, with a main method.27They can all be invoked standalone. However, they are also pulled together into a Junit28testcase in 'tests.shared.options.junit'. The TestOptionsBase class pulls together all29the tests but is abstract - the further subtypes of TestOptionsBase are the real testcases30but all they do is provide alternative setUp/tearDown methods that will run executed around31each of the testcases in TestOptionsBase. The testsuite AllTests pulls together the32variations of running the testcases. For example, TestOptionsDefault runs all the tests33letting the cache directory default whilst TestOptionsCacheDir runs all the tests whilst34setting the cacheDir explicitly to a destination.3536When writing a testcase main method, the runXXX methods inherited from the superclass TestUtils37will invoke a command, the output of the command is collected and can be examined directly or38checked via helper checkOutputXXX methods.3940TestUtils currently distinguishes Windows from 'every other platform' - other distinctions may41be required if running on further platforms. The distinction is made due to differences in42how the control files manifest on windows and unix platforms.4344Some of the shared memory tests are also likely to be linux only.4546The testcode directory contains some simple classes that can be invoked by the commands that are47spawned - if the testcode is changed, the testcode.jar file at the top level should be updated by48running this command whilst in the testcode subdirectory:49jar -cvMf ../src/testcode.jar *50The testcode jar is kept in the src tree so it can be treated as a java resource and will be51found by a classloader lookup - meaning the user wont have to supply the path to it.5253===54The tests can be launched as JUnit tests and the five possible combinations are included as launch profiles here.55You must edit the config.properties to choose the JVM that needs testing before you launch them.5657There is a lightweight cmdlinetester script that invokes JUnit and that is what is used on nescafe.5859