You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by sp...@apache.org on 2009/11/02 15:47:03 UTC
svn commit: r831930 - in
/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org:
./ apache/ apache/kato/ apache/kato/tck/ apache/kato/tck/setup/
apache/kato/tck/setup/javaruntime/
Author: spoole
Date: Mon Nov 2 15:47:01 2009
New Revision: 831930
URL: http://svn.apache.org/viewvc?rev=831930&view=rev
Log:
added new scenerio module to hold testcase setup for TCK
Added:
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClassLoader_getJavaObject.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClass_getName.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_equals.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_get.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getBoolean.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getByte.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getChar.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDeclaringClass.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDouble.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getFloat.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getInt.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getLong.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getModifiers.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getName.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getShort.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getSignature.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getString.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaMethod_getName.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_arraycopy.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getDeclaredFields_getName.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getReferences.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaReferences.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntimeThreads.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getCompiledMethods.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getHeapRoots.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaStackFrame_getHeapRoots.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThreadInspection.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getName.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getStackFrames.java
incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/TODOJavaMonitor_ObjectMonitors.java
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClassLoader_getJavaObject.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClassLoader_getJavaObject.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClassLoader_getJavaObject.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClassLoader_getJavaObject.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ *
+ *
+ */
+public class SetupJavaClassLoader_getJavaObject {
+
+ static TCKClassLoader referenceClassLoader;
+
+ public class TCKClassLoader extends ClassLoader {
+
+ private String JavaClassLoader_getJavaObject = "JavaClassLoader_getJavaObject";
+
+ public Class findClass(String name) {
+ byte[] b = loadClassData(name);
+ return defineClass(name, b, 0, b.length);
+ }
+ private byte[] loadClassData(String name) {
+ return null;
+ }
+ }
+
+
+ public void configureJavaClassLoader_getJavaObject()
+ {
+ referenceClassLoader = new TCKClassLoader();
+ }
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClass_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClass_getName.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClass_getName.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaClass_getName.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+public class SetupJavaClass_getName {
+
+ static TestObject theTestObject;
+
+ class TestObject {
+ private String JavaObject_getDeclaredFields_getName = "JavaObject_getDeclaredFields_getName";
+ }
+
+ public static final String TestObjectClassName = TestObject.class.getName().replace('.', '/');
+ public void configureJavaClass_getName()
+ {
+ theTestObject=new TestObject();
+ }
+
+
+ public class Unicode_class_\u0412\u043e\u0434\u043a\u0430 {
+
+ }
+
+ private Unicode_class_\u0412\u043e\u0434\u043a\u0430 unicodeClass = new Unicode_class_\u0412\u043e\u0434\u043a\u0430();
+
+ public static String unicodeClassname = Unicode_class_\u0412\u043e\u0434\u043a\u0430.class.getName().replace('.','/');
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_equals.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_equals.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_equals.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_equals.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+public class SetupJavaField_equals {
+ int fieldA=1;
+ int fieldB=2;
+ static String staticField="3";
+
+ public static class DifferentClass {
+ int fieldA=1;
+ int fieldB=2;
+ static String staticField="3";
+
+ }
+
+ static DifferentClass differentObject = new DifferentClass();
+
+ String differentClassName = DifferentClass.class.getName().replace('.', '/');
+
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_get.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_get.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_get.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_get.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+public class SetupJavaField_get {
+ public byte byteValue = 0x5a;
+ public byte maxByteValue = Byte.MAX_VALUE;
+ public byte minByteValue = Byte.MIN_VALUE;
+
+ public short shortValue = 0x5a7f;
+ public short maxShortValue = Short.MAX_VALUE;
+ public short minShortValue = Short.MIN_VALUE;
+
+ public char charValue = '\u043e';
+ public char maxCharValue = Character.MAX_VALUE;
+ public char minCharValue = Character.MIN_VALUE;
+
+ public int intValue = 0x12345678;
+ public int maxIntValue = Integer.MAX_VALUE;
+ public int minIntValue = Integer.MIN_VALUE;
+
+ public long longValue = 0x9abcdef012345678l;
+ public long maxLongValue = Long.MAX_VALUE;
+ public long minLongValue = Long.MIN_VALUE;
+
+ public float floatValue = (float)4.0e2;
+ public float maxFloatValue = Float.MAX_VALUE;
+ public float minFloatValue = Float.MIN_VALUE;
+
+ public double doubleValue = 4.1e2;
+ public double maxDoubleValue = Double.MAX_VALUE;
+ public double minDoubleValue = Double.MIN_VALUE;
+
+ public String stringValue = "this is a string";
+ public Object objectValue = new Object();
+ public Object nullValue = null;
+
+ public static byte byteStaticValue = 0x12;
+ public static byte maxByteStaticValue = Byte.MAX_VALUE;
+ public static byte minByteStaticValue = Byte.MIN_VALUE;
+
+ public static short shortStaticValue = 0x1842;
+ public static short maxShortStaticValue = Byte.MAX_VALUE;
+ public static short minShortStaticValue = Byte.MIN_VALUE;
+
+ public static char charStaticValue = '\u0342';
+ public static char maxCharStaticValue = Character.MAX_VALUE;
+ public static char minCharStaticValue = Character.MIN_VALUE;
+
+ public static int intStaticValue = 0x98765432;
+ public static int maxIntStaticValue = Integer.MAX_VALUE;
+ public static int minIntStaticValue = Integer.MIN_VALUE;
+
+
+ public static long longStaticValue = 0x47393fabcd8dbea7l;
+ public static long maxLongStaticValue = Long.MAX_VALUE;
+ public static long minLongStaticValue = Long.MIN_VALUE;
+
+
+ public static float floatStaticValue = (float)1.0e-3;
+ public static float maxFloatStaticValue = Float.MAX_VALUE;
+ public static float minFloatStaticValue = Float.MIN_VALUE;
+
+ public static double doubleStaticValue = 7.2e-9;
+ public static double maxDoubleStaticValue = Double.MAX_VALUE;
+ public static double minDoubleStaticValue = Double.MIN_VALUE;
+
+ public static String stringStaticValue = "This statement is false.";
+ public static Object objectStaticValue = new Object();
+ public static Object nullStaticValue = null;
+
+ public static class WrongClass {
+ byte byteValue;
+ Object objectValue = new Object();
+ }
+
+ public WrongClass wrongObjectInstance = new WrongClass();
+
+ public static String wrongClassName = WrongClass.class.getName().replace('.', '/');
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getBoolean.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getBoolean.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getBoolean.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getBoolean.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Tests that JavaField.getBoolean works as expected.
+ *
+ */
+public class SetupJavaField_getBoolean {
+ public boolean trueBoolean = true;
+ public boolean falseBoolean = false;
+
+ public static boolean trueStaticBoolean = true;
+ public static boolean falseStaticBoolean = false;
+
+ public class IncompatibleClass {
+ boolean trueBoolean = true;
+ }
+ public IncompatibleClass incompatibleObject = new IncompatibleClass();
+ public String incompatibleClassName = IncompatibleClass.class.getName().replace('.', '/');
+
+ public int notBoolean = 23;
+ public Object notBoolean2 = new Object();
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getByte.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getByte.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getByte.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getByte.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Test JavaField.getByte() against various fields and values.
+ *
+ */
+public class SetupJavaField_getByte {
+ public byte maxByte = Byte.MAX_VALUE;
+ public byte minByte = Byte.MIN_VALUE;
+ public static byte staticMinByte = Byte.MIN_VALUE;
+ public byte zeroByte = 0;
+ public byte negByte = -64;
+ public byte posByte = +64;
+ public boolean booleanValue = false;
+ public Object objectReference = new Object();
+
+ public short shortValue =2;
+ public char charValue = 3;
+ public long longValue = 4l;
+ public float floatValue = (float)5.0;
+ public double doubleValue = (double)6;
+
+ public int intValue = 2048;
+
+
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getChar.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getChar.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getChar.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getChar.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Test JavaField.getChar() against various fields and values.
+ *
+ */
+public class SetupJavaField_getChar {
+ public char maxChar = Character.MAX_VALUE;
+ public char minChar = Character.MIN_VALUE;
+ public static char staticMinChar = Character.MIN_VALUE;
+ public char zeroChar = 0;
+ public char posChar = 0xa5a5;
+ public boolean booleanValue = false;
+ public Object objectReference = new Object();
+ public int intValue = 0x37fadef;
+ public byte byteValue = 1;
+ public short shortValue =2;
+ public char charValue = 3;
+ public long longValue = 4l;
+ public float floatValue = (float)5.0;
+ public double doubleValue = (double)6;
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDeclaringClass.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDeclaringClass.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDeclaringClass.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDeclaringClass.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Tests that getDeclaringClass is working.
+ *
+ */
+public class SetupJavaField_getDeclaringClass {
+ public String instanceField = new String("bob");
+ public static String staticField = new String("hope");
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDouble.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDouble.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDouble.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getDouble.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Test JavaField.getDouble() against various fields and values.
+ *
+ */
+public class SetupJavaField_getDouble {
+ public double maxDouble = Double.MAX_VALUE;
+ public double minDouble = Double.MIN_VALUE;
+ public static double staticMinDouble = Double.MIN_VALUE;
+ public double zeroDouble = 0;
+ public double negDouble = -0x55a55a5a5a5aa75al;
+ public double posDouble = +0x2a5a75a55a5a75a5l;
+ public boolean booleanValue = false;
+ public Object objectReference = new Object();
+ public int intValue = 0xfafafafa;
+ public byte byteValue = 1;
+ public short shortValue =2;
+ public char charValue = 3;
+ public float floatValue = (float)5.0;
+ public double doubleValue = (double)6;
+ public long longValue = 0x37faf57a57fad7fal;
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getFloat.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getFloat.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getFloat.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getFloat.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Test JavaField.getFloat() against various fields and values.
+ *
+ */
+public class SetupJavaField_getFloat {
+ public float maxFloat = Float.MAX_VALUE;
+ public float minFloat = Float.MIN_VALUE;
+ public static float staticMinFloat = Float.MIN_VALUE;
+ public float zeroFloat = 0;
+ public float negFloat = -0x55a55a5a5a5aa75al;
+ public float posFloat = +0x2a5a75a55a5a75a5l;
+ public boolean booleanValue = false;
+ public Object objectReference = new Object();
+ public int intValue = 0xfafafafa;
+ public byte byteValue = 1;
+ public short shortValue =2;
+ public char charValue = 3;
+ public float floatValue = (float)5.0;
+ public long longValue = 0x37faf57a57fad7fal;
+ public double doubleValue = (double)6;
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getInt.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getInt.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getInt.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getInt.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Test JavaField.getInteger() against various fields and values.
+ *
+ */
+public class SetupJavaField_getInt {
+ public int maxInteger = Integer.MAX_VALUE;
+ public int minInteger = Integer.MIN_VALUE;
+ public static int staticMinInteger = Integer.MIN_VALUE;
+ public int zeroInteger = 0;
+ public int negInteger = -0x75a5a5a5;
+ public int posInteger = +0x5a5a75a5;
+ public boolean booleanValue = false;
+ public Object objectReference = new Object();
+ public long longValue = 0x37faf57a57fad7fal;
+ public byte byteValue = 1;
+ public short shortValue =2;
+ public char charValue = 3;
+ public float floatValue = (float)5.0;
+ public double doubleValue = (double)6;
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getLong.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getLong.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getLong.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getLong.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Test JavaField.getLong() against various fields and values.
+ *
+ */
+public class SetupJavaField_getLong {
+ public long maxLong = Long.MAX_VALUE;
+ public long minLong = Long.MIN_VALUE;
+ public static long staticMinLong = Long.MIN_VALUE;
+ public long zeroLong = 0;
+ public long negLong = -0x55a55a5a5a5aa75al;
+ public long posLong = +0x2a5a75a55a5a75a5l;
+ public boolean booleanValue = false;
+ public Object objectReference = new Object();
+ public int intValue = 0xfafafafa;
+ public byte byteValue = 1;
+ public short shortValue =2;
+ public char charValue = 3;
+ public float floatValue = (float)5.0;
+ public double doubleValue = (double)6;
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getModifiers.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getModifiers.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getModifiers.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getModifiers.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+public class SetupJavaField_getModifiers {
+ public 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;
+
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getName.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getName.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getName.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tck.setup.javaruntime;
+
+
+
+public class SetupJavaField_getName {
+
+ public int \u0412\u043e\u0434\u043a\u0430 = 2;
+ public static int \u0412\u043e\u0434\u043a\u0430_static = 3;
+ public byte thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah=47;
+ public static byte thisIsAnIncrediblyLongNameBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah_static=23;
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getShort.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getShort.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getShort.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getShort.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Test JavaField.getShort() against various fields and values.
+ *
+ */
+public class SetupJavaField_getShort {
+ public short maxShort = Short.MAX_VALUE;
+ public short minShort = Short.MIN_VALUE;
+ public static short staticMinShort = Short.MIN_VALUE;
+ public short zeroShort = 0;
+ public short negShort = -0x75a5;
+ public short posShort = +0x5a5a;
+ public boolean booleanValue = false;
+ public Object objectReference = new Object();
+ public int intValue = 0xfafafafa;
+ public byte byteValue = 1;
+ public short shortValue =2;
+ public char charValue = 3;
+ public long longValue = 4l;
+ public float floatValue = (float)5.0;
+ public double doubleValue = (double)6;
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getSignature.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getSignature.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getSignature.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getSignature.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+public class SetupJavaField_getSignature {
+ public byte byteField=1;
+ public short shortField = 2;
+ public char charField='3';
+ public int intField = 4;
+ public long longField = 5;
+ public float floatField = 6;
+ public double doubleField = 7;
+ public String objectField = "8";
+ public byte[] byteArrayField = {9};
+ public short[] shortArrayField = {10};
+ public char[] charArrayField = {'b'};
+ public int[] intArrayField = {12};
+ public long[] longArrayField = {13};
+ public float[] floatArrayField = {14};
+ public double[] doubleArrayField = {15};
+ public String[] objectArrayField = {"16"};
+ public byte[][] byteArrayArrayField = {{17}};
+ short[][] shortArrayArrayField = {{18}};
+ public char[][] charArrayArrayField = {{'c'}};
+ public int[][] intArrayArrayField = {{20}};
+ public long[][] longArrayArrayField = {{21}};
+ public float[][] floatArrayArrayField = {{22}};
+ public double[][] doubleArrayArrayField = {{23}};
+ public String[][] objectArrayArrayField = {{"24"}};
+
+
+ public class Class_\u0412\u043e\u0434\u043a\u0430_Value {
+
+ }
+
+ public Class_\u0412\u043e\u0434\u043a\u0430_Value unicodeClass = new Class_\u0412\u043e\u0434\u043a\u0430_Value();
+ public Class_\u0412\u043e\u0434\u043a\u0430_Value unicodeClassArray[] = new Class_\u0412\u043e\u0434\u043a\u0430_Value[2];
+
+ public static String unicodeClassName = Class_\u0412\u043e\u0434\u043a\u0430_Value.class.getName().replace('.','/');
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getString.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getString.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getString.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaField_getString.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+
+public class SetupJavaField_getString {
+ 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);
+ }
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaMethod_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaMethod_getName.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaMethod_getName.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaMethod_getName.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+import org.apache.kato.tck.api.ICheckpoint;
+
+
+public class SetupJavaMethod_getName {
+
+ public static final String threadName = "org.apache.kato.tck.tests.javaruntime.TestJavaMethod_getName#configure\u0412\u043e\u0434\u043a\u0430";
+
+ public static final String methodName = "configure\u0412\u043e\u0434\u043a\u0430";
+
+ public String configure\u0412\u043e\u0434\u043a\u0430(ICheckpoint checkpoint) {
+ checkpoint.checkpoint();
+ return "Vodka";
+ }
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_arraycopy.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_arraycopy.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_arraycopy.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_arraycopy.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ * Sets up an object containing references to an array of each type.
+ * Then finds it in DTFJ and the compares the contents of the arrays with
+ * the contents of the arrays from DTFJ using JavaObject.arraycopy()
+ *
+ * TODO testcase should be expanded to test the boundary conditions, and expected error conditions.
+ *
+ */
+public class SetupJavaObject_arraycopy {
+
+ /**
+ * A container and initializer for each array's contents
+ *
+ */
+ public static class TestArrays {
+ public boolean[] booleanArray;
+ public byte[] byteArray;
+ public short[] shortArray;
+ public char[] charArray;
+ public int[] intArray;
+ public long[] longArray;
+ public float[] floatArray;
+ public double[] doubleArray;
+ public Integer[] integerArray;
+ public Object nonArray = new Object();
+ public short[][] arrayArray;
+
+ public TestArrays(int count) {
+ booleanArray = new boolean[count];
+ byteArray = new byte[count];
+ shortArray = new short[count];
+ charArray = new char[count];
+ intArray = new int[count];
+ longArray = new long[count];
+ floatArray = new float[count];
+ doubleArray = new double[count];
+ integerArray = new Integer[count];
+ arrayArray = new short[count][count];
+
+ for (int i=0; i < count; i++) {
+ booleanArray[i] = (i % 2) == 1;
+ byteArray[i] = (byte) i;
+ shortArray[i] = (short) i;
+ charArray[i] = (char) i;
+ intArray[i] = i;
+ longArray[i] = i;
+ floatArray[i] = i;
+ doubleArray[i] = i;
+ integerArray[i] = new Integer(i);
+
+ for(int j = 0; j < count; j++) {
+ arrayArray[i][j] = (short) (i + j);
+ }
+ }
+
+ }
+ }
+
+ // The array sizes.
+ public static final int testArraysElementCount = 10;
+
+ // As this is static, this will exist in both the DTFJ dump and the JUnit testcase. No configure needed.
+ public static TestArrays theTestObject = new TestArrays(testArraysElementCount);
+
+ public static final String TestArraysClassName = TestArrays.class.getName().replace('.', '/');
+
+
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getDeclaredFields_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getDeclaredFields_getName.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getDeclaredFields_getName.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getDeclaredFields_getName.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+
+public class SetupJavaObject_getDeclaredFields_getName {
+
+ public static TestObject theTestObject;
+
+ class TestObject {
+ private String JavaObject_getDeclaredFields_getName = "JavaObject_getDeclaredFields_getName";
+ }
+
+ public static final String TestObjectClassName = TestObject.class.getName().replace('.', '/');
+
+ public void configureJavaObject_get()
+ {
+ theTestObject=new TestObject();
+ }
+
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getReferences.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getReferences.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getReferences.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaObject_getReferences.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tck.setup.javaruntime;
+
+
+
+public class SetupJavaObject_getReferences {
+
+ public int[][] multiDimArray = new int[3][5];
+
+ public void configureMultiDimensionalArray() {
+ multiDimArray = new int[][]{{1,2},{11,12},{21,22}};
+ }
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaReferences.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaReferences.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaReferences.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaReferences.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+import java.lang.ref.PhantomReference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+import java.lang.ref.WeakReference;
+
+public class SetupJavaReferences {
+
+ class StrongReferent {
+ public static final String TYPE = "Strong";
+ };
+
+ class WeakReferent {
+ public static final String TYPE = "Weak";
+ };
+ class SoftReferent {
+ public static final String TYPE = "Soft";
+
+ };
+ class PhantomReferent {
+ public static final String TYPE = "Phantom";
+ };
+
+ class ArrayElement {
+ public static final String TYPE = "ArrayElement";
+
+ }
+
+ private WeakReference weakReference = null;
+ private SoftReference softReference = null;
+ private PhantomReference phantomReference = null;
+
+ private StrongReferent strongReferent = new StrongReferent();
+ private WeakReferent weakReferent = new WeakReferent();
+ private SoftReferent softReferent = new SoftReferent();
+ private PhantomReferent phantomReferent = new PhantomReferent();
+
+ private ClassLoader classLoader = null;
+
+ private ArrayElement[] array = new ArrayElement[1];
+ public void configureReferences() {
+ weakReference = new WeakReference(weakReferent);
+ softReference = new SoftReference(softReferent);
+ phantomReference = new PhantomReference(phantomReferent, new ReferenceQueue());
+
+ array[0] = new ArrayElement();
+
+ classLoader = this.getClass().getClassLoader();
+ }
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ *
+ *
+ */
+public class SetupJavaRuntime {
+
+
+ public static final String DTCK_TEST_RUNTIME_VERSION = "-Dtck.test_runtime_version=";
+
+ public String[] jvmJavaJavaRuntime_getVersion()
+ {
+ return new String[]{DTCK_TEST_RUNTIME_VERSION+System.getProperty("java.version")};
+ }
+
+
+}
+
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntimeThreads.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntimeThreads.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntimeThreads.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntimeThreads.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ *
+ *
+ */
+public class SetupJavaRuntimeThreads {
+
+ public static final String DTFJ_TCK_T3 = "dtfj_tck_t3";
+ public static final String DTFJ_TCK_T2 = "dtfj_tck_t2";
+ public static final String DTFJ_TCK_T1 = "dtfj_tck_t1";
+
+ public void configureSetThreads()
+ {
+
+
+ ThreadGroup group=new ThreadGroup("dtfj_tck");
+
+
+ Thread t1=new Thread(group,new PausingRunnable(),DTFJ_TCK_T1);
+ t1.start();
+
+ Thread t2=new Thread(group,new PausingRunnable(),DTFJ_TCK_T2);
+ t2.start();
+
+ Thread t3=new Thread(group,new PausingRunnable(),DTFJ_TCK_T3);
+ t3.start();
+
+ }
+
+ class PausingRunnable implements Runnable {
+ public void run() {
+ try {
+ Thread.sleep(1000000);
+ } catch (InterruptedException e) {
+
+ e.printStackTrace();
+ }
+
+ }
+ }
+}
+
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getCompiledMethods.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getCompiledMethods.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getCompiledMethods.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getCompiledMethods.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.tck.setup.javaruntime;
+
+
+
+public class SetupJavaRuntime_getCompiledMethods {
+ public int jitMe(int value, int cnt) {
+ if (cnt ==0 ) {
+ return 0;
+ }
+ if (Math.IEEEremainder(value, 2)== 0)
+ return jitMe(value+1, cnt-1);
+ else
+ return jitMe(value-1,cnt-1);
+
+ }
+
+ public void configureCompiledMethod() {
+ int value = 0;
+ value = jitMe(0,3000);
+ System.out.println("Value is "+ value);
+ }
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getHeapRoots.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getHeapRoots.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getHeapRoots.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaRuntime_getHeapRoots.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+import org.apache.kato.tck.api.ICheckpoint;
+
+
+public class SetupJavaRuntime_getHeapRoots {
+
+ public static final String DTFJ_STRING_TABLE_ROOT_TEST = "DTFJ StringTable root test";
+
+
+ public static java.lang.ClassLoader cl = null;
+
+ public HeapRootsTestUnfinalized unfinalizedObj = null;
+
+ public static class HeapRoot {
+ private Object root = null;
+ private int type = 0;
+
+ public HeapRoot(Object r, int t) {
+ root = r;
+ type = t;
+ }
+
+ public boolean equals(Object o) {
+ if (! (o instanceof HeapRoot)) {
+ return false;
+ } else {
+ HeapRoot ro = (HeapRoot) o;
+ return root.equals(ro.getRoot()) && type==0?true:type==ro.getType();
+ }
+ }
+
+ public int hashCode() {
+ return root.hashCode();
+ }
+
+ public Object getRoot() {
+ return root;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+
+
+ }
+
+ class HeapRootsTestClassLoader extends ClassLoader {
+
+ public Class findClass(String name) {
+ byte[] b = loadClassData(name);
+ return defineClass(name, b, 0, b.length);
+ }
+ private byte[] loadClassData(String name) {
+ return null;
+ }
+ }
+
+ class HeapRootsTestThread extends java.lang.Thread {
+ public void run() {
+ while (true) {
+ try {
+ sleep(10000);
+ } catch (InterruptedException e) {}
+ }
+ }
+ }
+
+
+ class HeapRootsTestFinalizable {
+ protected void finalize() {
+// System.out.println("Finalizer for object " + this + " started in thread " + Thread.currentThread());
+ while (true) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ class HeapRootsTestUnfinalized {
+ protected void finalize() {
+ System.out.println("Finalizer for object " + this + " started...");
+ }
+ }
+
+
+ public void configureClassloaderRoot() {
+
+ cl = new HeapRootsTestClassLoader();
+ }
+
+ public void configureUnfinalizedRoot(ICheckpoint cp) {
+ unfinalizedObj = new HeapRootsTestUnfinalized();
+ cp.checkpoint();
+ System.out.println(unfinalizedObj);
+ }
+
+ public void configureFinalizableRoot() {
+ HeapRootsTestFinalizable finalizableObj = new HeapRootsTestFinalizable();
+ HeapRootsTestFinalizable finalizableObj2 = new HeapRootsTestFinalizable();
+ finalizableObj = null;
+ finalizableObj2 = null;
+ System.gc();
+ }
+
+ public void configureStringTableRoot() {
+ String string = DTFJ_STRING_TABLE_ROOT_TEST;
+ string.intern();
+ }
+
+ public void configureThreadRoot(ICheckpoint cp) {
+ HeapRootsTestThread thread = new HeapRootsTestThread();
+ thread.start();
+ cp.checkpoint();
+ }
+
+ class HeapRootsTestParam {}
+ class HeapRootsTestLocalVariable {}
+
+ public final String javaLocalRootsthreadName = this.getClass().getName()+"#configureJavaLocalsRoots";
+ public void configureJavaLocalsRoots(ICheckpoint cp) {
+ HeapRootsTestParam param = new HeapRootsTestParam();
+ methodA(cp, param);
+ }
+
+ private void methodA(ICheckpoint cp, HeapRootsTestParam param) {
+ HeapRootsTestLocalVariable localVariable = new HeapRootsTestLocalVariable();
+ cp.checkpoint();
+ System.out.println(param);
+ System.out.println(localVariable);
+ }
+
+
+
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaStackFrame_getHeapRoots.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaStackFrame_getHeapRoots.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaStackFrame_getHeapRoots.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaStackFrame_getHeapRoots.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class SetupJavaStackFrame_getHeapRoots {
+
+
+ class HeapRootsTestParam {}
+ class HeapRootsTestLocalVariable {}
+
+ public static final String threadName = "org.apache.kato.tck.tests.javaruntime.TestJavaStackFrame_getHeapRoots#configureJavaLocalsRoots";
+ private Map rootsCheckList = new HashMap();
+
+// public String[] jvmDisableJIT()
+// {
+// System.out.println("Disabling JIT...");
+// return new String[]{"-Xint"};
+// }
+
+
+
+ public void configureJavaLocalsRoots(ICheckpoint cp) {
+ HeapRootsTestParam param = new HeapRootsTestParam();
+ methodA(cp, param);
+ }
+
+ private void methodA(ICheckpoint cp, HeapRootsTestParam param) {
+ HeapRootsTestLocalVariable localVariable = new HeapRootsTestLocalVariable();
+ cp.checkpoint();
+ System.out.println(param);
+ System.out.println(localVariable);
+ }
+
+
+
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThreadInspection.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThreadInspection.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThreadInspection.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThreadInspection.java Mon Nov 2 15:47: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.setup.javaruntime;
+
+
+
+/**
+ * Tests to ensure that valid Thread objects get reported correctly
+ *
+ */
+public class SetupJavaThreadInspection{
+
+
+public Thread[] configThreadInstances=null;
+
+
+
+ public void configureValidJavaThreads(ICheckpoint cp) {
+ Thread t1=new Thread() {
+ public void run() {
+ while (true) {
+ try {
+ sleep (10000);
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+ };
+ Thread t2=new Thread(t1);
+ Thread t3=new Thread("");
+
+ configThreadInstances=new Thread[]{t1,t2,t3};
+
+ cp.checkpoint();
+
+ }
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getName.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getName.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getName.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+import java.util.Hashtable;
+
+
+public class SetupJavaThread_getName {
+
+ public class MyThread extends Thread {
+ public Hashtable name = null;
+
+ public MyThread(Runnable r, String n) {
+ super(r,n);
+ }
+
+ }
+
+ public static String threadName = "a_special_thread";
+
+
+ public void configureJavaThread()
+ {
+ Runnable r=new Runnable() {
+
+ public void run() {
+ try {
+ Thread.sleep(1000000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }};
+
+ MyThread t=new MyThread(r,threadName);
+ t.start();
+ }
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getStackFrames.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getStackFrames.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getStackFrames.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/SetupJavaThread_getStackFrames.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+
+
+/**
+ *
+ * Tests JavaThread.getStackFrames(). Configures a thread with a known stack in
+ * the live JVM. Finds the thread, by name, in the dump and then retrieves it's
+ * JavaStackFrames and checks that the expected methods are there in the correct
+ * order. Ignores possible spurious methods inbetween the methods it does expect
+ * for implementation specifics.
+ *
+ */
+public class SetupJavaThread_getStackFrames {
+ public static final String threadName = "TestJavaThread_getStackFrames Thread";
+
+ public static String[] methodNames = { "wait", "methodC", "methodB", "methodA",
+ "run" };
+
+ public static class ContrivedThread extends Thread {
+ volatile private boolean running = false;
+
+ public boolean isRunning() {
+ return running;
+ }
+
+ public ContrivedThread(String name) {
+ super(name);
+ }
+
+ public void run() {
+ methodA(1);
+ }
+
+ public int methodA(int arg) {
+ return methodB(arg) + 1;
+ }
+
+ public int methodB(int arg) {
+ return methodC(arg, arg);
+ }
+
+ public synchronized int methodC(int arg1, int arg2) {
+ int total = arg1 + arg2;
+
+ this.running = true;
+
+ this.notify();
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ return total;
+ }
+ }
+
+ public void configureThreadStack() {
+ ContrivedThread thread = new ContrivedThread(threadName);
+ synchronized (thread) {
+ thread.start();
+ while (!thread.isRunning()) {
+ try {
+ thread.wait();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ //public JavaThread contrivedThread;
+}
Added: incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/TODOJavaMonitor_ObjectMonitors.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/TODOJavaMonitor_ObjectMonitors.java?rev=831930&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/TODOJavaMonitor_ObjectMonitors.java (added)
+++ incubator/kato/trunk/org.apache.kato/kato.testsuite.scenerio/src/main/java/org/apache/kato/tck/setup/javaruntime/TODOJavaMonitor_ObjectMonitors.java Mon Nov 2 15:47:01 2009
@@ -0,0 +1,320 @@
+/*******************************************************************************
+ * 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.setup.javaruntime;
+
+import javax.tools.diagnostics.runtime.java.JavaMonitor;
+
+
+/**
+ * Tests that monitors work correctly.
+ *
+ * Tests with variations on the number of notify waiters, enter waiters and owners,
+ * up to a maximum of 2 waiters of each type (there can be only one owner, of course).
+ *
+ * TODO Add tests where threads own one monitor and wait on another.
+ *
+ */
+public class TODOJavaMonitor_ObjectMonitors {
+ public static final String monitorNotifyThreadName = "NotifyThread";
+
+ public static final String monitorOwnerThreadName = "OwnerThread";
+
+ public static final String monitorEnterThreadName = "EnterThread";
+ public static final String namePrefix = "TestMonitors-";
+
+ /**
+ * A unique class to allow DTFJ to find the correct object.
+ *
+ */
+ public class MonitorClass {
+ private String id;
+
+ public MonitorClass(String id) {
+ this.id = id;
+ }
+ }
+
+ public static final String monitorClassName = MonitorClass.class.getName()
+ .replace('.', '/');
+
+ public static class MonitorThreadConfig {
+ public MonitorThreadConfig(int waiters, int enters, int owners) {
+ this.waiters = waiters;
+ this.enters = enters;
+ this.owners = owners;
+ this.id = generatePrefix(waiters, enters, owners);
+ }
+
+ public void setMonitor(JavaMonitor monitor) {
+ this.monitor = monitor;
+ }
+ public JavaMonitor getMonitor() {
+ return monitor;
+ }
+
+ String id;
+ int waiters, enters, owners;
+ private JavaMonitor monitor;
+
+ }
+
+ private static int NUM_MONITORS = 9;
+
+ static MonitorThreadConfig[] monitorConfigs;
+ {
+ int i=0;
+ monitorConfigs = new MonitorThreadConfig[NUM_MONITORS];
+
+ monitorConfigs[i++] = new MonitorThreadConfig(2, 2, 1);
+ monitorConfigs[i++] = new MonitorThreadConfig(0, 2, 1);
+ monitorConfigs[i++] = new MonitorThreadConfig(2, 0, 1);
+ monitorConfigs[i++] = new MonitorThreadConfig(2, 0, 0);
+ monitorConfigs[i++] = new MonitorThreadConfig(1, 1, 1);
+ monitorConfigs[i++] = new MonitorThreadConfig(1, 0, 1);
+ monitorConfigs[i++] = new MonitorThreadConfig(1, 0, 0);
+ monitorConfigs[i++] = new MonitorThreadConfig(0, 0, 1);
+ monitorConfigs[i++] = new MonitorThreadConfig(0, 1, 1);
+
+ }
+
+
+
+ public MonitorThreadConfig findMonitorThreadConfig(String id) {
+ for (int i = 0; i < monitorConfigs.length; i++) {
+ MonitorThreadConfig current = monitorConfigs[i];
+
+ if (current.id.equals(id)) {
+ return current;
+ }
+ }
+
+ return null;
+ }
+
+
+
+ public void configureMonitors() {
+ for (int i = 0; i < monitorConfigs.length; i++) {
+ createMonitor(monitorConfigs[i].waiters, monitorConfigs[i].enters,
+ monitorConfigs[i].owners);
+ }
+ }
+
+ private static String generatePrefix(int waiters, int enters, int owners) {
+ return namePrefix + waiters + "-" + owners + "-" + enters;
+ }
+
+ public void createMonitor(int waiters, int enters, int owners) {
+ String prefix = generatePrefix(waiters, enters, owners);
+
+ Object monitor = new MonitorClass(prefix);
+
+ // These rules are very important.
+ if (waiters == 0 && enters == 0 && owners == 0) {
+ throw new IllegalArgumentException(
+ "Can't create monitor with no threads");
+ }
+
+ if (waiters < 0 || enters < 0 || owners < 0) {
+ throw new IllegalArgumentException(
+ "Numbers of threads must be 0 or above.");
+ }
+
+ if (enters > 0 && owners == 0) {
+ throw new IllegalArgumentException(
+ "Can't create enters threads with no owner");
+ }
+
+ if (owners > 1) {
+ throw new IllegalArgumentException(
+ "Can't create monitor with more than one owner");
+ }
+
+ // The ordering is significant.
+ for (int i = 0; i < waiters; i++) {
+ new MonitorNotifyThread(prefix + "-" + monitorNotifyThreadName
+ + "-" + i, monitor).start();
+ }
+
+ for (int i = 0; i < owners; i++) {
+ new MonitorOwnerThread(prefix + "-" + monitorOwnerThreadName + "-"
+ + i, monitor).start();
+ }
+
+ for (int i = 0; i < enters; i++) {
+ new MonitorEnterThread(prefix + "-" + monitorEnterThreadName + "-"
+ + i, monitor).start();
+ }
+ }
+
+ public MonitorThreadConfig findMonitorThreadConfig(int waiters,
+ int enters, int owners) {
+ for (int i = 0; i < monitorConfigs.length; i++) {
+ MonitorThreadConfig current = monitorConfigs[i];
+
+ if ((current.waiters == waiters) && (current.enters == enters)
+ && (current.owners == owners)) {
+ return current;
+ }
+ }
+
+ return null;
+ }
+
+ public class MonitorNotifyThread extends Thread {
+ private Object monitor;
+ private volatile boolean almostReady = false;
+
+ public MonitorNotifyThread(String name, Object monitor) {
+ super(name);
+ this.setDaemon(true); // Allow JVM to exit.
+ this.monitor = monitor;
+ }
+
+ public void run() {
+ synchronized (monitor) {
+ synchronized (this) {
+ almostReady = true;
+ this.notify();
+ }
+ while (true) {
+ try {
+ monitor.wait();
+ } catch (InterruptedException e) {
+ // Keep waiting...
+ }
+ }
+ }
+ }
+
+ /**
+ * Start thread, and waits until the thread is about to release the
+ * monitor.
+ */
+ public void start() {
+ super.start();
+ synchronized (this) {
+ try {
+ while (!almostReady) {
+ this.wait();
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ }
+
+ /**
+ * A thread that tries to own a monitor.
+ *
+ */
+ public class MonitorOwnerThread extends Thread {
+ private Object monitor;
+ private volatile boolean owned = false;
+
+ public MonitorOwnerThread(String name, Object monitor) {
+ super(name);
+ this.setDaemon(true); // Allow JVM to exit.
+ this.monitor = monitor;
+ }
+
+ public void run() {
+ synchronized (monitor) {
+ synchronized (this) {
+ owned = true;
+ this.notify();
+ }
+ while (true) {
+ // We have either entered, or are entering.
+
+ try {
+ sleep(10000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ public void start() {
+ super.start();
+ synchronized (this) {
+ try {
+ while (!owned) {
+ this.wait();
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+ }
+
+ /**
+ * A thread that tries to enter a monitor.
+ *
+ */
+ public class MonitorEnterThread extends Thread {
+ private Object monitor;
+ private volatile boolean owned = false;
+
+ public MonitorEnterThread(String name, Object monitor) {
+ super(name);
+ this.setDaemon(true); // Allow JVM to exit.
+ this.monitor = monitor;
+ }
+
+ public void run() {
+ synchronized (this) {
+ owned = true;
+ this.notify();
+ }
+ synchronized (monitor) {
+ // This code should never be reached.
+ }
+ }
+
+ public void start() {
+ super.start();
+
+ synchronized (this) {
+
+ try {
+ while (!owned) {
+ this.wait();
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ try {
+ sleep(1000);
+ } catch (InterruptedException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+
+
+
+
+
+
+
+}