incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccris...@apache.org
Subject svn commit: r754945 [2/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...
Date Mon, 16 Mar 2009 16:42:41 GMT
Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getFloat.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getFloat.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getFloat.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getFloat.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * 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.getFloat() against various fields and values.
+ * 
+ */
+public class TestJavaField_getFloat extends TCKJavaRuntimeTestcase {
+	float maxFloat = Float.MAX_VALUE;
+	float minFloat = Float.MIN_VALUE;
+	static float staticMinFloat = Float.MIN_VALUE;
+	float zeroFloat = 0;
+	float negFloat = -0x55a55a5a5a5aa75al;
+	float posFloat = +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;
+	long longValue = 0x37faf57a57fad7fal;
+	double doubleValue = (double)6;
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getThis() {
+		if (thisObject == null) {
+			thisObject = super.getThis();
+		}	
+		return thisObject;		
+	}
+	
+	public void testMaxFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField maxFloatField = getJavaField(thisJavaObject, "maxFloat");
+		
+		float maxFloatValue = maxFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(maxFloat, maxFloatValue, 0.0);		
+	}
+	
+	public void testMinFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minFloatField = getJavaField(thisJavaObject, "minFloat");
+		
+		float minFloatValue = minFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(minFloat, minFloatValue, 0.0);	
+	}
+
+	public void testStaticMinFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minFloatField = getJavaField(thisJavaObject, "staticMinFloat");
+		
+		float minFloatValue = minFloatField.getFloat(null);
+		
+		assertEquals(staticMinFloat, minFloatValue, 0.0);		
+	}
+	
+	public void testZeroFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField zeroFloatField = getJavaField(thisJavaObject, "zeroFloat");
+		
+		float zeroFloatValue = zeroFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(zeroFloat, zeroFloatValue, 0.0);		
+	}
+	
+	public void testNegFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField negFloatField = getJavaField(thisJavaObject, "negFloat");
+		
+		float negFloatValue = negFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(negFloat, negFloatValue, 0.0);		
+	}	
+	
+	public void testPosFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField posFloatField = getJavaField(thisJavaObject, "posFloat");
+		
+		float posFloatValue = posFloatField.getFloat(thisJavaObject);
+		
+		assertEquals(posFloat, posFloatValue, 0.0);		
+	}
+
+
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		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 = getThis();
+		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 = getThis();
+		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 = getThis();
+		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 = getThis();
+		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 = getThis();
+		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 = getThis();
+		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 = getThis();
+		JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+		
+		try{
+			float anObjectReference = objectReferenceField.getFloat(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getFloat(objectReference)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getInt.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getInt.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getInt.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getInt.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * 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.getInteger() against various fields and values.
+ * 
+ */
+public class TestJavaField_getInt extends TCKJavaRuntimeTestcase {
+	int maxInteger = Integer.MAX_VALUE;
+	int minInteger = Integer.MIN_VALUE;
+	static int staticMinInteger = Integer.MIN_VALUE;
+	int zeroInteger = 0;
+	int negInteger = -0x75a5a5a5;
+	int posInteger = +0x5a5a75a5;
+	boolean booleanValue = false;
+	Object objectReference = new Object();
+	long longValue = 0x37faf57a57fad7fal;
+	byte byteValue = 1;
+	short shortValue =2;
+	char charValue = 3;
+	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 testMaxIntegerValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField maxIntegerField = getJavaField(thisJavaObject, "maxInteger");
+		
+		int maxIntegerValue = maxIntegerField.getInt(thisJavaObject);
+		
+		assertEquals(maxInteger, maxIntegerValue);		
+	}
+	
+	public void testMinIntegerValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minIntegerField = getJavaField(thisJavaObject, "minInteger");
+		
+		int minIntegerValue = minIntegerField.getInt(thisJavaObject);
+		
+		assertEquals(minInteger, minIntegerValue);		
+	}
+
+	public void testStaticMinIntegerValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minIntegerField = getJavaField(thisJavaObject, "staticMinInteger");
+		
+		int minIntegerValue = minIntegerField.getInt(null);
+		
+		assertEquals(staticMinInteger, minIntegerValue);		
+	}
+	
+	public void testZeroIntegerValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField zeroIntegerField = getJavaField(thisJavaObject, "zeroInteger");
+		
+		int zeroIntegerValue = zeroIntegerField.getInt(thisJavaObject);
+		
+		assertEquals(zeroInteger, zeroIntegerValue);		
+	}
+	
+	public void testNegIntegerValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField negIntegerField = getJavaField(thisJavaObject, "negInteger");
+		
+		int negIntegerValue = negIntegerField.getInt(thisJavaObject);
+		
+		assertEquals(negInteger, negIntegerValue);		
+	}	
+	
+	public void testPosIntegerValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField posIntegerField = getJavaField(thisJavaObject, "posInteger");
+		
+		int posIntegerValue = posIntegerField.getInt(thisJavaObject);
+		
+		assertEquals(posInteger, posIntegerValue);		
+	}
+
+
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField doubleValueField = getJavaField(thisJavaObject, "doubleValue");
+
+		try{
+			int aDoubleValue = doubleValueField.getInt(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getInt(doubleValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");
+
+		try{
+			int aFloatValue = floatValueField.getInt(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getInt(floatValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField longValueField = getJavaField(thisJavaObject, "longValue");
+
+		try{
+			int aLongValue = longValueField.getInt(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getInt(longValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testByteValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField byteValueField = getJavaField(thisJavaObject, "byteValue");
+
+		try{
+			int aByteValue = byteValueField.getInt(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getInt(byteValue)");
+		}	
+	}
+	
+	public void testCharValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField charValueField = getJavaField(thisJavaObject, "charValue");
+
+		try{
+			int aCharValue = charValueField.getInt(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getInt(charValue)");
+		}	
+	}
+	
+	public void testShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField shortValueField = getJavaField(thisJavaObject, "shortValue");
+
+		try{
+			int aShortValue = shortValueField.getInt(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getInt(shortValue)");
+		}	
+	}
+	
+	public void testBooleanValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
+		
+		try{
+			int aBooleanValue = booleanValueField.getInt(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getInteger(booleanValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+	
+	public void testObjectReference() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+		
+		try{
+			int anObjectReference = objectReferenceField.getInt(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getInteger(objectReference)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getLong.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getLong.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getLong.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getLong.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * 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.getLong() against various fields and values.
+ *
+ */
+public class TestJavaField_getLong extends TCKJavaRuntimeTestcase {
+	long maxLong = Long.MAX_VALUE;
+	long minLong = Long.MIN_VALUE;
+	static long staticMinLong = Long.MIN_VALUE;
+	long zeroLong = 0;
+	long negLong = -0x55a55a5a5a5aa75al;
+	long posLong = +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;
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getThis() {
+		if (thisObject == null) {
+			thisObject = super.getThis();
+		}	
+		return thisObject;		
+	}
+	
+	public void testMaxLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField maxLongField = getJavaField(thisJavaObject, "maxLong");
+		
+		long maxLongValue = maxLongField.getLong(thisJavaObject);
+		
+		assertEquals(maxLong, maxLongValue);		
+	}
+	
+	public void testMinLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minLongField = getJavaField(thisJavaObject, "minLong");
+		
+		long minLongValue = minLongField.getLong(thisJavaObject);
+		
+		assertEquals(minLong, minLongValue);		
+	}
+
+	public void testStaticMinLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minLongField = getJavaField(thisJavaObject, "staticMinLong");
+		
+		long minLongValue = minLongField.getLong(null);
+		
+		assertEquals(staticMinLong, minLongValue);		
+	}
+	
+	public void testZeroLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField zeroLongField = getJavaField(thisJavaObject, "zeroLong");
+		
+		long zeroLongValue = zeroLongField.getLong(thisJavaObject);
+		
+		assertEquals(zeroLong, zeroLongValue);		
+	}
+	
+	public void testNegLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField negLongField = getJavaField(thisJavaObject, "negLong");
+		
+		long negLongValue = negLongField.getLong(thisJavaObject);
+		
+		assertEquals(negLong, negLongValue);		
+	}	
+	
+	public void testPosLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField posLongField = getJavaField(thisJavaObject, "posLong");
+		
+		long posLongValue = posLongField.getLong(thisJavaObject);
+		
+		assertEquals(posLong, posLongValue);		
+	}
+
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField doubleValueField = getJavaField(thisJavaObject, "doubleValue");
+
+		try{
+			long aDoubleValue = doubleValueField.getLong(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getLong(doubleValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");
+
+		try{
+			long aFloatValue = floatValueField.getLong(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getLong(floatValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testIntValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField intValueField = getJavaField(thisJavaObject, "intValue");
+
+		try{
+			long aIntValue = intValueField.getLong(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getLong(intValue)");
+		}	
+	}
+	
+	public void testByteValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField byteValueField = getJavaField(thisJavaObject, "byteValue");
+
+		try{
+			long aByteValue = byteValueField.getLong(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getLong(byteValue)");
+		}	
+	}
+	
+	public void testCharValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField charValueField = getJavaField(thisJavaObject, "charValue");
+
+		try{
+			long aCharValue = charValueField.getLong(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getLong(charValue)");
+		}	
+	}
+	
+	public void testShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField shortValueField = getJavaField(thisJavaObject, "shortValue");
+
+		try{
+			long aShortValue = shortValueField.getLong(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getLong(shortValue)");
+		}	
+	}
+	
+	public void testBooleanValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
+		
+		try{
+			long aBooleanValue = booleanValueField.getLong(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getLong(booleanValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+	
+	public void testObjectReference() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+		
+		try{
+			long anObjectReference = objectReferenceField.getLong(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getLong(objectReference)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getModifiers.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getModifiers.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getModifiers.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getModifiers.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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.lang.reflect.Modifier;
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaField_getModifiers extends TCKJavaRuntimeTestcase {
+	final int finalField=0;
+	private char privateField = '1';
+	protected char protectedField = '2';
+	public String publicField = "3";	
+	static long staticField = 4;
+	transient char transientField = '5';
+	volatile boolean volatileField = false;
+	int defaultField = 10101;
+
+	static private volatile transient byte staticPrivateVolatileTransientField = 23;
+	final protected int finalProtectedField = 74;
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getThis() {
+		if (thisObject == null) {
+			thisObject = super.getThis();
+		}	
+		return thisObject;
+		
+	}
+
+	public void testFinalField() throws Exception {
+		JavaField field = getJavaField(getThis(), "finalField");
+		assertEquals(Modifier.FINAL, field.getModifiers() & 0xFF);
+	}
+	
+	public void testPrivateField() throws Exception {
+		JavaField field = getJavaField(getThis(), "privateField");
+		assertEquals(Modifier.PRIVATE, field.getModifiers() & 0xFF);
+	}	
+	
+	public void testProtectedField() throws Exception {
+		JavaField field = getJavaField(getThis(), "protectedField");
+		assertEquals(Modifier.PROTECTED, field.getModifiers() & 0xFF);
+	}
+	
+	public void testPublicField() throws Exception {
+		JavaField field = getJavaField(getThis(), "publicField");
+		assertEquals(Modifier.PUBLIC, field.getModifiers() & 0xFF);
+	}
+	
+	public void testStaticField() throws Exception {
+		JavaField field = getJavaField(getThis(), "staticField");
+		assertEquals(Modifier.STATIC, field.getModifiers() & 0xFF);
+	}
+	
+	public void testTransientField() throws Exception {
+		JavaField field = getJavaField(getThis(), "transientField");
+		assertEquals(Modifier.TRANSIENT, field.getModifiers() & 0xFF);
+	}
+	
+	public void testVolatileField() throws Exception {
+		JavaField field = getJavaField(getThis(), "volatileField");
+		assertEquals(Modifier.VOLATILE, field.getModifiers() & 0xFF);
+	}
+	
+	public void testDefaultField() throws Exception {
+		JavaField field = getJavaField(getThis(), "defaultField");
+		assertEquals(0, field.getModifiers() & 0xFF);
+	}
+	
+	public void testStaticPrivateVolatileTransientField() throws Exception {
+		JavaField field = getJavaField(getThis(), "staticPrivateVolatileTransientField");
+		assertEquals(Modifier.STATIC| Modifier.PRIVATE| Modifier.VOLATILE| Modifier.TRANSIENT
+				, field.getModifiers() & 0xFF);
+	}
+	public void testFinalProtectedField() throws Exception {
+		JavaField field = getJavaField(getThis(), "finalProtectedField");
+		assertEquals( Modifier.FINAL | Modifier.PROTECTED, field.getModifiers() & 0xFF);
+	}
+	
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getName.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getName.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getName.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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_getName extends TCKJavaRuntimeTestcase {
+	
+	int \u0412\u043e\u0434\u043a\u0430 = 2;
+	static int \u0412\u043e\u0434\u043a\u0430_static = 3;
+	byte thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah=47;
+	static byte thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah_static=23;
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getThis() {
+		if (thisObject == null) {
+			thisObject = super.getThis();
+		}	
+		return thisObject;		
+	}
+	
+	public void testUnicodeName() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField unicodeField = getJavaField(thisJavaObject, "\u0412\u043e\u0434\u043a\u0430");
+		
+		assertNotNull("Unable to find the field \u0412\u043e\u0434\u043a\u0430", unicodeField);
+		
+		int intValue = unicodeField.getInt(thisJavaObject);
+		
+		assertEquals(\u0412\u043e\u0434\u043a\u0430, intValue);		
+	}
+	
+	public void testStaticUnicodeName() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField unicodeField = getJavaField(thisJavaObject, "\u0412\u043e\u0434\u043a\u0430_static");
+		
+		assertNotNull("Unable to find the field \u0412\u043e\u0434\u043a\u0430_static", unicodeField);
+		
+		int intValue = unicodeField.getInt(null);
+		
+		assertEquals(\u0412\u043e\u0434\u043a\u0430_static, intValue);		
+	}
+	
+	public void testLongName() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField longField = getJavaField(thisJavaObject, "thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah");
+		
+		assertNotNull("Unable to find the field thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah", longField);
+		
+		byte byteValue = longField.getByte(thisJavaObject);
+		
+		assertEquals(thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah, byteValue);
+	}
+	
+	public void testLongStaticName() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField longField = getJavaField(thisJavaObject, "thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah_static");
+		
+		assertNotNull("Unable to find the field thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah_static", longField);
+		
+		byte byteValue = longField.getByte(thisJavaObject);
+		
+		assertEquals(thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah_static, byteValue);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getShort.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getShort.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getShort.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getShort.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * 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.getShort() against various fields and values.
+ * 
+ */
+public class TestJavaField_getShort extends TCKJavaRuntimeTestcase {
+	short maxShort = Short.MAX_VALUE;
+	short minShort = Short.MIN_VALUE;
+	static short staticMinShort = Short.MIN_VALUE;
+	short zeroShort = 0;
+	short negShort = -0x75a5;
+	short posShort = +0x5a5a;
+	boolean booleanValue = false;
+	Object objectReference = new Object();
+	int intValue = 0xfafafafa;
+	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 testMaxShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField maxShortField = getJavaField(thisJavaObject, "maxShort");
+		
+		short maxShortValue = maxShortField.getShort(thisJavaObject);
+		
+		assertEquals(maxShort, maxShortValue);		
+	}
+	
+	public void testMinShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minShortField = getJavaField(thisJavaObject, "minShort");
+		
+		short minShortValue = minShortField.getShort(thisJavaObject);
+		
+		assertEquals(minShort, minShortValue);		
+	}
+
+	public void testStaticMinShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField minShortField = getJavaField(thisJavaObject, "staticMinShort");
+		
+		short minShortValue = minShortField.getShort(null);
+		
+		assertEquals(staticMinShort, minShortValue);		
+	}
+	
+	public void testZeroShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField zeroShortField = getJavaField(thisJavaObject, "zeroShort");
+		
+		short zeroShortValue = zeroShortField.getShort(thisJavaObject);
+		
+		assertEquals(zeroShort, zeroShortValue);		
+	}
+	
+	public void testNegShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField negShortField = getJavaField(thisJavaObject, "negShort");
+		
+		short negShortValue = negShortField.getShort(thisJavaObject);
+		
+		assertEquals(negShort, negShortValue);		
+	}	
+	
+	public void testPosShortValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField posShortField = getJavaField(thisJavaObject, "posShort");
+		
+		short posShortValue = posShortField.getShort(thisJavaObject);
+		
+		assertEquals(posShort, posShortValue);		
+	}
+
+
+	public void testDoubleValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField doubleValueField = getJavaField(thisJavaObject, "doubleValue");
+
+		try{
+			short aDoubleValue = doubleValueField.getShort(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getShort(doubleValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testFloatValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");
+
+		try{
+			short aFloatValue = floatValueField.getShort(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getShort(floatValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testLongValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField longValueField = getJavaField(thisJavaObject, "longValue");
+
+		try{
+			short aLongValue = longValueField.getShort(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getShort(longValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testIntValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField intValueField = getJavaField(thisJavaObject, "intValue");
+
+		try{
+			short aIntValue = intValueField.getShort(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getShort(intValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testByteValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField byteValueField = getJavaField(thisJavaObject, "byteValue");
+
+		try{
+			short aByteValue = byteValueField.getShort(thisJavaObject);
+		} catch (IllegalArgumentException e) {
+			fail("Unexpected illegal argument exception from JavaField.getShort(byteValue)");
+		}	
+	}
+	
+	public void testCharValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField charValueField = getJavaField(thisJavaObject, "charValue");
+
+		try{
+			short aShortValue = charValueField.getShort(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getShort(charValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}	
+	}
+	
+	public void testBooleanValue() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
+		
+		try{
+			short aBooleanValue = booleanValueField.getShort(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getShort(booleanValue)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+	
+	public void testObjectReference() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
+		
+		try{
+			short anObjectReference = objectReferenceField.getShort(thisJavaObject);
+			fail("Missing illegal argument exception from JavaField.getShort(objectReference)");
+		} catch (IllegalArgumentException e) {
+			// expected
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getSignature.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getSignature.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getSignature.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getSignature.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * 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.java.JavaRuntime;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaField_getSignature extends TCKJavaRuntimeTestcase {
+	byte byteField=1;
+	short shortField = 2;
+	char charField='3';
+	int intField = 4;
+	long longField = 5;
+	float floatField = 6;
+	double doubleField = 7;
+	String objectField = "8";
+	byte[] byteArrayField = {9};
+	short[] shortArrayField = {10};
+	char[] charArrayField = {'b'};
+	int[] intArrayField = {12};
+	long[] longArrayField = {13};
+	float[] floatArrayField = {14};
+	double[] doubleArrayField = {15};
+	String[] objectArrayField = {"16"};
+	byte[][] byteArrayArrayField = {{17}};
+	short[][] shortArrayArrayField = {{18}};
+	char[][] charArrayArrayField = {{'c'}};
+	int[][] intArrayArrayField = {{20}};
+	long[][] longArrayArrayField = {{21}};
+	float[][] floatArrayArrayField = {{22}};
+	double[][] doubleArrayArrayField = {{23}};
+	String[][] objectArrayArrayField = {{"24"}};
+	
+	
+	public class Class_\u0412\u043e\u0434\u043a\u0430_Value {
+		
+	}
+
+	Class_\u0412\u043e\u0434\u043a\u0430_Value unicodeClass = new Class_\u0412\u043e\u0434\u043a\u0430_Value();
+	Class_\u0412\u043e\u0434\u043a\u0430_Value unicodeClassArray[] = new Class_\u0412\u043e\u0434\u043a\u0430_Value[2];
+
+	String unicodeClassName = Class_\u0412\u043e\u0434\u043a\u0430_Value.class.getName().replace('.','/');
+
+	static JavaObject thisObject = null;	
+	public JavaObject getThis() {
+		if (thisObject == null) {
+			thisObject = super.getThis();
+		}	
+		return thisObject;
+		
+	}
+
+	
+	public void testByteFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "byteField");
+		
+		assertEquals("B", field.getSignature());
+	}
+	
+	public void testShortFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "shortField");
+		
+		assertEquals("S", field.getSignature());
+	}
+	
+	public void testCharFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "charField");
+		
+		assertEquals("C", field.getSignature());
+	}
+	
+	public void testIntFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "intField");
+		
+		assertEquals("I", field.getSignature());
+	}
+	
+	public void testLongFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "longField");
+		
+		assertEquals("J", field.getSignature());
+	}
+	
+	public void testFloatFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "floatField");
+		
+		assertEquals("F", field.getSignature());
+	}
+	
+	public void testDoubleFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "doubleField");
+		
+		assertEquals("D", field.getSignature());
+	}
+	
+	public void testObjectFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "objectField");
+		
+		assertEquals("Ljava/lang/String;", field.getSignature());
+	}
+	
+	public void testByteArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "byteArrayArrayField");
+		
+		assertEquals("[[B", field.getSignature());
+	}
+	
+	public void testShortArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "shortArrayArrayField");
+		
+		assertEquals("[[S", field.getSignature());
+	}
+	
+	public void testCharArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "charArrayArrayField");
+		
+		assertEquals("[[C", field.getSignature());
+	}
+	
+	public void testIntArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "intArrayArrayField");
+		
+		assertEquals("[[I", field.getSignature());
+	}
+	
+	public void testLongArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "longArrayArrayField");
+		
+		assertEquals("[[J", field.getSignature());
+	}
+	
+	public void testFloatArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "floatArrayArrayField");
+		
+		assertEquals("[[F", field.getSignature());
+	}
+	
+	public void testDoubleArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "doubleArrayArrayField");
+		
+		assertEquals("[[D", field.getSignature());
+	}
+	
+	public void testObjectArrayArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "objectArrayArrayField");
+		
+		assertEquals("[[Ljava/lang/String;", field.getSignature());
+	}
+	
+	public void testByteArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "byteArrayField");
+		
+		assertEquals("[B", field.getSignature());
+	}
+	
+	public void testShortArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "shortArrayField");
+		
+		assertEquals("[S", field.getSignature());
+	}
+	
+	public void testCharArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "charArrayField");
+		
+		assertEquals("[C", field.getSignature());
+	}
+	
+	public void testIntArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "intArrayField");
+		
+		assertEquals("[I", field.getSignature());
+	}
+	
+	public void testLongArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "longArrayField");
+		
+		assertEquals("[J", field.getSignature());
+	}
+	
+	public void testFloatArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "floatArrayField");
+		
+		assertEquals("[F", field.getSignature());
+	}
+	
+	public void testDoubleArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "doubleArrayField");
+		
+		assertEquals("[D", field.getSignature());
+	}
+	
+	public void testObjectArrayFieldSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "objectArrayField");
+		
+		assertEquals("[Ljava/lang/String;", field.getSignature());
+	}
+	
+	public void testUnicodeClassSignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "unicodeClass");
+		assertEquals("L"+unicodeClassName+";", field.getSignature());
+	}
+	
+	public void testUnicodeClassArraySignature() throws Exception {
+		JavaField field = getJavaField(getThis(), "unicodeClassArray");
+		assertEquals("[L"+unicodeClassName+";", field.getSignature());
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getString.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getString.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getString.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaField_getString.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * 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;
+
+public class TestJavaField_getString extends TCKJavaRuntimeTestcase {
+	public String longString;
+	public String emptyString = "";
+	public String nullString = null;
+	public String foreignString = "\u0412\u043e\u0434\u043a\u0430"; 
+	static public String staticString = "This is a static string. So there.";
+	public int nonString = 34;
+	
+	public static int strlen = 65536;
+	
+	{
+		// Initalize string with somewhat random string.
+		char buffer[] = new char[strlen];
+		int value = 1239723;
+		
+		for (int i=0; i< strlen; i++) {
+			value = (17223 * value + 327) % 127893;
+			
+			buffer[i] = (char)((int)'a' + Math.abs(value  % 26));
+		}
+		
+		longString = new String(buffer);
+	}
+	
+//	public void configure(ICheckpoint cp) {
+//		cp.checkpoint();
+//	}
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getThis() {
+		if (thisObject == null) {
+			thisObject = super.getThis();
+		}	
+		return thisObject;		
+	}
+	
+	/**
+	 *  Tests that a long string can be retrieved correctly.
+	 *  
+	 */
+	public void testLongString() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		
+		assertNotNull(thisJavaObject);		
+		
+		JavaField longStringField = getJavaField(thisJavaObject, "longString");		
+		
+		assertNotNull(longStringField);
+		
+		String longStringValue = longStringField.getString(thisJavaObject);
+		
+		assertEquals(longString, longStringValue);
+	}
+	
+	public void testEmptyString() throws Exception {
+	JavaObject thisJavaObject = getThis();
+		
+		assertNotNull(thisJavaObject);		
+		
+		JavaField emptyStringField = getJavaField(thisJavaObject, "emptyString");		
+		
+		assertNotNull(emptyStringField);
+		
+		String emptyStringValue = emptyStringField.getString(thisJavaObject);
+		
+		assertEquals(emptyString, emptyStringValue);
+		
+	}
+	
+	public void testNullString() throws Exception {
+		JavaObject thisJavaObject = getThis();
+
+		assertNotNull(thisJavaObject);		
+
+		JavaField nullStringField = getJavaField(thisJavaObject, "nullString");		
+
+		assertNotNull(nullStringField);
+
+		String nullStringValue = nullStringField.getString(thisJavaObject);
+
+		assertEquals(nullString, nullStringValue);
+
+	}
+	
+	public void testForeignString() throws Exception {
+		JavaObject thisJavaObject = getThis();
+
+		assertNotNull(thisJavaObject);		
+
+		JavaField foreignStringField = getJavaField(thisJavaObject, "foreignString");		
+
+		assertNotNull(foreignStringField);
+
+		String foreignStringValue = foreignStringField.getString(thisJavaObject);
+		
+		assertEquals(foreignString, foreignStringValue);
+
+	}
+	
+	public void testNullJavaObjectOnInstanceField() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		
+		assertNotNull(thisJavaObject);
+		
+		JavaField longStringField = getJavaField(thisJavaObject, "longString");
+		
+		assertNotNull(longStringField);
+		
+		try{
+			String string = longStringField.getString(null);
+			fail ("Expected NullPointerException. Got \""+string+"\"");
+		} catch (NullPointerException e) {
+			// passes.
+		}
+	}
+	
+	public void testStaticString() throws Exception {		
+		JavaObject thisJavaObject = getThis();
+		
+		assertNotNull(thisJavaObject);
+		
+		JavaField staticStringField = getJavaField(thisJavaObject, "staticString");
+		
+		String staticStringValue = staticStringField.getString(null);
+		
+		assertEquals(staticString, staticStringValue);
+	}
+	
+	public void testNonString() throws Exception {
+		JavaObject thisJavaObject = getThis();
+		
+		assertNotNull(thisJavaObject);
+		
+		JavaField nonStringField = getJavaField(thisJavaObject, "nonString");
+		
+		try {
+			String nonStringValue = nonStringField.getString(thisJavaObject);
+			fail("Didn't get illegal argument exception when int field read with getString.");
+		} catch(IllegalArgumentException e) {
+			// passed - expect exception.
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaHeap_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaHeap_getName.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaHeap_getName.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaHeap_getName.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.tests.javaruntime;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.java.JavaHeap;
+import com.ibm.dtfj.java.JavaRuntime;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaHeap_getName extends TCKJavaRuntimeTestcase {
+
+	/**
+	 * 
+	 * 
+	 */
+	public void testJavaHeap_getName()
+	{
+		boolean foundHeaps = 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;
+			assertTrue("One of the java heaps has a null name.", aJavaHeap.getName()!=null);
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaMethod_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaMethod_getName.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaMethod_getName.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaMethod_getName.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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.java.JavaClass;
+import com.ibm.dtfj.java.JavaLocation;
+import com.ibm.dtfj.java.JavaMethod;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.java.JavaStackFrame;
+import com.ibm.dtfj.java.JavaThread;
+import com.ibm.dtfj.tck.api.ICheckpoint;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaMethod_getName extends TCKJavaRuntimeTestcase {
+	
+	public static final String threadName = "com.ibm.dtfj.tck.tests.javaruntime.TestJavaMethod_getName#configure\u0412\u043e\u0434\u043a\u0430";
+
+	public String configure\u0412\u043e\u0434\u043a\u0430(ICheckpoint checkpoint) {
+		checkpoint.checkpoint();
+		return "Vodka";
+	}
+	
+	static JavaObject thisObject = null;	
+	public JavaObject getThis() {
+		if (thisObject == null) {
+			thisObject = super.getThis();
+		}	
+		return thisObject;		
+	}
+	
+	private static final String methodName = "configure\u0412\u043e\u0434\u043a\u0430";
+	/**
+	 * Get this class directly, and find the method via getDeclaredMethods();
+	 * 
+	 * @throws Exception
+	 */
+	public void testGetDeclaredMethods() throws Exception {
+		JavaClass thisClass = getThis().getJavaClass();
+		
+		assertNotNull("Unable to find this class", thisClass);
+		
+		Iterator methods = thisClass.getDeclaredMethods();
+		boolean found=false;
+		while(methods.hasNext()) {
+			JavaMethod method = (JavaMethod) methods.next();
+			
+			if (method.getName().equals(methodName)) {
+				found = true;
+				break;
+			}
+		}
+		
+		assertTrue("Unable to find method get\u0412\u043e\u0434\u043a\u0430()", found);
+	}
+	
+	/**
+	 * Pick the method off of the JavaThreads stack. The JavaMethod might be
+	 * instantiated differently.
+	 * 
+	 * @throws Exception
+	 */
+	public void testGetStackMethods() throws Exception {
+		Iterator threads = getJavaRuntime().getThreads();
+		
+		JavaThread testThread = null;
+		while(threads.hasNext()) {
+			Object next = threads.next();
+			
+			if (next instanceof JavaThread) {
+				JavaThread thread = (JavaThread) next;
+				if (thread.getName().equals(threadName)) {
+					testThread = thread;
+					break;
+				}
+			} else {
+				break;
+			}
+		}
+		
+		assertNotNull("Unable to find thread "+threadName, testThread);
+		
+		Iterator frames = testThread.getStackFrames();
+		boolean found = false;
+		
+		while(frames.hasNext()) {
+			Object next = frames.next();
+			
+			if(next instanceof JavaStackFrame) {
+				JavaStackFrame frame = (JavaStackFrame) next;
+				
+				JavaLocation location = frame.getLocation();
+				
+				if (location != null) {
+					JavaMethod method = location.getMethod();
+					
+					if(method != null) {
+						if (methodName.equals(method.getName())) {
+							found = true;
+							break;
+						}
+					}
+				}
+			}
+		}
+		
+		assertTrue("Unable to find method "+methodName+" in stack.", found);
+	}
+}



Mime
View raw message