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 [35/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/ImageStackFrameTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageStackFrameTest.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/ImageStackFrameTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageStackFrameTest.java Mon Nov 23 15:53:48 2009
@@ -1,104 +1,104 @@
-/*******************************************************************************
- * 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.DataUnavailable;
-import javax.tools.diagnostics.image.ImagePointer;
-import javax.tools.diagnostics.image.ImageStackFrame;
-import javax.tools.diagnostics.image.ImageThread;
-
-
-public class ImageStackFrameTest extends AbstractImageTestcase
-{
-	private ImageStackFrame _stackFrame;
-	
-	public  ImageStackFrame defaultStackFrame()
-	{
-//		try {
-//			return (ImageStackFrame) defaultImageThread().getStackFrames().next();
-//		} catch (DataUnavailable e) {
-			// Try harder to find a thread with a stack.
-			Iterator it = defaultImageProcess().getThreads().iterator();
-			while (it.hasNext()) {
-				ImageThread thread = (ImageThread) it.next();
-				try {
-					if (thread.getStackFrames().isEmpty()==false) {
-						return (ImageStackFrame) thread.getStackFrames().get(0);
-					}
-				} catch (DataUnavailable e1) {
-					// Ignore
-				}
-			}
-			// although this is accepted by the spec, it has no real meaning for the test so just choose to be unimplemented
-			throw new TestNotImplementedException();
-//		}
-	}
-	
-	protected void setUp() throws Exception
-	{
-		_stackFrame = defaultStackFrame();
-		super.setUp();
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageStackFrame.getProcedureAddress()'
-	 * 
-	 * Ensures that we get a non-null address
-	 */
-	public void testGetProcedureAddress()
-	{
-		try {
-			ImagePointer address = _stackFrame.getProcedureAddress();
-			assertNotNull(address);
-		} catch (CorruptDataException e) {
-			//accepted
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageStackFrame.getBasePointer()'
-	 * 
-	 * Ensures that we get a non-null base pointer
-	 */
-	public void testGetBasePointer()
-	{
-		try {
-			ImagePointer address = _stackFrame.getBasePointer();
-			assertNotNull(address);
-			assertTrue(address.getAddress() != 0);
-		} catch (CorruptDataException e) {
-			//accepted
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageStackFrame.getProcedureName()'
-	 * 
-	 * Ensures that we get a non-null, non-empty name
-	 */
-	public void testGetProcedureName()
-	{
-		try {
-			String name = _stackFrame.getProcedureName();
-			assertNotNull(name);
-			assertTrue(name.length() > 0);
-		} catch (CorruptDataException e) {
-			//accepted
-		}
-	}
-
-}
+/*******************************************************************************
+ * 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.DataUnavailable;
+import javax.tools.diagnostics.image.ImagePointer;
+import javax.tools.diagnostics.image.ImageStackFrame;
+import javax.tools.diagnostics.image.ImageThread;
+
+
+public class ImageStackFrameTest extends AbstractImageTestcase
+{
+	private ImageStackFrame _stackFrame;
+	
+	public  ImageStackFrame defaultStackFrame()
+	{
+//		try {
+//			return (ImageStackFrame) defaultImageThread().getStackFrames().next();
+//		} catch (DataUnavailable e) {
+			// Try harder to find a thread with a stack.
+			Iterator it = defaultImageProcess().getThreads().iterator();
+			while (it.hasNext()) {
+				ImageThread thread = (ImageThread) it.next();
+				try {
+					if (thread.getStackFrames().isEmpty()==false) {
+						return (ImageStackFrame) thread.getStackFrames().get(0);
+					}
+				} catch (DataUnavailable e1) {
+					// Ignore
+				}
+			}
+			// although this is accepted by the spec, it has no real meaning for the test so just choose to be unimplemented
+			throw new TestNotImplementedException();
+//		}
+	}
+	
+	protected void setUp() throws Exception
+	{
+		_stackFrame = defaultStackFrame();
+		super.setUp();
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageStackFrame.getProcedureAddress()'
+	 * 
+	 * Ensures that we get a non-null address
+	 */
+	public void testGetProcedureAddress()
+	{
+		try {
+			ImagePointer address = _stackFrame.getProcedureAddress();
+			assertNotNull(address);
+		} catch (CorruptDataException e) {
+			//accepted
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageStackFrame.getBasePointer()'
+	 * 
+	 * Ensures that we get a non-null base pointer
+	 */
+	public void testGetBasePointer()
+	{
+		try {
+			ImagePointer address = _stackFrame.getBasePointer();
+			assertNotNull(address);
+			assertTrue(address.getAddress() != 0);
+		} catch (CorruptDataException e) {
+			//accepted
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageStackFrame.getProcedureName()'
+	 * 
+	 * Ensures that we get a non-null, non-empty name
+	 */
+	public void testGetProcedureName()
+	{
+		try {
+			String name = _stackFrame.getProcedureName();
+			assertNotNull(name);
+			assertTrue(name.length() > 0);
+		} catch (CorruptDataException e) {
+			//accepted
+		}
+	}
+
+}

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

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSymbolTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSymbolTest.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/ImageSymbolTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageSymbolTest.java Mon Nov 23 15:53:48 2009
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * 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.ImagePointer;
-import javax.tools.diagnostics.image.ImageSymbol;
-
-
-public class ImageSymbolTest extends AbstractImageTestcase
-{
-	private ImageSymbol _symbol;
-	
-	public  ImageSymbol defaultImageSymbol()
-	{
-		Iterator symbols = defaultImageModule().getSymbols().iterator();
-		if(symbols.hasNext()) {
-			return (ImageSymbol) symbols.next();
-		} else {		
-			return null;
-		}
-	}
-	
-	protected void setUp() throws Exception
-	{
-		_symbol = defaultImageSymbol();
-		super.setUp();
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSymbol.getAddress()'
-	 * Ensures that the address is non-null
-	 */
-	public void testGetAddress()
-	{
-		ImagePointer address = _symbol.getAddress();
-		assertNotNull(address);
-		assertTrue(address.getAddress() != 0);
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageSymbol.getName()'
-	 * Ensures that the name is non-null and non-empty
-	 */
-	public void testGetName()
-	{
-		String name = _symbol.getName();
-		assertNotNull(name);
-		assertTrue(name.length() > 0);
-	}
-}
+/*******************************************************************************
+ * 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.ImagePointer;
+import javax.tools.diagnostics.image.ImageSymbol;
+
+
+public class ImageSymbolTest extends AbstractImageTestcase
+{
+	private ImageSymbol _symbol;
+	
+	public  ImageSymbol defaultImageSymbol()
+	{
+		Iterator symbols = defaultImageModule().getSymbols().iterator();
+		if(symbols.hasNext()) {
+			return (ImageSymbol) symbols.next();
+		} else {		
+			return null;
+		}
+	}
+	
+	protected void setUp() throws Exception
+	{
+		_symbol = defaultImageSymbol();
+		super.setUp();
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSymbol.getAddress()'
+	 * Ensures that the address is non-null
+	 */
+	public void testGetAddress()
+	{
+		ImagePointer address = _symbol.getAddress();
+		assertNotNull(address);
+		assertTrue(address.getAddress() != 0);
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageSymbol.getName()'
+	 * Ensures that the name is non-null and non-empty
+	 */
+	public void testGetName()
+	{
+		String name = _symbol.getName();
+		assertNotNull(name);
+		assertTrue(name.length() > 0);
+	}
+}

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

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageTest.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/ImageTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageTest.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.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;
-
-
-/**
- * 
- * A collection of simple test-cases to make sure that the DTFJ Image Interface agrees with its documented
- * behaviour.
- */
-public class ImageTest extends AbstractImageTestcase
-{
-	private Image _core=null;
-	protected void setUp() throws Exception
-	{
-		try {
-			//this is required to load the core file image which is to be tested so that we don't have to load each time
-			_core = defaultTestingImage();
-		} catch (Throwable t) {
-			t.printStackTrace();
-			fail();
-		}
-		super.setUp();
-	}
-	
-	
-	//now, onto the testing
-	
-	/**
-	 * ensure that the core has non-null address spaces and at least one
-	 */
-	public void testGetAddressSpaces() {
-		List it = _core.getAddressSpaces();
-		
-		assertNotNull(it);
-		assertFalse(it.isEmpty());
-	}
-	
-	/**
-	 * make sure that the creation time is sane (>0)
-	 */
-	public void testGetCreationTime() {
-		try {
-			assertTrue(_core.getCreationTime() > 0);
-		} catch (DataUnavailable e) {
-			//spec correct
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * test that the installed memory is sane or not known
-	 */
-	public void testGetInstalledMemory() {
-		try {
-			assertTrue(_core.getInstalledMemory() > 0);
-		} catch (DataUnavailable e) {
-			//this is considered acceptable behaviour
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * make sure that we get a sane number of processors or unknown
-	 */
-	public void testGetProcessorCount() {
-		try {
-			assertTrue(_core.getProcessorCount() > 0);
-		} catch (DataUnavailable e) {
-			//this is considered acceptable behaviour
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * Make sure that the processor subtype is non-null
-	 * TODO:  this probably isn't the right way to test this
-	 */
-	public void testGetProcessorSubtype() {
-		try {
-			assertNotNull(_core.getProcessorSubType());
-		} catch (DataUnavailable e) {
-			//accepted in spec
-		} catch (CorruptDataException e) {
-			//accepted in spec
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * Make sure that we get a processor name
-	 */
-	public void testGetProcessorType() {
-		try {
-			assertNotNull(_core.getProcessorType());
-		} catch (DataUnavailable e) {
-			//this exception is supported by the API so it is ok
-		} catch (CorruptDataException e) {
-			//this exception is supported by the API so it is ok
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * Make sure that there is a system sub-type
-	 * TODO:  this probably isn't the right way to test this
-	 */
-	public void testGetSystemSubType() {
-		try {
-			assertNotNull(_core.getSystemSubType());
-		} catch (DataUnavailable e) {
-			//accepted in spec
-		} catch (CorruptDataException e) {
-			//accepted in spec
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * Make sure that there is a system type
-	 */
-	public void testGetSystemType() {
-		try {
-			assertNotNull(_core.getSystemType());
-		} catch (DataUnavailable e) {
-			//this exception is supported by the API so it is ok
-		} catch (CorruptDataException e) {
-			//this exception is supported by the API so it is ok
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * Ensures that the string is non-null and throws no unexpected exceptions
-	 */
-	public void testGetHostName()
-	{
-		try {
-			assertNotNull(_core.getHostName());
-		} catch (DataUnavailable e) {
-			//this exception is supported by the API so it is ok
-		} catch (CorruptDataException e) {
-			//this exception is supported by the API so it is ok
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-	
-	/**
-	 * Ensures that the iterator is non-null, throws no expected exceptions, and every member is an InetAddress
-	 */
-	public void testGetIPAddresses()
-	{
-		try {
-			Iterator addresses = _core.getIPAddresses();
-			assertNotNull(addresses);
-			while (addresses.hasNext()) {
-				Object address = addresses.next();
-				assertTrue((address instanceof java.net.InetAddress) 
-						|| (address instanceof CorruptData));
-			}
-		} catch (DataUnavailable e) {
-			//this exception is supported by the API so it is ok
-		} catch (Throwable t) {
-			//exception fall-through
-			fail();
-		}
-	}
-}
+/*******************************************************************************
+ * 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;
+
+
+/**
+ * 
+ * A collection of simple test-cases to make sure that the DTFJ Image Interface agrees with its documented
+ * behaviour.
+ */
+public class ImageTest extends AbstractImageTestcase
+{
+	private Image _core=null;
+	protected void setUp() throws Exception
+	{
+		try {
+			//this is required to load the core file image which is to be tested so that we don't have to load each time
+			_core = defaultTestingImage();
+		} catch (Throwable t) {
+			t.printStackTrace();
+			fail();
+		}
+		super.setUp();
+	}
+	
+	
+	//now, onto the testing
+	
+	/**
+	 * ensure that the core has non-null address spaces and at least one
+	 */
+	public void testGetAddressSpaces() {
+		List it = _core.getAddressSpaces();
+		
+		assertNotNull(it);
+		assertFalse(it.isEmpty());
+	}
+	
+	/**
+	 * make sure that the creation time is sane (>0)
+	 */
+	public void testGetCreationTime() {
+		try {
+			assertTrue(_core.getCreationTime() > 0);
+		} catch (DataUnavailable e) {
+			//spec correct
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * test that the installed memory is sane or not known
+	 */
+	public void testGetInstalledMemory() {
+		try {
+			assertTrue(_core.getInstalledMemory() > 0);
+		} catch (DataUnavailable e) {
+			//this is considered acceptable behaviour
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * make sure that we get a sane number of processors or unknown
+	 */
+	public void testGetProcessorCount() {
+		try {
+			assertTrue(_core.getProcessorCount() > 0);
+		} catch (DataUnavailable e) {
+			//this is considered acceptable behaviour
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * Make sure that the processor subtype is non-null
+	 * TODO:  this probably isn't the right way to test this
+	 */
+	public void testGetProcessorSubtype() {
+		try {
+			assertNotNull(_core.getProcessorSubType());
+		} catch (DataUnavailable e) {
+			//accepted in spec
+		} catch (CorruptDataException e) {
+			//accepted in spec
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * Make sure that we get a processor name
+	 */
+	public void testGetProcessorType() {
+		try {
+			assertNotNull(_core.getProcessorType());
+		} catch (DataUnavailable e) {
+			//this exception is supported by the API so it is ok
+		} catch (CorruptDataException e) {
+			//this exception is supported by the API so it is ok
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * Make sure that there is a system sub-type
+	 * TODO:  this probably isn't the right way to test this
+	 */
+	public void testGetSystemSubType() {
+		try {
+			assertNotNull(_core.getSystemSubType());
+		} catch (DataUnavailable e) {
+			//accepted in spec
+		} catch (CorruptDataException e) {
+			//accepted in spec
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * Make sure that there is a system type
+	 */
+	public void testGetSystemType() {
+		try {
+			assertNotNull(_core.getSystemType());
+		} catch (DataUnavailable e) {
+			//this exception is supported by the API so it is ok
+		} catch (CorruptDataException e) {
+			//this exception is supported by the API so it is ok
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * Ensures that the string is non-null and throws no unexpected exceptions
+	 */
+	public void testGetHostName()
+	{
+		try {
+			assertNotNull(_core.getHostName());
+		} catch (DataUnavailable e) {
+			//this exception is supported by the API so it is ok
+		} catch (CorruptDataException e) {
+			//this exception is supported by the API so it is ok
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+	
+	/**
+	 * Ensures that the iterator is non-null, throws no expected exceptions, and every member is an InetAddress
+	 */
+	public void testGetIPAddresses()
+	{
+		try {
+			Iterator addresses = _core.getIPAddresses();
+			assertNotNull(addresses);
+			while (addresses.hasNext()) {
+				Object address = addresses.next();
+				assertTrue((address instanceof java.net.InetAddress) 
+						|| (address instanceof CorruptData));
+			}
+		} catch (DataUnavailable e) {
+			//this exception is supported by the API so it is ok
+		} catch (Throwable t) {
+			//exception fall-through
+			fail();
+		}
+	}
+}

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

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageThreadTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageThreadTest.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/ImageThreadTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageThreadTest.java Mon Nov 23 15:53:48 2009
@@ -1,117 +1,117 @@
-/*******************************************************************************
- * 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.CorruptData;
-import javax.tools.diagnostics.image.DataUnavailable;
-import javax.tools.diagnostics.image.ImageRegister;
-import javax.tools.diagnostics.image.ImageSection;
-import javax.tools.diagnostics.image.ImageStackFrame;
-import javax.tools.diagnostics.image.ImageThread;
-
-
-public class ImageThreadTest extends AbstractImageTestcase
-{
-	private ImageThread _thread = null;
-	
-	protected void setUp() throws Exception
-	{
-		_thread = defaultImageThread();
-		assertNotNull(_thread);
-		super.setUp();
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getID()'
-	 */
-	public void testGetID()
-	{
-		try {
-			String id = _thread.getID();
-			assertNotNull(id);
-			Long.decode(id);
-		} catch (Exception e) {
-			fail();
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getStackFrames()'
-	 * 
-	 * Ensures that a non-null iterator is returned with at lzero or more elements
-	 * of type ImageStackFrame or CorruptData.
-	 * 
-	 */
-	public void testGetStackFrames()
-	{
-		try {
-			Iterator frames = _thread.getStackFrames().iterator();
-			
-			assertNotNull(frames);
-			while (frames.hasNext()) {
-				Object frame = frames.next();
-				assertTrue((frame instanceof ImageStackFrame) || (frame instanceof CorruptData));
-			}
-		} catch (DataUnavailable e) {
-			//acceptable in spec
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getStackSections()'
-	 * 
-	 * Ensures that at least one stack section exists
-	 */
-	public void testGetStackSections()
-	{
-		Iterator it = _thread.getStackSections().iterator();
-		assertNotNull(it);
-		// empty iterator is a valid return from getStackFrames
-		while (it.hasNext()) {
-			Object section = it.next();
-			assertTrue((section instanceof ImageSection) || (section instanceof CorruptData));
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getRegisters()'
-	 * 
-	 * Ensures that a non-null, non-empty iterator is returned and all instances
-	 * are of type ImageRegister
-	 */
-	public void testGetRegisters()
-	{
-		Iterator regs = _thread.getRegisters().iterator();
-		
-		assertNotNull(regs);
-		// Empty iterator is a valid return from getRegisters
-		while (regs.hasNext()) {
-			Object reg = regs.next();
-			// if there are registers check they are valid
-			assertTrue(reg instanceof ImageRegister);
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getProperties()'
-	 * 
-	 * Ensures that non-null properties are returned
-	 */
-	public void testGetProperties()
-	{
-		assertNotNull(_thread.getProperties());
-	}
-}
+/*******************************************************************************
+ * 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.CorruptData;
+import javax.tools.diagnostics.image.DataUnavailable;
+import javax.tools.diagnostics.image.ImageRegister;
+import javax.tools.diagnostics.image.ImageSection;
+import javax.tools.diagnostics.image.ImageStackFrame;
+import javax.tools.diagnostics.image.ImageThread;
+
+
+public class ImageThreadTest extends AbstractImageTestcase
+{
+	private ImageThread _thread = null;
+	
+	protected void setUp() throws Exception
+	{
+		_thread = defaultImageThread();
+		assertNotNull(_thread);
+		super.setUp();
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getID()'
+	 */
+	public void testGetID()
+	{
+		try {
+			String id = _thread.getID();
+			assertNotNull(id);
+			Long.decode(id);
+		} catch (Exception e) {
+			fail();
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getStackFrames()'
+	 * 
+	 * Ensures that a non-null iterator is returned with at lzero or more elements
+	 * of type ImageStackFrame or CorruptData.
+	 * 
+	 */
+	public void testGetStackFrames()
+	{
+		try {
+			Iterator frames = _thread.getStackFrames().iterator();
+			
+			assertNotNull(frames);
+			while (frames.hasNext()) {
+				Object frame = frames.next();
+				assertTrue((frame instanceof ImageStackFrame) || (frame instanceof CorruptData));
+			}
+		} catch (DataUnavailable e) {
+			//acceptable in spec
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getStackSections()'
+	 * 
+	 * Ensures that at least one stack section exists
+	 */
+	public void testGetStackSections()
+	{
+		Iterator it = _thread.getStackSections().iterator();
+		assertNotNull(it);
+		// empty iterator is a valid return from getStackFrames
+		while (it.hasNext()) {
+			Object section = it.next();
+			assertTrue((section instanceof ImageSection) || (section instanceof CorruptData));
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getRegisters()'
+	 * 
+	 * Ensures that a non-null, non-empty iterator is returned and all instances
+	 * are of type ImageRegister
+	 */
+	public void testGetRegisters()
+	{
+		Iterator regs = _thread.getRegisters().iterator();
+		
+		assertNotNull(regs);
+		// Empty iterator is a valid return from getRegisters
+		while (regs.hasNext()) {
+			Object reg = regs.next();
+			// if there are registers check they are valid
+			assertTrue(reg instanceof ImageRegister);
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.image.ImageThread.getProperties()'
+	 * 
+	 * Ensures that non-null properties are returned
+	 */
+	public void testGetProperties()
+	{
+		assertNotNull(_thread.getProperties());
+	}
+}

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

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/JavaClassLoaderTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/JavaClassLoaderTest.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/JavaClassLoaderTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/JavaClassLoaderTest.java Mon Nov 23 15:53:48 2009
@@ -1,119 +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 org.apache.kato.tests.junit;
-
-import java.util.Iterator;
-
-import javax.tools.diagnostics.image.CorruptDataException;
-import javax.tools.diagnostics.runtime.java.JavaClass;
-import javax.tools.diagnostics.runtime.java.JavaClassLoader;
-import javax.tools.diagnostics.runtime.java.JavaObject;
-
-
-public class JavaClassLoaderTest extends AbstractImageTestcase
-{
-	private JavaClassLoader _loader;
-	
-	protected void setUp() throws Exception
-	{
-		_loader = defaultJavaClassLoader();
-		super.setUp();
-	}
-	
-	
-	/**
-	 * Ensure that the classes iterator is non-null
-	 */
-	public void testGetDefinedClasses()
-	{
-		Iterator iter = _loader.getDefinedClasses().iterator();
-		assertNotNull(iter);
-	}
-
-	/**
-	 * Ensure that the cached classes iterator is non-null
-	 */
-	public void testGetCachedClasses()
-	{
-		Iterator iter = _loader.getCachedClasses().iterator();
-		assertNotNull(iter);
-	}
-
-	/**
-	 * 
-	 * Grab any class, then try looking up a class with that name since we know it is there
-	 */
-	public void testFindClass()
-	{
-		JavaClass oneClass = (JavaClass) _loader.getDefinedClasses().get(0);
-		try {
-			String name = oneClass.getName();
-			JavaClass foundClass = _loader.findClass(name);
-			//make sure that it came out
-			assertNotNull(foundClass);
-			//classes might not be the same instance but they should be comparable to each other if they are the same entity
-			assertTrue(foundClass.equals(oneClass));
-		} catch (CorruptDataException e) {
-		}
-	}
-
-	/**
-	 * 
-	 * Ensure that the class loader object exists and is an instance of java.lang.ClassLoader
-	 * or some class that inherits from it
-	 */
-	public void testGetObject()
-	{
-		try {
-			JavaObject loader = _loader.getObject();
-			boolean didMatch = false;
-			JavaClass oneClass = loader.getJavaClass();
-			while ((!didMatch) && (null != oneClass)) {
-				if (oneClass.getName().equals("java/lang/ClassLoader")) {
-					didMatch = true;
-				}
-				oneClass = oneClass.getSuperclass();
-			}
-			assertTrue(didMatch);
-		} catch (CorruptDataException e) {
-			//technically, this is valid
-		}
-		
-	}
-
-	/**
-	 * Verify that the equals call doesn't throw
-	 */
-	public void testEquals()
-	{
-		try{
-			assertTrue(_loader.equals(_loader));
-		} 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 != _loader.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 java.util.Iterator;
+
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaClassLoader;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+
+public class JavaClassLoaderTest extends AbstractImageTestcase
+{
+	private JavaClassLoader _loader;
+	
+	protected void setUp() throws Exception
+	{
+		_loader = defaultJavaClassLoader();
+		super.setUp();
+	}
+	
+	
+	/**
+	 * Ensure that the classes iterator is non-null
+	 */
+	public void testGetDefinedClasses()
+	{
+		Iterator iter = _loader.getDefinedClasses().iterator();
+		assertNotNull(iter);
+	}
+
+	/**
+	 * Ensure that the cached classes iterator is non-null
+	 */
+	public void testGetCachedClasses()
+	{
+		Iterator iter = _loader.getCachedClasses().iterator();
+		assertNotNull(iter);
+	}
+
+	/**
+	 * 
+	 * Grab any class, then try looking up a class with that name since we know it is there
+	 */
+	public void testFindClass()
+	{
+		JavaClass oneClass = (JavaClass) _loader.getDefinedClasses().get(0);
+		try {
+			String name = oneClass.getName();
+			JavaClass foundClass = _loader.findClass(name);
+			//make sure that it came out
+			assertNotNull(foundClass);
+			//classes might not be the same instance but they should be comparable to each other if they are the same entity
+			assertTrue(foundClass.equals(oneClass));
+		} catch (CorruptDataException e) {
+		}
+	}
+
+	/**
+	 * 
+	 * Ensure that the class loader object exists and is an instance of java.lang.ClassLoader
+	 * or some class that inherits from it
+	 */
+	public void testGetObject()
+	{
+		try {
+			JavaObject loader = _loader.getObject();
+			boolean didMatch = false;
+			JavaClass oneClass = loader.getJavaClass();
+			while ((!didMatch) && (null != oneClass)) {
+				if (oneClass.getName().equals("java/lang/ClassLoader")) {
+					didMatch = true;
+				}
+				oneClass = oneClass.getSuperclass();
+			}
+			assertTrue(didMatch);
+		} catch (CorruptDataException e) {
+			//technically, this is valid
+		}
+		
+	}
+
+	/**
+	 * Verify that the equals call doesn't throw
+	 */
+	public void testEquals()
+	{
+		try{
+			assertTrue(_loader.equals(_loader));
+		} 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 != _loader.hashCode());
+		} catch (Throwable t) {
+			assertTrue(false);
+		}
+	}
+}

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

Modified: incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/JavaClassTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/JavaClassTest.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/JavaClassTest.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/JavaClassTest.java Mon Nov 23 15:53:48 2009
@@ -1,534 +1,534 @@
-/*******************************************************************************
- * 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.Arrays;
-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.ImagePointer;
-import javax.tools.diagnostics.image.MemoryAccessException;
-import javax.tools.diagnostics.runtime.java.JavaClass;
-import javax.tools.diagnostics.runtime.java.JavaClassLoader;
-import javax.tools.diagnostics.runtime.java.JavaField;
-import javax.tools.diagnostics.runtime.java.JavaMethod;
-import javax.tools.diagnostics.runtime.java.JavaObject;
-import javax.tools.diagnostics.runtime.java.JavaReference;
-
-import org.apache.kato.tests.scenarios.ArrayletTest;
-
-
-public class JavaClassTest extends AbstractImageTestcase
-{
-	
-	public class Super {
-		int superField1 = 3;
-		String superField2 = "Ciao";
-	}
-	
-	public class Sub extends Super {
-		long subField1 = 100;
-		char[] subField2 = new char[]{'c','c'};
-		
-		public Sub() {
-			System.out.println("Sub instantiated");
-		}
-	}
-	
-	private JavaClass _testClass;
-	private JavaObject _arrayInstance;	//array classes aren't loaded like normal classes and only come into existence when an array object is created
-	private static Sub _subClassObject = null;
-	private static ArrayletTest _testDeadlock = null;
-	
-	protected void setUp() throws Exception
-	{
-		try {
-			_testClass = defaultJavaClass();
-			_arrayInstance = defaultJavaObject(true);
-			super.setUp();
-		} catch (TestNotImplementedException e) {
-			throw e;
-		} 
-	}
-
-	public void configureDeclareFieldsNotInherited() {
-		_subClassObject = new Sub();
-	}
-
-	public void configureArraylets() {
-		_testDeadlock = new ArrayletTest();
-	}
-
-	
-	/*
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getObject()'
-	 */
-	public void testGetObject()
-	{
-		try {
-			JavaObject object = _testClass.getObject();
-			assertNotNull(object);
-			/* validate that the object is an instance of java/lang/Class */
-			JavaClass javaLangClass = object.getJavaClass();
-			assertNotNull(javaLangClass);
-			assertEquals(javaLangClass.getName(), "java/lang/Class");
-			
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getClassLoader()'
-	 */
-	public void testGetClassLoader()
-	{
-		try {
-			JavaClassLoader loader = _testClass.getClassLoader();
-			assertNotNull(loader);
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getName()'
-	 */
-	public void testGetName()
-	{
-		try {
-			String name = _testClass.getName();
-			assertNotNull(name);
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getSuperclass()'
-	 */
-	public void testGetSuperclass()
-	{
-		try {
-			JavaClass superClass = _testClass.getSuperclass();
-			assertNotNull(superClass);
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getInterfaces()'
-	 */
-	public void testGetInterfaces()
-	{
-		try {
-			List iter = _testClass.getInterfaces();
-			assertNotNull(iter);
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getModifiers()'
-	 */
-	public void testGetModifiers()
-	{
-		try {
-			_testClass.getModifiers();
-			//fill in any checks that could be used for validity here
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/*
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.isArray()'
-	 */
-	public void testIsArray()
-	{
-		//any result is safe so long as it doesn't throw something unexpected
-		try {
-			_testClass.isArray();
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getComponentType()'
-	 * 
-	 * Ensures that we get a non-null component type which has a non-null, non-empty length
-	 */
-	public void testGetComponentType()
-	{
-		JavaClass arrayClass = null;
-		JavaClass component = null;
-		try {
-			arrayClass = _arrayInstance.getJavaClass();
-			component = arrayClass.getComponentType();
-		} catch (CorruptDataException e) {
-			//allowed by the spec
-		}
-		assertNotNull(component);
-		String name=null;
-		try {
-			name = component.getName();
-		} catch (CorruptDataException e) {
-		}
-		assertNotNull(name);
-		assertTrue(name.length() > 0);
-		
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getDeclaredFields()'
-	 * 
-	 * Ensures that we get a non-null iterator and anything in the iterator is an instance
-	 * of JavaField or CorruptData
-	 */
-	public void testGetDeclaredFields()
-	{
-		try {
-			Iterator fields = _testClass.getDeclaredFields().iterator();
-			assertNotNull(fields);
-			while (fields.hasNext()) {
-				Object element = fields.next();
-				assertTrue((element instanceof JavaField) || (element instanceof CorruptData));
-			}
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getDeclaredMethods()'
-	 * 
-	 * Ensures that the declared methods iterator is non-null and any methods in it
-	 * are either JavaMethod or CorruptData
-	 */
-	public void testGetDeclaredMethods()
-	{
-		try {
-			Iterator methods = _testClass.getDeclaredMethods().iterator();
-			assertNotNull(methods);
-			while (methods.hasNext()) {
-				Object instance = methods.next();
-				assertTrue((instance instanceof JavaMethod) || (instance instanceof CorruptData));
-			}
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getConstantPoolReferences()'
-	 * 
-	 * Ensures that the test class returns a non-null iterator and that any elements
-	 * in it are either JavaObject or CorruptData
-	 */
-	public void testGetConstantPoolReferences()
-	{
-		try {
-			Iterator references = _testClass.getConstantPoolReferences().iterator();
-			assertNotNull(references);
-			while (references.hasNext()) {
-				Object instance = references.next();
-				assertTrue((instance instanceof JavaObject) || (instance instanceof CorruptData));
-				if (instance instanceof JavaObject) {
-					// ensure that these are valid objects by reading the class
-					JavaObject object = (JavaObject)instance;
-					JavaClass clazz = object.getJavaClass();
-					assertNotNull(clazz);
-				}
-			} 
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getID()'
-	 * 
-	 * Ensures that the pointer is non-null and that the underlying address is non-zero
-	 */
-	public void testGetID()
-	{
-		try {
-			ImagePointer id = _testClass.getID();
-			assertNotNull(id);
-			assertTrue(0 != id.getAddress());
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getReferences()'
-	 * 
-	 * Ensures that the test class returns a non-null iterator, that any elements in it are 
-	 * either JavaReference or CorruptData, and that any JavaReference objects have a non-null 
-	 * description.
-	 */
-	public void testGetReferences()
-	{
-		try {
-			Iterator references = _testClass.getReferences().iterator();
-			assertNotNull(references);
-			while (references.hasNext()) {
-				Object instance = references.next();
-				assertTrue((instance instanceof JavaReference) || (instance instanceof CorruptData));
-				if (instance instanceof JavaReference) {
-					// sniff these objects by getting the description
-					JavaReference object = (JavaReference)instance;
-					String description = object.getDescription();
-					assertNotNull(description);
-				}
-			} 
-		} catch (Exception e) {
-			// if we caught anything else, this is a failure
-			fail();
-		}	
-	}
-	
-	/**
-	 * Verify that the equals call doesn't throw
-	 */
-	public void testEquals()
-	{
-		try{
-			assertTrue(_testClass.equals(_testClass));
-		} catch (Throwable t) {
-			//if we fail internally, we want to flag that as a test failure, not just an error
-			t.printStackTrace();
-			fail();
-		}
-	}
-	
-	/**
-	 * 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 != _testClass.hashCode());
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-	
-	public void testDeclaredFieldsNotInherited()
-	{
-		try {
-			//search all the loaders for a class which we know we had in the address space
-			String candidateClass = this.getClass().getName()+"$Sub";
-			candidateClass = candidateClass.replace('.', '/');
-			JavaClass subclass = _findClassForName(candidateClass);
-			if (null == subclass) {
-				//not finding this testing class makes this test useless
-				//note that this can also happen if we are working with a corrupt core file
-				throw new TestNotImplementedException();
-			}
-			JavaClass superclass = null;
-			try {
-				superclass = subclass.getSuperclass();
-			} catch (CorruptDataException e) {
-				//even though this would be valid, it isn't helpful for our case 
-				throw new TestNotImplementedException();
-			}
-			if (null == superclass) {
-				//not finding this testing class makes this test useless
-				throw new TestNotImplementedException();
-			}
-			//now make sure that none of the fields in subclass are in superclass
-			Iterator subfields = subclass.getDeclaredFields().iterator();
-			while (subfields.hasNext()) {
-				Object subtest = subfields.next();
-				Iterator superfields = superclass.getDeclaredFields().iterator();
-				
-				while (superfields.hasNext()) {
-					Object supertest = superfields.next();
-					assertFalse(supertest.equals(subtest));
-				}
-			}
-		} catch (TestNotImplementedException t) {
-			//we wanted this exception to break the test case with error instead of failure so re-throw
-			throw t;
-		} catch (Exception e) {
-			//if we caught anything else, this is an error
-			fail();
-		}
-	}
-
-	private JavaClass _findClassForName(String candidateClass)
-	{
-		Iterator allLoaders = defaultJavaRuntime().getJavaClassLoaders().iterator();
-		JavaClass subclass = null;
-		while (allLoaders.hasNext() && (null == subclass)) {
-			JavaClassLoader loader = (JavaClassLoader) allLoaders.next();
-			Iterator classes = loader.getDefinedClasses().iterator();
-			while (classes.hasNext()  && (null == subclass)) {
-				JavaClass oneClass = (JavaClass) classes.next();
-				try {
-					if (oneClass.getName().equals(candidateClass)) {
-						subclass = oneClass;
-						break;
-					}
-				} catch (CorruptDataException e) {
-					//even though this would be valid, it isn't helpful for our case 
-					throw new TestNotImplementedException();
-				}
-			}
-		}
-		return subclass;
-	}
-	
-	/**
-	 * This test should eventually be moved out to a stand-alone high-level test since it is looking for a specific
-	 * field to verify that arraycopy and arraylets (in the RTJ case) work properly.
-	 */
-	public void testArraylets()
-	{
-		String staticSizeName = "DTFJ_ARRAYLET_LENGTH";
-		String staticName = "DTFJ_ARRAYLET_TEST_INSTANCE";
-		JavaClass candidateClass = _findClassForName("org/apache/kato/tests/scenarios/ArrayletTest");
-		
-		if (null != candidateClass) {
-			int size = 0;
-			JavaObject container = null;
-			Iterator fields = candidateClass.getDeclaredFields().iterator();
-			
-			try {
-				while (fields.hasNext()) {
-					JavaField field = (JavaField) fields.next();
-					String fieldName = field.getName();
-					
-					if (fieldName.equals(staticSizeName)) {
-						size = field.getInt(null);
-					} else  if (fieldName.equals(staticName)) {
-						container = (JavaObject) field.get(null);
-					}
-				}
-				//now ensure that we actually have something to test with
-				if ((0 != size) && (null != container)) {
-					//now, pull apart the fields of the container
-					JavaClass containerClass = container.getJavaClass();
-					Iterator theseFields = containerClass.getDeclaredFields().iterator();
-					while (theseFields.hasNext()) {
-						JavaField oneField = (JavaField) theseFields.next();
-						if (oneField.getName().equals("DTFJ_ARRAYLET_INTS")) {
-							//run the int test
-							JavaObject array = (JavaObject) oneField.get(container);
-							int remote[] = new int[size];
-							int whole[] = new int[size];
-							for (int i = 0; i < size; i++) {
-								array.arraycopy(i, remote, i, 1);
-								assertTrue(remote[i] == (size -i));
-							}
-							array.arraycopy(0, whole, 0, size);
-							assertTrue(Arrays.equals(whole, remote));
-						} else if (oneField.getName().equals("DTFJ_ARRAYLET_BYTES")) {
-							//run the byte test
-							JavaObject array = (JavaObject) oneField.get(container);
-							byte remote[] = new byte[size];
-							byte whole[] = new byte[size];
-							for (int i = 0; i < size; i++) {
-								array.arraycopy(i, remote, i, 1);
-								assertTrue(remote[i] ==  ((byte)(size -i)));
-							}
-							array.arraycopy(0, whole, 0, size);
-							assertTrue(Arrays.equals(whole, remote));
-						} else if (oneField.getName().equals("DTFJ_ARRAYLET_STRINGCONTAINER")) {
-							//run the byte test
-							JavaObject array = (JavaObject) oneField.get(container);
-							JavaObject whole[] = new JavaObject[size];
-							array.arraycopy(0, whole, 0, size);
-							JavaField stringField = null;
-							Iterator iter = whole[0].getJavaClass().getDeclaredFields().iterator();
-							while(iter.hasNext()) {
-								JavaField testField = (JavaField) iter.next();
-								if (testField.getName().equals("_stringField")) {
-									//this is the field
-									stringField = testField;
-								}
-							}
-							assertNotNull(stringField);
-							//now extract the string fields
-							for (int i = 0; i < whole.length; i++) {
-								String stringContent = stringField.getString(whole[i]);
-								assertTrue(stringContent.equals(Integer.toString(size-i)));
-							}
-						}
-					}
-				} else {
-					//we are missing something required to run the test
-					throw new TestNotImplementedException();
-				}
-			} catch (CorruptDataException e) {
-				//if anything went wrong, we can't run the test
-				throw new TestNotImplementedException();
-			} catch (MemoryAccessException e) {
-				assertNotNull(e.getPointer());
-				//if anything went wrong, we can't run the test
-				throw new TestNotImplementedException();
-			} catch (Exception e) {
-				//if we caught anything else, this is an error
-				fail();
-			}
-		} else {
-			//the class isn't there so say we can't run the test
-			throw new TestNotImplementedException();
-		}
-	}
-
-	/**
-	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.toString()' 
-	 * 
-	 */
-	public void testToString()
-	{
-		String theString = _testClass.toString();
-		assertNotNull(theString);
-		assertTrue(theString.length() >= 0 );
-	}
-
-}
+/*******************************************************************************
+ * 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.Arrays;
+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.ImagePointer;
+import javax.tools.diagnostics.image.MemoryAccessException;
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaClassLoader;
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaMethod;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+import javax.tools.diagnostics.runtime.java.JavaReference;
+
+import org.apache.kato.tests.scenarios.ArrayletTest;
+
+
+public class JavaClassTest extends AbstractImageTestcase
+{
+	
+	public class Super {
+		int superField1 = 3;
+		String superField2 = "Ciao";
+	}
+	
+	public class Sub extends Super {
+		long subField1 = 100;
+		char[] subField2 = new char[]{'c','c'};
+		
+		public Sub() {
+			System.out.println("Sub instantiated");
+		}
+	}
+	
+	private JavaClass _testClass;
+	private JavaObject _arrayInstance;	//array classes aren't loaded like normal classes and only come into existence when an array object is created
+	private static Sub _subClassObject = null;
+	private static ArrayletTest _testDeadlock = null;
+	
+	protected void setUp() throws Exception
+	{
+		try {
+			_testClass = defaultJavaClass();
+			_arrayInstance = defaultJavaObject(true);
+			super.setUp();
+		} catch (TestNotImplementedException e) {
+			throw e;
+		} 
+	}
+
+	public void configureDeclareFieldsNotInherited() {
+		_subClassObject = new Sub();
+	}
+
+	public void configureArraylets() {
+		_testDeadlock = new ArrayletTest();
+	}
+
+	
+	/*
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getObject()'
+	 */
+	public void testGetObject()
+	{
+		try {
+			JavaObject object = _testClass.getObject();
+			assertNotNull(object);
+			/* validate that the object is an instance of java/lang/Class */
+			JavaClass javaLangClass = object.getJavaClass();
+			assertNotNull(javaLangClass);
+			assertEquals(javaLangClass.getName(), "java/lang/Class");
+			
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getClassLoader()'
+	 */
+	public void testGetClassLoader()
+	{
+		try {
+			JavaClassLoader loader = _testClass.getClassLoader();
+			assertNotNull(loader);
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getName()'
+	 */
+	public void testGetName()
+	{
+		try {
+			String name = _testClass.getName();
+			assertNotNull(name);
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getSuperclass()'
+	 */
+	public void testGetSuperclass()
+	{
+		try {
+			JavaClass superClass = _testClass.getSuperclass();
+			assertNotNull(superClass);
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getInterfaces()'
+	 */
+	public void testGetInterfaces()
+	{
+		try {
+			List iter = _testClass.getInterfaces();
+			assertNotNull(iter);
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getModifiers()'
+	 */
+	public void testGetModifiers()
+	{
+		try {
+			_testClass.getModifiers();
+			//fill in any checks that could be used for validity here
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/*
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.isArray()'
+	 */
+	public void testIsArray()
+	{
+		//any result is safe so long as it doesn't throw something unexpected
+		try {
+			_testClass.isArray();
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getComponentType()'
+	 * 
+	 * Ensures that we get a non-null component type which has a non-null, non-empty length
+	 */
+	public void testGetComponentType()
+	{
+		JavaClass arrayClass = null;
+		JavaClass component = null;
+		try {
+			arrayClass = _arrayInstance.getJavaClass();
+			component = arrayClass.getComponentType();
+		} catch (CorruptDataException e) {
+			//allowed by the spec
+		}
+		assertNotNull(component);
+		String name=null;
+		try {
+			name = component.getName();
+		} catch (CorruptDataException e) {
+		}
+		assertNotNull(name);
+		assertTrue(name.length() > 0);
+		
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getDeclaredFields()'
+	 * 
+	 * Ensures that we get a non-null iterator and anything in the iterator is an instance
+	 * of JavaField or CorruptData
+	 */
+	public void testGetDeclaredFields()
+	{
+		try {
+			Iterator fields = _testClass.getDeclaredFields().iterator();
+			assertNotNull(fields);
+			while (fields.hasNext()) {
+				Object element = fields.next();
+				assertTrue((element instanceof JavaField) || (element instanceof CorruptData));
+			}
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getDeclaredMethods()'
+	 * 
+	 * Ensures that the declared methods iterator is non-null and any methods in it
+	 * are either JavaMethod or CorruptData
+	 */
+	public void testGetDeclaredMethods()
+	{
+		try {
+			Iterator methods = _testClass.getDeclaredMethods().iterator();
+			assertNotNull(methods);
+			while (methods.hasNext()) {
+				Object instance = methods.next();
+				assertTrue((instance instanceof JavaMethod) || (instance instanceof CorruptData));
+			}
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getConstantPoolReferences()'
+	 * 
+	 * Ensures that the test class returns a non-null iterator and that any elements
+	 * in it are either JavaObject or CorruptData
+	 */
+	public void testGetConstantPoolReferences()
+	{
+		try {
+			Iterator references = _testClass.getConstantPoolReferences().iterator();
+			assertNotNull(references);
+			while (references.hasNext()) {
+				Object instance = references.next();
+				assertTrue((instance instanceof JavaObject) || (instance instanceof CorruptData));
+				if (instance instanceof JavaObject) {
+					// ensure that these are valid objects by reading the class
+					JavaObject object = (JavaObject)instance;
+					JavaClass clazz = object.getJavaClass();
+					assertNotNull(clazz);
+				}
+			} 
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getID()'
+	 * 
+	 * Ensures that the pointer is non-null and that the underlying address is non-zero
+	 */
+	public void testGetID()
+	{
+		try {
+			ImagePointer id = _testClass.getID();
+			assertNotNull(id);
+			assertTrue(0 != id.getAddress());
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.getReferences()'
+	 * 
+	 * Ensures that the test class returns a non-null iterator, that any elements in it are 
+	 * either JavaReference or CorruptData, and that any JavaReference objects have a non-null 
+	 * description.
+	 */
+	public void testGetReferences()
+	{
+		try {
+			Iterator references = _testClass.getReferences().iterator();
+			assertNotNull(references);
+			while (references.hasNext()) {
+				Object instance = references.next();
+				assertTrue((instance instanceof JavaReference) || (instance instanceof CorruptData));
+				if (instance instanceof JavaReference) {
+					// sniff these objects by getting the description
+					JavaReference object = (JavaReference)instance;
+					String description = object.getDescription();
+					assertNotNull(description);
+				}
+			} 
+		} catch (Exception e) {
+			// if we caught anything else, this is a failure
+			fail();
+		}	
+	}
+	
+	/**
+	 * Verify that the equals call doesn't throw
+	 */
+	public void testEquals()
+	{
+		try{
+			assertTrue(_testClass.equals(_testClass));
+		} catch (Throwable t) {
+			//if we fail internally, we want to flag that as a test failure, not just an error
+			t.printStackTrace();
+			fail();
+		}
+	}
+	
+	/**
+	 * 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 != _testClass.hashCode());
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+	
+	public void testDeclaredFieldsNotInherited()
+	{
+		try {
+			//search all the loaders for a class which we know we had in the address space
+			String candidateClass = this.getClass().getName()+"$Sub";
+			candidateClass = candidateClass.replace('.', '/');
+			JavaClass subclass = _findClassForName(candidateClass);
+			if (null == subclass) {
+				//not finding this testing class makes this test useless
+				//note that this can also happen if we are working with a corrupt core file
+				throw new TestNotImplementedException();
+			}
+			JavaClass superclass = null;
+			try {
+				superclass = subclass.getSuperclass();
+			} catch (CorruptDataException e) {
+				//even though this would be valid, it isn't helpful for our case 
+				throw new TestNotImplementedException();
+			}
+			if (null == superclass) {
+				//not finding this testing class makes this test useless
+				throw new TestNotImplementedException();
+			}
+			//now make sure that none of the fields in subclass are in superclass
+			Iterator subfields = subclass.getDeclaredFields().iterator();
+			while (subfields.hasNext()) {
+				Object subtest = subfields.next();
+				Iterator superfields = superclass.getDeclaredFields().iterator();
+				
+				while (superfields.hasNext()) {
+					Object supertest = superfields.next();
+					assertFalse(supertest.equals(subtest));
+				}
+			}
+		} catch (TestNotImplementedException t) {
+			//we wanted this exception to break the test case with error instead of failure so re-throw
+			throw t;
+		} catch (Exception e) {
+			//if we caught anything else, this is an error
+			fail();
+		}
+	}
+
+	private JavaClass _findClassForName(String candidateClass)
+	{
+		Iterator allLoaders = defaultJavaRuntime().getJavaClassLoaders().iterator();
+		JavaClass subclass = null;
+		while (allLoaders.hasNext() && (null == subclass)) {
+			JavaClassLoader loader = (JavaClassLoader) allLoaders.next();
+			Iterator classes = loader.getDefinedClasses().iterator();
+			while (classes.hasNext()  && (null == subclass)) {
+				JavaClass oneClass = (JavaClass) classes.next();
+				try {
+					if (oneClass.getName().equals(candidateClass)) {
+						subclass = oneClass;
+						break;
+					}
+				} catch (CorruptDataException e) {
+					//even though this would be valid, it isn't helpful for our case 
+					throw new TestNotImplementedException();
+				}
+			}
+		}
+		return subclass;
+	}
+	
+	/**
+	 * This test should eventually be moved out to a stand-alone high-level test since it is looking for a specific
+	 * field to verify that arraycopy and arraylets (in the RTJ case) work properly.
+	 */
+	public void testArraylets()
+	{
+		String staticSizeName = "DTFJ_ARRAYLET_LENGTH";
+		String staticName = "DTFJ_ARRAYLET_TEST_INSTANCE";
+		JavaClass candidateClass = _findClassForName("org/apache/kato/tests/scenarios/ArrayletTest");
+		
+		if (null != candidateClass) {
+			int size = 0;
+			JavaObject container = null;
+			Iterator fields = candidateClass.getDeclaredFields().iterator();
+			
+			try {
+				while (fields.hasNext()) {
+					JavaField field = (JavaField) fields.next();
+					String fieldName = field.getName();
+					
+					if (fieldName.equals(staticSizeName)) {
+						size = field.getInt(null);
+					} else  if (fieldName.equals(staticName)) {
+						container = (JavaObject) field.get(null);
+					}
+				}
+				//now ensure that we actually have something to test with
+				if ((0 != size) && (null != container)) {
+					//now, pull apart the fields of the container
+					JavaClass containerClass = container.getJavaClass();
+					Iterator theseFields = containerClass.getDeclaredFields().iterator();
+					while (theseFields.hasNext()) {
+						JavaField oneField = (JavaField) theseFields.next();
+						if (oneField.getName().equals("DTFJ_ARRAYLET_INTS")) {
+							//run the int test
+							JavaObject array = (JavaObject) oneField.get(container);
+							int remote[] = new int[size];
+							int whole[] = new int[size];
+							for (int i = 0; i < size; i++) {
+								array.arraycopy(i, remote, i, 1);
+								assertTrue(remote[i] == (size -i));
+							}
+							array.arraycopy(0, whole, 0, size);
+							assertTrue(Arrays.equals(whole, remote));
+						} else if (oneField.getName().equals("DTFJ_ARRAYLET_BYTES")) {
+							//run the byte test
+							JavaObject array = (JavaObject) oneField.get(container);
+							byte remote[] = new byte[size];
+							byte whole[] = new byte[size];
+							for (int i = 0; i < size; i++) {
+								array.arraycopy(i, remote, i, 1);
+								assertTrue(remote[i] ==  ((byte)(size -i)));
+							}
+							array.arraycopy(0, whole, 0, size);
+							assertTrue(Arrays.equals(whole, remote));
+						} else if (oneField.getName().equals("DTFJ_ARRAYLET_STRINGCONTAINER")) {
+							//run the byte test
+							JavaObject array = (JavaObject) oneField.get(container);
+							JavaObject whole[] = new JavaObject[size];
+							array.arraycopy(0, whole, 0, size);
+							JavaField stringField = null;
+							Iterator iter = whole[0].getJavaClass().getDeclaredFields().iterator();
+							while(iter.hasNext()) {
+								JavaField testField = (JavaField) iter.next();
+								if (testField.getName().equals("_stringField")) {
+									//this is the field
+									stringField = testField;
+								}
+							}
+							assertNotNull(stringField);
+							//now extract the string fields
+							for (int i = 0; i < whole.length; i++) {
+								String stringContent = stringField.getString(whole[i]);
+								assertTrue(stringContent.equals(Integer.toString(size-i)));
+							}
+						}
+					}
+				} else {
+					//we are missing something required to run the test
+					throw new TestNotImplementedException();
+				}
+			} catch (CorruptDataException e) {
+				//if anything went wrong, we can't run the test
+				throw new TestNotImplementedException();
+			} catch (MemoryAccessException e) {
+				assertNotNull(e.getPointer());
+				//if anything went wrong, we can't run the test
+				throw new TestNotImplementedException();
+			} catch (Exception e) {
+				//if we caught anything else, this is an error
+				fail();
+			}
+		} else {
+			//the class isn't there so say we can't run the test
+			throw new TestNotImplementedException();
+		}
+	}
+
+	/**
+	 * Test method for 'javax.tools.diagnostics.runtime.java.JavaClass.toString()' 
+	 * 
+	 */
+	public void testToString()
+	{
+		String theString = _testClass.toString();
+		assertNotNull(theString);
+		assertTrue(theString.length() >= 0 );
+	}
+
+}

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



Mime
View raw message