You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by cc...@apache.org on 2009/03/16 16:42:15 UTC
svn commit: r754944 [1/4] - in
/incubator/kato/trunk/import/org.apache.kato.tck.harness: ./ .settings/
META-INF/ launchers/ lib/ slave-configs/ slave-configs/hornet/ src/
src/com/ src/com/ibm/ src/com/ibm/dtfj/ src/com/ibm/dtfj/tck/
src/com/ibm/dtfj/tc...
Author: ccristal
Date: Mon Mar 16 16:42:12 2009
New Revision: 754944
URL: http://svn.apache.org/viewvc?rev=754944&view=rev
Log:
Initial code contribution from IBM.
Added:
incubator/kato/trunk/import/org.apache.kato.tck.harness/
incubator/kato/trunk/import/org.apache.kato.tck.harness/.classpath
incubator/kato/trunk/import/org.apache.kato.tck.harness/.project
incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/
incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.core.resources.prefs
incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.jdt.core.prefs
incubator/kato/trunk/import/org.apache.kato.tck.harness/META-INF/
incubator/kato/trunk/import/org.apache.kato.tck.harness/META-INF/MANIFEST.MF
incubator/kato/trunk/import/org.apache.kato.tck.harness/README.TXT
incubator/kato/trunk/import/org.apache.kato.tck.harness/build.properties
incubator/kato/trunk/import/org.apache.kato.tck.harness/build.xml
incubator/kato/trunk/import/org.apache.kato.tck.harness/example.instance.properties
incubator/kato/trunk/import/org.apache.kato.tck.harness/launchers/
incubator/kato/trunk/import/org.apache.kato.tck.harness/launchers/All dtfj Tests.launch
incubator/kato/trunk/import/org.apache.kato.tck.harness/lib/
incubator/kato/trunk/import/org.apache.kato.tck.harness/properties.readme
incubator/kato/trunk/import/org.apache.kato.tck.harness/slave-configs/
incubator/kato/trunk/import/org.apache.kato.tck.harness/slave-configs/hornet/
incubator/kato/trunk/import/org.apache.kato.tck.harness/slave-configs/hornet/build.properties
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/AbstractDumpCreator.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/DumpDefinition.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckPointHandler.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckpoint.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpCreator.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpDescriptor.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImageCreator.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImplementationSpecific.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IJavaRuntimeCreator.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/PropertyStore.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKConfiguration.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKException.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractLauncher.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractTCKTestcase.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/BuildVersionHelper.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/Configure.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/ConsoleOutputConstants.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/ITestCaseVisitor.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/JRESystemPropertyRetriever.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/MapCollector.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/ProcessLauncher.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/PropertyStoreXMLWriter.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/SetupCollector.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TCKJavaRuntimeTestcase.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TCKLauncher.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TCKLauncherConfigurator.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TCKProcessTestcase.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TCKReporter.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TCKTestCaseSuiteBuilder.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TCKTestcaseRunner.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TestCaseWalker.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/TextStreamRedirector.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/ValueCollector.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/VisitStatistics.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/ConsoleOutputResultsReader.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/FullSortedProvider.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/HTMLWriter.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/JUnitAntFormatTestLoader.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/Key.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/OSVersionJVMTestSuiteSortedProvider.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/SortKeyProvider.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TCKConsoleReportsAggregator.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TCKResultMatrix.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TCKResultMatrixHTMLWriter.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TCKResultMatrixWriter.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TCKResultSet.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TestExecutionConfig.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TestcaseResult.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TestcaseResultError.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TestcaseResultFailure.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/TestcaseResultPass.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/VersionOSSortedProvider.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/results/reporter/VersionSortKeyProvider.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/resources/
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/resources/blue.png (with props)
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/resources/purple.png (with props)
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/resources/red.png (with props)
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/resources/stylesheet.css
incubator/kato/trunk/import/org.apache.kato.tck.harness/src/tck.default.properties
incubator/kato/trunk/import/org.apache.kato.tck.harness/standard-configs/
incubator/kato/trunk/import/org.apache.kato.tck.harness/standard-configs/example-alltests.properties
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/com/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/com/ibm/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/com/ibm/dtfj/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/com/ibm/dtfj/tck/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/com/ibm/dtfj/tck/harness/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/tck/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/tck/harness/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/tck/harness/TestJarHarness.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/tck/harness/unittests/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/tck/harness/unittests/TestBuildVersionHelper.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/tck/harness/unittests/TestMapCollector.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/test/ibm/dtfj/tck/harness/unittests/TestPropertyStore.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/results/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/results/reporter/
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/results/reporter/StandardRunner.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/results/reporter/TestCanLocateEyeCandy.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/results/reporter/TestConsoleTestResultReader.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/results/reporter/TestResultMatrix.java
incubator/kato/trunk/import/org.apache.kato.tck.harness/testsrc/tests/ibm/dtfj/tck/results/reporter/TestVersionOSkeyProvider.java
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/.classpath
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/.classpath?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/.classpath (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/.classpath Mon Mar 16 16:42:12 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry excluding="com/ibm/dtfj/tck/results/reporter/resources/" kind="src" path="src"/>
+ <classpathentry kind="src" path="testsrc"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sun150"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/tools.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/.project
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/.project?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/.project (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/.project Mon Mar 16 16:42:12 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.kato.tck.harness</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.core.resources.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.core.resources.prefs?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.core.resources.prefs (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.core.resources.prefs Mon Mar 16 16:42:12 2009
@@ -0,0 +1,9 @@
+#Fri Jan 30 14:26:59 GMT 2009
+eclipse.preferences.version=1
+encoding//bin/tck.default.properties=ISO-8859-1
+encoding//slave-configs/hornet/build.properties=ISO-8859-1
+encoding//src/tck.default.properties=ISO-8859-1
+encoding//standard-configs/example-alltests.properties=ISO-8859-1
+encoding/build.properties=ISO-8859-1
+encoding/build.xml=UTF-8
+encoding/example.instance.properties=ISO-8859-1
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.jdt.core.prefs?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/.settings/org.eclipse.jdt.core.prefs Mon Mar 16 16:42:12 2009
@@ -0,0 +1,12 @@
+#Fri Oct 10 12:22:54 BST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.4
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/META-INF/MANIFEST.MF?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/META-INF/MANIFEST.MF (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/META-INF/MANIFEST.MF Mon Mar 16 16:42:12 2009
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: tck2
+Bundle-SymbolicName: org.apache.kato.tck.harness
+Bundle-Version: 1.0.0
+Export-Package: com.ibm.dtfj.tck.api,
+ com.ibm.dtfj.tck.harness
+Require-Bundle: org.junit,
+ org.apache.kato.api;bundle-version="1.3.0",
+ org.apache.kato.anttasks;bundle-version="1.0.0"
+Main-Class: com.ibm.dtfj.tck.harness.TCKLauncher
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/README.TXT
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/README.TXT?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/README.TXT (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/README.TXT Mon Mar 16 16:42:12 2009
@@ -0,0 +1,65 @@
+TCK Harness
+
+The code in this project comprises the DTFJ API TCK harness. The testcases
+reside in the com.ibm.dtfj.tck.tests project
+
+Objectives
+
+The objective of this harness is to provide a framework and excution system for
+producing dumps from a JVM and then running the TCK test suite against the dump
+Since there are multiple forms of dump and multiple JVMs the harness has been designed
+to be very configurable.
+
+
+Setup
+
+Once you have checked out the harness and testcases projects you will also need to check out
+the projects that contain the required JVM implementation code.
+
+The harness project contains two example files. These files show to configure the TCK for
+your machine environment and for a specific test execution.
+
+The example.local.properties file should be copied and renamed to tck.properties in your user directory.
+This is the same location as would be presented if you examined the java user.home system property.
+It is necessary to change the properties to reflect the locations of the files on you system.
+The file contains properties that will be used by the harness to locate the required Java launchers etc.
+More information about TCK properties is available in the properties.readme file.
+
+The example.instance.properties file is an example of how to configure a specific execution run.
+The file contains properties to set that indicate to the harness the JVM to use and what testcases
+to execute. These properties are also described in the properties.readme file. To use this example file
+create a copy (any name is acceptable) in a location of your choice. The name and location of this file
+will be used to launch the TCK harness
+
+
+Executing the Test Suite
+
+Executing the harness is a simple as running the main method in the com.ibm.dtfj.tck.harness.TCKLauncher class
+The expected use is to pass in the instance properties file name and location as the first parameter. Note that
+by default the harness expects the classpath of the launcher to contain references to all required classes. This
+includes JUnit 3.0.
+
+At the start of execution the harness copies the instance property file into its working directory and renames it
+to tck.properties. This is to allow easy debugging of failing testcases.
+
+
+Executing a Single Testcase
+
+In the event that the test suite has a failing testcase the test case can be launched directly as a standard
+JUnit testcase. The testcase will be self configuring and will look for the tck.properties file in the harness
+working directory. Note that any required environmental variables and jvm arguments are not set when running in
+self hosting mode.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/build.properties
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/build.properties?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/build.properties (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/build.properties Mon Mar 16 16:42:12 2009
@@ -0,0 +1,21 @@
+#-------------------------------------------------------------------------------
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#-------------------------------------------------------------------------------
+workspace=..
+builder=../builder.dtfj
+project=com.ibm.dtfj.tck.harness
+src=./src
+bin=./bin
+source.. = src/
+bin.includes = META-INF/,\
+ .
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/build.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/build.xml?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/build.xml (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/build.xml Mon Mar 16 16:42:12 2009
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- ======================================================================
+
+ DTFJ API
+
+ ====================================================================== -->
+<project name="project" default="default">
+
+ <property file="build.properties" />
+ <property file="${builder}/build.properties" />
+
+ <path id="compile.classpath">
+
+ <fileset dir="${components}/com.ibm.dtfj.api/dist">
+ <include name="*.jar" />
+ </fileset>
+ <path location="${junit.path}" />
+ <path location="${dtfjant.path}" />
+ </path>
+
+ <!-- =================================
+ target: default
+ ================================= -->
+
+ <target name="default">
+ <antcall target="clean" />
+ <antcall target="compile" />
+ <antcall target="test" />
+ <antcall target="javadoc" />
+ <antcall target="jar" />
+
+
+ </target>
+
+ <!-- remove compiled classes and jars-->
+
+ <target name="clean">
+ <delete dir="${bin}" />
+
+ <delete dir="${dist}" />
+
+ <delete dir="${junit.output}" />
+
+ <delete dir="${javadoc.results}" />
+
+ </target>
+
+ <!-- compile -->
+
+ <target name="compile">
+ <mkdir dir="${bin}" />
+ <javac debug="true" srcdir="${src}" destdir="${bin}" source="${srclevel}" target="${srclevel}">
+ <classpath refid="compile.classpath" />
+ </javac>
+ <javac debug="true" srcdir="${testsrc}" destdir="${bin}" source="${srclevel}" target="${srclevel}">
+ <classpath>
+ <path location="${junit.path}" />
+ </classpath>
+ </javac>
+ <copy todir="${bin}" file="${src}/tck.default.properties"/>
+ <copy todir="${bin}/testconfigs">
+ <fileset dir="${src}/testconfigs"/>
+ </copy>
+ <copy todir="${bin}/testdata">
+ <fileset dir="${testsrc}/testdata"/>
+ </copy>
+ <copy todir="${bin}/resources">
+ <fileset dir="${src}/resources"/>
+ </copy>
+
+ </target>
+
+
+ <target name="test" unless="no.test">
+ <mkdir dir="${junit.output}" />
+ <junit>
+ <classpath>
+ <path location="${junit.path}" />
+ <path location="${bin}" />
+ </classpath>
+
+ <formatter type="plain" />
+ <formatter type="xml" />
+
+ <batchtest fork="yes" todir="${junit.output}">
+ <fileset dir="${testsrc}">
+ <include name="**/*Test*.java" />
+ <exclude name="**/AllTests.java" />
+ </fileset>
+ </batchtest>
+
+ </junit>
+ </target>
+
+ <target name="jar">
+ <mkdir dir="${dist}" />
+ <jar jarfile="${jarfile}" filesonly="true" manifest="META-INF/MANIFEST.MF">
+ <fileset dir="${bin}">
+ <exclude name="test**/*.class" />
+ </fileset>
+
+
+ </jar>
+ <jar jarfile="${srcjarfile}" filesonly="true">
+ <fileset dir="${src}">
+ <include name="**/*.java" />
+ </fileset>
+ </jar>
+ </target>
+
+
+
+
+ <target name="javadoc" unless="no.javadoc">
+ <mkdir dir="${javadoc.results}" />
+ <javadoc packagenames="com.ibm.dtfj.tck.api.*"
+ classpathref="compile.classpath"
+ sourcepath="${src}" defaultexcludes="yes" destdir="${javadoc.results}" author="true" version="true" use="true" />
+ </target>
+
+
+
+</project>
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/example.instance.properties
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/example.instance.properties?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/example.instance.properties (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/example.instance.properties Mon Mar 16 16:42:12 2009
@@ -0,0 +1,59 @@
+#-------------------------------------------------------------------------------
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#-------------------------------------------------------------------------------
+#
+# test suite to run
+#
+tck.testsuite=javaruntime
+#
+# name of class that implements com.ibm.dtfj.tck.apiIDumpCreator
+#
+tck.dumpcreator.class=
+#
+# name of class that implements com.ibm.dtfj.tck.apiIImageCreator
+#
+tck.imagecreator.class=
+
+#
+# Java executable to be used to create the dump
+#
+tck.dumpcreator.launcher=
+#
+# name of the executable to be used to run the tests
+#
+tck.java.test.executeable.path=${tck.java.location.sun.hotspot.1.6.0}
+#
+# Example setting for prepending to the bootclasspath of the
+# dump creator launcher process
+#
+tck.dumpcreator.bootclasspath=${user.home}/dtfj-emma.jar
+#
+# Example setting for prepending to the bootclasspath of the
+# image creator launcher process
+#
+tck.imagecreator.bootclasspath=${user.home}/dtfj-emma.jar
+
+
+#
+# Optional values to turn on emma coverage and to
+# show where to place the output
+#
+tck.emma.coverage=true
+tck.emma.output=/tmp/coverage.emma
+
+
+
+
+
+
+
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/launchers/All dtfj Tests.launch
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/launchers/All%20dtfj%20Tests.launch?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/launchers/All dtfj Tests.launch (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/launchers/All dtfj Tests.launch Mon Mar 16 16:42:12 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/com.ibm.dtfj.tck.tests"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.apache.kato.tck.tests"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="2" projectName="com.ibm.dtfj.api" type="1"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.ibm.dtfj.tck.tests"/> </runtimeClasspathEntry> "/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.dtfj.tck.tests"/>
+</launchConfiguration>
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/properties.readme
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/properties.readme?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/properties.readme (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/properties.readme Mon Mar 16 16:42:12 2009
@@ -0,0 +1,2 @@
+Property Dictionary
+
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/slave-configs/hornet/build.properties
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/slave-configs/hornet/build.properties?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/slave-configs/hornet/build.properties (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/slave-configs/hornet/build.properties Mon Mar 16 16:42:12 2009
@@ -0,0 +1,20 @@
+#-------------------------------------------------------------------------------
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#-------------------------------------------------------------------------------
+# Properties file for builds.
+
+testconfigs=example-alltests.properties
+test.url=http://localhost:8080/job/builder.dtfj/lastSuccessfulBuild/artifact/kato.output/latest/dist/dtfj-support/
+run.dir=../run
+tck.files=../tck-files
+
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/AbstractDumpCreator.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/AbstractDumpCreator.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/AbstractDumpCreator.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/AbstractDumpCreator.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.io.IOException;
+
+public abstract class AbstractDumpCreator implements IDumpCreator{
+
+ private TCKConfiguration config=null;
+
+
+ public AbstractDumpCreator() {
+ config=TCKConfiguration.getConfiguration();
+ }
+ public String createDump(int dumpType) throws IOException {
+
+
+ switch(dumpType) {
+
+
+ case IDumpDescriptor.ALL_DUMPS :
+ return createDumpForAllTests();
+
+ case IDumpDescriptor.PROCESS_DUMP :
+ return createDumpForProcessTests();
+
+
+ case IDumpDescriptor.JAVAHEAP_DUMP:
+ return createDumpForJavaHeapTests();
+
+ case IDumpDescriptor.JAVARUNTIME_DUMP:
+ return createDumpForJavaRuntimeTests();
+
+ }
+ return "no-dump";
+ }
+
+ public String createDumpForAllTests() throws IOException{
+
+ createDumpForProcessTests();
+ createDumpForJavaHeapTests();
+ createDumpForJavaRuntimeTests();
+
+ return "all-dumps";
+ }
+ public abstract String createDumpForProcessTests() throws IOException;
+ public abstract String createDumpForJavaHeapTests() throws IOException;
+ public abstract String createDumpForJavaRuntimeTests() throws IOException;
+ public TCKConfiguration getConfiguration() {
+ return config;
+ }
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/DumpDefinition.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/DumpDefinition.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/DumpDefinition.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/DumpDefinition.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.util.Properties;
+
+public class DumpDefinition {
+
+ private Properties props=new Properties();
+
+ public DumpDefinition () {
+
+ }
+
+ public String getJvmBuildDate() {
+ return props.getProperty("jvm.build.date");
+ }
+
+ /**
+ * Build date of JVM
+ *
+ * @param jvmBuildDate in form of yyyy/mm/dd
+ */
+ public void setJvmBuildVersion(String jvmBuildVersion) {
+ props.setProperty("jvm.build.version",jvmBuildVersion);
+ }
+
+ public String toString() {
+ return props.toString();
+ }
+
+ public Properties getProperties() {
+
+
+ return props;
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckPointHandler.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckPointHandler.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckPointHandler.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckPointHandler.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.lang.reflect.Method;
+
+import com.ibm.dtfj.tck.harness.AbstractTCKTestcase;
+
+public interface ICheckPointHandler {
+
+ public void handle(Method method,AbstractTCKTestcase testcase);
+
+ public void checkpoint(Method method);
+
+ public boolean hasOutstandingThreads();
+
+ public int outstandingThreads();
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckpoint.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckpoint.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckpoint.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/ICheckpoint.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+public interface ICheckpoint {
+
+ public void checkpoint();
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpCreator.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpCreator.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpCreator.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpCreator.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.io.IOException;
+
+
+public interface IDumpCreator {
+
+ public DumpDefinition createDump() throws IOException ;
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpDescriptor.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpDescriptor.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IDumpDescriptor.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+public interface IDumpDescriptor {
+
+
+ public static final int PROCESS_DUMP=2;
+ public static final int JAVARUNTIME_DUMP=3;
+ public static final int JAVAHEAP_DUMP=4;
+ public static final int ALL_DUMPS = 1;
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImageCreator.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImageCreator.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImageCreator.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImageCreator.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.io.IOException;
+
+import com.ibm.dtfj.image.Image;
+
+public interface IImageCreator {
+
+ public Image createProcessImage(TCKConfiguration config) throws IOException;
+
+
+}
+
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImplementationSpecific.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImplementationSpecific.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImplementationSpecific.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IImplementationSpecific.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+public interface IImplementationSpecific {
+
+ /**
+ * Returns a String of the form
+ * vendor.jvmtype.javaversion
+ *
+ * Values can be specific or an * to "denote not applicable"
+ *
+ *
+ */
+ public String getImplementationSpecifics();
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IJavaRuntimeCreator.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IJavaRuntimeCreator.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IJavaRuntimeCreator.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/IJavaRuntimeCreator.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.io.IOException;
+
+import com.ibm.dtfj.java.JavaRuntime;
+
+public interface IJavaRuntimeCreator {
+
+ public JavaRuntime createJavaRuntime(TCKConfiguration config) throws IOException;
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/PropertyStore.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/PropertyStore.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/PropertyStore.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/PropertyStore.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+
+public class PropertyStore {
+
+ private PropertyStore parent=null;
+ private Properties current=null;
+ private String source=null;
+ public String getSource() {
+ return source;
+ }
+
+ private boolean debug=false;
+
+ public PropertyStore() {
+ this(new Properties(),"no source");
+
+ }
+ public PropertyStore(Properties current,String source,PropertyStore parent) {
+ this(current,source);
+ this.parent=parent;
+ }
+ public PropertyStore( Properties current,String source) {
+ this.current=current;
+ this.source=source;
+ }
+
+
+ public PropertyStore(PropertyStore parent) {
+ this();
+ this.parent=parent;
+ }
+ public PropertyStore(File propertiesFile) throws IOException {
+
+ current=new Properties();
+ source=propertiesFile.getAbsolutePath();
+ FileInputStream fis = new FileInputStream(propertiesFile);
+ current.load(fis);
+ fis.close();
+
+
+
+ }
+
+ public PropertyStore(InputStream propertyStream,String source) throws IOException {
+ current=new Properties();
+ current.load(propertyStream);
+ this.source=source;
+
+
+ }
+ public PropertyStore(InputStream propertyStream,String source,PropertyStore parent) throws IOException {
+ current=new Properties();
+ current.load(propertyStream);
+ this.parent=parent;
+ this.source=source;
+ }
+
+ public PropertyStore(File localFile, PropertyStore parent) throws IOException {
+ this(localFile);
+ this.source=localFile.getAbsolutePath();
+ this.parent=parent;
+ }
+ public String getProperty(String keyName) {
+ String value=retrieveProperty(keyName);
+ if(value!=null) {
+ value=expandValue(value);
+ }
+ return value;
+ }
+ public String getPropertyAsIs(String keyName) {
+
+ return current.getProperty(keyName);
+ }
+
+ private String retrieveProperty(String keyName) {
+
+ String value=null;
+ if(current.containsKey(keyName)) {
+ value=current.getProperty(keyName);
+ }
+ else {
+ if(parent!=null) value=parent.retrieveProperty(keyName);
+ }
+
+ return value;
+ }
+
+
+ public String expandValue(String input) {
+
+ String before=null;
+ do {
+ before=input;
+
+ input=expandString( before);
+ if(debug) {
+ System.out.println(">"+before);
+ System.out.println("<"+input);
+ }
+ } while (input.equals(before)==false);
+
+ return input;
+ }
+
+ private String expandString(String input) {
+
+ int lastPos=0;
+ int suffixPos=0;
+ int prefixPos=0;
+ while(true) {
+
+ suffixPos=input.indexOf("}",suffixPos);
+ if(suffixPos<0) {
+ // no more suffixes
+ return input;
+ }
+ prefixPos=input.lastIndexOf("${", suffixPos);
+ if(prefixPos<0) {
+ // not found. move to next suffix
+ continue;
+ }
+
+ // found a prefix
+ // find the matching suffix
+
+ int endSuffix=input.indexOf("}",prefixPos);
+ break;
+ }
+
+ // now we have the works
+
+ String propertyName=input.substring(prefixPos+2,suffixPos);
+ String replaceValue=null;
+ if(hasProperty(propertyName)) replaceValue=retrieveProperty(propertyName);
+
+ if(replaceValue==null) replaceValue="?"+propertyName+"?";
+
+ // replace value in string
+
+ String left="";
+ if(prefixPos>0) left=input.substring(0,prefixPos);
+
+ String right="";
+ if(suffixPos<input.length()) right=input.substring(suffixPos+1);
+
+ input=left+replaceValue+right;
+ lastPos=left.length()+replaceValue.length();
+
+
+
+ return input;
+ }
+ public boolean hasProperty(String keyName) {
+
+ if(current.containsKey(keyName)) return true;
+ if(parent==null) return false;
+ return parent.hasProperty(keyName);
+ }
+ public void setProperty(String key, String value) {
+ current.setProperty(key,value);
+
+ }
+ /**
+ * Returns a property as a String array
+ * The property value is split in occurances of the seperator
+ * Any replaceable values are resolved prior to splitting
+ * the value.
+ *
+ * @param keyname
+ * @param seperator
+ *
+ */
+ public String[] getPropertyAsArray(String keyName, String seperator) {
+
+ String value=getProperty(keyName);
+ if(value==null) return null;
+
+ List list=new LinkedList();
+ int sepPos=value.indexOf(seperator);
+ if(sepPos<0) {
+ list.add(value);
+ }
+ else {
+ while(true) {
+ String portion=value.substring(0,sepPos);
+ list.add(portion);
+ value=value.substring(sepPos+seperator.length());
+ sepPos=value.indexOf(seperator);
+ if(sepPos<0) {
+ list.add(value);
+ break;
+ }
+ }
+
+ }
+
+ return (String[]) list.toArray(new String[0]);
+ }
+ /**
+ * Returns an iterator of all keys in the property store chain
+ *
+ */
+ public Iterator iterator() {
+
+ Set keys=new HashSet();
+ retrieveKeys(keys);
+ return keys.iterator();
+
+
+ }
+ public void retrieveKeys(Set keys) {
+
+ keys.addAll(current.keySet());
+ if(parent!=null) parent.retrieveKeys(keys);
+
+ }
+ /**
+ * Returns all property Keys that start with the provided prefix
+ * @param string
+ *
+ */
+ public String[] getPropertyNames(String prefix) {
+
+ Set keys=new TreeSet();
+ retrieveKeys(keys);
+
+ List results=new LinkedList();
+
+ Iterator keyIterator=keys.iterator();
+ while(keyIterator.hasNext()) {
+ String key=(String) keyIterator.next();
+ if(key.startsWith(prefix)) results.add(key);
+ }
+
+ return (String[]) results.toArray(new String[0]);
+ }
+
+ public String getRequiredProperty(String key) {
+ String result=getProperty(key);
+ if(result==null) throw new TCKException("missing property "+key);
+ return result;
+ }
+ public String getProperty(String key, String defaultValue) {
+ String result=getProperty(key);
+ if(result==null) result=defaultValue;
+ return result;
+ }
+
+ public boolean getPropertyAsBoolean(String key, boolean defaultValue) {
+
+ String value=getProperty(key);
+ if(value==null || value.trim().equals("")) return defaultValue;
+
+ value=value.toLowerCase().trim();
+ if(value.equals("true")) return true;
+ return false;
+
+ }
+ public PropertyStore getParent() {
+ return parent;
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKConfiguration.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKConfiguration.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKConfiguration.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,693 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.ibm.dtfj.anttasks.tcklistbuilder.TCKDefinition;
+import com.ibm.dtfj.anttasks.tcklistbuilder.TCKDefinitionException;
+import com.ibm.dtfj.anttasks.tcklistbuilder.TCKDefinitionXMLReader;
+import com.ibm.dtfj.anttasks.tcklistbuilder.TCKTagGroup;
+import com.ibm.dtfj.tck.harness.AbstractTCKTestcase;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+
+
+
+
+public class TCKConfiguration {
+
+
+ public static final String TCK_TESTCONFIG = "tck.testconfig";
+ private static final String TCK_JUNIT_RUNNER = "tck.junit.runner";
+ private static final String TCK_HARNESS_CLASSPATH = "tck.harness.classpath";
+
+ public static final String TCK_WORKING_DIR = "tck.working.dir";
+ //public static final String TCK_JAVA_EXECUTEABLE_PATH = "tck.java.executeable.path";
+ public static final String TCK_JAVA_TEST_EXECUTEABLE_PATH = "tck.java.test.executeable.path";
+ public static final String TCK_TESTCASES_PATH = "tck.testcases.path";
+ public static final String TCK_IMAGE_GENERATOR = "tck.image.generator";
+ public static final String TCK_LAUNCHER_CLASSPATH = "tck.launcher.classpath";
+ //public static final String TCK_DUMP_GENERATOR = "tck.dump.generator";
+ public static final String TCK_DUMP_TYPE = "dumptype";
+
+ // new
+
+ public static final String TCK_OUTPUT = "tck.output";
+ public static final String TCK_DUMPCREATOR_LAUNCHER = "tck.dumpcreator.launcher";
+ public static final String TCK_DUMPCREATOR_CLASS = "tck.dumpcreator.class";
+ public static final String TCK_IMAGECREATOR_CLASS = "tck.imagecreator.class";
+ private static final String TCK_TESTSUITE = "tck.testsuite";
+ private static final String TCK_DUMP_CREATOR_BOOTCLASSPATH = "tck.dumpcreator.bootclasspath";
+ private static final String TCK_IMAGE_CREATOR_BOOTCLASSPATH = "tck.imagecreator.bootclasspath";
+
+ TCKDefinition def=null;
+ /**
+ * Returns the class type into a number!
+ * @param clazz
+ *
+ */
+ private static int getTestCaseType(Class clazz) {
+
+
+ if (TCKProcessTestcase.class.isAssignableFrom(clazz)) {
+ return 2;
+ }
+
+ if (TCKJavaRuntimeTestcase.class.isAssignableFrom(clazz)) {
+ return 3;
+ }
+
+
+ return -1;
+ }
+ static int getTestType(String testtype) {
+ testtype = testtype.toLowerCase().trim();
+ int type = 0;
+ if (testtype.equals("all")) {
+ type = 1;
+ } else if (testtype.equals("process")) {
+ type = 2;
+ } else if (testtype.equals("javaruntime")) {
+ type = 3;
+ } else if (testtype.equals("javaheap")) {
+ type = 4;
+ }
+ return type;
+ }
+ /**
+ * Parses the input string into separate pieces delimited by
+ * the specified value. Input and delimiters are trimmed before
+ * use
+ *
+ * Null or an empty input string result in an empty list
+ * being returned
+ *
+ * @param input
+ * @param delimiter
+ *
+ */
+ public static LinkedList parseString(String input, String delimiter) {
+
+ LinkedList list=new LinkedList();
+ if(input!=null ) {
+ input=input.trim();
+ if(input.equals("")==false) {
+
+ if(delimiter!=null) {
+ delimiter=delimiter.trim();
+ if(delimiter.equals("")) {
+ list.add(input);
+ }
+ else {
+ int delimLen=delimiter.length();
+ while(true) {
+ int index=input.indexOf(delimiter);
+ if(index<0) {
+ list.add(input);
+ break;
+ }
+ else {
+ String part=input.substring(0,index);
+ input=input.substring(index+delimLen);
+ list.add(part);
+ }
+ }
+
+
+ }
+ }
+ }
+
+
+ }
+
+ return list;
+ }
+ private PropertyStore store=null;
+ private HashSet suffixesToIgnore=null;
+ private static String pathSeparator=System.getProperty("path.separator");
+ private static String fileSeparator=System.getProperty("file.separator");
+ private static String classPath=System.getProperty("java.class.path");
+ private boolean verboseMode=true;
+
+ private TCKConfiguration() {
+
+ try {
+
+
+ preUserSetup();
+
+ postUserSetup();
+
+ } catch(IOException ioe) {
+ raiseError("error creating config", ioe);
+ }
+
+ }
+ private void postUserSetup() {
+ store=new PropertyStore(System.getProperties(),"system properties",store);
+ }
+
+ private void preUserSetup() throws IOException {
+ // default properties
+
+ InputStream in=getClass().getResourceAsStream("/tck.default.properties");
+ if(in==null) throw new TCKException("unable to locate tck.default.properties resource");
+ store=new PropertyStore(in,"default");
+ in.close();
+
+
+ // load tck config file from user home
+
+ File local=new File(System.getProperty("user.home"));
+
+ local=new File(local,"tck.properties");
+ if(local.exists() && local.isFile()) {
+ store=new PropertyStore(local,store);
+ }
+ }
+
+ /**
+ * Builds a configuration with the provided store at the
+ * top of the configuration
+ * @param store
+ */
+ private TCKConfiguration(File storeFile) {
+
+
+
+
+ try {
+ preUserSetup();
+ this.store=new PropertyStore(storeFile,store);
+ postUserSetup();
+
+ } catch (IOException e) {
+ raiseError("error creating config using "+storeFile.getAbsolutePath(), e);
+ }
+
+
+ }
+
+ public String convertPath(List pathSegments) {
+
+
+ String newPath=null;
+
+ Iterator i=pathSegments.iterator();
+ while(i.hasNext()) {
+ String part=(String) i.next();
+ if(newPath==null) newPath=part;
+ else {
+ newPath=newPath+pathSeparator+part;
+ }
+
+ }
+ return newPath;
+ }
+
+ public String convertPath(String result) {
+ char replacementChar=pathSeparator.charAt(0);
+ result=result.replace(',',replacementChar);
+ result=result.replace('\\', '/');
+ return result;
+
+ }
+
+ public String getConfigurationClassName() {
+ return getRequiredProperty("tck.configure.class");
+ }
+
+ public String getConfigurationOutput() {
+ return store.getProperty("tck.config.output");
+
+
+ }
+
+ public String getDumpCreatorBootclassPath() {
+
+ String result=store.getProperty(TCK_DUMP_CREATOR_BOOTCLASSPATH);
+ if(result==null) return null;
+ return convertPath(result);
+ }
+
+ public String getDumpCreatorClassname() {
+ return getRequiredProperty(TCK_DUMPCREATOR_CLASS);
+ }
+
+ public String getImageCreatorBootclassPath() {
+ String result=store.getProperty(TCK_IMAGE_CREATOR_BOOTCLASSPATH);
+ if(result==null) return null;
+ return convertPath(result);
+ }
+
+ public String getDumpType() {
+ return store.getProperty(TCK_DUMP_TYPE);
+ }
+
+
+
+ /**
+ * Returns environmental variables as name=value entries
+ *
+ */
+ public List getEnvironmentalVariables() {
+
+ return getProperties("env.");
+ }
+
+
+ public File getEnvironmentalVariablesReportFile() {
+ String outputFileName=store.getRequiredProperty("tck.environment.variables.report.file");
+ return new File(outputFileName);
+
+ }
+
+ /**
+ * Returns a classpath where every entry is fully qualified
+ *
+ * Each part of the class path is resolved as an already existing
+ * file or is assumed to be relative to the curent working directory
+ *
+ *
+ */
+ public String getFullyQualifiedClasspath() {
+
+ File home=new File(System.getProperty("user.dir"));
+
+ List parts=parseString(classPath, pathSeparator);
+
+ List results=new LinkedList();
+
+ Iterator i=parts.iterator();
+
+ while(i.hasNext()) {
+ String part=(String) i.next();
+ File partFile=new File(part);
+ if(partFile.exists()) {
+ results.add(partFile.getAbsolutePath());
+ }
+ else {
+ File local=new File(home,part);
+ if(local.exists()) {
+ results.add(local.getAbsolutePath());
+ }
+ else {
+ // doesn't exist
+ results.add(part);
+ }
+ }
+ }
+
+ // now convert list into vaid path string
+
+ return convertPath(results);
+ }
+
+public IImageCreator getImageCreator() {
+ String imageCreator=getImageCreatorClassName();
+ try {
+ Class clazz=Class.forName(imageCreator);
+ IImageCreator creator=(IImageCreator) clazz.newInstance();
+ return creator;
+ } catch (Exception e) {
+ throw new TCKException("loading image creator failed",e);
+ }
+
+
+
+}
+public String getImageCreatorClassName() {
+ return getRequiredProperty(TCK_IMAGECREATOR_CLASS);
+}
+
+ public String getJavaExecutablePath() {
+ return getRequiredProperty(TCK_DUMPCREATOR_LAUNCHER);
+
+ }
+ public String getJavaTestExecutablePath() {
+ return getRequiredProperty(TCK_JAVA_TEST_EXECUTEABLE_PATH);
+ }
+
+ /**
+ * Returns jvm arguments as a list
+ * The arguements take the form
+ *
+ * jvmarg.anyname=-wibble
+ *
+ * and are returned as just the property value
+ *
+ */
+ public List getJVMArguments() {
+
+ return getPropertyValues("jvmarg.");
+
+ }
+ public File getJVMArgumentsReportFile() {
+ String outputFileName=store.getRequiredProperty("tck.jvm.arguments.report.file");
+ return new File(outputFileName);
+
+ }
+ public List getProperties(String prefix) {
+
+ int length=prefix.length();
+
+ List envvars=new LinkedList();
+
+ Iterator keys=store.iterator();
+ while(keys.hasNext()) {
+ String key=(String) keys.next();
+ if(key.startsWith(prefix)) {
+ envvars.add(key.substring(length)+"="+store.getProperty(key));
+ }
+ }
+
+ return envvars;
+ }
+ /**
+ * Returns a list of the values of properties whos key starts with
+ * the suppled prefix
+ * @param prefix
+ *
+ */
+ public List getPropertyValues(String prefix) {
+
+
+ List envvars= new LinkedList();
+
+ Iterator keys=store.iterator();
+ while(keys.hasNext()) {
+ String key=(String) keys.next();
+ if(key.startsWith(prefix)) {
+ envvars.add(store.getProperty(key));
+ }
+ }
+
+ return envvars;
+ }
+ public String getRequiredProperty(String key) {
+ String value=store.getProperty(key);
+ if(value==null) raiseError("required property "+key+" is missing");
+ if(value.trim().equals("")) raiseError("required property "+key+" has no value");
+ return value;
+ }
+
+ public int getRequiredType() {
+
+ String testdumptype = store.getProperty("tck.testcases.type", "all");
+
+ int value = getTestType(testdumptype);
+
+ if (value == 0) {
+ raiseError("unable to determine test type required from " + testdumptype
+ + " property");
+
+ }
+ return value;
+ }
+ public PropertyStore getStore() {
+
+ return store;
+ }
+ public String getTCKHarnessClassPath() {
+ String result=getRequiredProperty(TCK_HARNESS_CLASSPATH);
+ return convertPath(result);
+ }
+ /**
+ * Returns list of testcases to run
+ *
+ */
+
+
+ /**
+ * Returns list of testcases to run
+ *
+ */
+ public TCKDefinition getTestcaseConfiguration() {
+ if(def!=null) return def;
+ loadTestcaseConfiguration();
+ return def;
+ }
+ private void loadTestcaseConfiguration() {
+
+ String testconfig = store.getProperty(TCK_TESTCONFIG);
+ if(testconfig!=null) {
+ File testSuiteFile=new File(testconfig);
+ if(testSuiteFile.exists()==false) {
+ raiseError("tck test config file " + testconfig + " does not exist");
+ return;
+ }
+ if(testSuiteFile.isDirectory()) {
+ raiseError("tck test config file " + testconfig + " is not a file");
+ return;
+ }
+ // load it..
+ TCKDefinitionXMLReader reader=new TCKDefinitionXMLReader();
+
+ try {
+ def=reader.load(testSuiteFile);
+ } catch (Exception e) {
+
+ raiseError("unable to load test config file "+testSuiteFile.getAbsolutePath(), e);
+ return;
+ }
+
+ }
+ else {
+ // look for the "standard" config. This is relative to a testcase in the testsuite
+ Class testClazz=null;
+ try {
+ testClazz=Class.forName("com.ibm.dtfj.tck.tests.tagvalidation.TestValidateWindowsClassTag");
+ } catch (ClassNotFoundException e) {
+ raiseError("unable to locate a TCK testcase - check classpath",e);
+ return;
+ }
+
+ InputStream in=testClazz.getResourceAsStream("/tck-definition.xml");
+ if(in==null) {
+ raiseError("Unable to locate TCK definition file");
+ return;
+ }
+ // load it
+ TCKDefinitionXMLReader reader=new TCKDefinitionXMLReader();
+ try {
+ def=reader.load(in);
+ in.close();
+ } catch (Exception e) {
+ raiseError("unable to load TCK definition file", e);
+ return;
+ }
+
+ }
+
+ }
+ public String getTestCaseRunner() {
+ return getRequiredProperty(TCK_JUNIT_RUNNER);
+ }
+
+ public String getTestcaseType() {
+ return getRequiredProperty(TCK_TESTSUITE);
+ }
+ public File getUserHomeDirectory() {
+ return new File(getRequiredProperty("user.home"));
+ }
+ public String getVendor() {
+ return getRequiredProperty("vendor");
+ }
+ public String getVersion() {
+ return getRequiredProperty("version");
+ }
+ public String getVMType() {
+ return getRequiredProperty("vmtype");
+ }
+ public String getWordSize() {
+ return getRequiredProperty("wordsize");
+ }
+ public String getVMBuild() {
+ return null;
+ }
+ /**
+ * Returns the list of possible options for jvm types
+ *
+ *
+ */
+ public List getVMTypeOptions() {
+
+ String result=getRequiredProperty("tck.vmtype.options");
+ return parseString(result,",");
+
+ }
+ public File getWorkingDirectory() {
+
+ return new File(getRequiredProperty(TCK_OUTPUT));
+ }
+ /**
+ * Determines if the provided class is one that matches the
+ * current test criteria
+ *
+ *
+ * @param clazz
+ *
+ */
+ public boolean isMatchingTCKTestClass(Class clazz) {
+
+ String name=clazz.getName();
+ if(name.indexOf("Abstract")>=0) return false;
+
+
+ int testCaseType = getTestCaseType(clazz);
+ int testType=getRequiredType();
+
+ if (testType == testCaseType || (testType==1 && testCaseType!=-1)) {
+ // valid class type
+ // does its name have a filter suffix
+ LinkedList bits=TCKConfiguration.parseString(clazz.getName(), "_");
+ if(bits.isEmpty()==false) {
+ String last=(String) bits.getLast();
+
+ if(suffixesToIgnore==null) setupTestFilteringOptions();
+
+ if(suffixesToIgnore.contains(last)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ Class superClazz = clazz.getSuperclass();
+ if (superClazz == null)
+ return false;
+
+ return isMatchingTCKTestClass(superClazz);
+ }
+
+ public void log(String message) {
+ if(verboseMode) {
+ System.out.println(message);
+ }
+ }
+
+ public void logClassPath()
+ {
+ log("classpath="+classPath);
+
+ }
+ public List parsePath(String path) {
+
+
+
+ return parseString(path,pathSeparator);
+
+
+ }
+ protected void raiseError(String message) {
+ log(message);
+ TCKException e=new TCKException(message);
+ e.printStackTrace();
+ throw e;
+
+ }
+ void raiseError(String message, Exception e) {
+ log(message);
+ throw new TCKException(message, e);
+
+ }
+
+ /**
+ * Test classes can be excluded from execution of their name ends in a
+ * _<vmtype> where vmtype is not the current target jvm
+ *
+ * For instance TestWibble_blob will execute on a JVM of vmtype "blob",
+ * but not on a JVM of vmtype "bling"
+ */
+
+ private void setupTestFilteringOptions() {
+ suffixesToIgnore=new HashSet();
+ String targetVMType=getVMType();
+ List filterSuffixes=getVMTypeOptions();
+
+ // remove target vm from list so that we can compare
+ // test class names for exclusion if required
+
+ filterSuffixes.remove(targetVMType);
+
+ suffixesToIgnore.addAll(filterSuffixes);
+
+ }
+
+ public static TCKConfiguration getConfiguration() {
+ TCKConfiguration config=new TCKConfiguration();
+ File workingDir=config.getWorkingDirectory();
+ File userConfig=new File(workingDir,"tck.properties");
+ if(userConfig.exists()) return new TCKConfiguration(userConfig);
+ return config;
+
+ }
+ public static TCKConfiguration getConfiguration(File userconfig) {
+ return new TCKConfiguration(userconfig);
+
+ }
+
+ public String getOSName() {
+ String osname=getRequiredProperty("os.name").toLowerCase();
+ if(osname.startsWith("windows")) return "windows";
+ if(osname.startsWith("linux")) return "linux";
+ if(osname.startsWith("aix")) return "aix";
+ if(osname.startsWith("os/390")) return "os390";
+ return "<unknown>";
+ }
+ /**
+ * Returns the expected result of executing the specified test
+ *
+ * @param abstractTCKTestcase test case
+ * @param name - method name
+ * @return
+ * @throws TCKDefinitionException
+ */
+ public boolean predictedTestResult(
+ AbstractTCKTestcase abstractTCKTestcase, String methodName) throws TCKDefinitionException {
+
+ TCKDefinition d=getTestcaseConfiguration(); // forces load
+
+ String packageName=abstractTCKTestcase.getClass().getPackage().getName();
+ String className=abstractTCKTestcase.getClass().getName();
+
+ // get the tag group
+
+ TCKTagGroup group= d.getTagGroup(packageName, className.substring(packageName.length()+1), methodName);
+
+ // get current required values
+
+ String osName=getOSName();
+ String arch=getArchitecture();
+ String vmVendor=getVendor();
+ String vmType=getVMType();
+ String dumpType=getDumpType();
+ String testSuiteType=getTestcaseType();
+ String vmBuild = getVMBuild();
+
+ return group.expectedResult(osName,arch,vmVendor,dumpType,vmType,testSuiteType,vmBuild);
+
+ }
+ public String getArchitecture() {
+ return getRequiredProperty("os.arch");
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKException.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKException.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKException.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/api/TCKException.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.api;
+
+public class TCKException extends RuntimeException {
+
+ private static final long serialVersionUID = -177670490385332658L;
+
+ public TCKException(String message) {
+ super(message);
+
+ }
+
+ public TCKException(Throwable cause) {
+ super(cause);
+
+ }
+
+ public TCKException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractLauncher.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractLauncher.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractLauncher.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractLauncher.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.harness;
+
+import java.io.File;
+
+import com.ibm.dtfj.tck.api.IDumpCreator;
+import com.ibm.dtfj.tck.api.TCKConfiguration;
+import com.ibm.dtfj.tck.api.TCKException;
+
+public abstract class AbstractLauncher {
+
+ private boolean verboseMode=true;
+
+ private TCKConfiguration config=null;
+
+ public AbstractLauncher() {
+ config=TCKConfiguration.getConfiguration();
+
+ }
+ public void log(String message) {
+ if(verboseMode) {
+ System.out.println(message);
+ }
+ }
+ protected void raiseError(String message) {
+ log(message);
+ throw new TCKException(message);
+
+ }
+
+ void raiseError(String message, Exception e) {
+ log(message);
+ throw new TCKException(message, e);
+
+ }
+
+ static int getTestType(String testtype) {
+ testtype = testtype.toLowerCase().trim();
+ int type = 0;
+ if (testtype.equals("all")) {
+ type = 1;
+ } else if (testtype.equals("process")) {
+ type = 2;
+ } else if (testtype.equals("javaruntime")) {
+ type = 3;
+ } else if (testtype.equals("javaheap")) {
+ type = 4;
+ }
+ return type;
+ }
+
+ static int getTestDumpType(String testtype) {
+ testtype = testtype.toLowerCase().trim();
+ int type = 0;
+ if (testtype.equals("all")) {
+ type = 1;
+ } else if (testtype.equals("process")) {
+ type = 2;
+ } else if (testtype.equals("javaruntime")) {
+ type = 3;
+ } else if (testtype.equals("javaheap")) {
+ type = 4;
+ }
+ return type;
+ }
+
+
+
+
+
+
+
+ protected IDumpCreator loadDumpCreator() {
+ String className=config.getDumpCreatorClassname();
+ log("dump generator class="+className);
+ Object instance=createInstance(className);
+ return (IDumpCreator)instance;
+
+ }
+
+ private Object createInstance(String className) {
+
+ try {
+ Class clazz=Class.forName(className);
+ Object instance=clazz.newInstance();
+ return instance;
+ } catch (ClassNotFoundException e) {
+
+ raiseError("cannot locate class "+className,e);
+ } catch (InstantiationException e) {
+ raiseError("unable to instantiate "+className,e);
+
+ } catch (IllegalAccessException e) {
+ raiseError("unable to instantiate "+className,e);
+ }
+
+ return null;
+ }
+
+
+ public int getRequiredType() {
+ String testdumptype = config.getTestcaseType();
+
+ int value = getTestType(testdumptype);
+
+ if (value == 0) {
+ raiseError("unable to determine test type required from " + testdumptype
+ + " property");
+
+ }
+ return value;
+ }
+
+ public boolean isVerboseMode() {
+ return verboseMode;
+ }
+
+ public TCKConfiguration getProperties() {
+ return config;
+ }
+ public void setUserConfiguration(File userconfig) {
+ config=TCKConfiguration.getConfiguration(userconfig);
+
+ }
+ public TCKConfiguration getConfig() {
+ return config;
+ }
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractTCKTestcase.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractTCKTestcase.java?rev=754944&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractTCKTestcase.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.harness/src/com/ibm/dtfj/tck/harness/AbstractTCKTestcase.java Mon Mar 16 16:42:12 2009
@@ -0,0 +1,225 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+/**
+ *
+ */
+package com.ibm.dtfj.tck.harness;
+
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import com.ibm.dtfj.tck.api.ICheckPointHandler;
+import com.ibm.dtfj.tck.api.ICheckpoint;
+import com.ibm.dtfj.tck.api.TCKConfiguration;
+import com.ibm.dtfj.tck.api.TCKException;
+
+/**
+ *
+ */
+public abstract class AbstractTCKTestcase extends TestCase {
+
+ public AbstractTCKTestcase() {
+
+
+ if(theProperties==null) {
+
+
+ theProperties=TCKConfiguration.getConfiguration();
+ }
+
+
+ }
+
+
+
+
+ private static TCKConfiguration theProperties = null;
+
+
+ protected void runTest() throws Throwable {
+
+ if(theProperties.predictedTestResult(this,getName())) {
+ super.runTest();
+ }
+ else {
+ boolean failed=true;
+ try {
+ super.runTest();
+ failed=false;
+
+ }
+ catch(Throwable t) {
+ // passed since it failed. Ignore error
+ }
+ if(!failed) throw new AssertionFailedError("testcase should have failed");
+ }
+ }
+
+
+
+ protected void report(Exception cause, String message) {
+ throw new TCKException(message,cause);
+
+ }
+ protected void report(String message) {
+ throw new TCKException(message);
+
+ }
+
+
+
+ /**
+ *
+ */
+ public void configure(ICheckPointHandler handler)
+ {
+ // get methods
+ Class me=getClass();
+ Method m[] = me.getDeclaredMethods();
+
+ // run all methods where the method name starts with configure
+ for (int j = 0; j < m.length; j++)
+ {
+ Method method=m[j];
+ String methodName=m[j].getName();
+ if (methodName.startsWith("config"))
+ {
+
+
+ try {
+ Class[] parms=method.getParameterTypes();
+ if(parms==null || parms.length==0) {
+ method.invoke(this, null);
+ }
+ else {
+ if(parms[0].isAssignableFrom(ICheckpoint.class)) {
+ handler.handle(method,this);
+ }
+ else {
+ throw new TCKException("unable to use configure method "+method.toString()+" as has unexpected method signature");
+ }
+ }
+
+ } catch (SecurityException e) {
+ throw new TCKException("Exception using configure method "+method,e);
+ } catch (IllegalArgumentException e) {
+ throw new TCKException("Exception using configure method "+method,e);
+ } catch (IllegalAccessException e) {
+ throw new TCKException("Exception using configure method "+method,e);
+ } catch (InvocationTargetException e) {
+ throw new TCKException("Exception using configure method "+method,e);
+ }
+ }
+ }
+ }
+
+
+ protected TCKConfiguration getConfiguration() {
+
+ return theProperties;
+ }
+
+
+ public void getEnvironmentArguments(MapCollector collector) {
+
+
+ // get methods
+ Class me=getClass();
+ Method m[] = me.getDeclaredMethods();
+
+ // run all methods where the method name starts with configure
+ for (int j = 0; j < m.length; j++)
+ {
+ Method method=m[j];
+ String methodName=m[j].getName();
+ if (methodName.startsWith("env"))
+ {
+
+ try {
+ String[] result=(String[]) method.invoke(this, null);
+ if(result!=null && result.length>0) {
+ for(int r=0;r<result.length;r++) {
+ String var=result[r];
+ collector.collect(var,method);
+
+ }
+ }
+
+ } catch (SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ }
+
+ }
+ public void getJVMArguments(ValueCollector collector) {
+
+
+ // get methods
+ Class me=getClass();
+ Method m[] = me.getDeclaredMethods();
+
+ // run all methods where the method name starts with configure
+ for (int j = 0; j < m.length; j++)
+ {
+ Method method=m[j];
+ String methodName=m[j].getName();
+ if (methodName.startsWith("jvm"))
+ {
+
+ try {
+ String[] result=(String[]) method.invoke(this, null);
+ if(result!=null && result.length>0) {
+ for(int r=0;r<result.length;r++) {
+ String var=result[r];
+ collector.collect(var,method);
+
+ }
+ }
+
+ } catch (SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ }
+
+ }
+
+}