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 [5/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/TestJavaRuntime_getCompiledMethods.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getCompiledMethods.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getCompiledMethods.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getCompiledMethods.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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.CorruptDataException;
+import com.ibm.dtfj.java.JavaMethod;
+import com.ibm.dtfj.java.JavaRuntime;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaRuntime_getCompiledMethods extends TCKJavaRuntimeTestcase {
+	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);
+	}
+	
+	public void testHasCompiledMethods() {
+		JavaRuntime runtime=getJavaRuntime();
+		Iterator compiledMethods=runtime.getCompiledMethods();
+		assertNotNull(compiledMethods);
+		assertTrue(compiledMethods.hasNext());
+	}
+	
+	public void testConfiguredCompiledMethods() {
+		JavaRuntime runtime=getJavaRuntime();
+		Iterator compiledMethods=runtime.getCompiledMethods();
+		boolean found = false;
+		while (compiledMethods.hasNext() && !found) {
+			Object next = compiledMethods.next();
+			if (!(next instanceof JavaMethod)) {
+				continue;
+			}
+			JavaMethod method = (JavaMethod)next;
+			try {
+				String methodName = method.getName();
+				// System.out.println("Current method is: "+ methodName);
+				if ("jitMe".equals(methodName)) {
+					return;
+				}
+			} catch (CorruptDataException cde) {
+				assertNotNull(cde.getCorruptData());
+				continue;
+			}
+		}
+		fail("Compiled method not found");
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getHeapRoots.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getHeapRoots.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getHeapRoots.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaRuntime_getHeapRoots.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,508 @@
+/*******************************************************************************
+ * 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.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.MemoryAccessException;
+import com.ibm.dtfj.java.JavaClass;
+import com.ibm.dtfj.java.JavaClassLoader;
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.java.JavaReference;
+import com.ibm.dtfj.java.JavaRuntime;
+import com.ibm.dtfj.java.JavaThread;
+import com.ibm.dtfj.tck.api.ICheckpoint;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaRuntime_getHeapRoots extends TCKJavaRuntimeTestcase {
+	
+	private static final String DTFJ_STRING_TABLE_ROOT_TEST = "DTFJ StringTable root test";
+
+	private static Map rootsCheckList = null;
+	
+	private static JavaClass javaLangString = null;
+	
+	private static java.lang.ClassLoader cl = null;
+	
+	private HeapRootsTestUnfinalized unfinalizedObj = null;
+	
+	static class HeapRoot {
+		private Object root = null;
+		private int type = 0;
+		
+		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;
+		}
+		
+		public String toString() {
+			if (root instanceof JavaObject) {
+				JavaObject objectRoot = (JavaObject)root;
+				String objectId = null;
+				try {
+					objectId = objectRoot.getJavaClass().getName() + "@" + objectRoot.getID();
+				} catch (CorruptDataException e) {
+					assertNotNull(e.getCorruptData());
+					objectId = objectRoot.toString();
+				}
+				return "Root " + objectId + " of type \"" + getRootTypeDescription(type) + "\"";
+			} else {
+				return "Root " + root + " of type \"" + getRootTypeDescription(type) + "\"";
+			}
+		}
+		
+		public static String getRootTypeDescription(int type) {
+			switch (type) {
+			case JavaReference.HEAP_ROOT_CLASSLOADER:
+				return "Classloader";
+			case JavaReference.HEAP_ROOT_FINALIZABLE_OBJ:
+				return "Finalizable object";
+			case JavaReference.HEAP_ROOT_JNI_GLOBAL:
+				return "JNI Global";
+			case JavaReference.HEAP_ROOT_JNI_LOCAL:
+				return "JNI Local";
+			case JavaReference.HEAP_ROOT_MONITOR:
+				return "Monitor";
+			case JavaReference.HEAP_ROOT_OTHER:
+				return "Other root";
+			case JavaReference.HEAP_ROOT_STACK_LOCAL:
+				return "Stack local";
+			case JavaReference.HEAP_ROOT_STRINGTABLE:
+				return "String table";
+			case JavaReference.HEAP_ROOT_SYSTEM_CLASS:
+				return "System class";
+			case JavaReference.HEAP_ROOT_THREAD:
+				return "Thread";
+			case JavaReference.HEAP_ROOT_UNFINALIZED_OBJ:
+				return "Unfinalized object";
+			case JavaReference.HEAP_ROOT_UNKNOWN:
+				return "Unknown";
+			default:
+				return "<Unrecognized root 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);
+	}
+	
+	public void testSystemClassRoots() {
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		assertTrue("Found system classes not reported as roots.", checkSystemClasses(rootsCheckList));
+	}
+	
+	public void testThreadRoot() {
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		HeapRoot[] roots = searchRootByClassName(rootsCheckList, "HeapRootsTestThread", JavaReference.HEAP_ROOT_THREAD);
+		assertTrue("Found thread not reported as root.", roots.length != 0);
+	}
+	
+	public void testClassloaderRoot() {
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		HeapRoot[] roots = searchRootByClassName(rootsCheckList, "HeapRootsTestClassLoader", JavaReference.HEAP_ROOT_CLASSLOADER);
+		assertTrue("Found classloader not reported as root.", roots.length != 0);
+	}
+	
+	public void testUnfinalizedRoot() {
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		HeapRoot[] roots = searchRootByClassName(rootsCheckList, "HeapRootsTestUnfinalized", JavaReference.HEAP_ROOT_UNFINALIZED_OBJ);
+		assertTrue("Found unfinalized object not reported as root.", roots.length != 0);
+		
+	}
+
+	public void testFinalizableRoot() {
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		
+		HeapRoot[] roots = searchRootByClassName(rootsCheckList, "HeapRootsTestFinalizable", JavaReference.HEAP_ROOT_FINALIZABLE_OBJ);
+		assertTrue("Found finalizable object not reported as root.", roots.length != 0);
+		
+	}
+	
+	public void testStringTableRoot() {
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		HeapRoot[] roots = searchRootByClassName(rootsCheckList, "", JavaReference.HEAP_ROOT_STRINGTABLE);
+		HeapRoot currentRoot = null;
+		
+		JavaField countField = null;
+		JavaField valueField = null;
+		Iterator fields = javaLangString.getDeclaredFields();
+		while (fields.hasNext()) {
+			Object next = fields.next();
+			if (next instanceof JavaField) {
+				JavaField field = (JavaField) next;
+				try {
+					if (field.getName().equals("value")) {
+						valueField = field;
+					} else if (field.getName().equals("count")) {
+						countField = field;
+					}
+				} catch (CorruptDataException e) {
+					assertNotNull(e.getCorruptData());
+				}
+			}
+		}
+		
+		boolean found = false;
+		for (int i=0; i<roots.length; i++) {
+			currentRoot = roots[i];
+			Object rootObject = currentRoot.getRoot();
+			if (!(rootObject instanceof JavaObject)) {
+				continue;
+			}
+			JavaObject root = (JavaObject)rootObject;
+			
+			try {
+				int length = countField.getInt(root);
+				char[] contents = new char[length];
+				Object valueObj = valueField.get(root);
+				if (valueObj instanceof JavaObject) {
+					JavaObject value = (JavaObject)valueObj;
+					value.arraycopy(0, contents, 0, length);
+					
+				}
+				String currentString = new String(contents);
+				if (DTFJ_STRING_TABLE_ROOT_TEST.equals(currentString)) {
+					found = true;
+					break;
+				}
+			} catch (CorruptDataException e) {
+				assertNotNull(e.getCorruptData());
+				e.printStackTrace();
+			} catch (MemoryAccessException e) {
+				assertNotNull(e.getPointer());
+				e.printStackTrace();
+			}
+
+		}
+		assertTrue("Found stringtable not reported as root.", found);
+	}
+
+	
+/* to be moved to the JavaStackFrame#getHeapRoots()
+	public void testJavaParameters() {
+
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		assertTrue("Found local variable not reported as root.", checkRoot(rootsCheckList, "HeapRootsTestLocalVariableClass"));
+	}
+
+	public void testJavaLocalVariables() {
+
+		if (rootsCheckList == null) {
+			rootsCheckList = getRootsCheckList();
+		}
+		assertTrue("Found local variable not reported as root.", checkRoot(rootsCheckList, "HeapRootsTestLocalVariableClass"));
+	}
+*/
+	
+	private Map getRootsCheckList() {
+		JavaRuntime runtime = getJavaRuntime();
+		Map rootsCheckList = new HashMap();
+		Iterator roots = runtime.getHeapRoots();
+		while (roots.hasNext()) {
+			Object next = roots.next();
+			if (next instanceof CorruptData) {
+				continue;
+			}
+			JavaReference r = (JavaReference)next;
+			try {
+				Object root = r.getTarget();
+				int type = r.getRootType();
+				HeapRoot rootObject = new HeapRoot(root, type);
+				rootsCheckList.put(rootObject, Boolean.FALSE);
+				//System.out.println("Adding " + rootObject + " to rootCheckList" );
+			} catch (DataUnavailable du) {
+			} catch (CorruptDataException cde) {
+				assertNotNull(cde.getCorruptData());
+			}			
+		}
+		return rootsCheckList;
+	}
+
+	/** Tests whether all the system classes are correctly reported as roots */
+	// need to ignore primitive types
+	private boolean checkSystemClasses(Map rootsCheckList) {
+		JavaClassLoader systemClassLoader = getBootClassLoader();
+		Iterator systemClasses = systemClassLoader.getDefinedClasses();
+		boolean passed = true;
+		String systemClassName = null;
+		while (systemClasses.hasNext()) {
+			Object next = systemClasses.next();
+			if (next instanceof CorruptData) {
+				continue;
+			}
+			JavaClass systemClass = (JavaClass)next;
+			try {
+				systemClassName = systemClass.getName();
+			} catch (CorruptDataException e) {
+				assertNotNull(e.getCorruptData());
+				e.printStackTrace();
+			}
+
+			if (systemClassName.equals("java/lang/String")) {
+				javaLangString = systemClass; // to be used later on
+			}
+
+			// primitive types are reported as loaded by the System classloader, 
+			// so they can be found, but they are not scanned as roots
+			if (!(systemClassName.equals("void")
+					|| systemClassName.equals("boolean")
+					|| systemClassName.equals("byte")
+					|| systemClassName.equals("char")
+					|| systemClassName.equals("short")
+					|| systemClassName.equals("int")
+					|| systemClassName.equals("long")
+					|| systemClassName.equals("float")
+					|| systemClassName.equals("double")))
+			{
+				Object rootClass = rootsCheckList.get(new HeapRoot(systemClass,JavaReference.HEAP_ROOT_SYSTEM_CLASS));
+				if (rootClass == null) {
+					System.out.println("Found a class loaded by the system classloader which is NOT a root:" + systemClassName);
+					passed = false;
+				} else {
+					//System.out.println("Found root object for system class: " + systemClassName);
+					rootsCheckList.put(rootClass, Boolean.TRUE);
+				}
+			}
+		}
+		return passed;
+	}
+
+	private HeapRoot[] searchRootByClassName(Map rootCheckList, String classNameToSearch) {
+		return searchRootByClassName(rootCheckList, classNameToSearch, 0);
+	}
+
+	
+	private HeapRoot[] searchRootByClassName(Map rootCheckList, String classNameToSearch, int type) {
+		String className;
+		ArrayList roots = new ArrayList();
+		Iterator i = rootsCheckList.keySet().iterator();
+		while (i.hasNext()) {
+			Object next = i.next();
+			if (!(next instanceof HeapRoot)) {
+				continue;
+			}
+			HeapRoot rootObject = (HeapRoot)next;
+			Object root = rootObject.getRoot();
+			int rootType = rootObject.getType();
+			if (type != 0 && type != rootType) {
+				continue;
+			}
+			try {
+				if (root instanceof JavaObject) {
+					className = ((JavaObject)root).getJavaClass().getName();
+				} else if (root instanceof JavaClass) {
+					className = ((JavaClass)root).getName();
+				} else {
+					continue;
+				}
+				
+//				System.out.println("Checking root object of class: "+ className + " root type: " + HeapRoot.getRootTypeDescription(rootType));
+				if (className.endsWith(classNameToSearch)) {
+//					System.out.println("Found root object of class: "+ className + " root type: " + HeapRoot.getRootTypeDescription(rootType));
+					roots.add(rootObject);
+				}
+			} catch (CorruptDataException e) {
+				assertNotNull(e.getCorruptData());
+				continue;
+			}
+		}
+		//System.out.println("Root object of type " + classNameToSearch + " not found.");
+		HeapRoot[] heapRoots = (HeapRoot[])roots.toArray(new HeapRoot[0]);
+		return heapRoots;
+	}
+	
+	/**
+	 * This test applies only to JVMs whose thread roots only appear with the rest of the roots,
+	 * and not in JavaStackFrames because of conservative garbage collection.
+	 */
+	public void testJavaThreadRoots() throws Exception {
+		JavaThread thread = null;
+		
+		// Find the thread to match as a root source.
+		Iterator threads = getJavaRuntime().getThreads();
+		while(threads.hasNext()) {
+			JavaThread candidateThread = (JavaThread) threads.next();
+			if (javaLocalRootsthreadName.equals(candidateThread.getName())) {
+				thread = candidateThread;
+				break;
+			}
+		}
+		
+		assertNotNull("Couldn't find thread "+javaLocalRootsthreadName, thread);			
+		
+		// Set up a set of JavaObject class names to look for.
+		Set roots = new HashSet();
+		
+		roots.add(HeapRootsTestLocalVariable.class.getName().replace('.', '/'));
+		roots.add(HeapRootsTestParam.class.getName().replace('.', '/'));
+		
+		// Find all JavaObject heaproots that have our test thread as a source
+		// Remove their class names from our set of expected names.
+		Iterator rootIterator = getJavaRuntime().getHeapRoots();
+		while(rootIterator.hasNext()) {
+			JavaReference reference = (JavaReference) rootIterator.next();
+			
+			if (thread.equals(reference.getSource())) {
+				if(reference.getTarget() instanceof JavaObject) {
+					JavaObject target = (JavaObject) reference.getTarget();
+					roots.remove(target.getJavaClass().getName());
+				}
+			}
+
+		}
+		
+		// Create error string of missing object.
+		String remainingRoots="";
+		// uh-oh, we should have found all our roots
+		if(roots.size()>0) {
+			Iterator rootsLeft = roots.iterator();
+	
+			while(rootsLeft.hasNext()) {
+				remainingRoots += " " + ((String) rootsLeft.next());
+			}
+		}
+		
+		assertFalse("Thread roots not found: " + remainingRoots, roots.size() >0);
+	}
+
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaStackFrame_getHeapRoots.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaStackFrame_getHeapRoots.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaStackFrame_getHeapRoots.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaStackFrame_getHeapRoots.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 java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.java.JavaClass;
+import com.ibm.dtfj.java.JavaLocation;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.java.JavaReference;
+import com.ibm.dtfj.java.JavaRuntime;
+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;
+import com.ibm.dtfj.tck.tests.javaruntime.TestJavaRuntime_getHeapRoots.HeapRoot;
+
+public class TestJavaStackFrame_getHeapRoots extends TCKJavaRuntimeTestcase {
+	
+	
+	class HeapRootsTestParam {}
+	class HeapRootsTestLocalVariable {}
+
+	public static final String threadName = "com.ibm.dtfj.tck.tests.javaruntime.TestJavaStackFrame_getHeapRoots#configureJavaLocalsRoots";
+	private JavaStackFrame frame = null;     
+	private Map rootsCheckList = new HashMap();
+
+//	public String[] jvmDisableJIT()
+//	{
+//		System.out.println("Disabling JIT...");	
+//		return new String[]{"-Xint"};
+//	}
+
+
+	
+	public void setUp () {
+		JavaRuntime runtime = getJavaRuntime();
+		Iterator threads = runtime.getThreads();
+		JavaThread contrivedThread = null;
+		while (threads.hasNext()) {
+			Object next = threads.next();
+			
+			if (next instanceof JavaThread) {
+				JavaThread thread = (JavaThread) next;
+				try {
+					//System.out.println("Thread: " + thread.getName());
+					if (threadName.equals( thread.getName())) {
+//						System.out.println("Thread " + thread.getName() + " found!");
+						contrivedThread = thread;
+						break;
+					}
+				} catch (CorruptDataException e) {
+					assertNotNull(e.getCorruptData());
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+		}
+		if (contrivedThread == null) {
+			fail("Couldn't find thread "+threadName);
+		}
+
+		Iterator frames = contrivedThread.getStackFrames();
+		JavaStackFrame currentFrame = null;
+		while (frames.hasNext() && frame == null) {
+			Object next = frames.next();
+
+			if (next instanceof JavaStackFrame) {
+				currentFrame = (JavaStackFrame) next;
+				try {
+					JavaLocation location = currentFrame.getLocation();
+					String methodName = location.getMethod().getName();
+//					System.out.println("Method is: " + methodName + " "+ location.getFilename() + "@" + location.getLineNumber());
+					if ("methodA".equals(methodName)) {
+						frame = currentFrame;
+					}
+				} catch (Exception e) {
+					//e.printStackTrace();
+				}
+			}
+		}
+		
+		if (null == frame) {
+			fail("Couldn't find stack frame for methodA");
+		}
+		
+		Iterator roots = frame.getHeapRoots();
+		while (roots.hasNext()) {
+			Object next = roots.next();
+			if (next instanceof CorruptData) {
+				continue;
+			}
+			JavaReference r = (JavaReference)next;
+			try {
+				Object root = r.getTarget();
+				int type = r.getRootType();
+				HeapRoot rootObject = new HeapRoot(root, type);
+				rootsCheckList.put(rootObject, Boolean.FALSE);
+				//System.out.println("Adding " + rootObject + " to rootCheckList" );
+			} catch (DataUnavailable du) {
+			} catch (CorruptDataException cde) {
+				assertNotNull(cde.getCorruptData());
+			}			
+		}
+
+		
+	}
+
+
+	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);
+	}
+	
+	private HeapRoot[] searchRootByClassName(Map rootCheckList, String classNameToSearch) {
+		return searchRootByClassName(rootCheckList, classNameToSearch, 0);
+	}
+
+	
+	private HeapRoot[] searchRootByClassName(Map rootCheckList, String classNameToSearch, int type) {
+		String className;
+		ArrayList roots = new ArrayList();
+		Iterator i = rootsCheckList.keySet().iterator();
+		while (i.hasNext()) {
+			Object next = i.next();
+			if (!(next instanceof HeapRoot)) {
+				continue;
+			}
+			HeapRoot rootObject = (HeapRoot)next;
+			Object root = rootObject.getRoot();
+			int rootType = rootObject.getType();
+			if (type != 0 && type != rootType) {
+				continue;
+			}
+			try {
+				if (root instanceof JavaObject) {
+					className = ((JavaObject)root).getJavaClass().getName();
+				} else if (root instanceof JavaClass) {
+					className = ((JavaClass)root).getName();
+				} else {
+					continue;
+				}
+				if (className.endsWith(classNameToSearch)) {
+					//System.out.println("Found root object of class: "+ className + " root type: " + HeapRoot.getRootTypeDescription(rootType));
+//					synchronized (root) {
+//						rootsCheckList.put(root, Boolean.TRUE);
+//					}
+					roots.add(rootObject);
+				}
+			} catch (CorruptDataException e) {
+				assertNotNull(e.getCorruptData());
+				continue;
+			}
+		}
+		//System.out.println("Root object of type " + classNameToSearch + " not found.");
+		HeapRoot[] heapRoots = (HeapRoot[])roots.toArray(new HeapRoot[0]);
+		return heapRoots;
+	}
+
+	
+	public void testJavaLocalRoots() throws Exception {
+		HeapRoot[] roots = searchRootByClassName(rootsCheckList, "HeapRootsTestLocalVariable", JavaReference.HEAP_ROOT_STACK_LOCAL);
+		assertTrue("Found Local Variable object not reported as root.", roots.length != 0);
+	}
+
+	public void testParameterRoots() throws Exception {
+		HeapRoot[] roots = searchRootByClassName(rootsCheckList, "HeapRootsTestParam", JavaReference.HEAP_ROOT_STACK_LOCAL);
+		assertTrue("Found Local Variable object not reported as root.", roots.length != 0);
+	}
+
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThreadInspection.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThreadInspection.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThreadInspection.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThreadInspection.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * 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.CorruptDataException;
+import com.ibm.dtfj.image.MemoryAccessException;
+import com.ibm.dtfj.java.JavaField;
+import com.ibm.dtfj.java.JavaObject;
+import com.ibm.dtfj.java.JavaThread;
+import com.ibm.dtfj.tck.api.ICheckpoint;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ * Tests to ensure that valid Thread objects get reported correctly 
+ * 
+ */
+public class TestJavaThreadInspection extends TCKJavaRuntimeTestcase{
+
+
+public Thread[] configThreadInstances=null;
+private JavaObject[] threadDumpInstances=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();
+		
+	}
+
+	
+	
+	/**
+	 * Locate special holder
+	 * @throws CorruptDataException 
+	 * @throws MemoryAccessException 
+	 */
+	public void setUp() throws CorruptDataException, MemoryAccessException {
+				
+		JavaObject thisTestInstanceInDump=getThis();
+		assertNotNull(thisTestInstanceInDump);
+		
+		
+		Iterator i=thisTestInstanceInDump.getJavaClass().getDeclaredFields();
+		assertNotNull("declared fields iterator is null",i);
+		
+		while(i.hasNext()) {
+			Object o=i.next();
+			if(o instanceof JavaField) {
+				JavaField field=(JavaField) o;
+				String name=field.getName();
+				if(name.equals("configThreadInstances")) {
+					JavaObject obj=(JavaObject) field.get(thisTestInstanceInDump);
+					// found field
+				
+					int arraySize=obj.getArraySize();
+					assertEquals(3,arraySize);
+					threadDumpInstances=new JavaObject[arraySize];
+					obj.arraycopy(0,threadDumpInstances,0,arraySize);
+					return;
+				}
+				
+			}
+		}
+		
+		fail("unable to locate thread instances field in testcase instance in dump");
+		
+	}
+	
+	/** 
+	 * Test that the contents of a thread created using new Thread() can be 
+	 * retrieved
+	 */
+	public void testSimpleThreadCreation() throws Exception {
+		assertNotNull(threadDumpInstances);
+		JavaObject o1=threadDumpInstances[0];
+		
+		Thread t=new Thread();
+		JavaThread jt;
+		
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getName.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getName.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getName.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.Hashtable;
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.java.JavaRuntime;
+import com.ibm.dtfj.java.JavaThread;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+public class TestJavaThread_getName extends TCKJavaRuntimeTestcase {
+	
+	public class MyThread extends Thread {
+		public Hashtable name = null;
+		
+		public MyThread(Runnable r, String n) {
+			super(r,n);
+		}
+		
+	}
+
+	private 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();
+	}
+
+	/**
+	 * https://jtcid.hursley.ibm.com/dtfj/index.jsp 
+	 * 
+	 */
+
+	public void testJavaThread()
+	{
+		boolean foundThread = false;
+
+		JavaRuntime runtime=getJavaRuntime();
+
+		Iterator threads = runtime.getThreads();
+
+		while (threads.hasNext()) {
+			Object next = threads.next();
+
+			if (next instanceof CorruptData) {
+				System.err.println("returned CorruptData `" + next + "'");
+				break;
+			}
+
+			JavaThread thread = (JavaThread) next;
+
+			try {
+				if (0==threadName.compareTo(thread.getName())){
+					foundThread=true;
+				}
+			} catch (CorruptDataException e) {
+				assertNotNull(e.getCorruptData());
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		assertTrue(foundThread);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getStackFrames.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getStackFrames.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getStackFrames.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/javaruntime/TestJavaThread_getStackFrames.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * 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.CorruptDataException;
+import com.ibm.dtfj.java.JavaLocation;
+import com.ibm.dtfj.java.JavaRuntime;
+import com.ibm.dtfj.java.JavaStackFrame;
+import com.ibm.dtfj.java.JavaThread;
+import com.ibm.dtfj.tck.harness.TCKJavaRuntimeTestcase;
+
+/**
+ * 
+ * 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 TestJavaThread_getStackFrames extends TCKJavaRuntimeTestcase {
+	public static final String threadName = "TestJavaThread_getStackFrames Thread";
+
+	private 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 void setUp () {
+		JavaRuntime runtime = getJavaRuntime();
+		Iterator threads = runtime.getThreads();
+		
+		while (threads.hasNext()) {
+			Object next = threads.next();
+			
+			if (next instanceof JavaThread) {
+				JavaThread thread = (JavaThread) next;
+				
+				try {
+					if (threadName.equals( thread.getName())) {
+						contrivedThread = thread;
+						break;
+					}
+				} catch (CorruptDataException e) {
+					assertNotNull(e.getCorruptData());
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+		}
+		
+		if (contrivedThread == null) {
+			fail("Couldn't find thread "+threadName);
+		}
+	}
+
+	private JavaThread contrivedThread;
+
+	public void testGetStackFrames() throws Exception {
+		Iterator frames = contrivedThread.getStackFrames();
+		int methodIndex = 0;
+
+		while (frames.hasNext()) {
+			Object next = frames.next();
+
+			if (next instanceof JavaStackFrame) {
+				JavaStackFrame frame = (JavaStackFrame) next;
+
+				JavaLocation location = frame.getLocation();
+				
+				if ((methodIndex < methodNames.length)
+						&& methodNames[methodIndex].equals(location.getMethod().getName())) {
+					methodIndex++;
+				}
+
+			}
+		}
+
+		assertEquals("Didn't find all expected methods name. Couldn't find "
+				+ ((methodIndex < methodNames.length) ? methodNames[methodIndex] : ""), methodNames.length, methodIndex);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestEnvironmentVariables.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestEnvironmentVariables.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestEnvironmentVariables.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestEnvironmentVariables.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * 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.process;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.image.ImageAddressSpace;
+import com.ibm.dtfj.image.ImageProcess;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+public class TestEnvironmentVariables extends TCKProcessTestcase {
+
+	private static final String VALUE = "com.ibm.dtfj.tck.environment.test-value-176453";
+	private static final String KEY1 = "com.ibm.dtfj.tck.evironment-test-key-176453";
+	private static final String KEY2 = "com.ibm.dtfj.tck.evironment-test-key-93222";
+	private static final String KEY3 = "com.ibm.dtfj.tck.evironment-test-key-96545";
+	
+	/**
+	 * Env method called by collection stage of TCK to set envvars
+	 * @return
+	 */
+	public String[] envEnvironmentVariableRetrieved() {
+		return new String[]{KEY1+"="+VALUE,KEY2+"=",KEY3};
+	}
+
+	/**
+	 * Tests that provided environmental variable is in dump and has
+	 * correct value
+	 * @throws CorruptDataException 
+	 * @throws DataUnavailable 
+	 */
+	public void testEnvironmentVariableRetrievedKeyValuePair() throws DataUnavailable, CorruptDataException {
+
+	
+		// get image  process
+
+		
+		ImageProcess process=getProcess();
+		
+		// get environment 
+	
+			Properties properties=process.getEnvironment();
+			String value=properties.getProperty(KEY1);
+			assertEquals(VALUE,value);
+		
+
+	
+	}
+	/**
+	 * Tests that provided environmental variable is in dump and has
+	 * correct value
+	 * @throws CorruptDataException 
+	 * @throws DataUnavailable 
+	 */
+	public void testEnvironmentVariableRetrievedKeyOnly() throws DataUnavailable, CorruptDataException {
+
+	
+		// get image  process
+
+		
+		ImageProcess process=getProcess();
+		
+		// get environment 
+	
+			Properties properties=process.getEnvironment();
+			String value=properties.getProperty(KEY2);
+			assertEquals("key2 value should be empty String","",value);
+			
+
+	
+	}
+	/**
+	 * Tests that provided environmental variable is in dump and has
+	 * correct value
+	 * @throws CorruptDataException 
+	 * @throws DataUnavailable 
+	 */
+	public void testEnvironmentVariableRetrievedKeyNoValue() throws DataUnavailable, CorruptDataException {
+
+	
+		// get image  process
+
+		
+		ImageProcess process=getProcess();
+		
+		// get environment 
+	
+			Properties properties=process.getEnvironment();
+			String value=properties.getProperty(KEY3);
+			System.out.println("KEY3 "+KEY3+" value \""+value+"\"");
+			assertNull(value);
+			
+
+	
+	}
+	private ImageProcess getProcess() {
+		
+		Image image=getImage();
+		Iterator addressIterator=image.getAddressSpaces();
+		ImageAddressSpace addressSpace=(ImageAddressSpace) addressIterator.next();
+		ImageProcess process=addressSpace.getCurrentProcess();
+		return process;
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestImage.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestImage.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestImage.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/TestImage.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.tests.process;
+
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ * Image Tests
+ * 
+ *
+ */
+public class TestImage extends TCKProcessTestcase{
+
+	/**
+	 * Simple test that image exists
+	 */
+	public void testImageExists() {
+
+		Image image=getImage();
+		assertNotNull(image);
+
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageAddressSpace.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageAddressSpace.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageAddressSpace.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageAddressSpace.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.process.image;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.image.ImageAddressSpace;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ * ImageAddressSpace
+ * 
+ */
+public class TestImageAddressSpace extends TCKProcessTestcase{
+
+	/**
+	 *
+	 */
+	public void testAddressSpace() {
+
+		Image image=getImage();
+		Iterator addressSpaces = image.getAddressSpaces();
+
+		while (addressSpaces.hasNext()) {
+			Object nextAddressSpace = addressSpaces.next();
+			if (nextAddressSpace instanceof CorruptData) {
+				System.err.println("returned CorruptData `" + nextAddressSpace + "'");
+				break;
+			}
+
+			ImageAddressSpace anAddressSpace = (ImageAddressSpace) nextAddressSpace;
+
+			assertNotNull(anAddressSpace);
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetCreationTime.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetCreationTime.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetCreationTime.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetCreationTime.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+public class TestImageGetCreationTime extends TCKProcessTestcase{
+
+	
+
+	public void testGetCreationTime() throws Exception {
+
+		Image image=getImage();
+		long theCreationTime=0;
+		try {
+			theCreationTime = image.getCreationTime();
+			assertTrue(0!=theCreationTime);
+		} catch (DataUnavailable du) {
+			//allowed by the specification
+		}
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetHostName.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetHostName.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetHostName.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetHostName.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+public class TestImageGetHostName extends TCKProcessTestcase{
+
+	/**
+	 *
+	 */
+	public void testGetHostName() {
+
+		Image image=getImage();
+		String theHostName=null;
+		try {
+			theHostName = image.getHostName();
+		} catch (CorruptDataException e) {
+			// allowed by the specification
+			return;
+		} catch (DataUnavailable e) {
+			// allowed by the specification
+			return;
+		}
+
+		assertNotNull(theHostName);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetIPAddresses.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetIPAddresses.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetIPAddresses.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetIPAddresses.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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.process.image;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+public class TestImageGetIPAddresses extends TCKProcessTestcase{
+
+	/**
+	 *
+	 */
+	public void testGetIPAddresses() {
+
+		Image image=getImage();
+		Iterator IPAdresses;
+		try {
+			IPAdresses = image.getIPAddresses();
+			while (IPAdresses.hasNext()) {
+				Object nextIPAddress = IPAdresses.next();
+				if (nextIPAddress instanceof CorruptData) {
+					System.err.println("returned CorruptData `" + nextIPAddress + "'");
+					break;
+				}
+				else
+				{
+					return;
+				}
+			}
+
+		} catch (DataUnavailable e) {
+			//this is acceptable
+			return;
+		}
+		assertTrue(false);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetInstalledMemory.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetInstalledMemory.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetInstalledMemory.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetInstalledMemory.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+public class TestImageGetInstalledMemory extends TCKProcessTestcase{
+
+	/*
+	 *
+	 */
+	public void testGetInstalledMemory() {
+
+		Image image=getImage();
+		long theMemory=0;
+		try {
+			theMemory = image.getInstalledMemory();
+			// TODO test range is acceptable
+			assertTrue(0!=theMemory);
+		} catch (DataUnavailable e) {
+			// DataUnavailable is an acceptable return from getInstalledMemory()
+		}
+
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorCount.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorCount.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorCount.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorCount.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+public class TestImageGetProcessorCount extends TCKProcessTestcase{
+
+	/**
+	 * @throws DataUnavailable 
+	 * 
+	 * @tck     
+	 */
+	public void testGet() throws DataUnavailable {
+
+		Image image=getImage();
+		long theValue=0;
+	
+			theValue = image.getProcessorCount();
+			System.out.println("theValue "+theValue);
+			assertTrue(0!=theValue);
+		
+
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorSubType.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorSubType.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorSubType.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorSubType.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+
+public class TestImageGetProcessorSubType extends TCKProcessTestcase{
+
+	/**
+	 * @throws CorruptDataException 
+	 * @throws DataUnavailable 
+	 *
+	 */
+	public void testGet() throws DataUnavailable, CorruptDataException {
+
+		Image image=getImage();
+		String theValue=image.getProcessorSubType();
+		assertNotNull("Processor subType is null",theValue);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorType.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorType.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorType.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetProcessorType.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+
+public class TestImageGetProcessorType extends TCKProcessTestcase{
+
+	/**
+	 * @throws CorruptDataException 
+	 * @throws DataUnavailable 
+	 *
+	 */
+	public void testGetProcessorType() throws DataUnavailable, CorruptDataException {
+
+		Image image=getImage();
+		String theValue=image.getProcessorType();
+		assertNotNull("Processor type is null",theValue);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemSubType.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemSubType.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemSubType.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemSubType.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+
+public class TestImageGetSystemSubType extends TCKProcessTestcase{
+
+	/**
+	 * @throws CorruptDataException 
+	 * @throws DataUnavailable 
+	 *
+	 */
+	public void testGetSystemSubType() throws DataUnavailable, CorruptDataException {
+
+		Image image=getImage();
+		String theValue=image.getSystemSubType();
+		assertNotNull("System subtype is null",theValue);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemType.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemType.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemType.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/process/image/TestImageGetSystemType.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.process.image;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+
+public class TestImageGetSystemType extends TCKProcessTestcase {
+
+	/**
+	 * @throws CorruptDataException 
+	 * @throws DataUnavailable 
+	 *
+	 */
+	public void testGet() throws DataUnavailable, CorruptDataException {
+
+		Image image = getImage();
+		String theValue = null;
+		theValue = image.getSystemType();
+		assertNotNull("SystemType is null",theValue);
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateAIXClassTag.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateAIXClassTag.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateAIXClassTag.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateAIXClassTag.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.tagvalidation;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ * @os aix
+ *
+ * A TCK Tag validation testcase to ensure that the aix 
+ * tag is honoured correctly during tck execution
+ */
+public class TestValidateAIXClassTag extends TCKProcessTestcase{
+	
+
+public void testMethod() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue(lowercase.startsWith("aix"));
+		
+	}
+	
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateDumpTypeMethodTag.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateDumpTypeMethodTag.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateDumpTypeMethodTag.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateDumpTypeMethodTag.java Mon Mar 16 16:42:39 2009
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.tck.tests.tagvalidation;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.api.TCKConfiguration;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ *  
+ *
+ * A TCK Tag validation testcase to ensure that the dump type 
+ * tag is honoured correctly during tck execution
+ */
+public class TestValidateDumpTypeMethodTag extends TCKProcessTestcase{
+	
+/**
+ * @dumptype sdff
+ * @throws DataUnavailable
+ * @throws CorruptDataException
+ */
+	
+public void testSdffTag() throws DataUnavailable, CorruptDataException {
+		
+		
+		assertEquals("Expecting dump type to be sdff","sdff",getDumpType());
+		
+	}
+
+
+
+/**
+ * @dumptype svc
+ * @throws DataUnavailable
+ * @throws CorruptDataException
+ */
+	
+public void testSvcTag() throws DataUnavailable, CorruptDataException {
+		
+	assertEquals("Expecting dump type to be svc","svc",getDumpType());
+		
+	}
+	
+
+private String getDumpType() {
+	TCKConfiguration config=getConfiguration();
+	String dumpType=config.getDumpType();
+	return dumpType;
+}
+	
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateLinuxClassTag.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateLinuxClassTag.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateLinuxClassTag.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateLinuxClassTag.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.tagvalidation;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ * @os linux
+ *
+ * A TCK Tag validation testcase to ensure that the linux
+ * tag is honoured correctly during tck execution
+ */
+public class TestValidateLinuxClassTag extends TCKProcessTestcase{
+	
+
+	public void testMethod() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue(lowercase.startsWith("linux"));
+		
+	}
+	
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOS390ClassTag.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOS390ClassTag.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOS390ClassTag.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOS390ClassTag.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.tagvalidation;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ * @os os390
+ *
+ * A TCK Tag validation testcase to ensure that the os390
+ * tag is honoured correctly during tck execution
+ */
+public class TestValidateOS390ClassTag extends TCKProcessTestcase{
+	
+
+public void testMethod() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue(lowercase.startsWith("os/390"));
+		
+	}
+	
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOSMethodTag.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOSMethodTag.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOSMethodTag.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateOSMethodTag.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.tagvalidation;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ * 
+ *
+ * A TCK Tag validation testcase to ensure that the os
+ * tag is honoured correctly during tck execution
+ */
+public class TestValidateOSMethodTag extends TCKProcessTestcase{
+	
+
+	/**
+	 * @os linux
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	public void testMethodLinux() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue(lowercase.startsWith("linux"));
+		
+	}
+	
+	/**
+	 * @os windows
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	public void testMethodWindows() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue(lowercase.startsWith("windows"));
+		
+	}
+	/**
+	 * @os aix
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	public void testMethodAIX() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue(lowercase.startsWith("aix"));
+		
+	}
+	/**
+	 * @os os390
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	public void testMethodOS390() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue(lowercase.startsWith("os/390"));
+		
+	}
+}

Added: incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateWindowsClassTag.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateWindowsClassTag.java?rev=754945&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateWindowsClassTag.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.tck.tests/src/com/ibm/dtfj/tck/tests/tagvalidation/TestValidateWindowsClassTag.java Mon Mar 16 16:42:39 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 com.ibm.dtfj.tck.tests.tagvalidation;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.Image;
+import com.ibm.dtfj.tck.harness.TCKProcessTestcase;
+
+/**
+ * @os windows
+ *
+ * A TCK Tag validation testcase to ensure that the windows 
+ * tag is honoured correctly during tck execution
+ */
+public class TestValidateWindowsClassTag extends TCKProcessTestcase{
+	
+
+public void testMethod() throws DataUnavailable, CorruptDataException {
+		
+		Image image=getImage();
+		String osname=image.getSystemType();
+		String lowercase=osname.toLowerCase();
+		
+		assertTrue("Not expected operating system got ("+osname+")",lowercase.startsWith("windows"));
+		
+	}
+	
+}



Mime
View raw message