incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r883669 [1/6] - in /incubator/kato/trunk/org.apache.kato/kato.tck: ./ src/test/ant/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/kato/ src/test/java/org/apache/kato/tck/ src/test/java/org/apache/kato/tck/tests/ src/...
Date Tue, 24 Nov 2009 12:27:11 GMT
Author: spoole
Date: Tue Nov 24 12:27:01 2009
New Revision: 883669

URL: http://svn.apache.org/viewvc?rev=883669&view=rev
Log:
The ant driven version of the test execution was unstable. This is a change to move that process into maven. The tck testcases have been moved from the tck.testsuite module (which will be removed)  

Added:
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestFactoryRegistry.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClass_getName.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_equals.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_get.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getBoolean.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getByte.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getChar.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDouble.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getFloat.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getInt.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getLong.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getModifiers.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getName.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getShort.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getSignature.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getString.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaHeap_getName.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaMethod_getName.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaMonitor_ObjectMonitors.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaObject_arraycopy.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaObject_getDeclaredFields_getName.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaObject_getReferences.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaReferences.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaRuntime.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaRuntimeThreads.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaRuntime_getCompiledMethods.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaRuntime_getHeapRoots.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaStackFrame_getHeapRoots.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaThreadInspection.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaThread_getName.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaThread_getStackFrames.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/TestEnvironmentVariables.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/TestImage.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageAddressSpace.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetCreationTime.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetHostName.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetIPAddresses.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetInstalledMemory.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetProcessorCount.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetProcessorSubType.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetProcessorType.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetSystemSubType.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/process/image/TestImageGetSystemType.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/AbstractImageTestcase.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/AllTests.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageFactoryTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageLoaderHelper.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageModuleTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImagePointerTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageProcessTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageRegisterTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageSectionTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageStackFrameTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageSymbolTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/ImageThreadTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaClassLoaderTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaClassTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaFieldTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaHeapTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaLocationTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaMethodTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaMonitorTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaObjectTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaRuntimeTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaStackFrameTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/JavaThreadTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/TestManifestProperties.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/TestNotImplementedException.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/junit/TestPackageInformation.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/scenarios/
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/scenarios/ArrayletTest.java
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tests/scenarios/ArrayletTestInstance.java
Removed:
    incubator/kato/trunk/org.apache.kato/kato.tck/src/test/ant/
Modified:
    incubator/kato/trunk/org.apache.kato/kato.tck/pom.xml

