harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r386058 [49/49] - in /incubator/harmony/enhanced/classlib/trunk: make/ modules/archive/make/common/ modules/archive/src/test/java/tests/ modules/archive/src/test/java/tests/api/ modules/archive/src/test/java/tests/api/java/ modules/archive/...
Date Wed, 15 Mar 2006 11:47:39 GMT
Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TestResource_fr_FR_VAR.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TestResource_fr_FR_VAR.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TestResource_fr_FR_VAR.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TestResource_fr_FR_VAR.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,28 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.support;
+
+public class Support_TestResource_fr_FR_VAR extends
+		java.util.ListResourceBundle {
+
+	protected Object[][] getContents() {
+		Object[][] contents = { { "parent4", "frFRVARValue4" },
+				{ "child1", "frFRVARChildValue1" },
+				{ "child2", "frFRVARChildValue2" },
+				{ "child3", "frFRVARChildValue3" }, };
+		return contents;
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TimeZone.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TimeZone.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TimeZone.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_TimeZone.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,74 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.support;
+
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+/**
+ * Sample java.util.TimeZone subclass to test getDSTSavings() and getOffset(long)
+ * APIs
+ * 
+ */
+public class Support_TimeZone extends TimeZone {
+
+	int rawOffset;
+
+	boolean useDaylightTime;
+
+	public Support_TimeZone(int rawOffset, boolean useDaylightTime) {
+		this.rawOffset = rawOffset;
+		this.useDaylightTime = useDaylightTime;
+	}
+
+	public int getRawOffset() {
+		return rawOffset;
+	}
+
+	/**
+	 * let's assume this timezone has daylight savings from the 4th month till
+	 * the 10th month of the year to ame things simple.
+	 */
+	public boolean inDaylightTime(java.util.Date p1) {
+		if (!useDaylightTime)
+			return false;
+		GregorianCalendar cal = new GregorianCalendar();
+		cal.setTime(p1);
+		int month = cal.get(Calendar.MONTH);
+
+		if (month > 4 && month < 10)
+			return true;
+		else
+			return false;
+	}
+
+	public boolean useDaylightTime() {
+		return useDaylightTime;
+	}
+
+	/*
+	 * return 0 to keep it simple, since this subclass is not used to test this
+	 * method..
+	 */
+	public int getOffset(int p1, int p2, int p3, int p4, int p5, int p6) {
+		return 0;
+	}
+
+	public void setRawOffset(int p1) {
+		rawOffset = p1;
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_URLConnector.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_URLConnector.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_URLConnector.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_URLConnector.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,81 @@
+/* Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.support;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+
+/**
+ * This class implements the Support_HttpConnector interface using java.net
+ * URL's
+ */
+public class Support_URLConnector implements Support_HttpConnector {
+	private URLConnection instance;
+
+	private boolean streamOpen = false;
+
+	/**
+	 * @see com.ibm.support.Support_HttpConnector#open(String)
+	 */
+	public void open(String address) throws IOException {
+		instance = new URL(address).openConnection();
+	}
+
+	public void close() throws IOException {
+		if (!streamOpen) {
+			((HttpURLConnection) instance).disconnect();
+		}
+	}
+
+	/**
+	 * @see com.ibm.support.Support_HttpConnector#getInputStream()
+	 */
+	public InputStream getInputStream() throws IOException {
+		if (instance == null)
+			return null;
+		streamOpen = true;
+		return instance.getInputStream();
+	}
+
+	public OutputStream getOutputStream() throws IOException {
+		if (instance == null)
+			return null;
+		instance.setDoOutput(true);
+		((HttpURLConnection) instance).setRequestMethod("POST");
+		streamOpen = true;
+		return instance.getOutputStream();
+	}
+
+	public boolean isChunkedOnFlush() {
+		return false;
+	}
+
+	public void setRequestProperty(String key, String value) throws IOException {
+		instance.setRequestProperty(key, value);
+	}
+
+	public String getHeaderField(int index) throws IOException {
+		return ((HttpURLConnection) instance).getHeaderField(index);
+	}
+
+	public String getHeaderFieldKey(int index) throws IOException {
+		return ((HttpURLConnection) instance).getHeaderFieldKey(index);
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,108 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.support;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+public class Support_UnmodifiableCollectionTest extends
+		junit.framework.TestCase {
+
+	Collection col;
+
+	// must be a collection containing the Integers 0 to 99 (which will iterate
+	// in order)
+
+	public Support_UnmodifiableCollectionTest(String p1) {
+		super(p1);
+	}
+
+	public Support_UnmodifiableCollectionTest(String p1, Collection c) {
+		super(p1);
+		col = c;
+	}
+
+	public void runTest() {
+
+		// contains
+		assertTrue("UnmodifiableCollectionTest - should contain 0", col
+				.contains(new Integer(0)));
+		assertTrue("UnmodifiableCollectionTest - should contain 50", col
+				.contains(new Integer(50)));
+		assertTrue("UnmodifiableCollectionTest - should not contain 100", !col
+				.contains(new Integer(100)));
+
+		// containsAll
+		HashSet hs = new HashSet();
+		hs.add(new Integer(0));
+		hs.add(new Integer(25));
+		hs.add(new Integer(99));
+		assertTrue(
+				"UnmodifiableCollectionTest - should contain set of 0, 25, and 99",
+				col.containsAll(hs));
+		hs.add(new Integer(100));
+		assertTrue(
+				"UnmodifiableCollectionTest - should not contain set of 0, 25, 99 and 100",
+				!col.containsAll(hs));
+
+		// isEmpty
+		assertTrue("UnmodifiableCollectionTest - should not be empty", !col
+				.isEmpty());
+
+		// iterator
+		Iterator it = col.iterator();
+		SortedSet ss = new TreeSet();
+		while (it.hasNext()) {
+			ss.add(it.next());
+		}
+		it = ss.iterator();
+		for (int counter = 0; it.hasNext(); counter++) {
+			int nextValue = ((Integer) it.next()).intValue();
+			assertTrue(
+					"UnmodifiableCollectionTest - Iterator returned wrong value.  Wanted: "
+							+ counter + " got: " + nextValue,
+					nextValue == counter);
+		}
+
+		// size
+		assertTrue(
+				"UnmodifiableCollectionTest - returned wrong size.  Wanted 100, got: "
+						+ col.size(), col.size() == 100);
+
+		// toArray
+		Object[] objArray;
+		objArray = col.toArray();
+		for (int counter = 0; it.hasNext(); counter++) {
+			assertTrue(
+					"UnmodifiableCollectionTest - toArray returned incorrect array",
+					objArray[counter] == it.next());
+		}
+
+		// toArray (Object[])
+		objArray = new Object[100];
+		col.toArray(objArray);
+		for (int counter = 0; it.hasNext(); counter++) {
+			assertTrue(
+					"UnmodifiableCollectionTest - toArray(Object) filled array incorrectly",
+					objArray[counter] == it.next());
+		}
+
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,158 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.support;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+public class Support_UnmodifiableMapTest extends junit.framework.TestCase {
+
+	Map map;
+
+	// must be a map containing the string keys "0"-"99" paired with the Integer
+	// values Integer(0) to Integer(99)
+
+	public Support_UnmodifiableMapTest(String p1) {
+		super(p1);
+	}
+
+	public Support_UnmodifiableMapTest(String p1, Map m) {
+		super(p1);
+		map = m;
+	}
+
+	public void runTest() {
+		// containsKey
+		assertTrue("UnmodifiableMapTest - Should contain the key \"0\"", map
+				.containsKey("0"));
+		assertTrue("UnmodifiableMapTest - Should contain the key \"50\"", map
+				.containsKey("50"));
+		assertTrue("UnmodifiableMapTest - Should not contain the key \"100\"",
+				!map.containsKey("100"));
+
+		// containsValue
+		assertTrue("UnmodifiableMapTest - Should contain the value 0", map
+				.containsValue(new Integer(0)));
+		assertTrue("UnmodifiableMapTest - Should contain the value 50", map
+				.containsValue(new Integer(50)));
+		assertTrue("UnmodifiableMapTest - Should not contain value 100", !map
+				.containsValue(new Integer(100)));
+
+		// entrySet
+		Set entrySet = map.entrySet();
+		Iterator entrySetIterator = entrySet.iterator();
+		int myCounter = 0;
+		while (entrySetIterator.hasNext()) {
+			Map.Entry me = (Map.Entry) entrySetIterator.next();
+			assertTrue("UnmodifiableMapTest - Incorrect Map.Entry returned",
+					map.get(me.getKey()).equals(me.getValue()));
+			myCounter++;
+		}
+		assertTrue(
+				"UnmodifiableMapTest - Incorrect number of map entries returned",
+				myCounter == 100);
+
+		// get
+		assertTrue("UnmodifiableMapTest - getting \"0\" didn't return 0",
+				((Integer) map.get("0")).intValue() == 0);
+		assertTrue("UnmodifiableMapTest - getting \"50\" didn't return 0",
+				((Integer) map.get("0")).intValue() == 0);
+		assertTrue("UnmodifiableMapTest - getting \"100\" didn't return null",
+				map.get("100") == null);
+
+		// isEmpty
+		assertTrue(
+				"UnmodifiableMapTest - should have returned false to isEmpty",
+				!map.isEmpty());
+
+		// keySet
+		Set keySet = map.keySet();
+		t_KeySet(keySet);
+
+		// size
+		assertTrue("Size should return 100, returned: " + map.size(), map
+				.size() == 100);
+
+		// values
+		new Support_UnmodifiableCollectionTest("Unmod--from map test", map
+				.values());
+
+	}
+
+	void t_KeySet(Set keySet) {
+		// keySet should be a set of the strings "0" to "99"
+
+		// contains
+		assertTrue("UnmodifiableMapTest - keySetTest - should contain \"0\"",
+				keySet.contains("0"));
+		assertTrue("UnmodifiableMapTest - keySetTest - should contain \"50\"",
+				keySet.contains("50"));
+		assertTrue(
+				"UnmodifiableMapTest - keySetTest - should not contain \"100\"",
+				!keySet.contains("100"));
+
+		// containsAll
+		HashSet hs = new HashSet();
+		hs.add("0");
+		hs.add("25");
+		hs.add("99");
+		assertTrue(
+				"UnmodifiableMapTest - keySetTest - should contain set of \"0\", \"25\", and \"99\"",
+				keySet.containsAll(hs));
+		hs.add("100");
+		assertTrue(
+				"UnmodifiableMapTest - keySetTest - should not contain set of \"0\", \"25\", \"99\" and \"100\"",
+				!keySet.containsAll(hs));
+
+		// isEmpty
+		assertTrue("UnmodifiableMapTest - keySetTest - should not be empty",
+				!keySet.isEmpty());
+
+		// iterator
+		Iterator it = keySet.iterator();
+		while (it.hasNext()) {
+			assertTrue(
+					"UnmodifiableMapTest - keySetTest - Iterator returned wrong values",
+					keySet.contains(it.next()));
+		}
+
+		// size
+		assertTrue(
+				"UnmodifiableMapTest - keySetTest - returned wrong size.  Wanted 100, got: "
+						+ keySet.size(), keySet.size() == 100);
+
+		// toArray
+		Object[] objArray;
+		objArray = keySet.toArray();
+		for (int counter = 0; it.hasNext(); counter++) {
+			assertTrue(
+					"UnmodifiableMapTest - keySetTest - toArray returned incorrect array",
+					objArray[counter] == it.next());
+		}
+
+		// toArray (Object[])
+		objArray = new Object[100];
+		keySet.toArray(objArray);
+		for (int counter = 0; it.hasNext(); counter++) {
+			assertTrue(
+					"UnmodifiableMapTest - keySetTest - toArray(Object) filled array incorrectly",
+					objArray[counter] == it.next());
+		}
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/resource/Support_Resources.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/resource/Support_Resources.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/resource/Support_Resources.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/resource/Support_Resources.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,134 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.support.resource;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import tests.support.Support_Configuration;
+
+public class Support_Resources {
+
+	public static final String RESOURCE_PACKAGE = "/tests/resources/";
+
+	public static final String RESOURCE_PACKAGE_NAME = "tests.resources";
+
+	public static InputStream getStream(String name) {
+		return Support_Resources.class.getResourceAsStream(RESOURCE_PACKAGE
+				+ name);
+	}
+
+	public static String getURL(String name) {
+		String folder = null;
+		String fileName = name;
+		File resources = createTempFolder();
+		int index = name.lastIndexOf("/");
+		if (index != -1) {
+			folder = name.substring(0, index);
+			name = name.substring(index + 1);
+		}
+		copyFile(resources, folder, name);
+		URL url = null;
+		String resPath = resources.toString();
+		if (resPath.charAt(0) == '/' || resPath.charAt(0) == '\\')
+			resPath = resPath.substring(1);
+		try {
+			url = new URL("file:/" + resPath + "/" + fileName);
+		} catch (MalformedURLException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return url.toString();
+	}
+
+	public static File createTempFolder() {
+
+		File folder = null;
+		try {
+			folder = File.createTempFile("hyts_resources", "", null);
+			folder.delete();
+			folder.mkdirs();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		folder.deleteOnExit();
+		return folder;
+	}
+
+	public static void copyFile(File root, String folder, String file) {
+		File f;
+		if (folder != null) {
+			f = new File(root.toString() + "/" + folder);
+			if (!f.exists()) {
+				f.mkdirs();
+				f.deleteOnExit();
+			}
+		} else
+			f = root;
+
+		File dest = new File(f.toString() + "/" + file);
+
+		InputStream in = Support_Resources.getStream(folder == null ? file
+				: folder + "/" + file);
+		try {
+			copyLocalFileto(dest, in);
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+	public static File createTempFile(String suffix) throws IOException {
+		return File.createTempFile("hyts_", suffix, null);
+	}
+
+	public static void copyLocalFileto(File dest, InputStream in)
+			throws FileNotFoundException, IOException {
+		if (!dest.exists()) {
+			FileOutputStream out = new FileOutputStream(dest);
+			int result;
+			byte[] buf = new byte[4096];
+			while ((result = in.read(buf)) != -1)
+				out.write(buf, 0, result);
+			in.close();
+			out.close();
+			dest.deleteOnExit();
+		}
+	}
+
+	public static File getExternalLocalFile(String url) throws IOException,
+			MalformedURLException {
+		File resources = createTempFolder();
+		InputStream in = new URL(url).openStream();
+		File temp = new File(resources.toString() + "/local.tmp");
+		copyLocalFileto(temp, in);
+		return temp;
+	}
+
+	public static String getResourceURL(String resource) {
+		return "http://" + Support_Configuration.TestResources + resource;
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/CallVerificationStack.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/CallVerificationStack.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/CallVerificationStack.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/CallVerificationStack.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,354 @@
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.util;
+
+import java.util.Stack;
+
+/**
+ * A stack to store the parameters of a call, as well as the call stack.
+ * 
+ */
+public class CallVerificationStack extends Stack {
+
+	/*
+	 * --------------------------------------------------------------------
+	 * Class variables
+	 * --------------------------------------------------------------------
+	 */
+
+	private static final long serialVersionUID = 1L;
+
+	// the singleton
+	private static CallVerificationStack _instance = new CallVerificationStack();
+
+	/*
+	 * --------------------------------------------------------------------
+	 * Instance variables
+	 * --------------------------------------------------------------------
+	 */
+
+	// the call stack, store StackTraceElement
+	private Stack callStack = new Stack();
+
+	/*
+	 * -------------------------------------------------------------------
+	 * Constructors
+	 * -------------------------------------------------------------------
+	 */
+
+	/**
+	 * Can't be instantiated.
+	 */
+	private CallVerificationStack() {
+		// empty
+	}
+
+	/*
+	 * -------------------------------------------------------------------
+	 * Methods
+	 * -------------------------------------------------------------------
+	 */
+
+	/**
+	 * Gets the singleton instance.
+	 * 
+	 * @return the singleton instance
+	 */
+	public static CallVerificationStack getInstance() {
+		return _instance;
+	}
+
+	/**
+	 * Pushes the call stack.
+	 */
+	private void pushCallStack() {
+		StackTraceElement[] eles = (new Throwable()).getStackTrace();
+		int i;
+		for (i = 1; i < eles.length; i++) {
+			if (!eles[i].getClassName().equals(this.getClass().getName())) {
+				break;
+			}
+		}
+		this.callStack.push(eles[i]);
+	}
+
+	/**
+	 * Gets the "current" calling class name.
+	 * 
+	 * @return the "current" calling class name
+	 */
+	public String getCurrentSourceClass() {
+		return ((StackTraceElement) this.callStack.peek()).getClassName();
+	}
+
+	/**
+	 * Gets the "current" calling method name.
+	 * 
+	 * @return the "current" calling method name
+	 */
+	public String getCurrentSourceMethod() {
+		return ((StackTraceElement) this.callStack.peek()).getMethodName();
+	}
+
+	/**
+	 * Clear the parameter stack and the call stack.
+	 * 
+	 */
+	public void clear() {
+		this.callStack.clear();
+		super.clear();
+	}
+
+	/**
+	 * Pushes an object onto the top of this stack.
+	 * 
+	 * @param o
+	 *            the object to push
+	 */
+	public Object push(Object o) {
+		pushCallStack();
+		return super.push(o);
+	}
+
+	/**
+	 * Pushes a boolean onto the top of this stack.
+	 * 
+	 * @param val
+	 *            the value to push
+	 */
+	public void push(boolean val) {
+		this.push(new BaseTypeWrapper(val));
+	}
+
+	/**
+	 * Pushes a char onto the top of this stack.
+	 * 
+	 * @param val
+	 *            the value to push
+	 */
+	public void push(char val) {
+		this.push(new BaseTypeWrapper(val));
+	}
+
+	/**
+	 * Pushes a double onto the top of this stack.
+	 * 
+	 * @param val
+	 *            the value to push
+	 */
+	public void push(double val) {
+		this.push(new BaseTypeWrapper(val));
+	}
+
+	/**
+	 * Pushes a float onto the top of this stack.
+	 * 
+	 * @param val
+	 *            the value to push
+	 */
+	public void push(float val) {
+		this.push(new BaseTypeWrapper(val));
+	}
+
+	/**
+	 * Pushes an int onto the top of this stack.
+	 * 
+	 * @param val
+	 *            the value to push
+	 */
+	public void push(int val) {
+		this.push(new BaseTypeWrapper(val));
+	}
+
+	/**
+	 * Pushes a long onto the top of this stack.
+	 * 
+	 * @param val
+	 *            the value to push
+	 */
+	public void push(long val) {
+		this.push(new BaseTypeWrapper(val));
+	}
+
+	/**
+	 * Pushes a short onto the top of this stack.
+	 * 
+	 * @param val
+	 *            the value to push
+	 */
+	public void push(short val) {
+		this.push(new BaseTypeWrapper(val));
+	}
+
+	/**
+	 * Pop an object.
+	 * 
+	 * @return the object
+	 */
+	public Object pop() {
+		this.callStack.pop();
+		return super.pop();
+	}
+
+	/**
+	 * Pop a boolean.
+	 * 
+	 * @return the value
+	 */
+	public boolean popBoolean() {
+		BaseTypeWrapper wrapper = (BaseTypeWrapper) this.pop();
+		Boolean value = (Boolean) wrapper.getValue();
+		return value.booleanValue();
+	}
+
+	/**
+	 * Pop a char.
+	 * 
+	 * @return the value
+	 */
+	public char popChar() {
+		BaseTypeWrapper wrapper = (BaseTypeWrapper) this.pop();
+		Character value = (Character) wrapper.getValue();
+		return value.charValue();
+	}
+
+	/**
+	 * Pop a double.
+	 * 
+	 * @return the value
+	 */
+	public double popDouble() {
+		BaseTypeWrapper wrapper = (BaseTypeWrapper) this.pop();
+		Double value = (Double) wrapper.getValue();
+		return value.doubleValue();
+	}
+
+	/**
+	 * Pop a float.
+	 * 
+	 * @return the value
+	 */
+	public float popFloat() {
+		BaseTypeWrapper wrapper = (BaseTypeWrapper) this.pop();
+		Float value = (Float) wrapper.getValue();
+		return value.floatValue();
+	}
+
+	/**
+	 * Pop a int.
+	 * 
+	 * @return the value
+	 */
+	public int popInt() {
+		BaseTypeWrapper wrapper = (BaseTypeWrapper) this.pop();
+		Integer value = (Integer) wrapper.getValue();
+		return value.intValue();
+	}
+
+	/**
+	 * Pop a long.
+	 * 
+	 * @return the value
+	 */
+	public long popLong() {
+		BaseTypeWrapper wrapper = (BaseTypeWrapper) this.pop();
+		Long value = (Long) wrapper.getValue();
+		return value.longValue();
+	}
+
+	/**
+	 * Pop a short.
+	 * 
+	 * @return the value
+	 */
+	public short popShort() {
+		BaseTypeWrapper wrapper = (BaseTypeWrapper) this.pop();
+		Short value = (Short) wrapper.getValue();
+		return value.shortValue();
+	}
+
+	/*
+	 * Wrapper of base types.
+	 */
+	class BaseTypeWrapper {
+
+		// the internal value
+		private Object value;
+
+		/*
+		 * Constructs a wrapper object for the base type <code> boolean </code> .
+		 */
+		public BaseTypeWrapper(boolean val) {
+			this.value = new Boolean(val);
+		}
+
+		/*
+		 * Constructs a wrapper object for the base type <code> c </code> .
+		 */
+		public BaseTypeWrapper(byte val) {
+			this.value = new Byte(val);
+		}
+
+		/*
+		 * Constructs a wrapper object for the base type <code> char </code> .
+		 */
+		public BaseTypeWrapper(char val) {
+			this.value = new Character(val);
+		}
+
+		/*
+		 * Constructs a wrapper object for the base type <code> double </code> .
+		 */
+		public BaseTypeWrapper(double val) {
+			this.value = new Double(val);
+		}
+
+		/*
+		 * Constructs a wrapper object for the base type <code> float </code> .
+		 */
+		public BaseTypeWrapper(float val) {
+			this.value = new Float(val);
+		}
+
+		/*
+		 * Constructs a wrapper object for the base type <code> int </code> .
+		 */
+		public BaseTypeWrapper(int val) {
+			this.value = new Integer(val);
+		}
+
+		/*
+		 * Constructs a wrapper object for the base type <code> long </code> .
+		 */
+		public BaseTypeWrapper(long val) {
+			this.value = new Long(val);
+		}
+
+		/*
+		 * Constructs a wrapper object for the base type <code> short </code> .
+		 */
+		public BaseTypeWrapper(short val) {
+			this.value = new Short(val);
+		}
+
+		/*
+		 * Gets the internal value.
+		 */
+		public Object getValue() {
+			return this.value;
+		}
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SerializationTester.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SerializationTester.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SerializationTester.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SerializationTester.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,244 @@
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+/**
+ * This class simplifies the serialization test.
+ * 
+ */
+public class SerializationTester {
+
+	/*
+	 * --------------------------------------------------------------------
+	 * Class variables
+	 * --------------------------------------------------------------------
+	 */
+
+	// the last deserialized object
+	private static Object lastOutput = null;
+
+	/*
+	 * -------------------------------------------------------------------
+	 * Constructors
+	 * -------------------------------------------------------------------
+	 */
+
+	private SerializationTester() {
+
+	}
+
+	/*
+	 * -------------------------------------------------------------------
+	 * Methods
+	 * -------------------------------------------------------------------
+	 */
+
+	/**
+	 * Serialize an object and then deserialize it.
+	 * 
+	 * @param inputObject
+	 *            the input object
+	 * @return the deserialized object
+	 */
+	public static Object getDeserilizedObject(Object inputObject)
+			throws IOException, ClassNotFoundException {
+		ByteArrayOutputStream bos = new ByteArrayOutputStream();
+		ObjectOutputStream oos = new ObjectOutputStream(bos);
+		oos.writeObject(inputObject);
+		oos.close();
+
+		ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
+		ObjectInputStream ois = new ObjectInputStream(bis);
+		Object outputObject = (Object) ois.readObject();
+		lastOutput = outputObject;
+		ois.close();
+		return outputObject;
+	}
+
+	/**
+	 * Tests the serialization and deserialization of const objects.
+	 * 
+	 * @param inputObject
+	 *            A const object
+	 * @return true if the deserialized object is the same as the input object,
+	 *         otherwise false
+	 * @throws Exception
+	 *             If any occurs.
+	 */
+	public static boolean assertSame(Object inputObject) throws Exception {
+		return inputObject == getDeserilizedObject(inputObject);
+	}
+
+	/**
+	 * Tests the serialization and deserialization of instance objects.
+	 * 
+	 * @param inputObject
+	 *            An object
+	 * @return true if the deserialized object is equal to the input object,
+	 *         otherwise false
+	 * @throws Exception
+	 *             If any occurs.
+	 */
+	public static boolean assertEquals(Object inputObject) throws Exception {
+		return inputObject.equals(getDeserilizedObject(inputObject));
+	}
+
+	/**
+	 * Tests the serialization compatibility with reference const objects.
+	 * 
+	 * @param obj
+	 *            the object to be checked
+	 * @param fileName
+	 *            the serialization output file generated by reference
+	 * @return true if compatible, otherwise false
+	 * @throws Exception
+	 *             If any occurs.
+	 */
+	public static boolean assertCompabilitySame(Object obj, String fileName)
+			throws Exception {
+		return obj == readObject(obj, fileName);
+	}
+
+	/**
+	 * Tests the serialization compatibility with reference for instance
+	 * objects.
+	 * 
+	 * @param obj
+	 *            the object to be checked
+	 * @param fileName
+	 *            the serialization output file generated by reference
+	 * @return true if compatible, otherwise false
+	 * @throws Exception
+	 *             If any occurs.
+	 */
+	public static boolean assertCompabilityEquals(Object obj, String fileName)
+			throws Exception {
+		return obj.equals(readObject(obj, fileName));
+	}
+
+	/**
+	 * Deserialize an object from a file.
+	 * 
+	 * @param obj
+	 *            the object to be serialized if no serialization file is found
+	 * @param fileName
+	 *            the serialization file
+	 * @return the deserialized object
+	 * @throws Exception
+	 *             If any occurs.
+	 */
+	public static Object readObject(Object obj, String fileName)
+			throws Exception {
+		InputStream input = null;
+		ObjectInputStream oinput = null;
+		URL url = SerializationTester.class.getClassLoader().getResource(
+				fileName);
+		if (null == url) {
+			// serialization file does not exist, create one in the current dir
+			writeObject(obj, new File(fileName).getName());
+			throw new Error(
+					"Serialization file does not exist, created in the current dir.");
+		}
+		input = url.openStream();
+		try {
+			oinput = new ObjectInputStream(input);
+			Object newObj = oinput.readObject();
+			return newObj;
+		} finally {
+			try {
+				if (null != oinput) {
+					oinput.close();
+				}
+			} catch (Exception e) {
+				// ignore
+			}
+			try {
+				if (null != input) {
+					input.close();
+				}
+			} catch (Exception e) {
+				// ignore
+			}
+		}
+	}
+
+	/*
+	 * Creates a serialization output.
+	 * 
+	 * @param obj the object to be serialized @param fileName the output file
+	 * @throws Exception If any occurs.
+	 */
+	public static void writeObject(Object obj, String fileName)
+			throws Exception {
+		// String path = SerializationTester.class.getResource(".").getPath();
+		// if (path.endsWith(".")) {
+		// path = path.substring(0, path.length() - 1);
+		// }
+		// if (!path.endsWith("/")) {
+		// path += "/";
+		// }
+		// path += fileName;
+		// System.out.println(path);
+		OutputStream output = null;
+		ObjectOutputStream ooutput = null;
+		try {
+			output = new FileOutputStream(fileName);
+			ooutput = new ObjectOutputStream(output);
+			ooutput.writeObject(obj);
+		} finally {
+			try {
+				if (null != ooutput) {
+					ooutput.close();
+				}
+			} catch (Exception e) {
+				// ignore
+			}
+			try {
+				if (null != output) {
+					output.close();
+				}
+			} catch (Exception e) {
+				// ignore
+			}
+		}
+	}
+
+	/**
+	 * Gets the last deserialized object.
+	 * 
+	 * @return the last deserialized object
+	 */
+	public static Object getLastOutput() {
+		return lastOutput;
+	}
+
+	/*
+	 * For test purpose.
+	 */
+	public static void main(String[] args) {
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SomeTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SomeTests.java?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SomeTests.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/util/SomeTests.java Wed Mar 15 03:46:17 2006
@@ -0,0 +1,320 @@
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 tests.util;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+
+import junit.extensions.TestDecorator;
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.apache.xpath.XPathAPI;
+import org.apache.xpath.objects.XObject;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Decorator for JUnit test suites that we want to run with certain test cases
+ * excluded. The exclusions are captured in a separate XML file.
+ */
+public class SomeTests extends TestSetup {
+
+	private static final String EXCLUDES_SCHEMA_URI_PROP = "excludes.schema.uri";
+
+	private static final String EXCLUDES_FILE_URI_PROP = "excludes.file.uri";
+
+	private static final String JAXP_SCHEMA_SOURCE_ATTR_NAME = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+	private static final String JAXP_SCHEMA_LANGUAGE_ATTR_VAL = "http://www.w3.org/2001/XMLSchema";
+
+	private static final String JAXP_SCHEMA_LANGUAGE_ATTR_NAME = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+
+	private static final String DOCUMENT_BUILDER_FACTORY_VAL = "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
+
+	private static final String DOCUMENT_BUILDER_FACTORY_PROP = "javax.xml.parsers.DocumentBuilderFactory";
+
+	private Node excludesDoc;
+
+	private List runCases = new ArrayList();
+
+	private String excludesListURI;
+
+	private String excludesSchemaURI;
+
+	int originalTestCaseCount;
+
+	private boolean docIsValid = false;
+
+	/**
+	 * @param test
+	 * @param excludesListURI
+	 * @param excludesSchemaURI
+	 */
+	public SomeTests(Test test) {
+		super(test);
+		initExcludes();
+
+		// Drill down into each test case contained in the supplied Test
+		// and, for each one *not* excluded, add the corresponding TestCase
+		// to an ordered collection. The number of TestCase objects in the
+		// collection is the number of test cases that will be run.
+		seekTests(this.getTest());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see junit.extensions.TestDecorator#basicRun(junit.framework.TestResult)
+	 */
+	public void basicRun(TestResult result) {
+		// The 'basic run' of this decorator is to enumerate through all
+		// of the tests not excluded and run them...
+		Iterator allIncluded = runCases.iterator();
+		while (allIncluded.hasNext()) {
+			TestCase test = (TestCase) allIncluded.next();
+			test.run(result);
+		}// end while
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see junit.extensions.TestSetup#setUp()
+	 */
+	protected void setUp() throws Exception {
+		if (docIsValid) {
+			System.out.println("\nExcludes list document " + excludesListURI
+					+ " is valid");
+		}
+		System.out.println("\nRunning " + this.countTestCases()
+				+ " out of a total of " + this.originalTestCaseCount
+				+ " possible test cases\n");
+	}
+
+	protected void tearDown() throws Exception {
+		System.out.println("\nRan " + this.countTestCases()
+				+ " out of a total of " + this.originalTestCaseCount
+				+ " possible test cases\n");
+
+		if (excludesDoc != null) {
+			System.out.println("THE FOLLOWING EXCLUSIONS WERE ENFORCED:");
+			NodeList allTypes = XPathAPI.selectNodeList(excludesDoc,
+					"/descendant::hy:type");
+			for (int i = 0; i < allTypes.getLength(); i++) {
+				Node typeNode = allTypes.item(i);
+				String typeName = typeNode.getAttributes().getNamedItem("id")
+						.getNodeValue();
+				NodeList allExcludesForType = XPathAPI.selectNodeList(typeNode,
+						"descendant::hy:exclude");
+				for (int j = 0; j < allExcludesForType.getLength(); j++) {
+					Node excludeNode = allExcludesForType.item(j);
+					String excName = excludeNode.getAttributes().getNamedItem(
+							"id").getNodeValue();
+					if (excName.equalsIgnoreCase("all")) {
+						excName = "!!!!!!!!!!ALL TESTS!!!!!!!!!!";
+					}
+					System.out.print(typeName + "::" + excName);
+					Node reasonNode = XPathAPI.selectSingleNode(excludeNode,
+							"descendant::hy:reason");
+					if (reasonNode != null) {
+						XObject reason = XPathAPI.eval(reasonNode, "string()");
+						System.out.print(" (" + reason.str() + ")");
+					}
+					System.out.print("\n");
+				}// end for all excludes
+			}// end for all types
+			System.out.println("\n");
+		}
+		super.tearDown();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see junit.framework.Test#countTestCases()
+	 */
+	public int countTestCases() {
+		return runCases.size();
+	}
+
+	private void seekTests(TestSuite suite) {
+		Enumeration allTests = suite.tests();
+		while (allTests.hasMoreElements()) {
+			Test test = (Test) allTests.nextElement();
+			seekTests(test);
+		}// end while
+	}
+
+	private void seekTests(Test test) {
+		if (test instanceof TestSuite) {
+			seekTests((TestSuite) test);
+		} else if (test instanceof TestCase) {
+			seekTests((TestCase) test);
+		} else if (test instanceof TestDecorator) {
+			seekTests(((TestDecorator) test).getTest());
+		}
+	}
+
+	private void seekTests(TestCase testCase) {
+		// Check the testcase against the excludes structure
+		if (!isTestCaseExcluded(testCase)) {
+			// Add this testcase to the collection of tests to be run.
+			runCases.add(testCase);
+		}
+	}
+
+	private boolean isTestCaseExcluded(TestCase testCase) {
+		this.originalTestCaseCount++;
+		boolean result = false;
+		String tcType = testCase.getClass().getName();
+		String tcName = testCase.getName();
+
+		if (excludesDoc != null) {
+			try {
+				// Find *the first* element for the type. If there are
+				// more than one "type" elements for a given type then the
+				// first one found is what counts.
+				NodeList typeNodes = XPathAPI.selectNodeList(excludesDoc,
+						"/descendant::hy:type[@id=\"" + tcType + "\"]");
+				if (typeNodes.getLength() > 0) {
+					Node typeNode = typeNodes.item(0);
+					// Look for a blanket exclusion of this test case type
+					NodeList excludes = XPathAPI.selectNodeList(typeNode,
+							"descendant::hy:exclude[@id=\"all\"]");
+					if (excludes.getLength() != 0) {
+						result = true;
+					} else {
+						// Look for explicit exclusion
+						excludes = XPathAPI.selectNodeList(typeNode,
+								"descendant::hy:exclude[@id=\"" + tcName
+										+ "\"]");
+						if (excludes.getLength() != 0) {
+							result = true;
+						}
+					}// end else
+				}// end if named type located
+			} catch (TransformerException e) {
+				// Carry on.
+				result = false;
+			}
+		}
+		return result;
+	}
+
+	/**
+	 */
+	private boolean initExcludes() {
+		boolean result = true;
+
+		// Look for location of excludes list and (optionally) a schema
+		// location override.
+		readProperties();
+		if (excludesListURI == null) {
+			System.out.println("No excludes list specified.");
+			result = false;
+		}
+
+		if (result) {
+			try {
+				System.setProperty(DOCUMENT_BUILDER_FACTORY_PROP,
+						DOCUMENT_BUILDER_FACTORY_VAL);
+				DocumentBuilderFactory factory = DocumentBuilderFactory
+						.newInstance();
+				factory.setNamespaceAware(true);
+				factory.setValidating(true);
+				factory.setAttribute(JAXP_SCHEMA_LANGUAGE_ATTR_NAME,
+						JAXP_SCHEMA_LANGUAGE_ATTR_VAL);
+				if (excludesSchemaURI != null) {
+					factory.setAttribute(JAXP_SCHEMA_SOURCE_ATTR_NAME,
+							excludesSchemaURI);
+				}
+
+				DocumentBuilder builder = factory.newDocumentBuilder();
+				DocValidator handler = new DocValidator();
+				builder.setErrorHandler(handler);
+				excludesDoc = builder.parse(excludesListURI);
+				if (handler.inError == true) {
+					this.docIsValid = false;
+					System.out.println("Excludes list document "
+							+ excludesListURI + " is invalid :"
+							+ handler.inError + " "
+							+ handler.spException.getMessage());
+					excludesDoc = null;
+					result = false;
+				} else {
+					this.docIsValid = true;
+				}
+			} catch (FileNotFoundException e) {
+				System.out.println("File not found : " + e.getMessage());
+				result = false;
+			} catch (ParserConfigurationException e) {
+				System.out.println("Serious error with XML parser : "
+						+ e.getMessage());
+				result = false;
+			} catch (SAXException e) {
+				System.out.println("Serious error occurred parsing document : "
+						+ e.getMessage());
+				result = false;
+			} catch (IOException e) {
+				System.out.println("IO error occurred : " + e.getMessage());
+				result = false;
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * 
+	 */
+	private void readProperties() {
+		excludesListURI = System.getProperty(EXCLUDES_FILE_URI_PROP);
+		excludesSchemaURI = System.getProperty(EXCLUDES_SCHEMA_URI_PROP);
+	}
+
+	/**
+	 */
+	class DocValidator extends DefaultHandler {
+		private boolean inError = false;
+
+		private SAXParseException spException = null;
+
+		public void error(SAXParseException exception) throws SAXException {
+			inError = true;
+			spException = exception;
+		}
+
+		public void fatalError(SAXParseException exception) throws SAXException {
+			inError = true;
+			spException = exception;
+		}
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/excludes.xsd
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/excludes.xsd?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/excludes.xsd (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/excludes.xsd Wed Mar 15 03:46:17 2006
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	    xmlns="http://incubator.apache.org/harmony/testing" 
+	    targetNamespace="http://incubator.apache.org/harmony/testing">
+
+  <!--
+  * A suite contains zero or more type declarations 
+  -->
+  <xsd:element name="suite">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="type" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!--
+  * A type contains one or more exclude elements.
+  * A type has a single attribute (id) which can be
+  * any meaningful character value that is based on
+  * proper XML naming conventions (must begin with a 
+  * letter or underscore).
+  -->
+  <xsd:element name="type">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="exclude" minOccurs="1" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="idtype" use="required" />
+    </xsd:complexType>
+  </xsd:element>
+
+  <!--
+  * An exclude element can have an optional reason
+  * element. 
+  -->
+  <xsd:element name="exclude">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element ref="reason" minOccurs="0" maxOccurs="1"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="idtype"  default="all" />
+      <xsd:attribute name="platform" type="platformlisttype" default="all" />
+      <xsd:attribute name="shouldfix" type="booleanstringtype" default="true" />
+    </xsd:complexType>
+  </xsd:element>
+
+<!--
+  * A reason element has no attributes, only parsed
+  * character data.	
+  -->
+  <xsd:element name="reason">
+    <xsd:complexType mixed="true"/>
+  </xsd:element>
+
+ 
+  <!--
+  * Type idtype is any string data.
+  -->
+  <xsd:simpleType name="idtype">
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+  
+
+  <!--
+  * Type platformstringtype is one of the 
+  * strings "all", "win.IA32" or "linux.IA32".
+  -->
+  <xsd:simpleType name="platformstringtype" >
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="win.IA32"/>
+      <xsd:enumeration value="linux.IA32"/>
+      <xsd:enumeration value="all"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+
+  <xsd:simpleType name="platformlisttype">
+    <xsd:list itemType="platformstringtype"/>
+  </xsd:simpleType>
+
+
+  <!--
+  * Type booleanstringtype is one of the 
+  * strings "true" or "false".
+  -->
+  <xsd:simpleType name="booleanstringtype" >
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="true"/>
+      <xsd:enumeration value="false"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  
+</xsd:schema>

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/jcltest-excludes.xml
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/jcltest-excludes.xml?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/jcltest-excludes.xml (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/jcltest-excludes.xml Wed Mar 15 03:46:17 2006
@@ -0,0 +1,405 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hy:suite xmlns:hy="http://incubator.apache.org/harmony/testing"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://incubator.apache.org/harmony/testing excludes.xsd">
+
+    <hy:type id="tests.api.java.io.BufferedInputStreamTest">
+        <hy:exclude id="test_reset" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.io.FileTest">
+        <hy:exclude id="test_Constructor_String_String_112270" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_Constructor_File_String_112270" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_deleteOnExit" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.io.ObjectInputStreamTest">
+        <hy:exclude id="test_ConstructorLjava_io_InputStream_subtest0" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.io.ObjectOutputStreamTest">
+        <hy:exclude id="test_ConstructorLjava_io_OutputStream_subtest0" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_writeObject_NotSerializable" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.io.PipedInputStreamTest">
+        <hy:exclude id="test_receive" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.io.PushbackReaderTest">
+        <hy:exclude id="test_skip$J" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.AttributedCharacterIteratorTest">
+        <hy:exclude id="test_getRunLimitLjava_text_AttributedCharacterIterator$Attribute" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.ChoiceFormatTest">
+        <hy:exclude id="test_toPattern" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.CollationKeyTest">
+        <hy:exclude id="test_toByteArray" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.CollatorTest">
+        <hy:exclude id="test_getAvailableLocales" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getDecomposition" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_setDecompositionI" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.DateFormatFieldTest">
+        <hy:exclude id="test_ConstructorLjava_lang_StringI" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_Constructor2" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_readResolve" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.MessageFormatTest">
+        <hy:exclude id="test_applyPatternLjava_lang_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.SimpleDateFormatTest">
+        <hy:exclude id="test_equalsLjava_lang_Object" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition" shouldfix="true">
+            <hy:reason>Wrong format: " h" expected:  3 result:  4</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_parseLjava_lang_StringLjava_text_ParsePosition" shouldfix="true">
+            <hy:reason>Wrong result: MM'M' input: 4M expected: Wed Apr 01 00:00:00 GMT 1970 result: Tue Mar 31 23:00:00 GMT 1970</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.math.BigDecimalTest">
+        <hy:exclude id="test_constructor_String_115522" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.lang.reflect.ReflectPermissionTest">
+        <hy:exclude id="test_ConstructorLjava_lang_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_ConstructorLjava_lang_StringLjava_lang_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.jar.JarFileTest">
+        <hy:exclude id="test_entries" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getInputStreamLjava_util_jar_JarEntry_subtest0" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.zip.ZipFileTest">
+        <hy:exclude id="test_entries" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.zip.ZipInputStreamTest">
+        <hy:exclude id="test_skipJ" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.ArraysTest">
+        <hy:exclude id="test_binarySearch$DD" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_binarySearch$FF" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_equals$F$F" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_equals$D$D" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_sort$D" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_sort$F" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.util.BitSetTest">
+        <hy:exclude id="test_111478" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.CalendarTest">
+        <hy:exclude id="test_setII" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.util.CollectionsTest">
+        <hy:exclude id="test_rotate2" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.util.IdentityHashMap2Test">
+        <hy:exclude id="test_null_Keys_and_Values" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_entrySet_removeAll" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_values" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_keySet_removeAll" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_keySet_retainAll" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_keyset_remove" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.util.LocaleTest">
+        <hy:exclude id="test_toString" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.lang.AssertionErrorTest">
+        <hy:exclude id="test_ObjectConstructor" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.lang.DoubleTest">
+        <hy:exclude id="test_compare" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.lang.FloatTest">
+        <hy:exclude id="test_compare" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.lang.StringTest">
+        <hy:exclude id="test_concatLjava_lang_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getBytes" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getBytesII$BI" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getBytesLjava_lang_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_substringI" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_substringII" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.lang.ThreadGroupTest">
+        <hy:exclude id="test_list" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.net.InetAddressTest">
+        <hy:exclude id="test_getHostName" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.net.URITest">
+        <hy:exclude id="test_URI_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_fiveArgConstructor" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_compareToLjava_lang_Object" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_compareTo2" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_equals2" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getAuthority2" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getPort2" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_normalize3" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_relativize2" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.net.URLClassLoaderTest">
+        <hy:exclude id="test_findClassLjava_lang_String" shouldfix="true">
+            <hy:reason>Undiagnosed failure</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.lang.OutOfMemoryErrorTest">
+        <hy:exclude id="all" shouldfix="true">
+            <hy:reason>Really, really slow to run!</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.util.VectorTest">
+        <hy:exclude id="test_toString" shouldfix="true">
+            <hy:reason>Fails because of stack overflow !</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.jar.JarOutputStreamTest">
+        <hy:exclude id="test_putNextEntryLjava_util_zip_ZipEntry" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.zip.CheckedInputStreamTest">
+        <hy:exclude id="test_getChecksum" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.zip.DeflaterTest">
+        <hy:exclude id="test_setStrategyI" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.lang.ClassTest">
+        <hy:exclude id="test_getResourceLjava_lang_String" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getResourceAsStreamLjava_lang_String" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.lang.ProcessTest">
+        <hy:exclude id="test_getInputStream" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_getOutputStream" shouldfix="true">
+            <hy:reason>Needs investigation...</hy:reason>
+        </hy:exclude>
+    </hy:type>
+    
+    <hy:type id="tests.api.java.net.Inet6AddressTest">
+        <hy:exclude id="all" shouldfix="true">
+            <hy:reason>Need to configure correctly</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.zip.GZIPInputStreamTest">
+        <hy:exclude id="test_read$BII" shouldfix="true">
+            <hy:reason>java.io.IOException: Size mismatch</hy:reason>
+        </hy:exclude>
+        <hy:exclude id="test_close" shouldfix="true">
+            <hy:reason>java.io.IOException: Size mismatch</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.zip.InflaterTest">
+        <hy:exclude id="test_setDictionary$B" shouldfix="true">
+            <hy:reason>java.lang.IllegalArgumentException in native method</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.zip.InflaterInputStreamTest">
+        <hy:exclude id="test_ConstructorLjava_io_InputStream" shouldfix="true">
+            <hy:reason>read() threw an exception while testing constructor</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.io.InputStreamReaderTest">
+        <hy:exclude id="test_read" shouldfix="true">
+            <hy:reason>UTF-16BE unexpected 1: java.io.IOException: CoderResult[Malformed-input error with erroneous input length 1]</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.io.OutputStreamWriterTest">
+        <hy:exclude id="test_close" shouldfix="true">
+            <hy:reason>invalid conversion</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.util.ResourceBundleTest">
+        <hy:exclude id="test_getBundleLjava_lang_StringLjava_util_LocaleLjava_lang_ClassLoader" shouldfix="true">
+            <hy:reason>Problem with Jar URLs containing relative paths needs investigating</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+    <hy:type id="tests.api.java.text.NumberFormatTest">
+        <hy:exclude id="test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition" shouldfix="true">
+            <hy:reason>Depends on a real implementation of BigInteger</hy:reason>
+        </hy:exclude>
+    </hy:type>
+
+</hy:suite>    

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/localhosttest.ini
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/localhosttest.ini?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/localhosttest.ini (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/localhosttest.ini Wed Mar 15 03:46:17 2006
@@ -0,0 +1,30 @@
+DomainAddress=
+WebName=localhost.
+TestResourcesDir=/testres231
+HomeAddressResponse=HTTP/1.1 200 OK
+HomeAddressSoftware=Apache/2.0.55 (Win32)
+ProxyServerTestHost=localhost
+SocksServerTestHost=localhost
+SocksServerTestPort=2080
+UnresolvedIP=192.168.99.99
+InetTestAddress=localhost
+InetTestIP=127.0.0.1
+NonLocalAddressBytes=1.0.0.0
+InetTestAddress2=localhost
+InetTestIP2=127.0.0.1
+InetTestHashcode=2130706433
+SpecialInetTestAddress=localhost
+SpecialInetTestAddressNumber=1
+FTPTestAddress=jcltest:jclpass@localhost
+URLConnectionLastModifiedString=Sat, 07 Jan 2006 13:50:52 GMT
+URLConnectionLastModified=1136641852000
+URLConnectionDate=929092440000
+InetTestIP6=fe80::20d:60ff:fe24:7410
+ResolvedNotExistingHost=9.26.194.72
+InetAlias1=localhost
+InetAlias2=localhost
+IPv6GlobalAddressJcl4=
+
+
+
+

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/testing.policy
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/testing.policy?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/testing.policy (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/config/testing.policy Wed Mar 15 03:46:17 2006
@@ -0,0 +1,9 @@
+grant {
+    // so we can remove the security manager
+    permission java.lang.RuntimePermission "setSecurityManager";
+    
+    permission java.io.SerializablePermission "enableSubclassImplementation";
+    
+    permission java.util.PropertyPermission "user.dir", "read";
+    permission java.io.FilePermission "${user.dir}${/}bin${/}tests${/}resources${/}-", "read";
+};
\ No newline at end of file

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/FTP/jcltest/nettest.txt
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/FTP/jcltest/nettest.txt?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/FTP/jcltest/nettest.txt (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/FTP/jcltest/nettest.txt Wed Mar 15 03:46:17 2006
@@ -0,0 +1 @@
+This text file is used for testing the java.net package of the Harmony class libraries.
\ No newline at end of file

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/cgi-bin/test.pl
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/cgi-bin/test.pl?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/cgi-bin/test.pl (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/cgi-bin/test.pl Wed Mar 15 03:46:17 2006
@@ -0,0 +1,5 @@
+#!/usr/bin/perl
+print "Content-type: text/plain\n\n";
+read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
+print $buffer;
+exit 0;

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/JUC/lf.jar
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/JUC/lf.jar?rev=386058&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/JUC/lf.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/RESOURCE.TXT
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/RESOURCE.TXT?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/RESOURCE.TXT (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/RESOURCE.TXT Wed Mar 15 03:46:17 2006
@@ -0,0 +1 @@
+This is a test resource file.
\ No newline at end of file

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/UCL/UCL.jar
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/UCL/UCL.jar?rev=386058&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/UCL/UCL.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/URLConnectionTest/Harmony.html
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/URLConnectionTest/Harmony.html?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/URLConnectionTest/Harmony.html (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/URLConnectionTest/Harmony.html Wed Mar 15 03:46:17 2006
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
+	<TITLE></TITLE>
+	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Win32)">
+	<META NAME="AUTHOR" CONTENT="George Harley">
+	<META NAME="CREATED" CONTENT="20060107;13432130">
+	<META NAME="CHANGEDBY" CONTENT="George Harley">
+	<META NAME="CHANGED" CONTENT="20060107;13505271">
+	<STYLE>
+	<!--
+		@page { size: 4.5cm 4.5cm; margin: 2cm }
+	-->
+	</STYLE>
+</HEAD>
+<BODY LANG="en-US" BGCOLOR="#000000" DIR="LTR">
+<P><BR><BR>
+</P>
+<P ALIGN=CENTER><FONT COLOR="#ffffff">&ldquo;<FONT FACE="Arial, sans-serif"><FONT SIZE=4>Happiness
+is when what you think, what you say, and what you do are in
+harmony.&rdquo;</FONT></FONT></FONT></P>
+<P ALIGN=CENTER><FONT FACE="Arial, sans-serif"><FONT SIZE=2><FONT COLOR="#ffffff">Mohandas
+Gandhi</FONT></FONT> </FONT>
+</P>
+</BODY>
+</HTML>
\ No newline at end of file

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/subdir1/RESOURCE.TXT
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/subdir1/RESOURCE.TXT?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/subdir1/RESOURCE.TXT (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/HTTP/html/testres231/subdir1/RESOURCE.TXT Wed Mar 15 03:46:17 2006
@@ -0,0 +1 @@
+This is a resource from a subdir
\ No newline at end of file

Added: incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/README.txt
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/README.txt?rev=386058&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/README.txt (added)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/resources/net.resources/README.txt Wed Mar 15 03:46:17 2006
@@ -0,0 +1,188 @@
+README
+======
+
+
+
+Contents
+--------
+This directory contains resources that can be used to carry out unit testing of
+the java.net types. The resources are separated according to the type of 
+server that will host them. 
+
+FTP
+---
+The FTP folder contains a single text file (nettest.txt) which should be placed
+in the root or home directory of an FTP account with id "jcltest" with password
+"jclpass". Please do not modify nettest.txt as the tests have been written to 
+check on the precise contents of this file.
+
+
+HTTP
+----
+The HTTP folder contains files to be deployed on an HTTP server.
+
+Directory cgi-bin contains a single Perl script called test.pl which should be
+placed in the normal bin directory for your HTTP server (e.g. "cgi-bin" for the
+Apache HTTP server). The intent is that this script can be accessed with the URL
+"http://<your host>/cgi-bin/test.pl" .
+
+Directory html/testres231 contains a number of text and binary resources. This
+folder and all of its subfolders should be copied to the root directory of your
+web server from which static documents are served (e.g. "htdocs" for the Apache
+HTTP server)...
+
+
+<DOCUMENT_ROOT>/testres231
+       |   RESOURCE.TXT
+       |
+       +---JUC
+       |       lf.jar
+       |
+       +---subdir1
+       |       RESOURCE.TXT
+       |
+       +---UCL
+       |       UCL.jar
+       |
+       \---URLConnectionTest
+               Harmony.html
+
+
+
+The intent is that these resources can be accessed with URLs beginning
+"http://<your host>/testres231/" . 
+
+As with the FTP resource, please do not modify these files in any way as the 
+unit test code has been written to expect specific information about these
+files such as content and date of last modification.
+
+
+SERVER CONFIGURATION
+--------------------
+Before running the unit tests for the java.net types the following steps should 
+be taken. 
+
+1. Install the FTP and HTTP documents to their respective server locations as
+described above. 
+2. Enable proxying capability on the HTTP server.
+3. Start the HTTP and FTP servers. 
+4. Start up a SOCKS server.
+
+
+
+RUNNING THE TESTS
+-----------------
+The success of the java.net tests rely on a number of text values which can be 
+supplied in a properties file. These properties include the hostname of the 
+HTTP server where the testres231 files are hosted, the network location of the 
+FTP and SOCKS servers and so on. Isolating these values in a properties file
+enables the tests to be run in any network environment without recourse to 
+updating values in the test case source code. 
+
+The location of the properties file can be specified to the running tests
+through setting the property "test.ini.file". An example of this is available
+in the "run-tests" target of the <EXTRACT_DIR>/Harmony/make/build-java.xml file
+contained in this zip file. There the "test.ini.file" property holds the 
+path to the file 
+<EXTRACT_DIR>/Harmony/Harmony_Tests/src/test/resources/config/localhost.ini
+that contains suitable property values if the HTTP, FTP and SOCKS servers were
+all running on the local machine of the tests user. 
+
+The key properties required by the java.net tests are as follows ...
+
+
+* DomainAddress : The domain name of the host where the HTTP server is running.
+
+* WebName : The unqualified name of the host where the HTTP server is running.
+
+* TestResourcesDir : the name of the folder on the HTTP server beneath the
+                     document root where the where the web resources have been
+                     deployed. 
+
+* HomeAddressResponse : the expected response returned from a successful get 
+                        from the HTTP server.
+
+* HomeAddressSoftware : the expected information about the HTTP server's
+                        software.
+                        
+* ProxyServerTestHost : the fully qualified location of the HTTP proxy host 
+                        used in the tests.
+
+* SocksServerTestHost : the fully qualified location of the SOCKS server used
+                        in the tests.
+
+* SocksServerTestPort : the test SOCKS server's port number
+
+* UnresolvedIP : an IP address that does not resolve to a host name
+
+* InetTestAddress : the string name of a network host with IP address given
+                    in the corresponding "InetTestIP" property.
+
+* InetTestIP : the IP address of a network host whose string name is supplied
+               in the corresponding "InetTestAddress" property.
+
+* NonLocalAddressBytes : the bytes representing the address of any machine which
+                         cannot be bound to during the tests. Used in the socket
+                         tests to verify we get the expected error when trying
+                         to bind to an address that cannot be reached. 
+
+* InetTestAddress2 : the string name of a network host with IP address given
+                    in the corresponding "InetTestIP" property.
+
+* InetTestIP2 : the IP address of a network host whose string name is supplied
+               in the corresponding "InetTestAddress" property.
+
+* InetTestHashcode : the expected hashcode value of the "InetTestAddress".
+
+* SpecialInetTestAddress : An address that resolves to more than one IP address.
+                           The expected number of IP addresses that this address
+                           resolves to should be set in the
+                           "SpecialInetTestAddressNumber" property. Used to test
+                           the java.net.InetAddress.getAllByName() method. 
+
+* SpecialInetTestAddressNumber : The number of IP addresses that resolve to the
+                                 host named in the property
+                                 "SpecialInetTestAddress". Used to test the
+                                 java.net.InetAddress.getAllByName() method. 
+
+* FTPTestAddress : a string of the form "jcltest:jclpass@<server address>" that
+                   points to the network location of the FTP resources.
+
+* URLConnectionLastModifiedString : string which gives the precise date and time
+                                    that the HTTP server resources were last
+                                    modified. If you make any changes to the
+                                    web resources this value will need to
+                                    change.
+
+* URLConnectionLastModified : the corresponding numeric equivalent of the 
+                              "URLConnectionLastModifiedString" string value. 
+                              Any changes to the web resources will affect this
+                              value. 
+
+* URLConnectionDate : the expected date when the file
+                      "http://<your HTTP host>/testres231/RESOURCE.TXT" was last
+                      modified. Making any changes to the RESOURCE.TXT file will
+                      mean this property value will require updating.
+
+* InetTestIP6 : an IPv6 address to help test out serialization of the type
+                java.net.Inet6Address .
+
+* ResolvedNotExistingHost : an IP address that resolves to a host that is not
+                            present on the local network. This allows us to
+                            check the timeouts for socket connections.
+
+* InetAlias1 : this property and "InetAlias2" should be different host names
+               that resolve to the same IP address.
+
+* InetAlias2 : this property and "InetAlias1" should be different host names
+               that resolve to the same IP address.
+
+* IPv6GlobalAddressJcl4 : the IPv6 address for a host on the network. 
+
+
+
+If any of these properties are not set the *hard coded* defaults in the class 
+tests.support.Support_Configuration will be used (see
+<EXTRACT_DIR>/Harmony/Harmony_Tests/src/test/java/tests/support/Support_Configuration.java
+in this zip file).
+



Mime
View raw message