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:41 UTC
svn commit: r754945 [1/8] - in
/incubator/kato/trunk/import/org.apache.kato.tck.tests: ./ .settings/ src/
src/com/ src/com/ibm/ src/com/ibm/dtfj/ src/com/ibm/dtfj/tck/
src/com/ibm/dtfj/tck/tests/ src/com/ibm/dtfj/tck/tests/javaruntime/
src/com/ibm/dtfj...
Author: ccristal
Date: Mon Mar 16 16:42:39 2009
New Revision: 754945
URL: http://svn.apache.org/viewvc?rev=754945&view=rev
Log:
Initial code contribution from IBM.
Added:
incubator/kato/trunk/import/org.apache.kato.tck.tests/
incubator/kato/trunk/import/org.apache.kato.tck.tests/.classpath
incubator/kato/trunk/import/org.apache.kato.tck.tests/.project
incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/
incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.core.resources.prefs
incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.jdt.core.prefs
incubator/kato/trunk/import/org.apache.kato.tck.tests/build.properties
incubator/kato/trunk/import/org.apache.kato.tck.tests/build.xml
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClass_getName.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_equals.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_get.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getBoolean.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getByte.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getChar.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDouble.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getFloat.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getInt.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getLong.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getModifiers.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getName.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getShort.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getSignature.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getString.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaHeap_getName.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaMethod_getName.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaMonitor_ObjectMonitors.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaObject_arraycopy.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaObject_getDeclaredFields_getName.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaObject_getReferences.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaReferences.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntimeThreads.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getCompiledMethods.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getHeapRoots.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaStackFrame_getHeapRoots.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThreadInspection.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getName.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getStackFrames.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestEnvironmentVariables.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestImage.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageAddressSpace.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetCreationTime.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetHostName.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetIPAddresses.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetInstalledMemory.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorCount.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorSubType.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorType.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemSubType.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemType.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateAIXClassTag.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateDumpTypeMethodTag.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateLinuxClassTag.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOS390ClassTag.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOSMethodTag.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateWindowsClassTag.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/AbstractDTFJTestcase.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/AllTests.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/DTFJImageLoader.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/DTFJManifestTests.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageAddressSpaceTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageFactoryTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageModuleTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImagePointerTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageProcessTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageRegisterTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageSectionTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageStackFrameTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageSymbolTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/ImageThreadTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaClassLoaderTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaClassTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaFieldTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaHeapTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaLocationTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaMethodTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaMonitorTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaObjectTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaRuntimeTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaStackFrameTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/JavaThreadTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/TestNotImplementedException.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/junit/TestPackageInformation.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/scenarios/
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/scenarios/ArrayletTest.java
incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tests/scenarios/ArrayletTestInstance.java
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/.classpath
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/.classpath?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/.classpath (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/.classpath Mon Mar 16 16:42:39 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sun142"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.apache.kato.api"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.apache.kato.tck.harness"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/.project
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/.project?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/.project (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/.project Mon Mar 16 16:42:39 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.kato.tck.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.core.resources.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.core.resources.prefs?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.core.resources.prefs (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.core.resources.prefs Mon Mar 16 16:42:39 2009
@@ -0,0 +1,5 @@
+#Fri Jan 30 14:26:59 GMT 2009
+eclipse.preferences.version=1
+encoding//src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_get.java=UTF-8
+encoding/build.properties=ISO-8859-1
+encoding/build.xml=UTF-8
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.jdt.core.prefs?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/.settings/org.eclipse.jdt.core.prefs Mon Mar 16 16:42:39 2009
@@ -0,0 +1,7 @@
+#Sat Jul 19 17:34:44 BST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/build.properties
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/build.properties?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/build.properties (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/build.properties Mon Mar 16 16:42:39 2009
@@ -0,0 +1,18 @@
+#-------------------------------------------------------------------------------
+# 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.tests
+src=./src
+bin=./bin
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/build.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/build.xml?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/build.xml (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/build.xml Mon Mar 16 16:42:39 2009
@@ -0,0 +1,108 @@
+<?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" />
+ <property file="${user.home}/tck.properties" />
+
+
+
+ <taskdef resource="com/ibm/dtfj/anttasks/anttasks.properties">
+ <classpath>
+ <pathelement location="${lib}/dtfjant.jar" />
+ </classpath>
+ </taskdef>
+
+ <path id="compile.classpath">
+
+ <fileset dir="${components}/com.ibm.dtfj.api/dist">
+ <include name="*.jar" />
+ </fileset>
+ <fileset dir="${components}/com.ibm.dtfj.tck.harness/dist">
+ <include name="*.jar" />
+ </fileset>
+ <path location="${junit.path}" />
+
+ </path>
+
+ <path id="source.path">
+ <path location="${src}" />
+ <path location="${workspace}/com.ibm.dtfj.api/src"/>
+ <path location="${workspace}/com.ibm.dtfj.tck.harness/src"/>
+ </path>
+
+ <!-- =================================
+ target: default
+ ================================= -->
+
+ <target name="default">
+ <antcall target="clean" />
+ <antcall target="build-list" />
+ <antcall target="compile" />
+ <antcall target="jar" />
+
+
+ </target>
+
+ <!-- remove compiled classes and jars-->
+
+ <target name="clean">
+ <delete dir="${bin}" />
+ <delete dir="${dist}" />
+
+
+ </target>
+
+ <!-- compile -->
+
+ <target name="compile">
+ <mkdir dir="${bin}" />
+ <javac fork="true" debug="true" executable="${tck.javac.location.sun.hotspot.1.4.2}" srcdir="${src}" destdir="${bin}" source="${srclevel}" target="${srclevel}">
+ <classpath refid="compile.classpath" />
+ </javac>
+ </target>
+
+
+
+ <target name="jar">
+ <mkdir dir="${dist}" />
+ <jar jarfile="${jarfile}" filesonly="true">
+ <fileset dir="${bin}" />
+
+ </jar>
+ <jar jarfile="${srcjarfile}" filesonly="true">
+ <fileset dir="${src}">
+ <include name="**/*.java" />
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="build-list">
+ <mkdir dir="${bin}" />
+ <tcklistbuilder packagenames="com.ibm.dtfj.tck.tests.*,com.ibm.dtfj.tests.*" output="${bin}/tck-definition.xml"
+ sourcepathref="source.path"
+ failonerror="true" docletpath="${lib}/dtfjant.jar" classpathref="compile.classpath"/>
+
+ </target>
+
+
+</project>
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.java.JavaClass;
+import com.ibm.dtfj.java.JavaClassLoader;
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.java.JavaRuntime;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ *
+ *
+ */
+public class TestJavaClassLoader_getJavaObject extends TCKJavaRuntimeTestcase {
+
+ static TCKClassLoader referenceClassLoader;
+
+ public class TCKClassLoader extends ClassLoader {
+
+ private String JavaClassLoader_getJavaObject = "JavaClassLoader_getJavaObject";
+
+ public Class findClass(String name) {
+ byte[] b = loadClassData(name);
+ return defineClass(name, b, 0, b.length);
+ }
+ private byte[] loadClassData(String name) {
+ return null;
+ }
+ }
+
+
+ public void configureJavaClassLoader_getJavaObject()
+ {
+ referenceClassLoader = new TCKClassLoader();
+ }
+
+ public void testJavaClassLoader_getJavaObject()
+ {
+ boolean foundClassLoader = false;
+
+ JavaRuntime runtime=getJavaRuntime();
+ Iterator classloaders = runtime.getJavaClassLoaders();
+
+ while (classloaders.hasNext()) {
+ Object nextClassloader = classloaders.next();
+ if (nextClassloader instanceof CorruptData) {
+ System.err.println("returned CorruptData `" + nextClassloader + "'");
+ break;
+ }
+
+ JavaClassLoader aJavaClassloader = (JavaClassLoader) nextClassloader;
+ JavaClass theJavaClass;
+ try {
+ JavaObject classLoaderObject = (aJavaClassloader).getObject();
+
+ // The system class loader doesn't have an object.
+ if (classLoaderObject == null ) {
+ continue;
+ }
+
+ theJavaClass = classLoaderObject.getJavaClass();
+ Iterator fields = theJavaClass.getDeclaredFields();
+
+ while (fields.hasNext()) {
+ Object nextField = fields.next();
+
+ if (nextField instanceof CorruptData) {
+ System.err.println("returned CorruptData `" + nextField + "'");
+ break;
+ }
+
+ JavaField theField = (JavaField) nextField;
+ String theFieldName = theField.getName();
+ if (theFieldName.equals("JavaClassLoader_getJavaObject")){
+ foundClassLoader = true;
+ }
+
+ }
+
+ } catch (CorruptDataException e) {
+ assertNotNull(e.getCorruptData());
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ assertTrue(foundClassLoader);
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClass_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClass_getName.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClass_getName.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaClass_getName.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.java.JavaClass;
+import com.ibm.dtfj.java.JavaHeap;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.java.JavaRuntime;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaClass_getName extends TCKJavaRuntimeTestcase {
+
+ static TestObject theTestObject;
+
+ class TestObject {
+ private String JavaObject_getDeclaredFields_getName = "JavaObject_getDeclaredFields_getName";
+ }
+
+ static final String TestObjectClassName = TestObject.class.getName().replace('.', '/');
+ public void configureJavaClass_getName()
+ {
+ theTestObject=new TestObject();
+ }
+
+
+ public class Unicode_class_\u0412\u043e\u0434\u043a\u0430 {
+
+ }
+
+ private Unicode_class_\u0412\u043e\u0434\u043a\u0430 unicodeClass = new Unicode_class_\u0412\u043e\u0434\u043a\u0430();
+
+ String unicodeClassname = Unicode_class_\u0412\u043e\u0434\u043a\u0430.class.getName().replace('.','/');
+
+ /**
+ *
+ */
+ public void testJavaClass_getName()
+ {
+ boolean foundClassName = false;
+
+ JavaRuntime runtime=getJavaRuntime();
+
+ Iterator heaps = runtime.getHeaps();
+
+ while (heaps.hasNext()) {
+ Object nextHeap = heaps.next();
+ if (nextHeap instanceof CorruptData) {
+ System.err.println("returned CorruptData `" + nextHeap + "'");
+ break;
+ }
+
+ JavaHeap aJavaHeap = (JavaHeap) nextHeap;
+ Iterator objects = aJavaHeap.getObjects();
+
+ while (objects.hasNext()) {
+ Object nextObject = objects.next();
+ if (nextObject instanceof CorruptData) {
+ System.err.println("returned CorruptData `" + nextObject + "'");
+ break;
+ }
+
+ JavaObject aJavaObject = (JavaObject) nextObject;
+ try {
+ JavaClass theJavaClass = aJavaObject.getJavaClass();
+ String theClassName = (theJavaClass).getName();
+ if (TestObjectClassName.equals(theClassName)) {
+ System.out.println("theClassName "+theClassName);
+ foundClassName=true;
+ }
+
+ } catch (CorruptDataException e) {
+ assertNotNull(e.getCorruptData());
+ e.printStackTrace();
+ }
+ }
+ }
+ assertTrue(foundClassName);
+ }
+
+ public void testUnicodeClassName() throws Exception {
+ JavaObject obj = getJavaObjectByClassname(unicodeClassname);
+
+ assertNotNull("Couldn't find object of instance " + unicodeClassname, obj);
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_equals.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_equals.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_equals.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_equals.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaField_equals extends TCKJavaRuntimeTestcase {
+ int fieldA=1;
+ int fieldB=2;
+ static String staticField="3";
+
+ public static class DifferentClass {
+ int fieldA=1;
+ int fieldB=2;
+ static String staticField="3";
+
+ }
+
+ static DifferentClass differentObject = new DifferentClass();
+
+ String differentClassName = DifferentClass.class.getName().replace('.', '/');
+
+ static JavaObject thisObject = null;
+ public JavaObject getThis() {
+ if (thisObject == null) {
+ thisObject = super.getThis();
+ }
+ return thisObject;
+ }
+
+ static JavaObject differentClassObject = null;
+ public void setUp() {
+ if (differentClassObject == null) {
+ differentClassObject = getJavaObjectByClassname(differentClassName);
+ }
+
+ assertNotNull("Unable to find class "+differentClassName, differentClassObject);
+ }
+
+ public void testToString() throws Exception {
+ JavaField fieldAField = getJavaField(getThis(), "fieldA");
+ String theString=fieldAField.toString();
+ assertNotNull(theString);
+ assertTrue(theString.length() >= 0 );
+ }
+
+ public void testHashCode() throws Exception {
+ JavaField fieldAField = getJavaField(getThis(), "fieldA");
+ JavaField fieldAField2 = getJavaField(getThis(), "fieldA");
+
+ assertTrue(fieldAField.hashCode()==fieldAField2.hashCode());
+ }
+
+
+ public void testNullFalse() throws Exception {
+ JavaField fieldAField = getJavaField(getThis(), "fieldA");
+
+ assertFalse(fieldAField.equals(null));
+ }
+
+ public void testNullFalseStatic() throws Exception {
+ JavaField staticField = getJavaField(getThis(), "staticField");
+
+ assertFalse(staticField.equals(null));
+ }
+
+ public void testDifferentFalse() throws Exception {
+ JavaField fieldAField = getJavaField(getThis(), "fieldA");
+ JavaField fieldBField = getJavaField(getThis(), "fieldB");
+
+ assertFalse(fieldAField.equals(fieldBField));
+ assertFalse(fieldBField.equals(fieldAField));
+ }
+
+ public void testDifferentFalseStatic() throws Exception {
+ JavaField staticField = getJavaField(getThis(), "staticField");
+ JavaField fieldBField = getJavaField(getThis(), "fieldB");
+
+ assertFalse(staticField.equals(fieldBField));
+ assertFalse(fieldBField.equals(staticField));
+ }
+
+ public void testEqualsSelf() throws Exception {
+ JavaField fieldAField = getJavaField(getThis(), "fieldA");
+ assertTrue(fieldAField.equals(fieldAField));
+ }
+
+ public void testNotEqualsDiffClass() throws Exception {
+ JavaField differentFieldAField = getJavaField(differentClassObject, "fieldA");
+ JavaField fieldAField = getJavaField(getThis(), "fieldA");
+
+ assertFalse(fieldAField.equals(differentFieldAField));
+ assertFalse(differentFieldAField.equals(fieldAField));
+ }
+
+ public void testNotEqualsDiffClassStatic() throws Exception {
+ JavaField differentStaticField = getJavaField(differentClassObject, "staticField");
+ JavaField staticField = getJavaField(getThis(), "staticField");
+
+ assertFalse(staticField.equals(differentStaticField));
+ assertFalse(differentStaticField.equals(staticField));
+ }
+
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_get.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_get.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_get.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_get.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,527 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaField_get extends TCKJavaRuntimeTestcase {
+ byte byteValue = 0x5a;
+ byte maxByteValue = Byte.MAX_VALUE;
+ byte minByteValue = Byte.MIN_VALUE;
+
+ short shortValue = 0x5a7f;
+ short maxShortValue = Short.MAX_VALUE;
+ short minShortValue = Short.MIN_VALUE;
+
+ char charValue = '\u043e';
+ char maxCharValue = Character.MAX_VALUE;
+ char minCharValue = Character.MIN_VALUE;
+
+ int intValue = 0x12345678;
+ int maxIntValue = Integer.MAX_VALUE;
+ int minIntValue = Integer.MIN_VALUE;
+
+ long longValue = 0x9abcdef012345678l;
+ long maxLongValue = Long.MAX_VALUE;
+ long minLongValue = Long.MIN_VALUE;
+
+ float floatValue = (float)4.0e2;
+ float maxFloatValue = Float.MAX_VALUE;
+ float minFloatValue = Float.MIN_VALUE;
+
+ double doubleValue = 4.1e2;
+ double maxDoubleValue = Double.MAX_VALUE;
+ double minDoubleValue = Double.MIN_VALUE;
+
+ String stringValue = "this is a string";
+ Object objectValue = new Object();
+ Object nullValue = null;
+
+ static byte byteStaticValue = 0x12;
+ static byte maxByteStaticValue = Byte.MAX_VALUE;
+ static byte minByteStaticValue = Byte.MIN_VALUE;
+
+ static short shortStaticValue = 0x1842;
+ static short maxShortStaticValue = Byte.MAX_VALUE;
+ static short minShortStaticValue = Byte.MIN_VALUE;
+
+ static char charStaticValue = '\u0342';
+ static char maxCharStaticValue = Character.MAX_VALUE;
+ static char minCharStaticValue = Character.MIN_VALUE;
+
+ static int intStaticValue = 0x98765432;
+ static int maxIntStaticValue = Integer.MAX_VALUE;
+ static int minIntStaticValue = Integer.MIN_VALUE;
+
+
+ static long longStaticValue = 0x47393fabcd8dbea7l;
+ static long maxLongStaticValue = Long.MAX_VALUE;
+ static long minLongStaticValue = Long.MIN_VALUE;
+
+
+ static float floatStaticValue = (float)1.0e-3;
+ static float maxFloatStaticValue = Float.MAX_VALUE;
+ static float minFloatStaticValue = Float.MIN_VALUE;
+
+ static double doubleStaticValue = 7.2e-9;
+ static double maxDoubleStaticValue = Double.MAX_VALUE;
+ static double minDoubleStaticValue = Double.MIN_VALUE;
+
+ static String stringStaticValue = "This statement is false.";
+ static Object objectStaticValue = new Object();
+ static Object nullStaticValue = null;
+
+ public static class WrongClass {
+ byte byteValue;
+ Object objectValue = new Object();
+ }
+
+ WrongClass wrongObjectInstance = new WrongClass();
+
+ static JavaObject thisObject = null;
+ public JavaObject getThis() {
+ if (thisObject == null) {
+ thisObject = super.getThis();
+ }
+ return thisObject;
+ }
+
+ static String wrongClassName = WrongClass.class.getName().replace('.', '/');
+
+ static JavaObject wrongClassObject = null;
+ public void setUp() {
+ if (wrongClassObject == null) {
+ wrongClassObject = getJavaObjectByClassname(wrongClassName);
+ }
+ }
+
+ public void testByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteField = getJavaField(thisJavaObject, "byteValue");
+
+ Byte byteObj = (Byte) byteField.get(thisJavaObject);
+
+ assertEquals(byteObj.byteValue(), byteValue);
+ }
+
+ public void testMaxByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteField = getJavaField(thisJavaObject, "maxByteValue");
+
+ Byte byteObj = (Byte) byteField.get(thisJavaObject);
+
+ assertEquals(byteObj.byteValue(), maxByteValue);
+ }
+
+ public void testMinByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteField = getJavaField(thisJavaObject, "minByteValue");
+
+ Byte byteObj = (Byte) byteField.get(thisJavaObject);
+
+ assertEquals(byteObj.byteValue(), minByteValue);
+ }
+
+ public void testShortValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortField = getJavaField(thisJavaObject, "shortValue");
+
+ Short shortObj = (Short) shortField.get(thisJavaObject);
+
+ assertEquals(shortObj.shortValue(), shortValue);
+ }
+
+ public void testMaxShortValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortField = getJavaField(thisJavaObject, "maxShortValue");
+
+ Short shortObj = (Short) shortField.get(thisJavaObject);
+
+ assertEquals(shortObj.shortValue(), maxShortValue);
+ }
+
+ public void testMinShortValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortField = getJavaField(thisJavaObject, "minShortValue");
+
+ Short shortObj = (Short) shortField.get(thisJavaObject);
+
+ assertEquals(shortObj.shortValue(), minShortValue);
+ }
+
+ public void testCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charField = getJavaField(thisJavaObject, "charValue");
+
+ Character charObj = (Character) charField.get(thisJavaObject);
+
+ assertEquals(charObj.charValue(), charValue);
+ }
+
+ public void testMaxCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charField = getJavaField(thisJavaObject, "maxCharValue");
+
+ Character charObj = (Character) charField.get(thisJavaObject);
+
+ assertEquals(charObj.charValue(), maxCharValue);
+ }
+
+ public void testMinCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charField = getJavaField(thisJavaObject, "minCharValue");
+
+ Character charObj = (Character) charField.get(thisJavaObject);
+
+ assertEquals(charObj.charValue(), minCharValue);
+ }
+
+ public void testIntValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intField = getJavaField(thisJavaObject, "intValue");
+
+ Integer intObj = (Integer) intField.get(thisJavaObject);
+
+ assertEquals(intObj.intValue(), intValue);
+ }
+
+ public void testMaxIntValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intField = getJavaField(thisJavaObject, "maxIntValue");
+
+ Integer intObj = (Integer) intField.get(thisJavaObject);
+
+ assertEquals(intObj.intValue(), maxIntValue);
+ }
+
+ public void testMinIntValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intField = getJavaField(thisJavaObject, "minIntValue");
+
+ Integer intObj = (Integer) intField.get(thisJavaObject);
+
+ assertEquals(intObj.intValue(), minIntValue);
+ }
+
+ public void testFloatValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatField = getJavaField(thisJavaObject, "floatValue");
+
+ Float floatObj = (Float) floatField.get(thisJavaObject);
+
+ assertEquals(floatObj.floatValue(), floatValue, 0.0);
+ }
+
+ public void testMaxFloatValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatField = getJavaField(thisJavaObject, "maxFloatValue");
+
+ Float floatObj = (Float) floatField.get(thisJavaObject);
+
+ assertEquals(floatObj.floatValue(), maxFloatValue, 0.0);
+ }
+
+ public void testMinFloatValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatField = getJavaField(thisJavaObject, "minFloatValue");
+
+ Float floatObj = (Float) floatField.get(thisJavaObject);
+
+ assertEquals(floatObj.floatValue(), minFloatValue, 0.0);
+ }
+
+ public void testDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleField = getJavaField(thisJavaObject, "doubleValue");
+
+ Double doubleObj = (Double) doubleField.get(thisJavaObject);
+
+ assertEquals(doubleObj.doubleValue(), doubleValue, 0.0);
+ }
+
+ public void testMaxDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleField = getJavaField(thisJavaObject, "maxDoubleValue");
+
+ Double doubleObj = (Double) doubleField.get(thisJavaObject);
+
+ assertEquals(doubleObj.doubleValue(), maxDoubleValue, 0.0);
+ }
+
+ public void testMinDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleField = getJavaField(thisJavaObject, "minDoubleValue");
+
+ Double doubleObj = (Double) doubleField.get(thisJavaObject);
+
+ assertEquals(doubleObj.doubleValue(), minDoubleValue, 0.0);
+ }
+
+ public void testStringValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField stringField = getJavaField(thisJavaObject, "stringValue");
+
+ JavaObject stringObject = (JavaObject) stringField.get(thisJavaObject);
+
+ assertEquals(String.class.getName().replace('.','/'), stringObject.getJavaClass().getName());
+ }
+
+ public void testObjectValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectField = getJavaField(thisJavaObject, "objectValue");
+
+ JavaObject objectObject = (JavaObject) objectField.get(thisJavaObject);
+
+ assertEquals(Object.class.getName().replace('.','/'), objectObject.getJavaClass().getName());
+ }
+
+ public void testNullValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectField = getJavaField(thisJavaObject, "nullValue");
+
+ JavaObject objectObject = (JavaObject) objectField.get(thisJavaObject);
+
+ assertNull(objectObject);
+ }
+
+ public void testNullObjectInstance() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectField = getJavaField(thisJavaObject, "objectValue");
+
+ try{
+ JavaObject objectObject = (JavaObject) objectField.get(null);
+ fail("Didn't get expected NullPointerException");
+ }catch(NullPointerException e) {
+ // expected - should get NPE with no object when passed to instance JavaField
+ }
+
+ }
+
+ public void testByteStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteField = getJavaField(thisJavaObject, "byteStaticValue");
+
+ Byte byteObj = (Byte) byteField.get(null);
+
+ assertEquals(byteObj.byteValue(), byteStaticValue);
+ }
+
+ public void testMaxByteStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteField = getJavaField(thisJavaObject, "maxByteStaticValue");
+
+ Byte byteObj = (Byte) byteField.get(null);
+
+ assertEquals(byteObj.byteValue(), maxByteStaticValue);
+ }
+
+ public void testMinByteStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteField = getJavaField(thisJavaObject, "minByteStaticValue");
+
+ Byte byteObj = (Byte) byteField.get(null);
+
+ assertEquals(byteObj.byteValue(), minByteStaticValue);
+ }
+
+
+ public void testShortStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortField = getJavaField(thisJavaObject, "shortStaticValue");
+
+ Short shortObj = (Short) shortField.get(null);
+
+ assertEquals(shortObj.shortValue(), shortStaticValue);
+ }
+
+ public void testMaxShortStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortField = getJavaField(thisJavaObject, "maxShortStaticValue");
+
+ Short shortObj = (Short) shortField.get(null);
+
+ assertEquals(shortObj.shortValue(), maxShortStaticValue);
+ }
+
+ public void testMinShortStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortField = getJavaField(thisJavaObject, "minShortStaticValue");
+
+ Short shortObj = (Short) shortField.get(null);
+
+ assertEquals(shortObj.shortValue(), minShortStaticValue);
+ }
+
+
+ public void testCharStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charField = getJavaField(thisJavaObject, "charStaticValue");
+
+ Character charObj = (Character) charField.get(null);
+
+ assertEquals(charObj.charValue(), charStaticValue);
+ }
+
+ public void testMaxCharStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charField = getJavaField(thisJavaObject, "maxCharStaticValue");
+
+ Character charObj = (Character) charField.get(null);
+
+ assertEquals(charObj.charValue(), maxCharStaticValue);
+ }
+
+ public void testMinCharStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charField = getJavaField(thisJavaObject, "minCharStaticValue");
+
+ Character charObj = (Character) charField.get(null);
+
+ assertEquals(charObj.charValue(), minCharStaticValue);
+ }
+
+ public void testIntStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intField = getJavaField(thisJavaObject, "intStaticValue");
+
+ Integer intObj = (Integer) intField.get(null);
+
+ assertEquals(intObj.intValue(), intStaticValue);
+ }
+
+ public void testMaxIntStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intField = getJavaField(thisJavaObject, "maxIntStaticValue");
+
+ Integer intObj = (Integer) intField.get(null);
+
+ assertEquals(intObj.intValue(), maxIntStaticValue);
+ }
+
+ public void testMinIntStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intField = getJavaField(thisJavaObject, "minIntStaticValue");
+
+ Integer intObj = (Integer) intField.get(null);
+
+ assertEquals(intObj.intValue(), minIntStaticValue);
+ }
+
+ public void testFloatStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatField = getJavaField(thisJavaObject, "floatStaticValue");
+
+ Float floatObj = (Float) floatField.get(null);
+
+ assertEquals(floatObj.floatValue(), floatStaticValue, 0.0);
+ }
+
+ public void testMaxFloatStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatField = getJavaField(thisJavaObject, "maxFloatStaticValue");
+
+ Float floatObj = (Float) floatField.get(null);
+
+ assertEquals(floatObj.floatValue(), maxFloatStaticValue, 0.0);
+ }
+
+ public void testMinFloatStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatField = getJavaField(thisJavaObject, "minFloatStaticValue");
+
+ Float floatObj = (Float) floatField.get(null);
+
+ assertEquals(floatObj.floatValue(), minFloatStaticValue, 0.0);
+ }
+
+ public void testDoubleStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleField = getJavaField(thisJavaObject, "doubleStaticValue");
+
+ Double doubleObj = (Double) doubleField.get(null);
+
+ assertEquals(doubleObj.doubleValue(), doubleStaticValue, 0.0);
+ }
+
+ public void testMaxDoubleStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleField = getJavaField(thisJavaObject, "maxDoubleStaticValue");
+
+ Double doubleObj = (Double) doubleField.get(null);
+
+ assertEquals(doubleObj.doubleValue(), maxDoubleStaticValue, 0.0);
+ }
+ public void testMinDoubleStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleField = getJavaField(thisJavaObject, "minDoubleStaticValue");
+
+ Double doubleObj = (Double) doubleField.get(null);
+
+ assertEquals(doubleObj.doubleValue(), minDoubleStaticValue, 0.0);
+ }
+ public void testStringStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField stringField = getJavaField(thisJavaObject, "stringStaticValue");
+
+ JavaObject stringObject = (JavaObject) stringField.get(null);
+
+ assertEquals(String.class.getName().replace('.','/'), stringObject.getJavaClass().getName());
+ }
+
+ public void testObjectStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectField = getJavaField(thisJavaObject, "objectStaticValue");
+
+ JavaObject objectObject = (JavaObject) objectField.get(null);
+
+ assertEquals(Object.class.getName().replace('.','/'), objectObject.getJavaClass().getName());
+ }
+
+ public void testNullStaticValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectField = getJavaField(thisJavaObject, "nullStaticValue");
+
+ JavaObject objectObject = (JavaObject) objectField.get(null);
+
+ assertNull(objectObject);
+ }
+
+ public void testWrongByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectField = getJavaField(thisJavaObject, "byteValue");
+
+ try{
+ Byte byteObj = (Byte) objectField.get(wrongClassObject);
+ fail("JavaField.get() should have thrown IllegalArgumentException as passed wrong object.");
+ }catch (IllegalArgumentException e) {
+ // expected
+ }
+
+ }
+
+ public void testWrongObjectValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectField = getJavaField(thisJavaObject, "objectValue");
+
+ try{
+ JavaObject objectObj = (JavaObject) objectField.get(wrongClassObject);
+ fail("JavaField.get() should have thrown IllegalArgumentException as passed wrong object.");
+ }catch (IllegalArgumentException e) {
+ // expected
+ }
+
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getBoolean.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getBoolean.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getBoolean.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getBoolean.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ * Tests that JavaField.getBoolean works as expected.
+ *
+ */
+public class TestJavaField_getBoolean extends TCKJavaRuntimeTestcase {
+ boolean trueBoolean = true;
+ boolean falseBoolean = false;
+
+ static boolean trueStaticBoolean = true;
+ static boolean falseStaticBoolean = false;
+
+ public class IncompatibleClass {
+ boolean trueBoolean = true;
+ }
+ IncompatibleClass incompatibleObject = new IncompatibleClass();
+ String incompatibleClassName = IncompatibleClass.class.getName().replace('.', '/');
+
+ int notBoolean = 23;
+ Object notBoolean2 = new Object();
+
+ static JavaObject thisObject = null;
+ public JavaObject getThis() {
+ if (thisObject == null) {
+ thisObject = super.getThis();
+ }
+ return thisObject;
+ }
+
+ public void testIncompatibleClass() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField trueBooleanField = getJavaField(thisJavaObject, "trueBoolean");
+ JavaObject incompatibleClass = getJavaObjectByClassname(incompatibleClassName);
+
+ assertNotNull("Couldn't find "+incompatibleClassName,incompatibleClass);
+ try{
+ boolean trueBooleanValue = trueBooleanField.getBoolean(incompatibleClass);
+ fail("JavaField.getBoolean() didn't fail when passed Object of wrong class");
+ }catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+
+ public void testNullObjectInstanceField() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField trueBooleanField = getJavaField(thisJavaObject, "trueBoolean");
+
+ try{
+ boolean trueBooleanValue = trueBooleanField.getBoolean(null);
+ fail("JavaField.getBoolean(null) on instance field didn't throw null pointer exception.");
+ }catch(NullPointerException e) {
+ // expected.
+ }
+
+ }
+
+ public void testNonNullObjectInstanceStaticField() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField trueBooleanField = getJavaField(thisJavaObject, "trueStaticBoolean");
+
+ boolean trueBooleanValue = trueBooleanField.getBoolean(thisJavaObject);
+
+ assertEquals(trueStaticBoolean, trueBooleanValue);
+ }
+
+
+ public void testTrueBoolean() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField trueBooleanField = getJavaField(thisJavaObject, "trueBoolean");
+
+ boolean trueBooleanValue = trueBooleanField.getBoolean(thisJavaObject);
+
+ assertEquals(trueBoolean, trueBooleanValue);
+ }
+
+ public void testFalseBoolean() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField falseBooleanField = getJavaField(thisJavaObject, "falseBoolean");
+
+ boolean falseBooleanValue = falseBooleanField.getBoolean(thisJavaObject);
+
+ assertEquals(falseStaticBoolean, falseBooleanValue);
+ }
+
+ public void testTrueStaticBoolean() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField trueBooleanField = getJavaField(thisJavaObject, "trueStaticBoolean");
+
+ boolean trueBooleanValue = trueBooleanField.getBoolean(null);
+
+ assertEquals(trueStaticBoolean, trueBooleanValue);
+ }
+
+ public void testFalseStaticBoolean() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField falseBooleanField = getJavaField(thisJavaObject, "falseStaticBoolean");
+
+ boolean falseBooleanValue = falseBooleanField.getBoolean(null);
+
+ assertEquals(falseStaticBoolean, falseBooleanValue);
+ }
+
+ public void testNotBoolean() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField notBooleanField = getJavaField(thisJavaObject, "notBoolean");
+
+ try{
+ boolean notBooleanValue = notBooleanField.getBoolean(thisJavaObject);
+ fail("getBoolean did't throw IllegalArgumentException when passed int field");
+ } catch (IllegalArgumentException e) {
+ // ok.
+ }
+
+ }
+
+ public void testNotBoolean2() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField notBooleanField = getJavaField(thisJavaObject, "notBoolean2");
+
+ try{
+ boolean notBooleanValue = notBooleanField.getBoolean(thisJavaObject);
+ fail("getBoolean did't throw IllegalArgumentException when passed Object field");
+ } catch (IllegalArgumentException e) {
+ // ok.
+ }
+
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getByte.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getByte.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getByte.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getByte.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ * Test JavaField.getByte() against various fields and values.
+ *
+ */
+public class TestJavaField_getByte extends TCKJavaRuntimeTestcase {
+ byte maxByte = Byte.MAX_VALUE;
+ byte minByte = Byte.MIN_VALUE;
+ static byte staticMinByte = Byte.MIN_VALUE;
+ byte zeroByte = 0;
+ byte negByte = -64;
+ byte posByte = +64;
+ boolean booleanValue = false;
+ Object objectReference = new Object();
+
+ short shortValue =2;
+ char charValue = 3;
+ long longValue = 4l;
+ float floatValue = (float)5.0;
+ double doubleValue = (double)6;
+
+ int intValue = 2048;
+
+
+
+ static JavaObject thisObject = null;
+ public JavaObject getThis() {
+ if (thisObject == null) {
+ thisObject = super.getThis();
+ }
+ return thisObject;
+ }
+
+ public void testMaxByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField maxByteField = getJavaField(thisJavaObject, "maxByte");
+
+ byte maxByteValue = maxByteField.getByte(thisJavaObject);
+
+ assertEquals(maxByte, maxByteValue);
+ }
+
+ public void testMinByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField minByteField = getJavaField(thisJavaObject, "minByte");
+
+ byte minByteValue = minByteField.getByte(thisJavaObject);
+
+ assertEquals(minByte, minByteValue);
+ }
+
+
+ public void testStaticMinByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField minByteField = getJavaField(thisJavaObject, "staticMinByte");
+
+ byte minByteValue = minByteField.getByte(null);
+
+ assertEquals(staticMinByte, minByteValue);
+ }
+
+ public void testZeroByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField zeroByteField = getJavaField(thisJavaObject, "zeroByte");
+
+ byte zeroByteValue = zeroByteField.getByte(thisJavaObject);
+
+ assertEquals(zeroByte, zeroByteValue);
+ }
+
+ public void testNegByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField negByteField = getJavaField(thisJavaObject, "negByte");
+
+ byte negByteValue = negByteField.getByte(thisJavaObject);
+
+ assertEquals(negByte, negByteValue);
+ }
+
+ public void testPosByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField posByteField = getJavaField(thisJavaObject, "posByte");
+
+ byte posByteValue = posByteField.getByte(thisJavaObject);
+
+ assertEquals(posByte, posByteValue);
+ }
+
+ public void testDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleValueField = getJavaField(thisJavaObject, "doubleValue");
+
+ try{
+ byte aDoubleValue = doubleValueField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(doubleValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testFloatValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");
+
+ try{
+ byte aFloatValue = floatValueField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(floatValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testLongValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField longValueField = getJavaField(thisJavaObject, "longValue");
+
+ try{
+ byte aLongValue = longValueField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(longValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testIntValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intValueField = getJavaField(thisJavaObject, "intValue");
+
+ try{
+ byte aIntValue = intValueField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(intValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charValueField = getJavaField(thisJavaObject, "charValue");
+
+ try{
+ byte aCharValue = charValueField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(charValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testShortValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortValueField = getJavaField(thisJavaObject, "shortValue");
+
+ try{
+ byte aShortValue = shortValueField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(shortValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testBooleanValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
+
+ try{
+ byte aBooleanValue = booleanValueField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(booleanValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testObjectReference() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+
+ try{
+ byte anObjectReference = objectReferenceField.getByte(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getByte(objectReference)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getChar.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getChar.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getChar.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getChar.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ * Test JavaField.getChar() against various fields and values.
+ *
+ */
+public class TestJavaField_getChar extends TCKJavaRuntimeTestcase {
+ char maxChar = Character.MAX_VALUE;
+ char minChar = Character.MIN_VALUE;
+ static char staticMinChar = Character.MIN_VALUE;
+ char zeroChar = 0;
+ char posChar = 0xa5a5;
+ boolean booleanValue = false;
+ Object objectReference = new Object();
+ int intValue = 0x37fadef;
+ byte byteValue = 1;
+ short shortValue =2;
+ char charValue = 3;
+ long longValue = 4l;
+ float floatValue = (float)5.0;
+ double doubleValue = (double)6;
+
+ static JavaObject thisObject = null;
+ public JavaObject getThis() {
+ if (thisObject == null) {
+ thisObject = super.getThis();
+ }
+ return thisObject;
+ }
+
+ public void testMaxCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField maxCharField = getJavaField(thisJavaObject, "maxChar");
+
+ char maxCharValue = maxCharField.getChar(thisJavaObject);
+
+ assertEquals(maxChar, maxCharValue);
+ }
+
+ public void testMinCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField minCharField = getJavaField(thisJavaObject, "minChar");
+
+ char minCharValue = minCharField.getChar(thisJavaObject);
+
+ assertEquals(minChar, minCharValue);
+ }
+
+ public void testStaticMinCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField minCharField = getJavaField(thisJavaObject, "staticMinChar");
+
+ char minCharValue = minCharField.getChar(null);
+
+ assertEquals(staticMinChar, minCharValue);
+ }
+
+ public void testZeroCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField zeroCharField = getJavaField(thisJavaObject, "zeroChar");
+
+ char zeroCharValue = zeroCharField.getChar(thisJavaObject);
+
+ assertEquals(zeroChar, zeroCharValue);
+ }
+
+ public void testPosCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField posCharField = getJavaField(thisJavaObject, "posChar");
+
+ char posCharValue = posCharField.getChar(thisJavaObject);
+
+ assertEquals(posChar, posCharValue);
+ }
+
+
+ public void testDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleValueField = getJavaField(thisJavaObject, "doubleValue");
+
+ try{
+ char aDoubleValue = doubleValueField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(doubleValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testFloatValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");
+
+ try{
+ char aFloatValue = floatValueField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(floatValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testLongValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField longValueField = getJavaField(thisJavaObject, "longValue");
+
+ try{
+ char aLongValue = longValueField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(longValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testIntValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intValueField = getJavaField(thisJavaObject, "intValue");
+
+ try{
+ char aIntValue = intValueField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(intValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteValueField = getJavaField(thisJavaObject, "byteValue");
+
+ try{
+ char aByteValue = byteValueField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(byteValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testShortValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField shortValueField = getJavaField(thisJavaObject, "shortValue");
+
+ try{
+ char aShortValue = shortValueField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(shortValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+ public void testBooleanValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
+
+ try{
+ char aBooleanValue = booleanValueField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(booleanValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testObjectReference() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+
+ try{
+ char anObjectReference = objectReferenceField.getChar(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getChar(objectReference)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import com.ibm.dtfj.java.JavaClass;
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ * Tests that getDeclaringClass is working.
+ *
+ */
+public class TestJavaField_getDeclaringClass extends TCKJavaRuntimeTestcase {
+ public String instanceField = new String("bob");
+ public static String staticField = new String("hope");
+
+ public void testInstanceField() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaClass thisJavaClass = thisJavaObject.getJavaClass();
+
+ JavaField instanceFieldField = getJavaField(thisJavaClass, "instanceField");
+
+ assertEquals(thisJavaClass, instanceFieldField.getDeclaringClass());
+ }
+
+ public void testStaticField() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaClass thisJavaClass = thisJavaObject.getJavaClass();
+
+ JavaField staticFieldField = getJavaField(thisJavaClass, "staticField");
+
+ assertEquals(thisJavaClass, staticFieldField.getDeclaringClass());
+ }
+}
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDouble.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDouble.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDouble.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getDouble.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * 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.tests.javaruntime;
+
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ * Test JavaField.getDouble() against various fields and values.
+ *
+ */
+public class TestJavaField_getDouble extends TCKJavaRuntimeTestcase {
+ double maxDouble = Double.MAX_VALUE;
+ double minDouble = Double.MIN_VALUE;
+ static double staticMinDouble = Double.MIN_VALUE;
+ double zeroDouble = 0;
+ double negDouble = -0x55a55a5a5a5aa75al;
+ double posDouble = +0x2a5a75a55a5a75a5l;
+ boolean booleanValue = false;
+ Object objectReference = new Object();
+ int intValue = 0xfafafafa;
+ byte byteValue = 1;
+ short shortValue =2;
+ char charValue = 3;
+ float floatValue = (float)5.0;
+ double doubleValue = (double)6;
+ long longValue = 0x37faf57a57fad7fal;
+
+
+ static JavaObject thisObject = null;
+ public JavaObject getThis() {
+ if (thisObject == null) {
+ thisObject = super.getThis();
+ }
+ return thisObject;
+ }
+
+ public void testMaxDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField maxDoubleField = getJavaField(thisJavaObject, "maxDouble");
+
+ double maxDoubleValue = maxDoubleField.getDouble(thisJavaObject);
+
+ assertEquals(maxDouble, maxDoubleValue, 0.0);
+ }
+
+ public void testMinDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField minDoubleField = getJavaField(thisJavaObject, "minDouble");
+
+ double minDoubleValue = minDoubleField.getDouble(thisJavaObject);
+
+ assertEquals(minDouble, minDoubleValue, 0.0);
+ }
+
+ public void testStaticMinDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField minDoubleField = getJavaField(thisJavaObject, "staticMinDouble");
+
+ double minDoubleValue = minDoubleField.getDouble(null);
+
+ assertEquals(staticMinDouble, minDoubleValue, 0.0);
+ }
+
+ public void testZeroDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField zeroDoubleField = getJavaField(thisJavaObject, "zeroDouble");
+
+ double zeroDoubleValue = zeroDoubleField.getDouble(thisJavaObject);
+
+ assertEquals(zeroDouble, zeroDoubleValue, 0.0);
+ }
+
+ public void testNegDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField negDoubleField = getJavaField(thisJavaObject, "negDouble");
+
+ double negDoubleValue = negDoubleField.getDouble(thisJavaObject);
+
+ assertEquals(negDouble, negDoubleValue, 0.0);
+ }
+
+ public void testPosDoubleValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField posDoubleField = getJavaField(thisJavaObject, "posDouble");
+
+ double posDoubleValue = posDoubleField.getDouble(thisJavaObject);
+
+ assertEquals(posDouble, posDoubleValue, 0.0);
+ }
+
+ public void testFloatValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");
+
+ try{
+ double aFloatValue = floatValueField.getDouble(thisJavaObject);
+ } catch (IllegalArgumentException e) {
+ fail("Unexpected illegal argument exception from JavaField.getDouble(floatValue)");
+ }
+ }
+
+ public void testLongValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField longValueField = getJavaField(thisJavaObject, "longValue");
+
+ try{
+ double aLongValue = longValueField.getDouble(thisJavaObject);
+ } catch (IllegalArgumentException e) {
+ fail("Unexpected illegal argument exception from JavaField.getDouble(longValue)");
+ }
+ }
+
+ public void testIntValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField intValueField = getJavaField(thisJavaObject, "intValue");
+
+ try{
+ double aIntValue = intValueField.getDouble(thisJavaObject);
+ } catch (IllegalArgumentException e) {
+ fail("Unexpected illegal argument exception from JavaField.getDouble(intValue)");
+ }
+ }
+
+ public void testByteValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField byteValueField = getJavaField(thisJavaObject, "byteValue");
+
+ try{
+ double aByteValue = byteValueField.getDouble(thisJavaObject);
+ } catch (IllegalArgumentException e) {
+ fail("Unexpected illegal argument exception from JavaField.getDouble(byteValue)");
+ }
+ }
+
+ public void testCharValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField charValueField = getJavaField(thisJavaObject, "charValue");
+
+ try{
+ double aCharValue = charValueField.getDouble(thisJavaObject);
+ } catch (IllegalArgumentException e) {
+ fail("Unexpected illegal argument exception from JavaField.getDouble(charValue)");
+ }
+ }
+
+ public void testShortValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField doubleValueField = getJavaField(thisJavaObject, "shortValue");
+
+ try{
+ double aShortValue = doubleValueField.getDouble(thisJavaObject);
+ } catch (IllegalArgumentException e) {
+ fail("Unexpected illegal argument exception from JavaField.getDouble(shortValue)");
+ }
+ }
+
+
+ public void testBooleanValue() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
+
+ try{
+ double aBooleanValue = booleanValueField.getDouble(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getDouble(booleanValue)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testObjectReference() throws Exception {
+ JavaObject thisJavaObject = getThis();
+ JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+
+ try{
+ double anObjectReference = objectReferenceField.getDouble(thisJavaObject);
+ fail("Missing illegal argument exception from JavaField.getDouble(objectReference)");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+}