Modified: incubator/kato/trunk/org.apache.kato/kato.tck/pom.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/pom.xml?rev=883669&r1=883668&r2=883669&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/pom.xml (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/pom.xml Tue Nov 24 12:27:01 2009
@@ -127,9 +127,9 @@
 						<scope>test</scope>
 					</dependency>
 					<dependency>
-						<groupId>ant</groupId>
-						<artifactId>ant-junit</artifactId>
-						<version>1.6.5</version>
+						<groupId>org.apache.kato</groupId>
+						<artifactId>kato.tck.testsuite</artifactId>
+						<version>M1-incubating</version>
 						<scope>test</scope>
 					</dependency>
 					
@@ -152,17 +152,28 @@
 				<version>1.3</version>
 				<executions>
 					<execution>
-						<id>compile</id>
-						<phase>test</phase>
+						<id>setup</id>
+						<phase>generate-test-resources</phase>
 						<configuration>
 							<tasks>
-								<ant antfile="tck.xml" dir="src/test/ant">
-									<property name="path" refid="maven.test.classpath" />
-									<property name="cjvmti.agent.path" value="${settings.localRepository}/org/apache/kato/native/${cjvmti.artifact}/${cjvmti.version}/${cjvmti.artifact}-${cjvmti.version}.${cjvmti.type}"/>
-									<property name="vmapi.agent.path" value="${settings.localRepository}/org/apache/kato/native/${vmapi.artifact}/${vmapi.version}/${vmapi.artifact}-${vmapi.version}.${vmapi.type}"/>
-									<property name="target" value="${project.build.directory}"/>
+							<taskdef resource="org/apache/kato/anttasks/anttasks.properties">
+								<classpath path="${path}" />
+							</taskdef>
+							
+							<property name="path" refid="maven.test.classpath" />
+							<property name="cjvmti.agent.path" value="${settings.localRepository}/org/apache/kato/native/${cjvmti.artifact}/${cjvmti.version}/${cjvmti.artifact}-${cjvmti.version}.${cjvmti.type}"/>
+							<property name="vmapi.agent.path" value="${settings.localRepository}/org/apache/kato/native/${vmapi.artifact}/${vmapi.version}/${vmapi.artifact}-${vmapi.version}.${vmapi.type}"/>
+							<property name="target" value="${project.build.directory}"/>
 									
-								</ant>
+							<!-- create the scenario and cause a cjvmti dump -->
+		
+							<tcksetup dir="${target}">
+								<classpath path="${path}" />
+								<scenario name="142"/>
+								<jvmarg value="-agentpath:${cjvmti.agent.path}"/>
+								<jvmarg value="-Dorg.apache.kato.dumptrigger.librarypath=${vmapi.agent.path}"/>
+							</tcksetup>
+							
 							</tasks>
 						</configuration>
 						<goals>
@@ -177,27 +188,28 @@
 						<version>1.6.5</version>
 					</dependency>
 					<dependency>
-						<groupId>ant</groupId>
-						<artifactId>ant-junit</artifactId>
-						<version>1.6.5</version>
-					</dependency>
-					<dependency>
-						<groupId>junit</groupId>
-						<artifactId>junit</artifactId>
-						<version>3.8.1</version>
-					</dependency>
-					<dependency>
-						<groupId>org.apache.kato</groupId>
-						<artifactId>kato.tck.testsuite</artifactId>
-						<version>M1-incubating</version>
-					</dependency>
-					<dependency>
 						<groupId>org.apache.kato</groupId>
 						<artifactId>kato.cjvmti</artifactId>
 						<version>M1-incubating</version>
 					</dependency>
 				</dependencies>
 			</plugin>
+			
+			<plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+         <testFailureIgnore>true</testFailureIgnore>
+          <systemProperties>
+            <property>
+              <name>org.apache.kato.dumppath</name>
+              <value>${project.build.directory}/cjvmtiV0.cdmp</value>
+            </property>
+          </systemProperties>
+          
+        </configuration>
+      </plugin>
+			
 		</plugins>
 	</build>
 </project>
\ No newline at end of file

Added: incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestFactoryRegistry.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestFactoryRegistry.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestFactoryRegistry.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestFactoryRegistry.java Tue Nov 24 12:27:01 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.FactoryRegistry;
+import javax.tools.diagnostics.image.ImageFactory;
+
+import org.apache.kato.tck.harness.AbstractTCKTestcase;
+
+/**
+ * 
+ */
+public class TestFactoryRegistry extends AbstractTCKTestcase {
+
+	
+	public void testGetDefaultRegistry() {
+		
+		
+		FactoryRegistry defaultRegistry=FactoryRegistry.getDefaultRegistry();
+		
+		assertNotNull(defaultRegistry);
+		
+	}
+	
+	public void testHasAtLeastOneFactory() {
+		
+		FactoryRegistry defaultRegistry=FactoryRegistry.getDefaultRegistry();
+		ImageFactory[] factories=defaultRegistry.getFactories();
+		assertNotNull(factories);
+		assertTrue("no factories registered",factories.length>0);
+		
+		
+	}
+	
+	
+}

Added: incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClassLoader_getJavaObject.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import java.util.Iterator;
+
+import javax.tools.diagnostics.image.CorruptData;
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaClassLoader;
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+
+
+/**
+ * 
+ * 
+ */
+public class TestJavaClassLoader_getJavaObject extends TCKJavaRuntimeTestcase {
+
+
+
+
+	public void testJavaClassLoader_getJavaObject()
+	{
+		boolean foundClassLoader = false;
+
+		JavaRuntime runtime=getJavaRuntime();
+		Iterator classloaders = runtime.getJavaClassLoaders().iterator();
+
+		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().iterator();
+
+				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/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClass_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClass_getName.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClass_getName.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaClass_getName.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import java.util.Iterator;
+
+import javax.tools.diagnostics.image.CorruptData;
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaHeap;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaClass_getName;
+
+
+public class TestJavaClass_getName extends TCKJavaRuntimeTestcase {
+
+	
+	
+	/**
+	 * 
+	 */
+	public void testJavaClass_getName()
+	{
+		boolean foundClassName = false;
+
+		JavaRuntime runtime=getJavaRuntime();
+
+		Iterator heaps = runtime.getHeaps().iterator();
+
+		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().iterator();
+
+			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 (SetupJavaClass_getName.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(SetupJavaClass_getName.unicodeClassname);
+		
+		assertNotNull("Couldn't find object of instance " + SetupJavaClass_getName.unicodeClassname, obj);
+	}
+}

Added: incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_equals.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_equals.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_equals.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_equals.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaField_equals;
+
+
+public class TestJavaField_equals extends TCKJavaRuntimeTestcase {
+
+	
+	
+	static SetupJavaField_equals.DifferentClass differentObject = new SetupJavaField_equals.DifferentClass();
+	
+	String differentClassName = SetupJavaField_equals.DifferentClass.class.getName().replace('.', '/');
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getScenerioReference() {
+		if (thisObject == null) {
+			thisObject = super.getScenerioReference();
+		}	
+		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(getScenerioReference(), "fieldA");
+		String theString=fieldAField.toString();
+		assertNotNull(theString);
+		assertTrue(theString.length() >= 0 );
+	}
+
+	public void testHashCode() throws Exception {
+		JavaField fieldAField = getJavaField(getScenerioReference(), "fieldA");
+		JavaField fieldAField2 = getJavaField(getScenerioReference(), "fieldA");
+		
+		assertTrue(fieldAField.hashCode()==fieldAField2.hashCode());
+	}
+	
+	
+	public void testNullFalse() throws Exception {
+		JavaField fieldAField = getJavaField(getScenerioReference(), "fieldA");
+		
+		assertFalse(fieldAField.equals(null));
+	}
+	
+	public void testNullFalseStatic() throws Exception {
+		JavaField staticField = getJavaField(getScenerioReference(), "staticField");
+		
+		assertFalse(staticField.equals(null));
+	}
+	
+	public void testDifferentFalse() throws Exception {
+		JavaField fieldAField = getJavaField(getScenerioReference(), "fieldA");
+		JavaField fieldBField = getJavaField(getScenerioReference(), "fieldB");
+		
+		assertFalse(fieldAField.equals(fieldBField));
+		assertFalse(fieldBField.equals(fieldAField));		
+	}
+	
+	public void testDifferentFalseStatic() throws Exception {
+		JavaField staticField = getJavaField(getScenerioReference(), "staticField");
+		JavaField fieldBField = getJavaField(getScenerioReference(), "fieldB");
+		
+		assertFalse(staticField.equals(fieldBField));
+		assertFalse(fieldBField.equals(staticField));		
+	}
+	
+	public void testEqualsSelf() throws Exception {
+		JavaField fieldAField = getJavaField(getScenerioReference(), "fieldA");
+		assertTrue(fieldAField.equals(fieldAField));
+	}
+	
+	public void testNotEqualsDiffClass() throws Exception {
+		JavaField differentFieldAField = getJavaField(differentClassObject, "fieldA");
+		JavaField fieldAField = getJavaField(getScenerioReference(), "fieldA");
+		
+		assertFalse(fieldAField.equals(differentFieldAField));
+		assertFalse(differentFieldAField.equals(fieldAField));
+	}
+	
+	public void testNotEqualsDiffClassStatic() throws Exception {
+		JavaField differentStaticField = getJavaField(differentClassObject, "staticField");
+		JavaField staticField = getJavaField(getScenerioReference(), "staticField");
+		
+		assertFalse(staticField.equals(differentStaticField));
+		assertFalse(differentStaticField.equals(staticField));
+	}
+
+}

Added: incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_get.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_get.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_get.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_get.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,461 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaField_get;
+
+
+public class TestJavaField_get extends TCKJavaRuntimeTestcase {
+		
+	
+	static JavaObject thisObject = null;	
+	static SetupJavaField_get setup=new SetupJavaField_get();
+	
+	public JavaObject getScenerioReference() {
+		if (thisObject == null) {
+			thisObject = super.getScenerioReference();
+		}	
+		return thisObject;		
+	}
+
+	static String wrongClassName = SetupJavaField_get.WrongClass.class.getName().replace('.', '/');
+	
+	static JavaObject wrongClassObject = null;
+	public void setUp() {
+		if (wrongClassObject == null) {
+			wrongClassObject = getJavaObjectByClassname(wrongClassName);
+		}
+	}
+	
+	public void testByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField byteField = getJavaField(thisJavaObject, "byteValue");
+		
+		Byte byteObj = (Byte) byteField.get(thisJavaObject);
+		
+		assertEquals(byteObj.byteValue(), setup.byteValue);		
+	}
+	
+	public void testMaxByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField byteField = getJavaField(thisJavaObject, "maxByteValue");
+		
+		Byte byteObj = (Byte) byteField.get(thisJavaObject);
+		
+		assertEquals(byteObj.byteValue(), setup.maxByteValue);		
+	}
+	
+	public void testMinByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField byteField = getJavaField(thisJavaObject, "minByteValue");
+		
+		Byte byteObj = (Byte) byteField.get(thisJavaObject);
+		
+		assertEquals(byteObj.byteValue(), setup.minByteValue);		
+	}
+	
+	public void testShortValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField shortField = getJavaField(thisJavaObject, "shortValue");
+		
+		Short shortObj = (Short) shortField.get(thisJavaObject);
+		
+		assertEquals(shortObj.shortValue(), setup.shortValue);		
+	}
+	
+	public void testMaxShortValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField shortField = getJavaField(thisJavaObject, "maxShortValue");
+		
+		Short shortObj = (Short) shortField.get(thisJavaObject);
+		
+		assertEquals(shortObj.shortValue(), setup.maxShortValue);		
+	}
+	
+	public void testMinShortValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField shortField = getJavaField(thisJavaObject, "minShortValue");
+		
+		Short shortObj = (Short) shortField.get(thisJavaObject);
+		
+		assertEquals(shortObj.shortValue(), setup.minShortValue);		
+	}
+	
+	public void testCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField charField = getJavaField(thisJavaObject, "charValue");
+		
+		Character charObj = (Character) charField.get(thisJavaObject);
+		
+		assertEquals(charObj.charValue(), setup.charValue);		
+	}
+	
+	public void testMaxCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField charField = getJavaField(thisJavaObject, "maxCharValue");
+		
+		Character charObj = (Character) charField.get(thisJavaObject);
+		
+		assertEquals(charObj.charValue(), setup.maxCharValue);		
+	}
+	
+	public void testMinCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField charField = getJavaField(thisJavaObject, "minCharValue");
+		
+		Character charObj = (Character) charField.get(thisJavaObject);
+		
+		assertEquals(charObj.charValue(), setup.minCharValue);		
+	}
+	
+	public void testIntValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField intField = getJavaField(thisJavaObject, "intValue");
+		
+		Integer intObj = (Integer) intField.get(thisJavaObject);
+		
+		assertEquals(intObj.intValue(), setup.intValue);		
+	}
+	
+	public void testMaxIntValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField intField = getJavaField(thisJavaObject, "maxIntValue");
+		
+		Integer intObj = (Integer) intField.get(thisJavaObject);
+		
+		assertEquals(intObj.intValue(), setup.maxIntValue);		
+	}
+	
+	public void testMinIntValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField intField = getJavaField(thisJavaObject, "minIntValue");
+		
+		Integer intObj = (Integer) intField.get(thisJavaObject);
+		
+		assertEquals(intObj.intValue(), setup.minIntValue);		
+	}
+	
+	public void testFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField floatField = getJavaField(thisJavaObject, "floatValue");
+		
+		Float floatObj = (Float) floatField.get(thisJavaObject);
+		
+		assertEquals(floatObj.floatValue(), setup.floatValue, 0.0);		
+	}
+	
+	public void testMaxFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField floatField = getJavaField(thisJavaObject, "maxFloatValue");
+		
+		Float floatObj = (Float) floatField.get(thisJavaObject);
+		
+		assertEquals(floatObj.floatValue(), setup.maxFloatValue, 0.0);		
+	}
+	
+	public void testMinFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField floatField = getJavaField(thisJavaObject, "minFloatValue");
+		
+		Float floatObj = (Float) floatField.get(thisJavaObject);
+		
+		assertEquals(floatObj.floatValue(), setup.minFloatValue, 0.0);		
+	}
+	
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField doubleField = getJavaField(thisJavaObject, "doubleValue");
+		
+		Double doubleObj = (Double) doubleField.get(thisJavaObject);
+		
+		assertEquals(doubleObj.doubleValue(), setup.doubleValue, 0.0);		
+	}
+	
+	public void testMaxDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField doubleField = getJavaField(thisJavaObject, "maxDoubleValue");
+		
+		Double doubleObj = (Double) doubleField.get(thisJavaObject);
+		
+		assertEquals(doubleObj.doubleValue(), setup.maxDoubleValue, 0.0);		
+	}
+	
+	public void testMinDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField doubleField = getJavaField(thisJavaObject, "minDoubleValue");
+		
+		Double doubleObj = (Double) doubleField.get(thisJavaObject);
+		
+		assertEquals(doubleObj.doubleValue(), setup.minDoubleValue, 0.0);		
+	}
+	
+	public void testStringValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		JavaField objectField = getJavaField(thisJavaObject, "nullValue");
+		
+		JavaObject objectObject = (JavaObject) objectField.get(thisJavaObject);
+		
+		assertNull(objectObject);		
+	}
+	
+	public void testNullObjectInstance() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		JavaField byteField = getJavaField(thisJavaObject, "byteStaticValue");
+		
+		Byte byteObj = (Byte) byteField.get(null);
+		
+		assertEquals(byteObj.byteValue(), SetupJavaField_get.byteStaticValue);		
+	}
+
+	public void testMaxByteStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField byteField = getJavaField(thisJavaObject, "maxByteStaticValue");
+		
+		Byte byteObj = (Byte) byteField.get(null);
+		
+		assertEquals(byteObj.byteValue(), SetupJavaField_get.maxByteStaticValue);		
+	}
+
+	public void testMinByteStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField byteField = getJavaField(thisJavaObject, "minByteStaticValue");
+		
+		Byte byteObj = (Byte) byteField.get(null);
+		
+		assertEquals(byteObj.byteValue(), SetupJavaField_get.minByteStaticValue);		
+	}
+
+	
+	public void testShortStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField shortField = getJavaField(thisJavaObject, "shortStaticValue");
+		
+		Short shortObj = (Short) shortField.get(null);
+		
+		assertEquals(shortObj.shortValue(), SetupJavaField_get.shortStaticValue);		
+	}
+	
+	public void testMaxShortStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField shortField = getJavaField(thisJavaObject, "maxShortStaticValue");
+		
+		Short shortObj = (Short) shortField.get(null);
+		
+		assertEquals(shortObj.shortValue(), SetupJavaField_get.maxShortStaticValue);		
+	}
+	
+	public void testMinShortStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField shortField = getJavaField(thisJavaObject, "minShortStaticValue");
+		
+		Short shortObj = (Short) shortField.get(null);
+		
+		assertEquals(shortObj.shortValue(), SetupJavaField_get.minShortStaticValue);		
+	}
+
+	
+	public void testCharStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField charField = getJavaField(thisJavaObject, "charStaticValue");
+		
+		Character charObj = (Character) charField.get(null);
+		
+		assertEquals(charObj.charValue(), SetupJavaField_get.charStaticValue);		
+	}
+	
+	public void testMaxCharStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField charField = getJavaField(thisJavaObject, "maxCharStaticValue");
+		
+		Character charObj = (Character) charField.get(null);
+		
+		assertEquals(charObj.charValue(), SetupJavaField_get.maxCharStaticValue);		
+	}
+	
+	public void testMinCharStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField charField = getJavaField(thisJavaObject, "minCharStaticValue");
+		
+		Character charObj = (Character) charField.get(null);
+		
+		assertEquals(charObj.charValue(), SetupJavaField_get.minCharStaticValue);		
+	}
+	
+	public void testIntStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField intField = getJavaField(thisJavaObject, "intStaticValue");
+		
+		Integer intObj = (Integer) intField.get(null);
+		
+		assertEquals(intObj.intValue(), SetupJavaField_get.intStaticValue);		
+	}
+	
+	public void testMaxIntStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField intField = getJavaField(thisJavaObject, "maxIntStaticValue");
+		
+		Integer intObj = (Integer) intField.get(null);
+		
+		assertEquals(intObj.intValue(), SetupJavaField_get.maxIntStaticValue);		
+	}
+	
+	public void testMinIntStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField intField = getJavaField(thisJavaObject, "minIntStaticValue");
+		
+		Integer intObj = (Integer) intField.get(null);
+		
+		assertEquals(intObj.intValue(), SetupJavaField_get.minIntStaticValue);		
+	}
+	
+	public void testFloatStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField floatField = getJavaField(thisJavaObject, "floatStaticValue");
+		
+		Float floatObj = (Float) floatField.get(null);
+		
+		assertEquals(floatObj.floatValue(), SetupJavaField_get.floatStaticValue, 0.0);		
+	}
+	
+	public void testMaxFloatStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField floatField = getJavaField(thisJavaObject, "maxFloatStaticValue");
+		
+		Float floatObj = (Float) floatField.get(null);
+		
+		assertEquals(floatObj.floatValue(), SetupJavaField_get.maxFloatStaticValue, 0.0);		
+	}
+	
+	public void testMinFloatStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField floatField = getJavaField(thisJavaObject, "minFloatStaticValue");
+		
+		Float floatObj = (Float) floatField.get(null);
+		
+		assertEquals(floatObj.floatValue(), SetupJavaField_get.minFloatStaticValue, 0.0);		
+	}
+	
+	public void testDoubleStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField doubleField = getJavaField(thisJavaObject, "doubleStaticValue");
+		
+		Double doubleObj = (Double) doubleField.get(null);
+		
+		assertEquals(doubleObj.doubleValue(), SetupJavaField_get.doubleStaticValue, 0.0);		
+	}
+	
+	public void testMaxDoubleStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField doubleField = getJavaField(thisJavaObject, "maxDoubleStaticValue");
+		
+		Double doubleObj = (Double) doubleField.get(null);
+		
+		assertEquals(doubleObj.doubleValue(), SetupJavaField_get.maxDoubleStaticValue, 0.0);		
+	}
+	public void testMinDoubleStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField doubleField = getJavaField(thisJavaObject, "minDoubleStaticValue");
+		
+		Double doubleObj = (Double) doubleField.get(null);
+		
+		assertEquals(doubleObj.doubleValue(), SetupJavaField_get.minDoubleStaticValue, 0.0);		
+	}
+	public void testStringStaticValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		JavaField objectField = getJavaField(thisJavaObject, "nullStaticValue");
+		
+		JavaObject objectObject = (JavaObject) objectField.get(null);
+		
+		assertNull(objectObject);		
+	}
+
+	public void testWrongByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		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/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getBoolean.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getBoolean.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getBoolean.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getBoolean.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaField_getBoolean;
+
+
+/**
+ * Tests that JavaField.getBoolean works as expected.
+ *
+ */
+public class TestJavaField_getBoolean extends TCKJavaRuntimeTestcase {
+	
+	SetupJavaField_getBoolean setup=new SetupJavaField_getBoolean();
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getScenerioReference() {
+		if (thisObject == null) {
+			thisObject = super.getScenerioReference();
+		}	
+		return thisObject;		
+	}
+	
+	public void testIncompatibleClass() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField trueBooleanField = getJavaField(thisJavaObject, "trueBoolean");
+		JavaObject incompatibleClass = getJavaObjectByClassname(setup.incompatibleClassName);
+		
+		assertNotNull("Couldn't find "+setup.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 = getScenerioReference();
+		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 = getScenerioReference();
+		JavaField trueBooleanField = getJavaField(thisJavaObject, "trueStaticBoolean");
+		
+		boolean trueBooleanValue = trueBooleanField.getBoolean(thisJavaObject);
+		
+		assertEquals(SetupJavaField_getBoolean.trueStaticBoolean, trueBooleanValue);		
+	}
+	
+	
+	public void testTrueBoolean() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField trueBooleanField = getJavaField(thisJavaObject, "trueBoolean");
+		
+		boolean trueBooleanValue = trueBooleanField.getBoolean(thisJavaObject);
+		
+		assertEquals(setup.trueBoolean, trueBooleanValue);		
+	}
+	
+	public void testFalseBoolean() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField falseBooleanField = getJavaField(thisJavaObject, "falseBoolean");
+		
+		boolean falseBooleanValue = falseBooleanField.getBoolean(thisJavaObject);
+		
+		assertEquals(SetupJavaField_getBoolean.falseStaticBoolean, falseBooleanValue);		
+	}
+	
+	public void testTrueStaticBoolean() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField trueBooleanField = getJavaField(thisJavaObject, "trueStaticBoolean");
+		
+		boolean trueBooleanValue = trueBooleanField.getBoolean(null);
+		
+		assertEquals(SetupJavaField_getBoolean.trueStaticBoolean, trueBooleanValue);		
+	}
+	
+	public void testFalseStaticBoolean() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField falseBooleanField = getJavaField(thisJavaObject, "falseStaticBoolean");
+		
+		boolean falseBooleanValue = falseBooleanField.getBoolean(null);
+		
+		assertEquals(SetupJavaField_getBoolean.falseStaticBoolean, falseBooleanValue);		
+	}
+	
+	public void testNotBoolean() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		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/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getByte.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getByte.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getByte.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getByte.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaField_getByte;
+
+
+/**
+ * Test JavaField.getByte() against various fields and values.
+ *
+ */
+public class TestJavaField_getByte extends TCKJavaRuntimeTestcase {
+	
+	SetupJavaField_getByte setup=new SetupJavaField_getByte();
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getScenerioReference() {
+		if (thisObject == null) {
+			thisObject = super.getScenerioReference();
+		}	
+		return thisObject;		
+	}
+	
+	public void testMaxByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField maxByteField = getJavaField(thisJavaObject, "maxByte");
+		
+		byte maxByteValue = maxByteField.getByte(thisJavaObject);
+		
+		assertEquals(setup.maxByte, maxByteValue);		
+	}
+	
+	public void testMinByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minByteField = getJavaField(thisJavaObject, "minByte");
+		
+		byte minByteValue = minByteField.getByte(thisJavaObject);
+		
+		assertEquals(setup.minByte, minByteValue);		
+	}
+
+	
+	public void testStaticMinByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minByteField = getJavaField(thisJavaObject, "staticMinByte");
+		
+		byte minByteValue = minByteField.getByte(null);
+		
+		assertEquals(SetupJavaField_getByte.staticMinByte, minByteValue);		
+	}
+	
+	public void testZeroByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField zeroByteField = getJavaField(thisJavaObject, "zeroByte");
+		
+		byte zeroByteValue = zeroByteField.getByte(thisJavaObject);
+		
+		assertEquals(setup.zeroByte, zeroByteValue);		
+	}
+	
+	public void testNegByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField negByteField = getJavaField(thisJavaObject, "negByte");
+		
+		byte negByteValue = negByteField.getByte(thisJavaObject);
+		
+		assertEquals(setup.negByte, negByteValue);		
+	}	
+	
+	public void testPosByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField posByteField = getJavaField(thisJavaObject, "posByte");
+		
+		byte posByteValue = posByteField.getByte(thisJavaObject);
+		
+		assertEquals(setup.posByte, posByteValue);		
+	}
+	
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getChar.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getChar.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getChar.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getChar.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaField_getChar;
+
+
+/**
+ * Test JavaField.getChar() against various fields and values.
+ * 
+ */
+public class TestJavaField_getChar extends TCKJavaRuntimeTestcase {
+	
+	SetupJavaField_getChar setup=new SetupJavaField_getChar();
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getScenerioReference() {
+		if (thisObject == null) {
+			thisObject = super.getScenerioReference();
+		}	
+		return thisObject;		
+	}
+	
+	public void testMaxCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField maxCharField = getJavaField(thisJavaObject, "maxChar");
+		
+		char maxCharValue = maxCharField.getChar(thisJavaObject);
+		
+		assertEquals(setup.maxChar, maxCharValue);		
+	}
+	
+	public void testMinCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minCharField = getJavaField(thisJavaObject, "minChar");
+		
+		char minCharValue = minCharField.getChar(thisJavaObject);
+		
+		assertEquals(setup.minChar, minCharValue);		
+	}
+
+	public void testStaticMinCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minCharField = getJavaField(thisJavaObject, "staticMinChar");
+		
+		char minCharValue = minCharField.getChar(null);
+		
+		assertEquals(SetupJavaField_getChar.staticMinChar, minCharValue);		
+	}
+	
+	public void testZeroCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField zeroCharField = getJavaField(thisJavaObject, "zeroChar");
+		
+		char zeroCharValue = zeroCharField.getChar(thisJavaObject);
+		
+		assertEquals(setup.zeroChar, zeroCharValue);		
+	}
+	
+	public void testPosCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField posCharField = getJavaField(thisJavaObject, "posChar");
+		
+		char posCharValue = posCharField.getChar(thisJavaObject);
+		
+		assertEquals(setup.posChar, posCharValue);		
+	}
+
+
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDeclaringClass.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+
+
+/**
+ * Tests that getDeclaringClass is working.
+ * 
+ */
+public class TestJavaField_getDeclaringClass extends TCKJavaRuntimeTestcase {
+	
+	
+	public void testInstanceField() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaClass thisJavaClass = thisJavaObject.getJavaClass();
+		
+		JavaField instanceFieldField = getJavaField(thisJavaClass, "instanceField");
+		
+		assertEquals(thisJavaClass, instanceFieldField.getDeclaringClass());		
+	}
+	
+	public void testStaticField() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaClass thisJavaClass = thisJavaObject.getJavaClass();
+		
+		JavaField staticFieldField = getJavaField(thisJavaClass, "staticField");
+		
+		assertEquals(thisJavaClass, staticFieldField.getDeclaringClass());
+	}
+}

