incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monte...@apache.org
Subject svn commit: r883384 [34/47] - in /incubator/kato/trunk/org.apache.kato: ./ kato.anttasks/src/main/java/org/apache/kato/anttasks/ kato.anttasks/src/main/java/org/apache/kato/anttasks/sitebuilder/ kato.anttasks/src/main/java/org/apache/kato/anttasks/tck/...
Date Mon, 23 Nov 2009 15:54:15 GMT
Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractImageTestcase.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractImageTestcase.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractImageTestcase.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractImageTestcase.java Mon Nov 23 15:53:48 2009
@@ -1,270 +1,270 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-import java.util.Iterator;
-import java.util.List;
-
-import javax.tools.diagnostics.image.CorruptData;
-import javax.tools.diagnostics.image.CorruptDataException;
-import javax.tools.diagnostics.image.DataUnavailable;
-import javax.tools.diagnostics.image.Image;
-import javax.tools.diagnostics.image.ImageAddressSpace;
-import javax.tools.diagnostics.image.ImageFactory;
-import javax.tools.diagnostics.image.ImageModule;
-import javax.tools.diagnostics.image.ImageProcess;
-import javax.tools.diagnostics.image.ImageThread;
-import javax.tools.diagnostics.runtime.java.JavaClass;
-import javax.tools.diagnostics.runtime.java.JavaClassLoader;
-import javax.tools.diagnostics.runtime.java.JavaHeap;
-import javax.tools.diagnostics.runtime.java.JavaMethod;
-import javax.tools.diagnostics.runtime.java.JavaObject;
-import javax.tools.diagnostics.runtime.java.JavaRuntime;
-import javax.tools.diagnostics.runtime.java.JavaThread;
-
-import org.apache.kato.tck.harness.TCKProcessTestcase;
-import org.apache.kato.tests.junit.ImageLoaderHelper.Capabilities;
-
-
-public abstract class AbstractImageTestcase extends TCKProcessTestcase {
-
-	private static Capabilities capabilities = null;
-	
-	public  ImageProcess defaultImageProcess() {
-		if(_proc==null)  _proc= defaultAddressSpace().getCurrentProcess();
-		return _proc;
-	}
-
-	public  ImageAddressSpace defaultAddressSpace() {
-		Image image = defaultTestingImage();
-		
-		//TODO: come up with a good way to test each address space.  For now we will just grab the first one
-		return (ImageAddressSpace) image.getAddressSpaces().get(0);
-	}
-
-	/**
-	 * Returns the Image for testing, creating it if necessary
-	 * @return The default testing image
-	 */
-	public  Image defaultTestingImage() {
-		
-		
-		try {
-			if (null == capabilities) {
-				capabilities=new ImageLoaderHelper().getCapabilities();
-			}
-		} catch (Throwable t) {
-			t.printStackTrace();
-			fail();
-		}
-		return capabilities.image;
-	}
-
-	
-	private ImageProcess _proc = null;
-	private ImageModule _module = null;
-
-	
-
-	public ImageModule defaultImageModule() {
-		
-		if(_module!=null)  return _module;
-		
-		ImageProcess proc = defaultImageProcess();
-		List it = null;
-		
-		try {
-			it = proc.getLibraries();
-		} catch (DataUnavailable e) {
-			//ok
-		} catch (CorruptDataException e) {
-			//ok
-		}
-		if (null == it) {
-			//we have nothing to test so throw unimplemented so we know it isn't a real bug
-			throw new TestNotImplementedException();
-		}
-		_module=(ImageModule) it.get(0);
-		return _module;
-	}
-
-	public ImageFactory getFactory() {
-		return capabilities.factory;
-	}
-
-	public JavaRuntime defaultJavaRuntime() {
-		JavaRuntime runtime = null;
-		Iterator it = defaultImageProcess().getRuntimes().iterator();
-		
-		assertFalse(null == it);
-		while ((null == runtime) && (it.hasNext())) {
-			Object maybeRuntime = it.next();
-			if (maybeRuntime instanceof JavaRuntime) {
-				runtime = (JavaRuntime) maybeRuntime;
-			} else {
-				throw new TestNotImplementedException();
-			}
-		}
-		assertNotNull(runtime);
-		return runtime;
-	}
-
-	public JavaThread defaultJavaThread() {
-		JavaRuntime time = defaultJavaRuntime();
-		assertNotNull(time);
-		Iterator it = time.getThreads().iterator();
-		assertNotNull(it);
-		assertTrue(it.hasNext());
-		//threads without stack frames aren't very useful for testing so ignore them
-		// unless they are the only ones
-		JavaThread candidate = null;
-		do {
-			candidate = (JavaThread) it.next();
-		} while ((it.hasNext()) && (!candidate.getStackFrames().iterator().hasNext()));
-		return candidate;
-	}
-
-	public JavaClassLoader defaultJavaClassLoader() {
-		Iterator loaders =  defaultJavaRuntime().getJavaClassLoaders().iterator();
-		assertTrue(loaders.hasNext());
-		JavaClassLoader loader = (JavaClassLoader) loaders.next();
-		Iterator i=loader.getDefinedClasses().iterator();
-		while ((!i.hasNext()) && (loaders.hasNext())) {
-			loader = (JavaClassLoader) loaders.next();
-		}
-		return loader;
-	}
-
-	public JavaClass defaultJavaClass() {
-		// Choose a class loader
-		JavaClassLoader loader = defaultJavaClassLoader();
-		
-		// Choose a class which has a superclass
-		try {
-			for (Iterator iter = loader.getDefinedClasses().iterator(); iter.hasNext();) {
-				JavaClass clazz = (JavaClass) iter.next();
-				if ( !clazz.getName().equals("java/lang/Object") &&
-				     !clazz.getName().equals("boolean"         ) &&
-				     !clazz.getName().equals("byte"            ) &&						
-				     !clazz.getName().equals("char"            ) &&		
-				     !clazz.getName().equals("double"          ) &&		
-				     !clazz.getName().equals("float"           ) &&		
-				     !clazz.getName().equals("int"             ) &&		
-				     !clazz.getName().equals("long"            ) &&		
-				     !clazz.getName().equals("short"           ) &&		
-				     !clazz.getName().equals("void"            ) &&		
-				     !clazz.isArray()                               ) {			
-					return clazz;
-				}
-			}
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-		return null;
-	}
-
-	public JavaHeap defaultJavaHeap() {
-		JavaRuntime runtime  = defaultJavaRuntime();
-		Iterator it = runtime.getHeaps().iterator();
-		assertNotNull(it);
-		assertTrue(it.hasNext());
-		JavaHeap heap = (JavaHeap) it.next();
-
-		// This should use Middleware Heap as default
-		// move on to Middleware Heap
-		if (heap.getName().equalsIgnoreCase("System Heap")){
-			heap = (JavaHeap) it.next();
-			if (heap.getName().equalsIgnoreCase("Transient Heap")){
-				heap = (JavaHeap) it.next();
-			}				
-		}
-
-		return (JavaHeap) heap;
-	}
-
-	public JavaObject defaultJavaObject(boolean isArray) {
-		JavaObject foundObject = null;
-		JavaHeap heap = defaultJavaHeap();
-		Iterator objects = heap.getObjects().iterator();
-		
-		while ((null == foundObject) && (objects.hasNext())) {
-			JavaObject oneObject = (JavaObject) objects.next();
-			
-			try {
-				if (isArray) {
-					// We need any array object with at least one element
-					if (oneObject.isArray()) {
-						if (oneObject.getArraySize() > 0) {
-							foundObject = oneObject;
-						}
-					}
-				} else {
-					// We need a non-array, non-trivial object with at least two declared fields
-					if ( (!oneObject.isArray()) && (!oneObject.getJavaClass().getName().equals("java/lang/Object"))) {
-						Iterator declaredFields=oneObject.getJavaClass().getDeclaredFields().iterator();
-						if (declaredFields.hasNext()) {
-							declaredFields.next();
-							if (declaredFields.hasNext()) {
-								foundObject = oneObject;
-							}
-						}
-					}
-				}
-			} catch (CorruptDataException e) {
-				//just ignore this one
-			}
-		}
-		return foundObject;
-	}
-
-	public ImageThread defaultImageThread() {
-		Iterator it = defaultImageProcess().getThreads().iterator();
-		
-		assertNotNull(it);
-		assertTrue(it.hasNext());
-		
-		ImageThread thread = null;
-		while (null == thread && it.hasNext()) {
-			Object next = it.next();
-			if (next instanceof CorruptData)
-				continue;
-			thread = (ImageThread) next;
-		}
-		
-		if (null == thread)
-			throw new TestNotImplementedException();
-	
-		return thread;
-	}
-
-	public JavaMethod defaultJavaMethod() {
-		JavaRuntime runtime = defaultJavaRuntime();
-		Iterator it = runtime.getCompiledMethods().iterator();
-		if (it.hasNext()) {
-			return (JavaMethod) it.next();
-		} else {
-			System.err.println("Warning:  No compiled methods found!  This core must have been without JIT!");
-			throw new TestNotImplementedException();
-		}
-	}
-
-	protected void setUp() throws Exception {
-		
-		if(capabilities==null) capabilities=new ImageLoaderHelper().getCapabilities();
-	}
-
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.tools.diagnostics.image.CorruptData;
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.image.DataUnavailable;
+import javax.tools.diagnostics.image.Image;
+import javax.tools.diagnostics.image.ImageAddressSpace;
+import javax.tools.diagnostics.image.ImageFactory;
+import javax.tools.diagnostics.image.ImageModule;
+import javax.tools.diagnostics.image.ImageProcess;
+import javax.tools.diagnostics.image.ImageThread;
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaClassLoader;
+import javax.tools.diagnostics.runtime.java.JavaHeap;
+import javax.tools.diagnostics.runtime.java.JavaMethod;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+import javax.tools.diagnostics.runtime.java.JavaThread;
+
+import org.apache.kato.tck.harness.TCKProcessTestcase;
+import org.apache.kato.tests.junit.ImageLoaderHelper.Capabilities;
+
+
+public abstract class AbstractImageTestcase extends TCKProcessTestcase {
+
+	private static Capabilities capabilities = null;
+	
+	public  ImageProcess defaultImageProcess() {
+		if(_proc==null)  _proc= defaultAddressSpace().getCurrentProcess();
+		return _proc;
+	}
+
+	public  ImageAddressSpace defaultAddressSpace() {
+		Image image = defaultTestingImage();
+		
+		//TODO: come up with a good way to test each address space.  For now we will just grab the first one
+		return (ImageAddressSpace) image.getAddressSpaces().get(0);
+	}
+
+	/**
+	 * Returns the Image for testing, creating it if necessary
+	 * @return The default testing image
+	 */
+	public  Image defaultTestingImage() {
+		
+		
+		try {
+			if (null == capabilities) {
+				capabilities=new ImageLoaderHelper().getCapabilities();
+			}
+		} catch (Throwable t) {
+			t.printStackTrace();
+			fail();
+		}
+		return capabilities.image;
+	}
+
+	
+	private ImageProcess _proc = null;
+	private ImageModule _module = null;
+
+	
+
+	public ImageModule defaultImageModule() {
+		
+		if(_module!=null)  return _module;
+		
+		ImageProcess proc = defaultImageProcess();
+		List it = null;
+		
+		try {
+			it = proc.getLibraries();
+		} catch (DataUnavailable e) {
+			//ok
+		} catch (CorruptDataException e) {
+			//ok
+		}
+		if (null == it) {
+			//we have nothing to test so throw unimplemented so we know it isn't a real bug
+			throw new TestNotImplementedException();
+		}
+		_module=(ImageModule) it.get(0);
+		return _module;
+	}
+
+	public ImageFactory getFactory() {
+		return capabilities.factory;
+	}
+
+	public JavaRuntime defaultJavaRuntime() {
+		JavaRuntime runtime = null;
+		Iterator it = defaultImageProcess().getRuntimes().iterator();
+		
+		assertFalse(null == it);
+		while ((null == runtime) && (it.hasNext())) {
+			Object maybeRuntime = it.next();
+			if (maybeRuntime instanceof JavaRuntime) {
+				runtime = (JavaRuntime) maybeRuntime;
+			} else {
+				throw new TestNotImplementedException();
+			}
+		}
+		assertNotNull(runtime);
+		return runtime;
+	}
+
+	public JavaThread defaultJavaThread() {
+		JavaRuntime time = defaultJavaRuntime();
+		assertNotNull(time);
+		Iterator it = time.getThreads().iterator();
+		assertNotNull(it);
+		assertTrue(it.hasNext());
+		//threads without stack frames aren't very useful for testing so ignore them
+		// unless they are the only ones
+		JavaThread candidate = null;
+		do {
+			candidate = (JavaThread) it.next();
+		} while ((it.hasNext()) && (!candidate.getStackFrames().iterator().hasNext()));
+		return candidate;
+	}
+
+	public JavaClassLoader defaultJavaClassLoader() {
+		Iterator loaders =  defaultJavaRuntime().getJavaClassLoaders().iterator();
+		assertTrue(loaders.hasNext());
+		JavaClassLoader loader = (JavaClassLoader) loaders.next();
+		Iterator i=loader.getDefinedClasses().iterator();
+		while ((!i.hasNext()) && (loaders.hasNext())) {
+			loader = (JavaClassLoader) loaders.next();
+		}
+		return loader;
+	}
+
+	public JavaClass defaultJavaClass() {
+		// Choose a class loader
+		JavaClassLoader loader = defaultJavaClassLoader();
+		
+		// Choose a class which has a superclass
+		try {
+			for (Iterator iter = loader.getDefinedClasses().iterator(); iter.hasNext();) {
+				JavaClass clazz = (JavaClass) iter.next();
+				if ( !clazz.getName().equals("java/lang/Object") &&
+				     !clazz.getName().equals("boolean"         ) &&
+				     !clazz.getName().equals("byte"            ) &&						
+				     !clazz.getName().equals("char"            ) &&		
+				     !clazz.getName().equals("double"          ) &&		
+				     !clazz.getName().equals("float"           ) &&		
+				     !clazz.getName().equals("int"             ) &&		
+				     !clazz.getName().equals("long"            ) &&		
+				     !clazz.getName().equals("short"           ) &&		
+				     !clazz.getName().equals("void"            ) &&		
+				     !clazz.isArray()                               ) {			
+					return clazz;
+				}
+			}
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+		return null;
+	}
+
+	public JavaHeap defaultJavaHeap() {
+		JavaRuntime runtime  = defaultJavaRuntime();
+		Iterator it = runtime.getHeaps().iterator();
+		assertNotNull(it);
+		assertTrue(it.hasNext());
+		JavaHeap heap = (JavaHeap) it.next();
+
+		// This should use Middleware Heap as default
+		// move on to Middleware Heap
+		if (heap.getName().equalsIgnoreCase("System Heap")){
+			heap = (JavaHeap) it.next();
+			if (heap.getName().equalsIgnoreCase("Transient Heap")){
+				heap = (JavaHeap) it.next();
+			}				
+		}
+
+		return (JavaHeap) heap;
+	}
+
+	public JavaObject defaultJavaObject(boolean isArray) {
+		JavaObject foundObject = null;
+		JavaHeap heap = defaultJavaHeap();
+		Iterator objects = heap.getObjects().iterator();
+		
+		while ((null == foundObject) && (objects.hasNext())) {
+			JavaObject oneObject = (JavaObject) objects.next();
+			
+			try {
+				if (isArray) {
+					// We need any array object with at least one element
+					if (oneObject.isArray()) {
+						if (oneObject.getArraySize() > 0) {
+							foundObject = oneObject;
+						}
+					}
+				} else {
+					// We need a non-array, non-trivial object with at least two declared fields
+					if ( (!oneObject.isArray()) && (!oneObject.getJavaClass().getName().equals("java/lang/Object"))) {
+						Iterator declaredFields=oneObject.getJavaClass().getDeclaredFields().iterator();
+						if (declaredFields.hasNext()) {
+							declaredFields.next();
+							if (declaredFields.hasNext()) {
+								foundObject = oneObject;
+							}
+						}
+					}
+				}
+			} catch (CorruptDataException e) {
+				//just ignore this one
+			}
+		}
+		return foundObject;
+	}
+
+	public ImageThread defaultImageThread() {
+		Iterator it = defaultImageProcess().getThreads().iterator();
+		
+		assertNotNull(it);
+		assertTrue(it.hasNext());
+		
+		ImageThread thread = null;
+		while (null == thread && it.hasNext()) {
+			Object next = it.next();
+			if (next instanceof CorruptData)
+				continue;
+			thread = (ImageThread) next;
+		}
+		
+		if (null == thread)
+			throw new TestNotImplementedException();
+	
+		return thread;
+	}
+
+	public JavaMethod defaultJavaMethod() {
+		JavaRuntime runtime = defaultJavaRuntime();
+		Iterator it = runtime.getCompiledMethods().iterator();
+		if (it.hasNext()) {
+			return (JavaMethod) it.next();
+		} else {
+			System.err.println("Warning:  No compiled methods found!  This core must have been without JIT!");
+			throw new TestNotImplementedException();
+		}
+	}
+
+	protected void setUp() throws Exception {
+		
+		if(capabilities==null) capabilities=new ImageLoaderHelper().getCapabilities();
+	}
+
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AbstractImageTestcase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AllTests.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AllTests.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AllTests.java Mon Nov 23 15:53:48 2009
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
-	public static Test suite() {
-		TestSuite suite = new TestSuite("Test for org.apache.kato.tests.junit");
-		//$JUnit-BEGIN$
-		suite.addTestSuite(JavaRuntimeTest.class);
-		suite.addTestSuite(ImageProcessTest.class);
-		suite.addTestSuite(ImageTest.class);
-		suite.addTestSuite(ImageAddressSpaceTest.class);
-		suite.addTestSuite(ImageModuleTest.class);
-		suite.addTestSuite(JavaThreadTest.class);
-		suite.addTestSuite(ImageThreadTest.class);
-		suite.addTestSuite(JavaStackFrameTest.class);
-		suite.addTestSuite(JavaMonitorTest.class);
-		suite.addTestSuite(JavaMethodTest.class);
-		suite.addTestSuite(ImageSectionTest.class);
-		suite.addTestSuite(JavaHeapTest.class);
-		suite.addTestSuite(JavaClassLoaderTest.class);
-		suite.addTestSuite(JavaClassTest.class);
-		suite.addTestSuite(JavaObjectTest.class);
-		suite.addTestSuite(ImagePointerTest.class);
-		suite.addTestSuite(ImageRegisterTest.class);
-		suite.addTestSuite(ImageStackFrameTest.class);
-		suite.addTestSuite(ImageSymbolTest.class);
-		suite.addTestSuite(JavaFieldTest.class);
-		suite.addTestSuite(JavaLocationTest.class);
-		suite.addTestSuite(ImageFactoryTest.class);
-		//$JUnit-END$
-		return suite;
-	}
-
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite("Test for org.apache.kato.tests.junit");
+		//$JUnit-BEGIN$
+		suite.addTestSuite(JavaRuntimeTest.class);
+		suite.addTestSuite(ImageProcessTest.class);
+		suite.addTestSuite(ImageTest.class);
+		suite.addTestSuite(ImageAddressSpaceTest.class);
+		suite.addTestSuite(ImageModuleTest.class);
+		suite.addTestSuite(JavaThreadTest.class);
+		suite.addTestSuite(ImageThreadTest.class);
+		suite.addTestSuite(JavaStackFrameTest.class);
+		suite.addTestSuite(JavaMonitorTest.class);
+		suite.addTestSuite(JavaMethodTest.class);
+		suite.addTestSuite(ImageSectionTest.class);
+		suite.addTestSuite(JavaHeapTest.class);
+		suite.addTestSuite(JavaClassLoaderTest.class);
+		suite.addTestSuite(JavaClassTest.class);
+		suite.addTestSuite(JavaObjectTest.class);
+		suite.addTestSuite(ImagePointerTest.class);
+		suite.addTestSuite(ImageRegisterTest.class);
+		suite.addTestSuite(ImageStackFrameTest.class);
+		suite.addTestSuite(ImageSymbolTest.class);
+		suite.addTestSuite(JavaFieldTest.class);
+		suite.addTestSuite(JavaLocationTest.class);
+		suite.addTestSuite(ImageFactoryTest.class);
+		//$JUnit-END$
+		return suite;
+	}
+
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/AllTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java Mon Nov 23 15:53:48 2009
@@ -1,79 +1,79 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-import java.util.Iterator;
-import java.util.List;
-
-import javax.tools.diagnostics.image.CorruptData;
-import javax.tools.diagnostics.image.ImageAddressSpace;
-import javax.tools.diagnostics.image.ImageSection;
-
-
-public class ImageAddressSpaceTest extends AbstractImageTestcase {
-	private ImageAddressSpace _space = null;
-	public static final long TEST_ADDRESS = 0x7FFFFFFF;	//TODO: don't test with this specific value
-	
-	protected void setUp() throws Exception {
-		_space = defaultAddressSpace();
-		super.setUp();
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getCurrentProcess()'
-	 * 
-	 * Ensures that the process is non-null
-	 */
-	public void testGetCurrentProcess() {
-		assertNotNull(_space.getCurrentProcess());
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getProcesses()'
-	 * 
-	 * Ensures that the process iterator is non-null and has at least one process
-	 */
-	public void testGetProcesses() {
-		List it = _space.getProcesses();
-		
-		assertNotNull(it);
-		assertFalse(it.isEmpty());
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getPointer(long)'
-	 * 
-	 * Ensures that pointers can be created which point at entities within the address space.
-	 * TODO:  this needs to be tested in a less arbitrary way.
-	 */
-	public void testGetPointer() {
-		assertNotNull(_space.getPointer(TEST_ADDRESS));
-	}
-	
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getImageSections()'
-	 * 
-	 * Ensures that there is at least one section and it is of type ImageSection
-	 */
-	public void testGetImageSections()
-	{
-		Iterator it = _space.getImageSections().iterator();
-		assertTrue(it.hasNext());
-		// empty iterator is a valid return from getImageSections
-		while (it.hasNext()) {
-			Object section = it.next();
-			assertTrue((section instanceof ImageSection) || (section instanceof CorruptData));
-		}
-	}
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.tools.diagnostics.image.CorruptData;
+import javax.tools.diagnostics.image.ImageAddressSpace;
+import javax.tools.diagnostics.image.ImageSection;
+
+
+public class ImageAddressSpaceTest extends AbstractImageTestcase {
+	private ImageAddressSpace _space = null;
+	public static final long TEST_ADDRESS = 0x7FFFFFFF;	//TODO: don't test with this specific value
+	
+	protected void setUp() throws Exception {
+		_space = defaultAddressSpace();
+		super.setUp();
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getCurrentProcess()'
+	 * 
+	 * Ensures that the process is non-null
+	 */
+	public void testGetCurrentProcess() {
+		assertNotNull(_space.getCurrentProcess());
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getProcesses()'
+	 * 
+	 * Ensures that the process iterator is non-null and has at least one process
+	 */
+	public void testGetProcesses() {
+		List it = _space.getProcesses();
+		
+		assertNotNull(it);
+		assertFalse(it.isEmpty());
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getPointer(long)'
+	 * 
+	 * Ensures that pointers can be created which point at entities within the address space.
+	 * TODO:  this needs to be tested in a less arbitrary way.
+	 */
+	public void testGetPointer() {
+		assertNotNull(_space.getPointer(TEST_ADDRESS));
+	}
+	
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getImageSections()'
+	 * 
+	 * Ensures that there is at least one section and it is of type ImageSection
+	 */
+	public void testGetImageSections()
+	{
+		Iterator it = _space.getImageSections().iterator();
+		assertTrue(it.hasNext());
+		// empty iterator is a valid return from getImageSections
+		while (it.hasNext()) {
+			Object section = it.next();
+			assertTrue((section instanceof ImageSection) || (section instanceof CorruptData));
+		}
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageFactoryTest.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageFactoryTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageFactoryTest.java Mon Nov 23 15:53:48 2009
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-import javax.tools.diagnostics.image.ImageFactory;
-
-public class ImageFactoryTest extends AbstractImageTestcase
-{
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageFactory.getDTFJMajorVersion()'
-	 * 
-	 * Ensures that the major version is at least 1
-	 */
-	public void testGetDTFJMajorVersion()
-	{
-		assertTrue(getFactory().getMajorVersion() >= 1);
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageFactory.getDTFJMinorVersion()'
-	 * 
-	 * Ensures that the minor version is at least 0
-	 */
-	public void testGetDTFJMinorVersion()
-	{
-		assertTrue(getFactory().getMinorVersion() >= 0);
-	}
-	
-	/**
-	 * Test that the modification level is greater than or equal to 0
-	 */
-	
-	public void testGetDTFJModificationLevel()
-	{
-		assertTrue(getFactory().getModificationLevel() >= 0);
-	}
-	
-	/**
-	 * Test that the modification level matches the implementation build no
-	 * Note that the existence of the implementation version string is tested
-	 * in the TestPackageInformation class
-	 */
-	
-	public void testGetDTFJModificationLevelAsBuildNo()
-	{
-		String implementationVersion=ImageFactory.class.getPackage().getImplementationVersion();
-		int buildNumber=0;
-		try {
-		buildNumber=Integer.parseInt(implementationVersion);
-		} catch(NumberFormatException nfe) {
-			buildNumber=-1;
-		}
-		assertTrue(getFactory().getModificationLevel()==buildNumber);
-	}
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import javax.tools.diagnostics.image.ImageFactory;
+
+public class ImageFactoryTest extends AbstractImageTestcase
+{
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageFactory.getDTFJMajorVersion()'
+	 * 
+	 * Ensures that the major version is at least 1
+	 */
+	public void testGetDTFJMajorVersion()
+	{
+		assertTrue(getFactory().getMajorVersion() >= 1);
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageFactory.getDTFJMinorVersion()'
+	 * 
+	 * Ensures that the minor version is at least 0
+	 */
+	public void testGetDTFJMinorVersion()
+	{
+		assertTrue(getFactory().getMinorVersion() >= 0);
+	}
+	
+	/**
+	 * Test that the modification level is greater than or equal to 0
+	 */
+	
+	public void testGetDTFJModificationLevel()
+	{
+		assertTrue(getFactory().getModificationLevel() >= 0);
+	}
+	
+	/**
+	 * Test that the modification level matches the implementation build no
+	 * Note that the existence of the implementation version string is tested
+	 * in the TestPackageInformation class
+	 */
+	
+	public void testGetDTFJModificationLevelAsBuildNo()
+	{
+		String implementationVersion=ImageFactory.class.getPackage().getImplementationVersion();
+		int buildNumber=0;
+		try {
+		buildNumber=Integer.parseInt(implementationVersion);
+		} catch(NumberFormatException nfe) {
+			buildNumber=-1;
+		}
+		assertTrue(getFactory().getModificationLevel()==buildNumber);
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageLoaderHelper.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageLoaderHelper.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageLoaderHelper.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageLoaderHelper.java Mon Nov 23 15:53:48 2009
@@ -1,52 +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 org.apache.kato.tests.junit;
-
-
-import javax.tools.diagnostics.image.Image;
-import javax.tools.diagnostics.image.ImageFactory;
-
-import org.apache.kato.tck.api.IImageCreator;
-
-
-public class ImageLoaderHelper {
-
-	
-	
-	public  Capabilities getCapabilities() throws Exception {
-		
-	 
-	    IImageCreator creator=null;
-	    
-	    Capabilities c=new Capabilities(); 
-	    
-	    c.image=creator.createProcessImage();
-		
-	  	return c;
-		
-	}
-		
-	
-
-	
-	
-	
-	
-	public class Capabilities {
-		public Image image=null;
-		public ImageFactory factory=null;
-		public boolean hasRootSupport=false;
-		public Exception loadError=null;
-	}
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+
+import javax.tools.diagnostics.image.Image;
+import javax.tools.diagnostics.image.ImageFactory;
+
+import org.apache.kato.tck.api.IImageCreator;
+
+
+public class ImageLoaderHelper {
+
+	
+	
+	public  Capabilities getCapabilities() throws Exception {
+		
+	 
+	    IImageCreator creator=null;
+	    
+	    Capabilities c=new Capabilities(); 
+	    
+	    c.image=creator.createProcessImage();
+		
+	  	return c;
+		
+	}
+		
+	
+
+	
+	
+	
+	
+	public class Capabilities {
+		public Image image=null;
+		public ImageFactory factory=null;
+		public boolean hasRootSupport=false;
+		public Exception loadError=null;
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageLoaderHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java Mon Nov 23 15:53:48 2009
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import javax.tools.diagnostics.image.CorruptDataException;
-
-
-public class ImageModuleTest extends AbstractImageTestcase {
-	
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getName()'
-	 * 
-	 * Ensures that the name is non-null
-	 */
-	public void testGetName() {
-		try {
-			assertNotNull(defaultImageModule().getName());
-		} catch (CorruptDataException e) {
-			//acceptable
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getSections()'
-	 * 
-	 * Ensures that the sections iterator is non-null and non-empty
-	 */
-	public void testGetSections() {
-		List it = defaultImageModule().getSections();
-		
-		assertNotNull(it);
-		assertFalse(it.isEmpty());
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getSymbols()'
-	 * 
-	 * Ensures that symbols exist in the module
-	 * 
-	 */
-	public void testGetSymbols() {
-		List it = defaultImageModule().getSymbols();
-		
-		assertNotNull(it);
-		assertFalse(it.isEmpty());
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getProperties()'
-	 * 
-	 * Ensures that the module has a properties structure
-	 */
-	public void testGetProperties() {
-		Properties props = null;
-		
-		try {
-			props = defaultImageModule().getProperties();
-		} catch (CorruptDataException e) {
-			assertTrue(false);
-		}
-		assertNotNull(props);
-	}
-
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import javax.tools.diagnostics.image.CorruptDataException;
+
+
+public class ImageModuleTest extends AbstractImageTestcase {
+	
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getName()'
+	 * 
+	 * Ensures that the name is non-null
+	 */
+	public void testGetName() {
+		try {
+			assertNotNull(defaultImageModule().getName());
+		} catch (CorruptDataException e) {
+			//acceptable
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getSections()'
+	 * 
+	 * Ensures that the sections iterator is non-null and non-empty
+	 */
+	public void testGetSections() {
+		List it = defaultImageModule().getSections();
+		
+		assertNotNull(it);
+		assertFalse(it.isEmpty());
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getSymbols()'
+	 * 
+	 * Ensures that symbols exist in the module
+	 * 
+	 */
+	public void testGetSymbols() {
+		List it = defaultImageModule().getSymbols();
+		
+		assertNotNull(it);
+		assertFalse(it.isEmpty());
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageModule.getProperties()'
+	 * 
+	 * Ensures that the module has a properties structure
+	 */
+	public void testGetProperties() {
+		Properties props = null;
+		
+		try {
+			props = defaultImageModule().getProperties();
+		} catch (CorruptDataException e) {
+			assertTrue(false);
+		}
+		assertNotNull(props);
+	}
+
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageModuleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImagePointerTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImagePointerTest.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImagePointerTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImagePointerTest.java Mon Nov 23 15:53:48 2009
@@ -1,259 +1,259 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-import javax.tools.diagnostics.image.CorruptDataException;
-import javax.tools.diagnostics.image.DataUnavailable;
-import javax.tools.diagnostics.image.ImageAddressSpace;
-import javax.tools.diagnostics.image.ImagePointer;
-import javax.tools.diagnostics.image.MemoryAccessException;
-
-public class ImagePointerTest extends AbstractImageTestcase
-{
-	private static ImageAddressSpace _parent;	//used for comparisons
-	private static long _address;	//used for comparisons
-	private static final long OFFSET = 0x100;
-	private ImagePointer _testPointer;
-	
-	public  ImagePointer defaultImagePointer()
-	{
-		_parent = defaultAddressSpace();
-		_address = ImageAddressSpaceTest.TEST_ADDRESS;
-		
-		return _parent.getPointer(_address);
-	}
-	
-	protected void setUp() throws Exception
-	{
-		_testPointer = defaultImagePointer();
-		super.setUp();
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getAddress()'
-	 * 
-	 * Ensure that the address is what we created it with
-	 */
-	public void testGetAddress()
-	{
-		assertTrue(_address == _testPointer.getAddress());
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getAddressSpace()'
-	 * 
-	 * Ensures that the parent address space is equal to the one we used to create it
-	 */
-	public void testGetAddressSpace()
-	{
-		assertTrue(_parent.equals(_testPointer.getAddressSpace()));
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.add(long)'
-	 * 
-	 * Ensures that adding an offset yields a pointer at the expected address
-	 */
-	public void testAdd()
-	{
-		ImagePointer newPointer = _testPointer.add(OFFSET);
-		assertTrue(newPointer.getAddress() == (_testPointer.getAddress() + OFFSET));
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.isExecutable()'
-	 * 
-	 * Ensures that the method can be called
-	 */
-	public void testIsExecutable()
-	{
-		try {
-			_testPointer.isExecutable();
-		} catch (DataUnavailable e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.isReadOnly()'
-	 * 
-	 * Ensures that the method can be called
-	 */
-	public void testIsReadOnly()
-	{
-		try {
-			_testPointer.isReadOnly();
-		} catch (DataUnavailable e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.isShared()'
-	 * 
-	 * Ensures that the method can be called
-	 */
-	public void testIsShared()
-	{
-		try {
-			_testPointer.isShared();
-		} catch (DataUnavailable e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getPointerAt(long)'
-	 * 
-	 * Ensure that we can read a pointer at the given address without throwing anything unexpected
-	 */
-	public void testGetPointerAt()
-	{
-		try {
-			_testPointer.getPointerAt(0);
-		} catch (MemoryAccessException e) {
-			assertNotNull(e.getPointer());
-			//accepted by spec
-		} catch (CorruptDataException e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getLongAt(long)'
-	 * 
-	 * Ensure that we can read a long at the given address without throwing anything unexpected
-	 */
-	public void testGetLongAt()
-	{
-		try {
-			_testPointer.getLongAt(0);
-		} catch (MemoryAccessException e) {
-			assertNotNull(e.getPointer());
-			//accepted by spec
-		} catch (CorruptDataException e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getIntAt(long)'
-	 * 
-	 * Ensure that we can read an int at the given address without throwing anything unexpected
-	 */
-	public void testGetIntAt()
-	{
-		try {
-			_testPointer.getIntAt(0);
-		} catch (MemoryAccessException e) {
-			assertNotNull(e.getPointer());
-			//accepted by spec
-		} catch (CorruptDataException e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getShortAt(long)'
-	 * 
-	 * Ensure that we can read a short at the given address without throwing anything unexpected
-	 */
-	public void testGetShortAt()
-	{
-		try {
-			_testPointer.getShortAt(0);
-		} catch (MemoryAccessException e) {
-			assertNotNull(e.getPointer());
-			//accepted by spec
-		} catch (CorruptDataException e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getByteAt(long)'
-	 * 
-	 * Ensure that we can read a byte at the given address without throwing anything unexpected
-	 */
-	public void testGetByteAt()
-	{
-		try {
-			_testPointer.getByteAt(0);
-		} catch (MemoryAccessException e) {
-			assertNotNull(e.getPointer());
-			//accepted by spec
-		} catch (CorruptDataException e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getFloatAt(long)'
-	 * 
-	 * Ensure that we can read a float at the given address without throwing anything unexpected
-	 */
-	public void testGetFloatAt()
-	{
-		try {
-			_testPointer.getFloatAt(0);
-		} catch (MemoryAccessException e) {
-			assertNotNull(e.getPointer());
-			//accepted by spec
-		} catch (CorruptDataException e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getDoubleAt(long)'
-	 * 
-	 * Ensure that we can read a double at the given address without throwing anything unexpected
-	 */
-	public void testGetDoubleAt()
-	{
-		try {
-			_testPointer.getDoubleAt(0);
-		} catch (MemoryAccessException e) {
-			assertNotNull(e.getPointer());
-			//accepted by spec
-		} catch (CorruptDataException e) {
-			//accepted by spec
-		}
-	}
-	
-	/**
-	 * Verify that the equals call doesn't throw
-	 */
-	public void testEquals()
-	{
-		try{
-			assertTrue(_testPointer.equals(_testPointer));
-		} catch (Throwable t) {
-			assertTrue(false);
-		}
-	}
-	
-	/**
-	 * Verify that hashCode() doesn't throw and returns non-zero (technically zero is ok but it will be 
-	 * flagged here to ensure that we aren't doing anything bad to create the hashcode)
-	 */
-	public void testHashCode()
-	{
-		try {
-			assertTrue(0 != _testPointer.hashCode());
-		} catch (Throwable t) {
-			assertTrue(false);
-		}
-	}
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.image.DataUnavailable;
+import javax.tools.diagnostics.image.ImageAddressSpace;
+import javax.tools.diagnostics.image.ImagePointer;
+import javax.tools.diagnostics.image.MemoryAccessException;
+
+public class ImagePointerTest extends AbstractImageTestcase
+{
+	private static ImageAddressSpace _parent;	//used for comparisons
+	private static long _address;	//used for comparisons
+	private static final long OFFSET = 0x100;
+	private ImagePointer _testPointer;
+	
+	public  ImagePointer defaultImagePointer()
+	{
+		_parent = defaultAddressSpace();
+		_address = ImageAddressSpaceTest.TEST_ADDRESS;
+		
+		return _parent.getPointer(_address);
+	}
+	
+	protected void setUp() throws Exception
+	{
+		_testPointer = defaultImagePointer();
+		super.setUp();
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getAddress()'
+	 * 
+	 * Ensure that the address is what we created it with
+	 */
+	public void testGetAddress()
+	{
+		assertTrue(_address == _testPointer.getAddress());
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getAddressSpace()'
+	 * 
+	 * Ensures that the parent address space is equal to the one we used to create it
+	 */
+	public void testGetAddressSpace()
+	{
+		assertTrue(_parent.equals(_testPointer.getAddressSpace()));
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.add(long)'
+	 * 
+	 * Ensures that adding an offset yields a pointer at the expected address
+	 */
+	public void testAdd()
+	{
+		ImagePointer newPointer = _testPointer.add(OFFSET);
+		assertTrue(newPointer.getAddress() == (_testPointer.getAddress() + OFFSET));
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.isExecutable()'
+	 * 
+	 * Ensures that the method can be called
+	 */
+	public void testIsExecutable()
+	{
+		try {
+			_testPointer.isExecutable();
+		} catch (DataUnavailable e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.isReadOnly()'
+	 * 
+	 * Ensures that the method can be called
+	 */
+	public void testIsReadOnly()
+	{
+		try {
+			_testPointer.isReadOnly();
+		} catch (DataUnavailable e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.isShared()'
+	 * 
+	 * Ensures that the method can be called
+	 */
+	public void testIsShared()
+	{
+		try {
+			_testPointer.isShared();
+		} catch (DataUnavailable e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getPointerAt(long)'
+	 * 
+	 * Ensure that we can read a pointer at the given address without throwing anything unexpected
+	 */
+	public void testGetPointerAt()
+	{
+		try {
+			_testPointer.getPointerAt(0);
+		} catch (MemoryAccessException e) {
+			assertNotNull(e.getPointer());
+			//accepted by spec
+		} catch (CorruptDataException e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getLongAt(long)'
+	 * 
+	 * Ensure that we can read a long at the given address without throwing anything unexpected
+	 */
+	public void testGetLongAt()
+	{
+		try {
+			_testPointer.getLongAt(0);
+		} catch (MemoryAccessException e) {
+			assertNotNull(e.getPointer());
+			//accepted by spec
+		} catch (CorruptDataException e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getIntAt(long)'
+	 * 
+	 * Ensure that we can read an int at the given address without throwing anything unexpected
+	 */
+	public void testGetIntAt()
+	{
+		try {
+			_testPointer.getIntAt(0);
+		} catch (MemoryAccessException e) {
+			assertNotNull(e.getPointer());
+			//accepted by spec
+		} catch (CorruptDataException e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getShortAt(long)'
+	 * 
+	 * Ensure that we can read a short at the given address without throwing anything unexpected
+	 */
+	public void testGetShortAt()
+	{
+		try {
+			_testPointer.getShortAt(0);
+		} catch (MemoryAccessException e) {
+			assertNotNull(e.getPointer());
+			//accepted by spec
+		} catch (CorruptDataException e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getByteAt(long)'
+	 * 
+	 * Ensure that we can read a byte at the given address without throwing anything unexpected
+	 */
+	public void testGetByteAt()
+	{
+		try {
+			_testPointer.getByteAt(0);
+		} catch (MemoryAccessException e) {
+			assertNotNull(e.getPointer());
+			//accepted by spec
+		} catch (CorruptDataException e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getFloatAt(long)'
+	 * 
+	 * Ensure that we can read a float at the given address without throwing anything unexpected
+	 */
+	public void testGetFloatAt()
+	{
+		try {
+			_testPointer.getFloatAt(0);
+		} catch (MemoryAccessException e) {
+			assertNotNull(e.getPointer());
+			//accepted by spec
+		} catch (CorruptDataException e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImagePointer.getDoubleAt(long)'
+	 * 
+	 * Ensure that we can read a double at the given address without throwing anything unexpected
+	 */
+	public void testGetDoubleAt()
+	{
+		try {
+			_testPointer.getDoubleAt(0);
+		} catch (MemoryAccessException e) {
+			assertNotNull(e.getPointer());
+			//accepted by spec
+		} catch (CorruptDataException e) {
+			//accepted by spec
+		}
+	}
+	
+	/**
+	 * Verify that the equals call doesn't throw
+	 */
+	public void testEquals()
+	{
+		try{
+			assertTrue(_testPointer.equals(_testPointer));
+		} catch (Throwable t) {
+			assertTrue(false);
+		}
+	}
+	
+	/**
+	 * Verify that hashCode() doesn't throw and returns non-zero (technically zero is ok but it will be 
+	 * flagged here to ensure that we aren't doing anything bad to create the hashcode)
+	 */
+	public void testHashCode()
+	{
+		try {
+			assertTrue(0 != _testPointer.hashCode());
+		} catch (Throwable t) {
+			assertTrue(false);
+		}
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImagePointerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageProcessTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageProcessTest.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageProcessTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageProcessTest.java Mon Nov 23 15:53:48 2009
@@ -1,203 +1,203 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import javax.tools.diagnostics.image.CorruptData;
-import javax.tools.diagnostics.image.CorruptDataException;
-import javax.tools.diagnostics.image.DiagnosticException;
-import javax.tools.diagnostics.image.DataUnavailable;
-import javax.tools.diagnostics.image.ImageProcess;
-import javax.tools.diagnostics.image.ImageThread;
-import javax.tools.diagnostics.runtime.ManagedRuntime;
-
-
-
-public class ImageProcessTest extends AbstractImageTestcase {
-	
-	ImageProcess _proc=null;
-	
-	protected void setUp() throws Exception {
-		_proc = defaultImageProcess();
-		super.setUp();
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getCommandLine()'
-	 */
-	public void testGetCommandLine()
-	{
-		try {
-			assertNotNull(_proc.getCommandLine());
-		} catch (DiagnosticException e) {
-			//acceptable
-			assertTrue(true);
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getEnvironment()'
-	 * 
-	 * Ensures that the properties are non-null
-	 */
-	public void testGetEnvironment()
-	{
-		try {
-			Properties env = _proc.getEnvironment();
-			assertNotNull(env);
-		} catch (DataUnavailable e) {
-			//acceptable
-		} catch (CorruptDataException e) {
-			//acceptable
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getID()'
-	 * 
-	 * Ensures that the process ID is non-null and non-empty
-	 */
-	public void testGetID()
-	{
-		try {
-			String id = _proc.getID();
-			assertNotNull(id);
-			assertTrue(id.length() > 0);
-		} catch (DataUnavailable e) {
-			//acceptable
-		} catch (CorruptDataException e) {
-			//acceptable
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getLibraries()'
-	 * 
-	 * Make sure that the libraries iterator is non-null
-	 */
-	public void testGetLibraries()
-	{
-		try {
-			assertNotNull(_proc.getLibraries());
-		} catch (DataUnavailable e) {
-			//this is considered correct
-		} catch (CorruptDataException e) {
-			//this is considered correct
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getExecutable()'
-	 * 
-	 * Make sure that the module is non-null
-	 */
-	public void testGetExecutable()
-	{
-		try {
-			assertNotNull(_proc.getExecutable());
-		} catch (DataUnavailable e) {
-			//this will be considered a success
-		} catch (CorruptDataException e) {
-			//normally we won't be testing corrupt data so this is a failure
-			assertTrue(false);
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getThreads()'
-	 * 
-	 * Ensures that there is at least one thread and it is an instance of ImageThread or CorruptData
-	 */
-	public void testGetThreads()
-	{
-		Iterator threads = _proc.getThreads().iterator();
-		assertNotNull(threads);
-		assertTrue(threads.hasNext());
-		Object instance = threads.next();
-		assertTrue((instance instanceof ImageThread) || (instance instanceof CorruptData));
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getCurrentThread()'
-	 * 
-	 * Ensures that anything (even null) is returned or the correct exception is thrown
-	 */
-	public void testGetCurrentThread()
-	{
-		try {
-			_proc.getCurrentThread();
-		} catch (CorruptDataException e) {
-			//acceptable
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getRuntimes()'
-	 * 
-	 * Ensures that at least one runtime is returned and that it is an instance of ManagedRuntime or CorruptData
-	 */
-	public void testGetRuntimes()
-	{
-		Iterator runtimes = _proc.getRuntimes().iterator();
-		assertNotNull(runtimes);
-		assertTrue(runtimes.hasNext());
-		Object instance = runtimes.next();
-		assertTrue((instance instanceof ManagedRuntime) || (instance instanceof CorruptData));
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getSignalNumber()'
-	 * 
-	 * Ensures that no unexpected exceptions are thrown
-	 */
-	public void testGetSignalNumber()
-	{
-		try {
-			_proc.getSignalNumber();
-		} catch (DataUnavailable e) {
-			//acceptable in the spec
-		} catch (CorruptDataException e) {
-			//acceptable in the spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getSignalName()'
-	 * 
-	 * Ensures that anything (even null) is returned or the correct exceptions are thrown
-	 */
-	public void testGetSignalName()
-	{
-		try {
-			_proc.getSignalName();
-		} catch (DataUnavailable e) {
-			//acceptable
-		} catch (CorruptDataException e) {
-			//acceptable
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getPointerSize()'
-	 * 
-	 * This should return 31, 32, or 64
-	 */
-	public void testGetPointerSize()
-	{
-		int size = _proc.getPointerSize();
-		assertTrue((31 == size) || (32 == size) || (64 == size));
-	}
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import javax.tools.diagnostics.image.CorruptData;
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.image.DiagnosticException;
+import javax.tools.diagnostics.image.DataUnavailable;
+import javax.tools.diagnostics.image.ImageProcess;
+import javax.tools.diagnostics.image.ImageThread;
+import javax.tools.diagnostics.runtime.ManagedRuntime;
+
+
+
+public class ImageProcessTest extends AbstractImageTestcase {
+	
+	ImageProcess _proc=null;
+	
+	protected void setUp() throws Exception {
+		_proc = defaultImageProcess();
+		super.setUp();
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getCommandLine()'
+	 */
+	public void testGetCommandLine()
+	{
+		try {
+			assertNotNull(_proc.getCommandLine());
+		} catch (DiagnosticException e) {
+			//acceptable
+			assertTrue(true);
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getEnvironment()'
+	 * 
+	 * Ensures that the properties are non-null
+	 */
+	public void testGetEnvironment()
+	{
+		try {
+			Properties env = _proc.getEnvironment();
+			assertNotNull(env);
+		} catch (DataUnavailable e) {
+			//acceptable
+		} catch (CorruptDataException e) {
+			//acceptable
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getID()'
+	 * 
+	 * Ensures that the process ID is non-null and non-empty
+	 */
+	public void testGetID()
+	{
+		try {
+			String id = _proc.getID();
+			assertNotNull(id);
+			assertTrue(id.length() > 0);
+		} catch (DataUnavailable e) {
+			//acceptable
+		} catch (CorruptDataException e) {
+			//acceptable
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getLibraries()'
+	 * 
+	 * Make sure that the libraries iterator is non-null
+	 */
+	public void testGetLibraries()
+	{
+		try {
+			assertNotNull(_proc.getLibraries());
+		} catch (DataUnavailable e) {
+			//this is considered correct
+		} catch (CorruptDataException e) {
+			//this is considered correct
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getExecutable()'
+	 * 
+	 * Make sure that the module is non-null
+	 */
+	public void testGetExecutable()
+	{
+		try {
+			assertNotNull(_proc.getExecutable());
+		} catch (DataUnavailable e) {
+			//this will be considered a success
+		} catch (CorruptDataException e) {
+			//normally we won't be testing corrupt data so this is a failure
+			assertTrue(false);
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getThreads()'
+	 * 
+	 * Ensures that there is at least one thread and it is an instance of ImageThread or CorruptData
+	 */
+	public void testGetThreads()
+	{
+		Iterator threads = _proc.getThreads().iterator();
+		assertNotNull(threads);
+		assertTrue(threads.hasNext());
+		Object instance = threads.next();
+		assertTrue((instance instanceof ImageThread) || (instance instanceof CorruptData));
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getCurrentThread()'
+	 * 
+	 * Ensures that anything (even null) is returned or the correct exception is thrown
+	 */
+	public void testGetCurrentThread()
+	{
+		try {
+			_proc.getCurrentThread();
+		} catch (CorruptDataException e) {
+			//acceptable
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getRuntimes()'
+	 * 
+	 * Ensures that at least one runtime is returned and that it is an instance of ManagedRuntime or CorruptData
+	 */
+	public void testGetRuntimes()
+	{
+		Iterator runtimes = _proc.getRuntimes().iterator();
+		assertNotNull(runtimes);
+		assertTrue(runtimes.hasNext());
+		Object instance = runtimes.next();
+		assertTrue((instance instanceof ManagedRuntime) || (instance instanceof CorruptData));
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getSignalNumber()'
+	 * 
+	 * Ensures that no unexpected exceptions are thrown
+	 */
+	public void testGetSignalNumber()
+	{
+		try {
+			_proc.getSignalNumber();
+		} catch (DataUnavailable e) {
+			//acceptable in the spec
+		} catch (CorruptDataException e) {
+			//acceptable in the spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getSignalName()'
+	 * 
+	 * Ensures that anything (even null) is returned or the correct exceptions are thrown
+	 */
+	public void testGetSignalName()
+	{
+		try {
+			_proc.getSignalName();
+		} catch (DataUnavailable e) {
+			//acceptable
+		} catch (CorruptDataException e) {
+			//acceptable
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageProcess.getPointerSize()'
+	 * 
+	 * This should return 31, 32, or 64
+	 */
+	public void testGetPointerSize()
+	{
+		int size = _proc.getPointerSize();
+		assertTrue((31 == size) || (32 == size) || (64 == size));
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageProcessTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageRegisterTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageRegisterTest.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageRegisterTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageRegisterTest.java Mon Nov 23 15:53:48 2009
@@ -1,93 +1,93 @@
-/*******************************************************************************
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package org.apache.kato.tests.junit;
-
-import java.util.Iterator;
-
-import javax.tools.diagnostics.image.CorruptDataException;
-import javax.tools.diagnostics.image.ImageRegister;
-
-public class ImageRegisterTest extends AbstractImageTestcase
-{
-	private ImageRegister _testRegister;
-
-	public  ImageRegister defaultImageRegister()
-	{
-		// if getRegisters() returns an empty iterator (which is valid)
-		// then defaultImageRegisters returns null
-		Iterator theR = defaultImageThread().getRegisters().iterator();
-		ImageRegister theIR = null;
-		while (theR.hasNext()){
-			theIR = (ImageRegister) theR.next();
-		}
-		return theIR;
-	}
-
-	protected void setUp() throws Exception
-	{
-		_testRegister = defaultImageRegister();
-		super.setUp();
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageRegister.getName()'
-	 * 
-	 * Ensures that the register has a non-null non-empty name
-	 */
-	public void testGetName()
-	{
-		// _testRegister == null if the registers are empty 
-		// ie the iterator is empty which is valid
-		if (null != _testRegister){
-			String name = _testRegister.getName();
-			assertNotNull(name);
-			assertTrue(name.length() > 0);
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageRegister.toString()'
-	 * 
-	 */
-	public void testToString()
-	{
-		// _testRegister == null if the registers are empty 
-		// ie the iterator is empty which is valid
-		if (null != _testRegister){
-			String name = null;
-			name = _testRegister.toString();
-
-			assertNotNull(name);
-			assertTrue(name.length() > 0);
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageRegister.getValue()'
-	 * 
-	 * Ensures that we can make the call without unexpected exceptions occurring
-	 */
-	public void testGetValue()
-	{
-		// _testRegister == null if the registers are empty 
-		// ie the iterator is empty which is valid
-		if (null != _testRegister){
-			try {
-				_testRegister.getValue();
-			} catch (CorruptDataException e) {
-				//accepted by spec
-			}
-		}
-	}
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import java.util.Iterator;
+
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.image.ImageRegister;
+
+public class ImageRegisterTest extends AbstractImageTestcase
+{
+	private ImageRegister _testRegister;
+
+	public  ImageRegister defaultImageRegister()
+	{
+		// if getRegisters() returns an empty iterator (which is valid)
+		// then defaultImageRegisters returns null
+		Iterator theR = defaultImageThread().getRegisters().iterator();
+		ImageRegister theIR = null;
+		while (theR.hasNext()){
+			theIR = (ImageRegister) theR.next();
+		}
+		return theIR;
+	}
+
+	protected void setUp() throws Exception
+	{
+		_testRegister = defaultImageRegister();
+		super.setUp();
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageRegister.getName()'
+	 * 
+	 * Ensures that the register has a non-null non-empty name
+	 */
+	public void testGetName()
+	{
+		// _testRegister == null if the registers are empty 
+		// ie the iterator is empty which is valid
+		if (null != _testRegister){
+			String name = _testRegister.getName();
+			assertNotNull(name);
+			assertTrue(name.length() > 0);
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageRegister.toString()'
+	 * 
+	 */
+	public void testToString()
+	{
+		// _testRegister == null if the registers are empty 
+		// ie the iterator is empty which is valid
+		if (null != _testRegister){
+			String name = null;
+			name = _testRegister.toString();
+
+			assertNotNull(name);
+			assertTrue(name.length() > 0);
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageRegister.getValue()'
+	 * 
+	 * Ensures that we can make the call without unexpected exceptions occurring
+	 */
+	public void testGetValue()
+	{
+		// _testRegister == null if the registers are empty 
+		// ie the iterator is empty which is valid
+		if (null != _testRegister){
+			try {
+				_testRegister.getValue();
+			} catch (CorruptDataException e) {
+				//accepted by spec
+			}
+		}
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageRegisterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSectionTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSectionTest.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSectionTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSectionTest.java Mon Nov 23 15:53:48 2009
@@ -1,115 +1,115 @@
-/*******************************************************************************
- * 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.tests.junit;
-
-import java.util.Iterator;
-
-import javax.tools.diagnostics.image.DataUnavailable;
-import javax.tools.diagnostics.image.ImageSection;
-import javax.tools.diagnostics.runtime.java.JavaMethod;
-
-
-public class ImageSectionTest extends AbstractImageTestcase
-{
-	private ImageSection _section = null;
-	
-	public  ImageSection defaultImageSection()
-	{
-		//for now we will just grab a compiled method section
-		JavaMethod method = defaultJavaMethod();
-		Iterator it = method.getCompiledSections().iterator();
-		assertNotNull(it);
-		assertTrue(it.hasNext());
-		return (ImageSection) it.next();
-	}
-	
-	
-	protected void setUp() throws Exception
-	{
-		_section = defaultImageSection();
-		super.setUp();
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSection.getBaseAddress()'
-	 * 
-	 * Ensure that we get a non-null base address
-	 */
-	public void testGetBaseAddress()
-	{
-		assertNotNull(_section.getBaseAddress());
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSection.getSize()'
-	 * 
-	 * Ensure that we get a >0 size
-	 */
-	public void testGetSize()
-	{
-		assertTrue(_section.getSize() > 0);
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSection.getName()'
-	 * 
-	 * Ensure that we get a non-null name
-	 */
-	public void testGetName()
-	{
-		assertNotNull(_section.getName());
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSection.isExecutable()'
-	 * 
-	 * Ensures that the method can be called
-	 */
-	public void testIsExecutable()
-	{
-		try {
-			_section.isExecutable();
-		} catch (DataUnavailable e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSection.isReadOnly()'
-	 * 
-	 * Ensures that the method can be called
-	 */
-	public void testIsReadOnly()
-	{
-		try {
-			_section.isReadOnly();
-		} catch (DataUnavailable e) {
-			//accepted by spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSection.isShared()'
-	 * 
-	 * Ensures that the method can be called
-	 */
-	public void testIsShared()
-	{
-		try {
-			_section.isShared();
-		} catch (DataUnavailable e) {
-			//accepted by spec
-		}
-	}
-}
+/*******************************************************************************
+ * 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.tests.junit;
+
+import java.util.Iterator;
+
+import javax.tools.diagnostics.image.DataUnavailable;
+import javax.tools.diagnostics.image.ImageSection;
+import javax.tools.diagnostics.runtime.java.JavaMethod;
+
+
+public class ImageSectionTest extends AbstractImageTestcase
+{
+	private ImageSection _section = null;
+	
+	public  ImageSection defaultImageSection()
+	{
+		//for now we will just grab a compiled method section
+		JavaMethod method = defaultJavaMethod();
+		Iterator it = method.getCompiledSections().iterator();
+		assertNotNull(it);
+		assertTrue(it.hasNext());
+		return (ImageSection) it.next();
+	}
+	
+	
+	protected void setUp() throws Exception
+	{
+		_section = defaultImageSection();
+		super.setUp();
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSection.getBaseAddress()'
+	 * 
+	 * Ensure that we get a non-null base address
+	 */
+	public void testGetBaseAddress()
+	{
+		assertNotNull(_section.getBaseAddress());
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSection.getSize()'
+	 * 
+	 * Ensure that we get a >0 size
+	 */
+	public void testGetSize()
+	{
+		assertTrue(_section.getSize() > 0);
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSection.getName()'
+	 * 
+	 * Ensure that we get a non-null name
+	 */
+	public void testGetName()
+	{
+		assertNotNull(_section.getName());
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSection.isExecutable()'
+	 * 
+	 * Ensures that the method can be called
+	 */
+	public void testIsExecutable()
+	{
+		try {
+			_section.isExecutable();
+		} catch (DataUnavailable e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSection.isReadOnly()'
+	 * 
+	 * Ensures that the method can be called
+	 */
+	public void testIsReadOnly()
+	{
+		try {
+			_section.isReadOnly();
+		} catch (DataUnavailable e) {
+			//accepted by spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSection.isShared()'
+	 * 
+	 * Ensures that the method can be called
+	 */
+	public void testIsShared()
+	{
+		try {
+			_section.isShared();
+		} catch (DataUnavailable e) {
+			//accepted by spec
+		}
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSectionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message