Added: incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDouble.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDouble.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDouble.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getDouble.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaField_getDouble;
+
+
+/**
+ * Test JavaField.getDouble() against various fields and values.
+ * 
+ */
+public class TestJavaField_getDouble extends TCKJavaRuntimeTestcase {
+	
+	SetupJavaField_getDouble setup=new SetupJavaField_getDouble();
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getScenerioReference() {
+		if (thisObject == null) {
+			thisObject = super.getScenerioReference();
+		}	
+		return thisObject;		
+	}
+	
+	public void testMaxDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField maxDoubleField = getJavaField(thisJavaObject, "maxDouble");
+		
+		double maxDoubleValue = maxDoubleField.getDouble(thisJavaObject);
+		
+		assertEquals(setup.maxDouble, maxDoubleValue, 0.0);		
+	}
+	
+	public void testMinDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minDoubleField = getJavaField(thisJavaObject, "minDouble");
+		
+		double minDoubleValue = minDoubleField.getDouble(thisJavaObject);
+		
+		assertEquals(setup.minDouble, minDoubleValue, 0.0);	
+	}
+
+	public void testStaticMinDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minDoubleField = getJavaField(thisJavaObject, "staticMinDouble");
+		
+		double minDoubleValue = minDoubleField.getDouble(null);
+		
+		assertEquals(SetupJavaField_getDouble.staticMinDouble, minDoubleValue, 0.0);		
+	}
+	
+	public void testZeroDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField zeroDoubleField = getJavaField(thisJavaObject, "zeroDouble");
+		
+		double zeroDoubleValue = zeroDoubleField.getDouble(thisJavaObject);
+		
+		assertEquals(setup.zeroDouble, zeroDoubleValue, 0.0);		
+	}
+	
+	public void testNegDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField negDoubleField = getJavaField(thisJavaObject, "negDouble");
+		
+		double negDoubleValue = negDoubleField.getDouble(thisJavaObject);
+		
+		assertEquals(setup.negDouble, negDoubleValue, 0.0);		
+	}	
+	
+	public void testPosDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField posDoubleField = getJavaField(thisJavaObject, "posDouble");
+		
+		double posDoubleValue = posDoubleField.getDouble(thisJavaObject);
+		
+		assertEquals(setup.posDouble, posDoubleValue, 0.0);		
+	}
+
+	public void testFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		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 = getScenerioReference();
+		JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+		
+		try{
+			double anObjectReference = objectReferenceField.getDouble(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getDouble(objectReference)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+}

Added: incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getFloat.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getFloat.java?rev=883669&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getFloat.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/src/test/java/org/apache/kato/tck/tests/javaruntime/TestJavaField_getFloat.java Tue Nov 24 12:27:01 2009
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * 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 org.apache.kato.tck.tests.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+import org.apache.kato.tck.harness.TCKJavaRuntimeTestcase;
+import org.apache.kato.tck.scenario142.javaruntime.SetupJavaField_getFloat;
+
+
+/**
+ * Test JavaField.getFloat() against various fields and values.
+ * 
+ */
+public class TestJavaField_getFloat extends TCKJavaRuntimeTestcase {
+	
+	SetupJavaField_getFloat setup=new SetupJavaField_getFloat();
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getScenerioReference() {
+		if (thisObject == null) {
+			thisObject = super.getScenerioReference();
+		}	
+		return thisObject;		
+	}
+	
+	public void testMaxFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField maxFloatField = getJavaField(thisJavaObject, "maxFloat");
+		
+		float maxFloatValue = maxFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(setup.maxFloat, maxFloatValue, 0.0);		
+	}
+	
+	public void testMinFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minFloatField = getJavaField(thisJavaObject, "minFloat");
+		
+		float minFloatValue = minFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(setup.minFloat, minFloatValue, 0.0);	
+	}
+
+	public void testStaticMinFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField minFloatField = getJavaField(thisJavaObject, "staticMinFloat");
+		
+		float minFloatValue = minFloatField.getFloat(null);
+		
+		assertEquals(SetupJavaField_getFloat.staticMinFloat, minFloatValue, 0.0);		
+	}
+	
+	public void testZeroFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField zeroFloatField = getJavaField(thisJavaObject, "zeroFloat");
+		
+		float zeroFloatValue = zeroFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(setup.zeroFloat, zeroFloatValue, 0.0);		
+	}
+	
+	public void testNegFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField negFloatField = getJavaField(thisJavaObject, "negFloat");
+		
+		float negFloatValue = negFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(setup.negFloat, negFloatValue, 0.0);		
+	}	
+	
+	public void testPosFloatValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField posFloatField = getJavaField(thisJavaObject, "posFloat");
+		
+		float posFloatValue = posFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(setup.posFloat, posFloatValue, 0.0);		
+	}
+
+
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField doubleValueField = getJavaField(thisJavaObject, "doubleValue");
+
+		try{
+			float aDoubleValue = doubleValueField.getFloat(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getFloat(doubleValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testLongValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField longValueField = getJavaField(thisJavaObject, "longValue");
+
+		try{
+			float aLongValue = longValueField.getFloat(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getFloat(longValue)");
+		}	
+	}
+	
+	public void testIntValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField intValueField = getJavaField(thisJavaObject, "intValue");
+
+		try{
+			float aIntValue = intValueField.getFloat(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getFloat(intValue)");
+		}	
+	}
+	
+	public void testByteValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField byteValueField = getJavaField(thisJavaObject, "byteValue");
+
+		try{
+			float aByteValue = byteValueField.getFloat(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getFloat(byteValue)");
+		}	
+	}
+	
+	public void testCharValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField charValueField = getJavaField(thisJavaObject, "charValue");
+
+		try{
+			float aCharValue = charValueField.getFloat(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getFloat(charValue)");
+		}	
+	}
+	
+	public void testShortValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");
+
+		try{
+			float aShortValue = floatValueField.getFloat(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getFloat(floatValue)");
+		}	
+	}
+	
+	
+	public void testBooleanValue() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
+		
+		try{
+			float aBooleanValue = booleanValueField.getFloat(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getFloat(booleanValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+	
+	public void testObjectReference() throws Exception {
+		JavaObject thisJavaObject = getScenerioReference();
+		JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+		
+		try{
+			float anObjectReference = objectReferenceField.getFloat(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getFloat(objectReference)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+}



Mime
View raw message