harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r440340 [3/5] - /incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/
Date Tue, 05 Sep 2006 13:39:20 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_HttpTests.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_HttpTests.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_HttpTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_HttpTests.java Tue Sep  5 06:39:17 2006
@@ -1,417 +1,417 @@
-/* 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.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import junit.framework.TestCase;
-
-/**
- * Performs some basic testing of either HttpConnection or HttpURLConnection
- * depending on the Support_ServerSocket and Support_HttpConnector passed to the
- * constructor.
- * 
- */
-public class Support_HttpTests {
-
-	private Support_ServerSocket serversocket;
-
-	private Support_HttpConnector connector;
-
-	public Support_HttpTests(Support_ServerSocket serversocket,
-			Support_HttpConnector client) {
-		this.serversocket = serversocket;
-		this.connector = client;
-	}
-
-	public void runTests(junit.framework.TestCase test) {
-
-		// get a port to use for the test
-		int portNumber = Support_PortManager.getNextPort();
-
-		// url's for the various tests
-		final String chunkedTestUrl = "http://localhost:" + portNumber
-				+ Support_HttpServer.CHUNKEDTEST;
-		final String contentTestUrl = "http://localhost:" + portNumber
-				+ Support_HttpServer.CONTENTTEST;
-		final String redirectTestUrl = "http://localhost:" + portNumber
-				+ Support_HttpServer.REDIRECTTEST;
-		final String postTestUrl = "http://localhost:" + portNumber
-				+ Support_HttpServer.POSTTEST;
-		final String headersTestUrl = "http://localhost:" + portNumber
-				+ Support_HttpServer.HEADERSTEST;
-
-		// start the test server. It will timeout and shut down after
-		// 5 seconds of inactivity
-		Support_HttpServer server = new Support_HttpServer(serversocket, test);
-		server.startServer(portNumber);
-
-		ByteArrayOutputStream bout = new ByteArrayOutputStream();
-		InputStream is;
-		int c;
-
-		// Chunked HTTP Transfer Coding Test
-		try {
-			// access the url and open a stream
-			connector.open(chunkedTestUrl);
-			is = connector.getInputStream();
-
-			// receive the data, and then read again after EOF
-			c = is.read();
-			while (c > 0)
-				c = is.read();
-			c = is.read();
-			is.close();
-			connector.close();
-			TestCase.assertEquals("Error receiving chunked transfer coded data",
-					-1, c);
-		} catch (Exception e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during test a: " + e);
-		}
-
-		// Content-Length Test
-		try {
-			connector.open(contentTestUrl);
-			is = connector.getInputStream();
-			bout.reset();
-			do {
-				c = is.read();
-				if (c != -1)
-					bout.write(c);
-			} while (c != -1);
-			is.close();
-			connector.close();
-			String result = new String(bout.toByteArray(), "ISO8859_1");
-			TestCase.assertTrue("Error receiving content coded data: " + result,
-					"ABCDE".equals(result));
-		} catch (Exception e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during test b: " + e);
-		}
-
-		// Headers Test
-		try {
-			connector.open(headersTestUrl);
-			connector.setRequestProperty("header1", "value1");
-			connector.setRequestProperty("header1", "value2");
-			int i = 0, found = 0;
-			String[] expected = new String[] { "no-cache=\"set-cookie\"",
-					"private", "no-transform" };
-			while (true) {
-				String key = connector.getHeaderFieldKey(i);
-				if (key == null && i > 0)
-					break;
-				if ("Cache-Control".equals(key)) {
-					TestCase.assertTrue("Too many headers at: " + i, found <= 2);
-					String value = connector.getHeaderField(i);
-					TestCase.assertTrue("Invalid header value: " + found + ": "
-							+ value, expected[found].equals(value));
-					found++;
-				}
-				i++;
-			}
-			TestCase.assertTrue("Invalid headers: " + found, found == 3);
-			connector.close();
-		} catch (Exception e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during test c: " + e);
-		}
-
-		// Post Test
-		// Same as "Basic post" test below, but uses read() instead
-		// of read(buf, offset, length) to read the results
-		try {
-			String toWrite = "abcdef";
-			connector.open(postTestUrl);
-			OutputStream out = connector.getOutputStream();
-			out.write(toWrite.getBytes("ISO8859_1"));
-			out.close();
-			is = connector.getInputStream();
-			bout.reset();
-			do {
-				c = is.read();
-				if (c != -1)
-					bout.write(c);
-			} while (c != -1);
-			is.close();
-			connector.close();
-			String result = new String(bout.toByteArray(), "ISO8859_1");
-			TestCase.assertTrue("Error sending data 1: " + result, toWrite
-					.equals(result));
-		} catch (Exception e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during test d: " + e);
-		}
-
-		// Post Test chunked
-		try {
-			String toWrite = "zyxwvuts";
-			connector.open(postTestUrl);
-			connector.setRequestProperty("Transfer-encoding", "chunked");
-			OutputStream out = connector.getOutputStream();
-			out.write(toWrite.getBytes("ISO8859_1"));
-			out.close();
-			is = connector.getInputStream();
-			bout.reset();
-			do {
-				c = is.read();
-				if (c != -1)
-					bout.write(c);
-			} while (c != -1);
-			is.close();
-			connector.close();
-			String result = new String(bout.toByteArray(), "ISO8859_1");
-			TestCase.assertTrue("Error sending data 2: " + result, ("C" + toWrite)
-					.equals(result));
-		} catch (Exception e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during test e: " + e);
-		}
-
-		OutputStream os = null;
-
-		byte[] data = new byte[1024];
-		int len = 0;
-
-		// Basic post
-		try {
-			String message = "test";
-			connector.open(postTestUrl);
-			os = connector.getOutputStream();
-			os.write(message.getBytes("ISO8859_1"));
-			os.close();
-			is = connector.getInputStream();
-			len = 0;
-			do {
-				int r = is.read(data, len, data.length - len);
-				if (r == -1)
-					break;
-				len += r;
-			} while (true);
-			is.close();
-			connector.close();
-			String result = new String(data, 0, len, "ISO8859_1");
-			TestCase.assertTrue("Basic port error: " + result, message
-					.equals(result));
-		} catch (IOException e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during basic post test: " + e);
-		}
-
-		String chunkChar = connector.isChunkedOnFlush() ? "C" : "";
-
-		// Flushing with post
-		try {
-			String message1 = "test2", message2 = "test3";
-			connector.open(postTestUrl);
-			os = connector.getOutputStream();
-			os.write(message1.getBytes("ISO8859_1"));
-			os.flush();
-			os.write(message2.getBytes("ISO8859_1"));
-			os.close();
-			is = connector.getInputStream();
-			len = 0;
-			do {
-				int r = is.read(data, len, data.length - len);
-				if (r == -1)
-					break;
-				len += r;
-			} while (true);
-			is.close();
-			connector.close();
-			String result = new String(data, 0, len, "ISO8859_1");
-			TestCase.assertTrue("Flushing with post: " + result, (chunkChar
-					+ message1 + chunkChar + message2).equals(result));
-		} catch (IOException e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during flushing post test: " + e);
-		}
-
-		// Flushing with post and setting content-length
-		try {
-			String message1 = "test4", message2 = "test5";
-			connector.open(postTestUrl);
-			connector.setRequestProperty("Content-Length", "10");
-			os = connector.getOutputStream();
-			os.write(message1.getBytes());
-			os.flush();
-			os.write(message2.getBytes());
-			os.close();
-			is = connector.getInputStream();
-			len = 0;
-			do {
-				int r = is.read(data, len, data.length - len);
-				if (r == -1)
-					break;
-				len += r;
-			} while (true);
-			is.close();
-			connector.close();
-			String result = new String(data, 0, len, "ISO8859_1");
-			TestCase.assertTrue("Flushing with post and setting content-length: "
-					+ result, (chunkChar + message1 + chunkChar + message2)
-					.equals(result));
-		} catch (IOException e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during flushing with content-length post test: "
-							+ e);
-		}
-
-		// Flushing followed immediately by a close()
-		try {
-			String message = "test6";
-			connector.open(postTestUrl);
-			os = connector.getOutputStream();
-			os.write(message.getBytes("ISO8859_1"));
-			os.flush();
-			os.close();
-			is = connector.getInputStream();
-			len = 0;
-			do {
-				int r = is.read(data, len, data.length - len);
-				if (r == -1)
-					break;
-				len += r;
-			} while (true);
-			is.close();
-			connector.close();
-			String result = new String(data, 0, len, "ISO8859_1");
-			TestCase.assertTrue("Flushing followed immediately by a close(): "
-					+ result, (chunkChar + message).equals(result));
-		} catch (IOException e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during flush followed by close post test: "
-					+ e);
-		}
-
-		// Redirection Tests
-		final int[] testCodes = { Support_HttpServer.MULT_CHOICE,
-				Support_HttpServer.MOVED_PERM, Support_HttpServer.FOUND,
-				Support_HttpServer.SEE_OTHER, Support_HttpServer.NOT_MODIFIED,
-				Support_HttpServer.UNUSED, Support_HttpServer.TEMP_REDIRECT, };
-
-		final int[] results = { 'A', 'A', 'A', 'A', 'P', 'P', 'P' };
-		// see Support_HTTPServer for the source of this data
-
-		final String fullLocalLocation = contentTestUrl;
-		final String partLocalLocation = Support_HttpServer.CONTENTTEST;
-
-		for (int i = 0; i < testCodes.length; i++) {
-
-			// test each of the redirection response codes
-			try {
-				// append the response code for the server to return
-				// and the location to redirect to
-				connector.open(redirectTestUrl + "/" + testCodes[i] + "-"
-						+ fullLocalLocation);
-				is = connector.getInputStream();
-				connector.close();
-
-				c = is.read();
-
-				if (testCodes[i] == Support_HttpServer.NOT_MODIFIED) {
-					// accept either the message-body or nothing, since the spec
-					// says there MUST NOT be a message body on 304 responses.
-					// But Java returns the message-body
-					if (!(c == results[i] || c == -1)) {
-						TestCase.fail("Incorrect data returned on test of HTTP response "
-										+ testCodes[i]);
-					}
-				} else if (c != results[i]) {
-					TestCase.fail("Incorrect data returned on test of HTTP response "
-									+ testCodes[i]);
-				}
-				while (c > 0)
-					c = is.read();
-				c = is.read();
-				is.close();
-			} catch (Exception e) {
-				e.printStackTrace();
-				TestCase.fail("Error during redirection test " + i + ": " + e);
-			}
-		}
-
-		// Test redirecting to a location on a different port
-		Class serversocketclass = serversocket.getClass();
-		try {
-			Support_ServerSocket serversocket2 = (Support_ServerSocket) serversocketclass
-					.newInstance();
-
-			Support_HttpServer server2 = new Support_HttpServer(serversocket2,
-					test);
-			int newport = Support_PortManager.getNextPort();
-			server2.startServer(newport);
-			server2.setPortRedirectTestEnable(true);
-
-			// Test if redirection to a different port works
-			final String otherPortLocation = "http://localhost:" + newport
-					+ Support_HttpServer.PORTREDIRTEST;
-
-			try {
-				// append the response code for the server to return
-				// and the location to redirect to
-
-				connector.open(redirectTestUrl + "/"
-						+ Support_HttpServer.MOVED_PERM + "-"
-						+ otherPortLocation);
-				is = connector.getInputStream();
-				connector.close();
-
-				c = is.read();
-				TestCase.assertEquals("Incorrect data returned on redirection to a different port.",
-								'A', c);
-				while (c > 0)
-					c = is.read();
-				c = is.read();
-				is.close();
-			} catch (Exception e) {
-				e.printStackTrace();
-				TestCase.fail("Exception during test f: " + e);
-			}
-			server2.stopServer();
-		} catch (IllegalAccessException e) {
-			TestCase.fail("Exception during redirection to a different port:" + e);
-		} catch (InstantiationException e) {
-			TestCase.fail("Exception during redirection to a different port:" + e);
-		}
-
-		// test redirecting to a relative URL on the same host
-		try {
-			// append the response code for the server to return
-			connector.open(redirectTestUrl + "/"
-					+ Support_HttpServer.MOVED_PERM + "-" + partLocalLocation);
-			is = connector.getInputStream();
-			connector.close();
-
-			c = is.read();
-			TestCase.assertEquals("Incorrect data returned on redirect to relative URI.",
-					'A', c);
-			while (c > 0)
-				c = is.read();
-			c = is.read();
-			is.close();
-		} catch (Exception e) {
-			e.printStackTrace();
-			TestCase.fail("Exception during redirection test to a relative URL: " + e);
-		}
-		server.stopServer();
-	}
-
-}
+/* 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.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import junit.framework.TestCase;
+
+/**
+ * Performs some basic testing of either HttpConnection or HttpURLConnection
+ * depending on the Support_ServerSocket and Support_HttpConnector passed to the
+ * constructor.
+ * 
+ */
+public class Support_HttpTests {
+
+	private Support_ServerSocket serversocket;
+
+	private Support_HttpConnector connector;
+
+	public Support_HttpTests(Support_ServerSocket serversocket,
+			Support_HttpConnector client) {
+		this.serversocket = serversocket;
+		this.connector = client;
+	}
+
+	public void runTests(junit.framework.TestCase test) {
+
+		// get a port to use for the test
+		int portNumber = Support_PortManager.getNextPort();
+
+		// url's for the various tests
+		final String chunkedTestUrl = "http://localhost:" + portNumber
+				+ Support_HttpServer.CHUNKEDTEST;
+		final String contentTestUrl = "http://localhost:" + portNumber
+				+ Support_HttpServer.CONTENTTEST;
+		final String redirectTestUrl = "http://localhost:" + portNumber
+				+ Support_HttpServer.REDIRECTTEST;
+		final String postTestUrl = "http://localhost:" + portNumber
+				+ Support_HttpServer.POSTTEST;
+		final String headersTestUrl = "http://localhost:" + portNumber
+				+ Support_HttpServer.HEADERSTEST;
+
+		// start the test server. It will timeout and shut down after
+		// 5 seconds of inactivity
+		Support_HttpServer server = new Support_HttpServer(serversocket, test);
+		server.startServer(portNumber);
+
+		ByteArrayOutputStream bout = new ByteArrayOutputStream();
+		InputStream is;
+		int c;
+
+		// Chunked HTTP Transfer Coding Test
+		try {
+			// access the url and open a stream
+			connector.open(chunkedTestUrl);
+			is = connector.getInputStream();
+
+			// receive the data, and then read again after EOF
+			c = is.read();
+			while (c > 0)
+				c = is.read();
+			c = is.read();
+			is.close();
+			connector.close();
+			TestCase.assertEquals("Error receiving chunked transfer coded data",
+					-1, c);
+		} catch (Exception e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during test a: " + e);
+		}
+
+		// Content-Length Test
+		try {
+			connector.open(contentTestUrl);
+			is = connector.getInputStream();
+			bout.reset();
+			do {
+				c = is.read();
+				if (c != -1)
+					bout.write(c);
+			} while (c != -1);
+			is.close();
+			connector.close();
+			String result = new String(bout.toByteArray(), "ISO8859_1");
+			TestCase.assertTrue("Error receiving content coded data: " + result,
+					"ABCDE".equals(result));
+		} catch (Exception e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during test b: " + e);
+		}
+
+		// Headers Test
+		try {
+			connector.open(headersTestUrl);
+			connector.setRequestProperty("header1", "value1");
+			connector.setRequestProperty("header1", "value2");
+			int i = 0, found = 0;
+			String[] expected = new String[] { "no-cache=\"set-cookie\"",
+					"private", "no-transform" };
+			while (true) {
+				String key = connector.getHeaderFieldKey(i);
+				if (key == null && i > 0)
+					break;
+				if ("Cache-Control".equals(key)) {
+					TestCase.assertTrue("Too many headers at: " + i, found <= 2);
+					String value = connector.getHeaderField(i);
+					TestCase.assertTrue("Invalid header value: " + found + ": "
+							+ value, expected[found].equals(value));
+					found++;
+				}
+				i++;
+			}
+			TestCase.assertTrue("Invalid headers: " + found, found == 3);
+			connector.close();
+		} catch (Exception e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during test c: " + e);
+		}
+
+		// Post Test
+		// Same as "Basic post" test below, but uses read() instead
+		// of read(buf, offset, length) to read the results
+		try {
+			String toWrite = "abcdef";
+			connector.open(postTestUrl);
+			OutputStream out = connector.getOutputStream();
+			out.write(toWrite.getBytes("ISO8859_1"));
+			out.close();
+			is = connector.getInputStream();
+			bout.reset();
+			do {
+				c = is.read();
+				if (c != -1)
+					bout.write(c);
+			} while (c != -1);
+			is.close();
+			connector.close();
+			String result = new String(bout.toByteArray(), "ISO8859_1");
+			TestCase.assertTrue("Error sending data 1: " + result, toWrite
+					.equals(result));
+		} catch (Exception e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during test d: " + e);
+		}
+
+		// Post Test chunked
+		try {
+			String toWrite = "zyxwvuts";
+			connector.open(postTestUrl);
+			connector.setRequestProperty("Transfer-encoding", "chunked");
+			OutputStream out = connector.getOutputStream();
+			out.write(toWrite.getBytes("ISO8859_1"));
+			out.close();
+			is = connector.getInputStream();
+			bout.reset();
+			do {
+				c = is.read();
+				if (c != -1)
+					bout.write(c);
+			} while (c != -1);
+			is.close();
+			connector.close();
+			String result = new String(bout.toByteArray(), "ISO8859_1");
+			TestCase.assertTrue("Error sending data 2: " + result, ("C" + toWrite)
+					.equals(result));
+		} catch (Exception e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during test e: " + e);
+		}
+
+		OutputStream os = null;
+
+		byte[] data = new byte[1024];
+		int len = 0;
+
+		// Basic post
+		try {
+			String message = "test";
+			connector.open(postTestUrl);
+			os = connector.getOutputStream();
+			os.write(message.getBytes("ISO8859_1"));
+			os.close();
+			is = connector.getInputStream();
+			len = 0;
+			do {
+				int r = is.read(data, len, data.length - len);
+				if (r == -1)
+					break;
+				len += r;
+			} while (true);
+			is.close();
+			connector.close();
+			String result = new String(data, 0, len, "ISO8859_1");
+			TestCase.assertTrue("Basic port error: " + result, message
+					.equals(result));
+		} catch (IOException e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during basic post test: " + e);
+		}
+
+		String chunkChar = connector.isChunkedOnFlush() ? "C" : "";
+
+		// Flushing with post
+		try {
+			String message1 = "test2", message2 = "test3";
+			connector.open(postTestUrl);
+			os = connector.getOutputStream();
+			os.write(message1.getBytes("ISO8859_1"));
+			os.flush();
+			os.write(message2.getBytes("ISO8859_1"));
+			os.close();
+			is = connector.getInputStream();
+			len = 0;
+			do {
+				int r = is.read(data, len, data.length - len);
+				if (r == -1)
+					break;
+				len += r;
+			} while (true);
+			is.close();
+			connector.close();
+			String result = new String(data, 0, len, "ISO8859_1");
+			TestCase.assertTrue("Flushing with post: " + result, (chunkChar
+					+ message1 + chunkChar + message2).equals(result));
+		} catch (IOException e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during flushing post test: " + e);
+		}
+
+		// Flushing with post and setting content-length
+		try {
+			String message1 = "test4", message2 = "test5";
+			connector.open(postTestUrl);
+			connector.setRequestProperty("Content-Length", "10");
+			os = connector.getOutputStream();
+			os.write(message1.getBytes());
+			os.flush();
+			os.write(message2.getBytes());
+			os.close();
+			is = connector.getInputStream();
+			len = 0;
+			do {
+				int r = is.read(data, len, data.length - len);
+				if (r == -1)
+					break;
+				len += r;
+			} while (true);
+			is.close();
+			connector.close();
+			String result = new String(data, 0, len, "ISO8859_1");
+			TestCase.assertTrue("Flushing with post and setting content-length: "
+					+ result, (chunkChar + message1 + chunkChar + message2)
+					.equals(result));
+		} catch (IOException e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during flushing with content-length post test: "
+							+ e);
+		}
+
+		// Flushing followed immediately by a close()
+		try {
+			String message = "test6";
+			connector.open(postTestUrl);
+			os = connector.getOutputStream();
+			os.write(message.getBytes("ISO8859_1"));
+			os.flush();
+			os.close();
+			is = connector.getInputStream();
+			len = 0;
+			do {
+				int r = is.read(data, len, data.length - len);
+				if (r == -1)
+					break;
+				len += r;
+			} while (true);
+			is.close();
+			connector.close();
+			String result = new String(data, 0, len, "ISO8859_1");
+			TestCase.assertTrue("Flushing followed immediately by a close(): "
+					+ result, (chunkChar + message).equals(result));
+		} catch (IOException e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during flush followed by close post test: "
+					+ e);
+		}
+
+		// Redirection Tests
+		final int[] testCodes = { Support_HttpServer.MULT_CHOICE,
+				Support_HttpServer.MOVED_PERM, Support_HttpServer.FOUND,
+				Support_HttpServer.SEE_OTHER, Support_HttpServer.NOT_MODIFIED,
+				Support_HttpServer.UNUSED, Support_HttpServer.TEMP_REDIRECT, };
+
+		final int[] results = { 'A', 'A', 'A', 'A', 'P', 'P', 'P' };
+		// see Support_HTTPServer for the source of this data
+
+		final String fullLocalLocation = contentTestUrl;
+		final String partLocalLocation = Support_HttpServer.CONTENTTEST;
+
+		for (int i = 0; i < testCodes.length; i++) {
+
+			// test each of the redirection response codes
+			try {
+				// append the response code for the server to return
+				// and the location to redirect to
+				connector.open(redirectTestUrl + "/" + testCodes[i] + "-"
+						+ fullLocalLocation);
+				is = connector.getInputStream();
+				connector.close();
+
+				c = is.read();
+
+				if (testCodes[i] == Support_HttpServer.NOT_MODIFIED) {
+					// accept either the message-body or nothing, since the spec
+					// says there MUST NOT be a message body on 304 responses.
+					// But Java returns the message-body
+					if (!(c == results[i] || c == -1)) {
+						TestCase.fail("Incorrect data returned on test of HTTP response "
+										+ testCodes[i]);
+					}
+				} else if (c != results[i]) {
+					TestCase.fail("Incorrect data returned on test of HTTP response "
+									+ testCodes[i]);
+				}
+				while (c > 0)
+					c = is.read();
+				c = is.read();
+				is.close();
+			} catch (Exception e) {
+				e.printStackTrace();
+				TestCase.fail("Error during redirection test " + i + ": " + e);
+			}
+		}
+
+		// Test redirecting to a location on a different port
+		Class serversocketclass = serversocket.getClass();
+		try {
+			Support_ServerSocket serversocket2 = (Support_ServerSocket) serversocketclass
+					.newInstance();
+
+			Support_HttpServer server2 = new Support_HttpServer(serversocket2,
+					test);
+			int newport = Support_PortManager.getNextPort();
+			server2.startServer(newport);
+			server2.setPortRedirectTestEnable(true);
+
+			// Test if redirection to a different port works
+			final String otherPortLocation = "http://localhost:" + newport
+					+ Support_HttpServer.PORTREDIRTEST;
+
+			try {
+				// append the response code for the server to return
+				// and the location to redirect to
+
+				connector.open(redirectTestUrl + "/"
+						+ Support_HttpServer.MOVED_PERM + "-"
+						+ otherPortLocation);
+				is = connector.getInputStream();
+				connector.close();
+
+				c = is.read();
+				TestCase.assertEquals("Incorrect data returned on redirection to a different port.",
+								'A', c);
+				while (c > 0)
+					c = is.read();
+				c = is.read();
+				is.close();
+			} catch (Exception e) {
+				e.printStackTrace();
+				TestCase.fail("Exception during test f: " + e);
+			}
+			server2.stopServer();
+		} catch (IllegalAccessException e) {
+			TestCase.fail("Exception during redirection to a different port:" + e);
+		} catch (InstantiationException e) {
+			TestCase.fail("Exception during redirection to a different port:" + e);
+		}
+
+		// test redirecting to a relative URL on the same host
+		try {
+			// append the response code for the server to return
+			connector.open(redirectTestUrl + "/"
+					+ Support_HttpServer.MOVED_PERM + "-" + partLocalLocation);
+			is = connector.getInputStream();
+			connector.close();
+
+			c = is.read();
+			TestCase.assertEquals("Incorrect data returned on redirect to relative URI.",
+					'A', c);
+			while (c > 0)
+				c = is.read();
+			c = is.read();
+			is.close();
+		} catch (Exception e) {
+			e.printStackTrace();
+			TestCase.fail("Exception during redirection test to a relative URL: " + e);
+		}
+		server.stopServer();
+	}
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_HttpTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ListTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ListTest.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ListTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ListTest.java Tue Sep  5 06:39:17 2006
@@ -1,213 +1,213 @@
-/* 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.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-public class Support_ListTest extends junit.framework.TestCase {
-
-	List list; // must contain the Integers 0 to 99 in order
-
-	public Support_ListTest(String p1) {
-		super(p1);
-	}
-
-	public Support_ListTest(String p1, List l) {
-		super(p1);
-		list = l;
-	}
-
-	public void runTest() {
-		int hashCode = 1;
-		for (int counter = 0; counter < 100; counter++) {
-			Object elem;
-			elem = list.get(counter);
-			hashCode = 31 * hashCode + elem.hashCode();
-			assertTrue("ListTest - get failed", elem
-					.equals(new Integer(counter)));
-		}
-		assertTrue("ListTest - hashCode failed", hashCode == list.hashCode());
-
-		list.add(50, new Integer(1000));
-		assertTrue("ListTest - a) add with index failed--did not insert", list
-				.get(50).equals(new Integer(1000)));
-		assertTrue(
-				"ListTest - b) add with index failed--did not move following elements",
-				list.get(51).equals(new Integer(50)));
-		assertTrue(
-				"ListTest - c) add with index failed--affected previous elements",
-				list.get(49).equals(new Integer(49)));
-
-		list.set(50, new Integer(2000));
-		assertTrue("ListTest - a) set failed--did not set", list.get(50)
-				.equals(new Integer(2000)));
-		assertTrue("ListTest - b) set failed--affected following elements",
-				list.get(51).equals(new Integer(50)));
-		assertTrue("ListTest - c) set failed--affected previous elements", list
-				.get(49).equals(new Integer(49)));
-
-		list.remove(50);
-		assertTrue("ListTest - a) remove with index failed--did not remove",
-				list.get(50).equals(new Integer(50)));
-		assertTrue(
-				"ListTest - b) remove with index failed--did not move following elements",
-				list.get(51).equals(new Integer(51)));
-		assertTrue(
-				"ListTest - c) remove with index failed--affected previous elements",
-				list.get(49).equals(new Integer(49)));
-
-		List myList = new LinkedList();
-		myList.add(new Integer(500));
-		myList.add(new Integer(501));
-		myList.add(new Integer(502));
-
-		list.addAll(50, myList);
-		assertTrue("ListTest - a) addAll with index failed--did not insert",
-				list.get(50).equals(new Integer(500)));
-		assertTrue("ListTest - b) addAll with index failed--did not insert",
-				list.get(51).equals(new Integer(501)));
-		assertTrue("ListTest - c) addAll with index failed--did not insert",
-				list.get(52).equals(new Integer(502)));
-		assertTrue(
-				"ListTest - d) addAll with index failed--did not move following elements",
-				list.get(53).equals(new Integer(50)));
-		assertTrue(
-				"ListTest - e) addAll with index failed--affected previous elements",
-				list.get(49).equals(new Integer(49)));
-
-		List mySubList = list.subList(50, 53);
-		assertEquals(3, mySubList.size());
-		assertTrue(
-				"ListTest - a) sublist Failed--does not contain correct elements",
-				mySubList.get(0).equals(new Integer(500)));
-		assertTrue(
-				"ListTest - b) sublist Failed--does not contain correct elements",
-				mySubList.get(1).equals(new Integer(501)));
-		assertTrue(
-				"ListTest - c) sublist Failed--does not contain correct elements",
-				mySubList.get(2).equals(new Integer(502)));
-
-		t_listIterator(mySubList);
-
-		mySubList.clear();
-		assertEquals("ListTest - Clearing the sublist did not remove the appropriate elements from the original list",
-				100, list.size());
-
-		t_listIterator(list);
-		ListIterator li = list.listIterator();
-		for (int counter = 0; li.hasNext(); counter++) {
-			Object elem;
-			elem = li.next();
-			assertTrue("ListTest - listIterator failed", elem
-					.equals(new Integer(counter)));
-		}
-
-		new Support_CollectionTest("", list).runTest();
-
-	}
-
-	public void t_listIterator(List list) {
-		ListIterator li = list.listIterator(1);
-		assertTrue("listIterator(1)", li.next() == list.get(1));
-
-		int orgSize = list.size();
-		li = list.listIterator();
-		for (int i = 0; i <= orgSize; i++) {
-			if (i == 0)
-				assertTrue("list iterator hasPrevious(): " + i, !li
-						.hasPrevious());
-			else
-				assertTrue("list iterator hasPrevious(): " + i, li
-						.hasPrevious());
-			if (i == list.size())
-				assertTrue("list iterator hasNext(): " + i, !li.hasNext());
-			else
-				assertTrue("list iterator hasNext(): " + i, li.hasNext());
-			assertTrue("list iterator nextIndex(): " + i, li.nextIndex() == i);
-			assertTrue("list iterator previousIndex(): " + i, li
-					.previousIndex() == i - 1);
-			boolean exception = false;
-			try {
-				assertTrue("list iterator next(): " + i, li.next() == list
-						.get(i));
-			} catch (NoSuchElementException e) {
-				exception = true;
-			}
-			if (i == list.size())
-				assertTrue("list iterator next() exception: " + i, exception);
-			else
-				assertTrue("list iterator next() exception: " + i, !exception);
-		}
-
-		for (int i = orgSize - 1; i >= 0; i--) {
-			assertTrue("list iterator previous(): " + i, li.previous() == list
-					.get(i));
-			assertTrue("list iterator nextIndex()2: " + i, li.nextIndex() == i);
-			assertTrue("list iterator previousIndex()2: " + i, li
-					.previousIndex() == i - 1);
-			if (i == 0)
-				assertTrue("list iterator hasPrevious()2: " + i, !li
-						.hasPrevious());
-			else
-				assertTrue("list iterator hasPrevious()2: " + i, li
-						.hasPrevious());
-			assertTrue("list iterator hasNext()2: " + i, li.hasNext());
-		}
-		boolean exception = false;
-		try {
-			li.previous();
-		} catch (NoSuchElementException e) {
-			exception = true;
-		}
-		assertTrue("list iterator previous() exception", exception);
-
-		Integer add1 = new Integer(600);
-		Integer add2 = new Integer(601);
-		li.add(add1);
-		assertTrue("list iterator add(), size()", list.size() == (orgSize + 1));
-		assertEquals("list iterator add(), nextIndex()", 1, li.nextIndex());
-		assertEquals("list iterator add(), previousIndex()",
-				0, li.previousIndex());
-		Object next = li.next();
-		assertTrue("list iterator add(), next(): " + next, next == list.get(1));
-		li.add(add2);
-		Object previous = li.previous();
-		assertTrue("list iterator add(), previous(): " + previous,
-				previous == add2);
-		assertEquals("list iterator add(), nextIndex()2", 2, li.nextIndex());
-		assertEquals("list iterator add(), previousIndex()2",
-				1, li.previousIndex());
-
-		li.remove();
-		assertTrue("list iterator remove(), size()",
-				list.size() == (orgSize + 1));
-		assertEquals("list iterator remove(), nextIndex()", 2, li.nextIndex());
-		assertEquals("list iterator remove(), previousIndex()", 1, li
-				.previousIndex());
-		assertTrue("list iterator previous()2", li.previous() == list.get(1));
-		assertTrue("list iterator previous()3", li.previous() == list.get(0));
-		assertTrue("list iterator next()2", li.next() == list.get(0));
-		li.remove();
-		assertTrue("list iterator hasPrevious()3", !li.hasPrevious());
-		assertTrue("list iterator hasNext()3", li.hasNext());
-		assertTrue("list iterator size()", list.size() == orgSize);
-		assertEquals("list iterator nextIndex()3", 0, li.nextIndex());
-		assertEquals("list iterator previousIndex()3", -1, li.previousIndex());
-	}
-}
+/* 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.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+public class Support_ListTest extends junit.framework.TestCase {
+
+	List list; // must contain the Integers 0 to 99 in order
+
+	public Support_ListTest(String p1) {
+		super(p1);
+	}
+
+	public Support_ListTest(String p1, List l) {
+		super(p1);
+		list = l;
+	}
+
+	public void runTest() {
+		int hashCode = 1;
+		for (int counter = 0; counter < 100; counter++) {
+			Object elem;
+			elem = list.get(counter);
+			hashCode = 31 * hashCode + elem.hashCode();
+			assertTrue("ListTest - get failed", elem
+					.equals(new Integer(counter)));
+		}
+		assertTrue("ListTest - hashCode failed", hashCode == list.hashCode());
+
+		list.add(50, new Integer(1000));
+		assertTrue("ListTest - a) add with index failed--did not insert", list
+				.get(50).equals(new Integer(1000)));
+		assertTrue(
+				"ListTest - b) add with index failed--did not move following elements",
+				list.get(51).equals(new Integer(50)));
+		assertTrue(
+				"ListTest - c) add with index failed--affected previous elements",
+				list.get(49).equals(new Integer(49)));
+
+		list.set(50, new Integer(2000));
+		assertTrue("ListTest - a) set failed--did not set", list.get(50)
+				.equals(new Integer(2000)));
+		assertTrue("ListTest - b) set failed--affected following elements",
+				list.get(51).equals(new Integer(50)));
+		assertTrue("ListTest - c) set failed--affected previous elements", list
+				.get(49).equals(new Integer(49)));
+
+		list.remove(50);
+		assertTrue("ListTest - a) remove with index failed--did not remove",
+				list.get(50).equals(new Integer(50)));
+		assertTrue(
+				"ListTest - b) remove with index failed--did not move following elements",
+				list.get(51).equals(new Integer(51)));
+		assertTrue(
+				"ListTest - c) remove with index failed--affected previous elements",
+				list.get(49).equals(new Integer(49)));
+
+		List myList = new LinkedList();
+		myList.add(new Integer(500));
+		myList.add(new Integer(501));
+		myList.add(new Integer(502));
+
+		list.addAll(50, myList);
+		assertTrue("ListTest - a) addAll with index failed--did not insert",
+				list.get(50).equals(new Integer(500)));
+		assertTrue("ListTest - b) addAll with index failed--did not insert",
+				list.get(51).equals(new Integer(501)));
+		assertTrue("ListTest - c) addAll with index failed--did not insert",
+				list.get(52).equals(new Integer(502)));
+		assertTrue(
+				"ListTest - d) addAll with index failed--did not move following elements",
+				list.get(53).equals(new Integer(50)));
+		assertTrue(
+				"ListTest - e) addAll with index failed--affected previous elements",
+				list.get(49).equals(new Integer(49)));
+
+		List mySubList = list.subList(50, 53);
+		assertEquals(3, mySubList.size());
+		assertTrue(
+				"ListTest - a) sublist Failed--does not contain correct elements",
+				mySubList.get(0).equals(new Integer(500)));
+		assertTrue(
+				"ListTest - b) sublist Failed--does not contain correct elements",
+				mySubList.get(1).equals(new Integer(501)));
+		assertTrue(
+				"ListTest - c) sublist Failed--does not contain correct elements",
+				mySubList.get(2).equals(new Integer(502)));
+
+		t_listIterator(mySubList);
+
+		mySubList.clear();
+		assertEquals("ListTest - Clearing the sublist did not remove the appropriate elements from the original list",
+				100, list.size());
+
+		t_listIterator(list);
+		ListIterator li = list.listIterator();
+		for (int counter = 0; li.hasNext(); counter++) {
+			Object elem;
+			elem = li.next();
+			assertTrue("ListTest - listIterator failed", elem
+					.equals(new Integer(counter)));
+		}
+
+		new Support_CollectionTest("", list).runTest();
+
+	}
+
+	public void t_listIterator(List list) {
+		ListIterator li = list.listIterator(1);
+		assertTrue("listIterator(1)", li.next() == list.get(1));
+
+		int orgSize = list.size();
+		li = list.listIterator();
+		for (int i = 0; i <= orgSize; i++) {
+			if (i == 0)
+				assertTrue("list iterator hasPrevious(): " + i, !li
+						.hasPrevious());
+			else
+				assertTrue("list iterator hasPrevious(): " + i, li
+						.hasPrevious());
+			if (i == list.size())
+				assertTrue("list iterator hasNext(): " + i, !li.hasNext());
+			else
+				assertTrue("list iterator hasNext(): " + i, li.hasNext());
+			assertTrue("list iterator nextIndex(): " + i, li.nextIndex() == i);
+			assertTrue("list iterator previousIndex(): " + i, li
+					.previousIndex() == i - 1);
+			boolean exception = false;
+			try {
+				assertTrue("list iterator next(): " + i, li.next() == list
+						.get(i));
+			} catch (NoSuchElementException e) {
+				exception = true;
+			}
+			if (i == list.size())
+				assertTrue("list iterator next() exception: " + i, exception);
+			else
+				assertTrue("list iterator next() exception: " + i, !exception);
+		}
+
+		for (int i = orgSize - 1; i >= 0; i--) {
+			assertTrue("list iterator previous(): " + i, li.previous() == list
+					.get(i));
+			assertTrue("list iterator nextIndex()2: " + i, li.nextIndex() == i);
+			assertTrue("list iterator previousIndex()2: " + i, li
+					.previousIndex() == i - 1);
+			if (i == 0)
+				assertTrue("list iterator hasPrevious()2: " + i, !li
+						.hasPrevious());
+			else
+				assertTrue("list iterator hasPrevious()2: " + i, li
+						.hasPrevious());
+			assertTrue("list iterator hasNext()2: " + i, li.hasNext());
+		}
+		boolean exception = false;
+		try {
+			li.previous();
+		} catch (NoSuchElementException e) {
+			exception = true;
+		}
+		assertTrue("list iterator previous() exception", exception);
+
+		Integer add1 = new Integer(600);
+		Integer add2 = new Integer(601);
+		li.add(add1);
+		assertTrue("list iterator add(), size()", list.size() == (orgSize + 1));
+		assertEquals("list iterator add(), nextIndex()", 1, li.nextIndex());
+		assertEquals("list iterator add(), previousIndex()",
+				0, li.previousIndex());
+		Object next = li.next();
+		assertTrue("list iterator add(), next(): " + next, next == list.get(1));
+		li.add(add2);
+		Object previous = li.previous();
+		assertTrue("list iterator add(), previous(): " + previous,
+				previous == add2);
+		assertEquals("list iterator add(), nextIndex()2", 2, li.nextIndex());
+		assertEquals("list iterator add(), previousIndex()2",
+				1, li.previousIndex());
+
+		li.remove();
+		assertTrue("list iterator remove(), size()",
+				list.size() == (orgSize + 1));
+		assertEquals("list iterator remove(), nextIndex()", 2, li.nextIndex());
+		assertEquals("list iterator remove(), previousIndex()", 1, li
+				.previousIndex());
+		assertTrue("list iterator previous()2", li.previous() == list.get(1));
+		assertTrue("list iterator previous()3", li.previous() == list.get(0));
+		assertTrue("list iterator next()2", li.next() == list.get(0));
+		li.remove();
+		assertTrue("list iterator hasPrevious()3", !li.hasPrevious());
+		assertTrue("list iterator hasNext()3", li.hasNext());
+		assertTrue("list iterator size()", list.size() == orgSize);
+		assertEquals("list iterator nextIndex()3", 0, li.nextIndex());
+		assertEquals("list iterator previousIndex()3", -1, li.previousIndex());
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ListTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MapTest2.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MapTest2.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MapTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MapTest2.java Tue Sep  5 06:39:17 2006
@@ -1,62 +1,62 @@
-/* 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.Map;
-
-public class Support_MapTest2 extends junit.framework.TestCase {
-
-	Map map;
-
-	public Support_MapTest2(Map m) {
-		super();
-		map = m;
-		if (!map.isEmpty()) {
-			fail("Map must be empty");
-		}
-	}
-
-	public void runTest() {
-		try {
-			map.put("one", "1");
-			assertEquals("size should be one", 1, map.size());
-			map.clear();
-			assertEquals("size should be zero", 0, map.size());
-			assertTrue("Should not have entries", !map.entrySet().iterator()
-					.hasNext());
-			assertTrue("Should not have keys", !map.keySet().iterator()
-					.hasNext());
-			assertTrue("Should not have values", !map.values().iterator()
-					.hasNext());
-		} catch (UnsupportedOperationException e) {
-		}
-
-		try {
-			map.put("one", "1");
-			assertEquals("size should be one", 1, map.size());
-			map.remove("one");
-			assertEquals("size should be zero", 0, map.size());
-			assertTrue("Should not have entries", !map.entrySet().iterator()
-					.hasNext());
-			assertTrue("Should not have keys", !map.keySet().iterator()
-					.hasNext());
-			assertTrue("Should not have values", !map.values().iterator()
-					.hasNext());
-		} catch (UnsupportedOperationException e) {
-		}
-	}
-
-}
+/* 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.Map;
+
+public class Support_MapTest2 extends junit.framework.TestCase {
+
+	Map map;
+
+	public Support_MapTest2(Map m) {
+		super();
+		map = m;
+		if (!map.isEmpty()) {
+			fail("Map must be empty");
+		}
+	}
+
+	public void runTest() {
+		try {
+			map.put("one", "1");
+			assertEquals("size should be one", 1, map.size());
+			map.clear();
+			assertEquals("size should be zero", 0, map.size());
+			assertTrue("Should not have entries", !map.entrySet().iterator()
+					.hasNext());
+			assertTrue("Should not have keys", !map.keySet().iterator()
+					.hasNext());
+			assertTrue("Should not have values", !map.values().iterator()
+					.hasNext());
+		} catch (UnsupportedOperationException e) {
+		}
+
+		try {
+			map.put("one", "1");
+			assertEquals("size should be one", 1, map.size());
+			map.remove("one");
+			assertEquals("size should be zero", 0, map.size());
+			assertTrue("Should not have entries", !map.entrySet().iterator()
+					.hasNext());
+			assertTrue("Should not have keys", !map.keySet().iterator()
+					.hasNext());
+			assertTrue("Should not have values", !map.values().iterator()
+					.hasNext());
+		} catch (UnsupportedOperationException e) {
+		}
+	}
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MapTest2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MessageFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MessageFormat.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MessageFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MessageFormat.java Tue Sep  5 06:39:17 2006
@@ -1,116 +1,116 @@
-/* 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.text.DateFormat;
-import java.text.MessageFormat;
-import java.text.NumberFormat;
-import java.text.MessageFormat.Field;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.Locale;
-import java.util.Vector;
-
-public class Support_MessageFormat extends Support_Format {
-
-	public Support_MessageFormat(String p1) {
-		super(p1);
-	}
-
-	public void runTest() {
-		t_formatToCharacterIterator();
-		t_format_with_FieldPosition();
-	}
-
-	public static void main(String[] args) {
-		new Support_MessageFormat("").runTest();
-	}
-
-	public void t_format_with_FieldPosition() {
-
-		String pattern = "On {4,date} at {3,time}, he ate {2,number, integer} hamburger{2,choice,1#|1<s} and drank {1, number} litres of coke. That was {0,choice,1#just enough|1<more than enough} food!";
-		MessageFormat format = new MessageFormat(pattern, Locale.US);
-
-		Date date = new GregorianCalendar(2005, 1, 28, 14, 20, 16).getTime();
-		Integer hamburgers = new Integer(8);
-		Object[] objects = new Object[] { hamburgers, new Double(3.5),
-				hamburgers, date, date };
-
-		super.text = "On Feb 28, 2005 at 2:20:16 PM, he ate 8 hamburgers and drank 3.5 litres of coke. That was more than enough food!";
-
-		// test with MessageFormat.Field.ARGUMENT
-		t_FormatWithField(1, format, objects, null, Field.ARGUMENT, 3, 15);
-
-		// test other format fields that are included in the formatted text
-		t_FormatWithField(2, format, objects, null, DateFormat.Field.AM_PM, 0,
-				0);
-		t_FormatWithField(3, format, objects, null,
-				NumberFormat.Field.FRACTION, 0, 0);
-
-		// test fields that are not included in the formatted text
-		t_FormatWithField(4, format, objects, null, DateFormat.Field.ERA, 0, 0);
-		t_FormatWithField(5, format, objects, null,
-				NumberFormat.Field.EXPONENT_SIGN, 0, 0);
-	}
-
-	public void t_formatToCharacterIterator() {
-
-		String pattern = "On {4,date} at {3,time}, he ate {2,number, integer} hamburger{2,choice,1#|1<s} and drank {1, number} litres of coke. That was {0,choice,1#just enough|1<more than enough} food!";
-		MessageFormat format = new MessageFormat(pattern, Locale.US);
-
-		Date date = new GregorianCalendar(2005, 1, 28, 14, 20, 16).getTime();
-		Integer hamburgers = new Integer(8);
-		Object[] objects = new Object[] { hamburgers, new Double(3.5),
-				hamburgers, date, date };
-
-		t_Format(1, objects, format, getMessageVector1());
-	}
-
-	private Vector getMessageVector1() {
-		Vector v = new Vector();
-		v.add(new FieldContainer(3, 6, Field.ARGUMENT, 4));
-		v.add(new FieldContainer(3, 6, DateFormat.Field.MONTH));
-		v.add(new FieldContainer(6, 7, Field.ARGUMENT, 4));
-		v.add(new FieldContainer(7, 9, Field.ARGUMENT, 4));
-		v.add(new FieldContainer(7, 9, DateFormat.Field.DAY_OF_MONTH));
-		v.add(new FieldContainer(9, 11, Field.ARGUMENT, 4));
-		v.add(new FieldContainer(11, 15, Field.ARGUMENT, 4));
-		v.add(new FieldContainer(11, 15, DateFormat.Field.YEAR));
-		v.add(new FieldContainer(19, 20, Field.ARGUMENT, 3));
-		v.add(new FieldContainer(19, 20, DateFormat.Field.HOUR1));
-		v.add(new FieldContainer(20, 21, Field.ARGUMENT, 3));
-		v.add(new FieldContainer(21, 23, Field.ARGUMENT, 3));
-		v.add(new FieldContainer(21, 23, DateFormat.Field.MINUTE));
-		v.add(new FieldContainer(23, 24, Field.ARGUMENT, 3));
-		v.add(new FieldContainer(24, 26, Field.ARGUMENT, 3));
-		v.add(new FieldContainer(24, 26, DateFormat.Field.SECOND));
-		v.add(new FieldContainer(26, 27, Field.ARGUMENT, 3));
-		v.add(new FieldContainer(27, 29, Field.ARGUMENT, 3));
-		v.add(new FieldContainer(27, 29, DateFormat.Field.AM_PM));
-		v.add(new FieldContainer(38, 39, Field.ARGUMENT, 2));
-		v.add(new FieldContainer(38, 39, NumberFormat.Field.INTEGER));
-		v.add(new FieldContainer(49, 50, Field.ARGUMENT, 2));
-		v.add(new FieldContainer(61, 62, Field.ARGUMENT, 1));
-		v.add(new FieldContainer(61, 62, NumberFormat.Field.INTEGER));
-		v.add(new FieldContainer(62, 63, Field.ARGUMENT, 1));
-		v.add(new FieldContainer(62, 63, NumberFormat.Field.DECIMAL_SEPARATOR));
-		v.add(new FieldContainer(63, 64, Field.ARGUMENT, 1));
-		v.add(new FieldContainer(63, 64, NumberFormat.Field.FRACTION));
-		v.add(new FieldContainer(90, 106, Field.ARGUMENT, 0));
-		return v;
-	}
-
-}
+/* 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.text.DateFormat;
+import java.text.MessageFormat;
+import java.text.NumberFormat;
+import java.text.MessageFormat.Field;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Locale;
+import java.util.Vector;
+
+public class Support_MessageFormat extends Support_Format {
+
+	public Support_MessageFormat(String p1) {
+		super(p1);
+	}
+
+	public void runTest() {
+		t_formatToCharacterIterator();
+		t_format_with_FieldPosition();
+	}
+
+	public static void main(String[] args) {
+		new Support_MessageFormat("").runTest();
+	}
+
+	public void t_format_with_FieldPosition() {
+
+		String pattern = "On {4,date} at {3,time}, he ate {2,number, integer} hamburger{2,choice,1#|1<s} and drank {1, number} litres of coke. That was {0,choice,1#just enough|1<more than enough} food!";
+		MessageFormat format = new MessageFormat(pattern, Locale.US);
+
+		Date date = new GregorianCalendar(2005, 1, 28, 14, 20, 16).getTime();
+		Integer hamburgers = new Integer(8);
+		Object[] objects = new Object[] { hamburgers, new Double(3.5),
+				hamburgers, date, date };
+
+		super.text = "On Feb 28, 2005 at 2:20:16 PM, he ate 8 hamburgers and drank 3.5 litres of coke. That was more than enough food!";
+
+		// test with MessageFormat.Field.ARGUMENT
+		t_FormatWithField(1, format, objects, null, Field.ARGUMENT, 3, 15);
+
+		// test other format fields that are included in the formatted text
+		t_FormatWithField(2, format, objects, null, DateFormat.Field.AM_PM, 0,
+				0);
+		t_FormatWithField(3, format, objects, null,
+				NumberFormat.Field.FRACTION, 0, 0);
+
+		// test fields that are not included in the formatted text
+		t_FormatWithField(4, format, objects, null, DateFormat.Field.ERA, 0, 0);
+		t_FormatWithField(5, format, objects, null,
+				NumberFormat.Field.EXPONENT_SIGN, 0, 0);
+	}
+
+	public void t_formatToCharacterIterator() {
+
+		String pattern = "On {4,date} at {3,time}, he ate {2,number, integer} hamburger{2,choice,1#|1<s} and drank {1, number} litres of coke. That was {0,choice,1#just enough|1<more than enough} food!";
+		MessageFormat format = new MessageFormat(pattern, Locale.US);
+
+		Date date = new GregorianCalendar(2005, 1, 28, 14, 20, 16).getTime();
+		Integer hamburgers = new Integer(8);
+		Object[] objects = new Object[] { hamburgers, new Double(3.5),
+				hamburgers, date, date };
+
+		t_Format(1, objects, format, getMessageVector1());
+	}
+
+	private Vector getMessageVector1() {
+		Vector v = new Vector();
+		v.add(new FieldContainer(3, 6, Field.ARGUMENT, 4));
+		v.add(new FieldContainer(3, 6, DateFormat.Field.MONTH));
+		v.add(new FieldContainer(6, 7, Field.ARGUMENT, 4));
+		v.add(new FieldContainer(7, 9, Field.ARGUMENT, 4));
+		v.add(new FieldContainer(7, 9, DateFormat.Field.DAY_OF_MONTH));
+		v.add(new FieldContainer(9, 11, Field.ARGUMENT, 4));
+		v.add(new FieldContainer(11, 15, Field.ARGUMENT, 4));
+		v.add(new FieldContainer(11, 15, DateFormat.Field.YEAR));
+		v.add(new FieldContainer(19, 20, Field.ARGUMENT, 3));
+		v.add(new FieldContainer(19, 20, DateFormat.Field.HOUR1));
+		v.add(new FieldContainer(20, 21, Field.ARGUMENT, 3));
+		v.add(new FieldContainer(21, 23, Field.ARGUMENT, 3));
+		v.add(new FieldContainer(21, 23, DateFormat.Field.MINUTE));
+		v.add(new FieldContainer(23, 24, Field.ARGUMENT, 3));
+		v.add(new FieldContainer(24, 26, Field.ARGUMENT, 3));
+		v.add(new FieldContainer(24, 26, DateFormat.Field.SECOND));
+		v.add(new FieldContainer(26, 27, Field.ARGUMENT, 3));
+		v.add(new FieldContainer(27, 29, Field.ARGUMENT, 3));
+		v.add(new FieldContainer(27, 29, DateFormat.Field.AM_PM));
+		v.add(new FieldContainer(38, 39, Field.ARGUMENT, 2));
+		v.add(new FieldContainer(38, 39, NumberFormat.Field.INTEGER));
+		v.add(new FieldContainer(49, 50, Field.ARGUMENT, 2));
+		v.add(new FieldContainer(61, 62, Field.ARGUMENT, 1));
+		v.add(new FieldContainer(61, 62, NumberFormat.Field.INTEGER));
+		v.add(new FieldContainer(62, 63, Field.ARGUMENT, 1));
+		v.add(new FieldContainer(62, 63, NumberFormat.Field.DECIMAL_SEPARATOR));
+		v.add(new FieldContainer(63, 64, Field.ARGUMENT, 1));
+		v.add(new FieldContainer(63, 64, NumberFormat.Field.FRACTION));
+		v.add(new FieldContainer(90, 106, Field.ARGUMENT, 0));
+		return v;
+	}
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_MessageFormat.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_NetworkInterface.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_NetworkInterface.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_NetworkInterface.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_NetworkInterface.java Tue Sep  5 06:39:17 2006
@@ -1,45 +1,45 @@
-/* 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.net.NetworkInterface;
-
-public class Support_NetworkInterface {
-
-	/**
-	 * On windows platforms with IPV6 enabled there are a number of pseudo
-	 * interfaces which don't work with our tests. This function is called to
-	 * make sure we only use the non-pseudo interfaces
-	 */
-	public static boolean useInterface(NetworkInterface theInterface) {
-		boolean result = true;
-		String platform = System.getProperty("os.name");
-		// only use these on windows platforms
-		if (platform.startsWith("Windows")) {
-			if ((theInterface.getDisplayName()
-					.equals("Teredo Tunneling Pseudo-Interface"))
-					|| (theInterface.getDisplayName()
-							.equals("6to4 Tunneling Pseudo-Interface"))
-					|| (theInterface.getDisplayName()
-							.equals("Automatic Tunneling Pseudo-Interface"))
-					|| (theInterface.getDisplayName()
-							.equals("Loopback Pseudo-Interface"))) {
-				result = false;
-			}
-		}
-		return result;
-	}
-}
+/* 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.net.NetworkInterface;
+
+public class Support_NetworkInterface {
+
+	/**
+	 * On windows platforms with IPV6 enabled there are a number of pseudo
+	 * interfaces which don't work with our tests. This function is called to
+	 * make sure we only use the non-pseudo interfaces
+	 */
+	public static boolean useInterface(NetworkInterface theInterface) {
+		boolean result = true;
+		String platform = System.getProperty("os.name");
+		// only use these on windows platforms
+		if (platform.startsWith("Windows")) {
+			if ((theInterface.getDisplayName()
+					.equals("Teredo Tunneling Pseudo-Interface"))
+					|| (theInterface.getDisplayName()
+							.equals("6to4 Tunneling Pseudo-Interface"))
+					|| (theInterface.getDisplayName()
+							.equals("Automatic Tunneling Pseudo-Interface"))
+					|| (theInterface.getDisplayName()
+							.equals("Loopback Pseudo-Interface"))) {
+				result = false;
+			}
+		}
+		return result;
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_NetworkInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PermissionCollection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PlatformFile.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PlatformFile.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PlatformFile.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PlatformFile.java Tue Sep  5 06:39:17 2006
@@ -1,34 +1,34 @@
-/* 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;
-
-public class Support_PlatformFile {
-
-	private static String platformId = null;
-
-	public static String getNewPlatformFile(String pre, String post) {
-		if (platformId == null) {
-			String property = System.getProperty("com.ibm.oti.configuration");
-			if (property == null) {
-				property = "JDK";
-			}
-			platformId = property
-					+ System.getProperty("java.vm.version").replace('.', '-');
-		}
-		return pre + platformId + post;
-	}
-
-}
+/* 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;
+
+public class Support_PlatformFile {
+
+	private static String platformId = null;
+
+	public static String getNewPlatformFile(String pre, String post) {
+		if (platformId == null) {
+			String property = System.getProperty("com.ibm.oti.configuration");
+			if (property == null) {
+				property = "JDK";
+			}
+			platformId = property
+					+ System.getProperty("java.vm.version").replace('.', '-');
+		}
+		return pre + platformId + post;
+	}
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PlatformFile.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PortManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PortManager.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PortManager.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PortManager.java Tue Sep  5 06:39:17 2006
@@ -1,41 +1,41 @@
-/* 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.Date;
-
-public class Support_PortManager extends java.lang.Object {
-
-	private static int lastAssignedPort = somewhatRandomPort();
-
-	public static synchronized int getNextPort() {
-		if (++lastAssignedPort > 65534)
-			lastAssignedPort = 6000;
-		return lastAssignedPort;
-	}
-
-	/*
-	 * Returns a different port number every 6 seconds or so. The port number
-	 * should be about += 100 at each 6 second interval
-	 */
-	private static int somewhatRandomPort() {
-		Date date = new Date();
-		int minutes = date.getMinutes();
-		int seconds = date.getSeconds();
-		return 6000 + (1000 * minutes) + ((seconds / 6) * 100);
-	}
-
-}
+/* 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.Date;
+
+public class Support_PortManager extends java.lang.Object {
+
+	private static int lastAssignedPort = somewhatRandomPort();
+
+	public static synchronized int getNextPort() {
+		if (++lastAssignedPort > 65534)
+			lastAssignedPort = 6000;
+		return lastAssignedPort;
+	}
+
+	/*
+	 * Returns a different port number every 6 seconds or so. The port number
+	 * should be about += 100 at each 6 second interval
+	 */
+	private static int somewhatRandomPort() {
+		Date date = new Date();
+		int minutes = date.getMinutes();
+		int seconds = date.getSeconds();
+		return 6000 + (1000 * minutes) + ((seconds / 6) * 100);
+	}
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_PortManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProcessReadWriteTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProcessReadWriteTest.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProcessReadWriteTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProcessReadWriteTest.java Tue Sep  5 06:39:17 2006
@@ -1,46 +1,46 @@
-/* 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.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-public class Support_ProcessReadWriteTest {
-
-	public static void main(String[] args) {
-		try {
-			FileInputStream input = new FileInputStream(FileDescriptor.in);
-			FileOutputStream output = new FileOutputStream(FileDescriptor.out);
-
-			// read just three lines since EOF isn't working properly. It would
-			// be better to read to the end and echo it all
-			for (int i = 0; i < 3; i++) {
-				int c = input.read();
-				while (c != '\n') {
-					output.write(c);
-					c = input.read();
-				}
-				output.write(c);
-			}
-			input.close();
-			output.close();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-}
+/* 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.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+public class Support_ProcessReadWriteTest {
+
+	public static void main(String[] args) {
+		try {
+			FileInputStream input = new FileInputStream(FileDescriptor.in);
+			FileOutputStream output = new FileOutputStream(FileDescriptor.out);
+
+			// read just three lines since EOF isn't working properly. It would
+			// be better to read to the end and echo it all
+			for (int i = 0; i < 3; i++) {
+				int c = input.read();
+				while (c != '\n') {
+					output.write(c);
+					c = input.read();
+				}
+				output.write(c);
+			}
+			input.close();
+			output.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProcessReadWriteTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderJCE.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderJCE.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderJCE.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderJCE.java Tue Sep  5 06:39:17 2006
@@ -1,86 +1,86 @@
-/* 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.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-
-/**
- * This class implements a dummy security provider
- */
-public class Support_ProviderJCE extends Provider {
-	// Provider name
-	private static final String NAME = "ProviderJCE";
-
-	// Version of the services
-	private static final double VERSION = 1.0;
-
-	private static final String INFO = NAME
-			+ " DSA key, parameter generation and signing; SHA-1 digest";
-
-	/**
-	 * Constructs a new instance of the dummy provider.
-	 */
-	public Support_ProviderJCE() {
-		super(NAME, VERSION, INFO);
-		registerServices();
-	}
-
-	/**
-	 * Register the services the receiver provides.
-	 */
-	private void registerServices() {
-		AccessController.doPrivileged(new PrivilegedAction() {
-			public Object run() {
-				// Digest engine
-				put("MessageDigest.SHA",
-						"made.up.provider.name.MessageDigestSHA");
-				put("MessageDigest.MD5",
-						"made.up.provider.name.MessageDigestMD5");
-
-				// Algorithm parameter generator
-				put("AlgorithmParameterGenerator.DSA",
-						"made.up.provider.name.AlgorithmParameterGeneratorDSA");
-
-				// Algorithm parameters
-				put("AlgorithmParameters.DSA",
-						"made.up.provider.name.AlgorithmParametersDSA");
-
-				// Key pair generator
-				put("KeyPairGenerator.DSA",
-						"made.up.provider.name.KeyPairGeneratorDSA");
-
-				// Key factory
-				put("KeyFactory.DSA", "made.up.provider.name.KeyFactoryDSA");
-				put("KeyFactory.RSA", "made.up.provider.name.KeyFactoryRSA");
-
-				// Signature algorithm
-				put("Signature.SHA1withDSA",
-						"made.up.provider.name.SignatureDSA");
-
-				// KeyStore
-				put("KeyStore.PKCS#12/Netscape",
-						"made.up.provider.name.KeyStore");
-
-				// Certificate
-				put("CertificateFactory.X509",
-						"made.up.provider.name.CertificateFactoryX509");
-				return null;
-			}
-		});
-	}
+/* 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.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.Provider;
+
+/**
+ * This class implements a dummy security provider
+ */
+public class Support_ProviderJCE extends Provider {
+	// Provider name
+	private static final String NAME = "ProviderJCE";
+
+	// Version of the services
+	private static final double VERSION = 1.0;
+
+	private static final String INFO = NAME
+			+ " DSA key, parameter generation and signing; SHA-1 digest";
+
+	/**
+	 * Constructs a new instance of the dummy provider.
+	 */
+	public Support_ProviderJCE() {
+		super(NAME, VERSION, INFO);
+		registerServices();
+	}
+
+	/**
+	 * Register the services the receiver provides.
+	 */
+	private void registerServices() {
+		AccessController.doPrivileged(new PrivilegedAction() {
+			public Object run() {
+				// Digest engine
+				put("MessageDigest.SHA",
+						"made.up.provider.name.MessageDigestSHA");
+				put("MessageDigest.MD5",
+						"made.up.provider.name.MessageDigestMD5");
+
+				// Algorithm parameter generator
+				put("AlgorithmParameterGenerator.DSA",
+						"made.up.provider.name.AlgorithmParameterGeneratorDSA");
+
+				// Algorithm parameters
+				put("AlgorithmParameters.DSA",
+						"made.up.provider.name.AlgorithmParametersDSA");
+
+				// Key pair generator
+				put("KeyPairGenerator.DSA",
+						"made.up.provider.name.KeyPairGeneratorDSA");
+
+				// Key factory
+				put("KeyFactory.DSA", "made.up.provider.name.KeyFactoryDSA");
+				put("KeyFactory.RSA", "made.up.provider.name.KeyFactoryRSA");
+
+				// Signature algorithm
+				put("Signature.SHA1withDSA",
+						"made.up.provider.name.SignatureDSA");
+
+				// KeyStore
+				put("KeyStore.PKCS#12/Netscape",
+						"made.up.provider.name.KeyStore");
+
+				// Certificate
+				put("CertificateFactory.X509",
+						"made.up.provider.name.CertificateFactoryX509");
+				return null;
+			}
+		});
+	}
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderJCE.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderRSA.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderRSA.java?view=diff&rev=440340&r1=440339&r2=440340
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderRSA.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderRSA.java Tue Sep  5 06:39:17 2006
@@ -1,92 +1,92 @@
-/* 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.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-
-/**
- * This class implements a dummy provider.
- */
-public class Support_ProviderRSA extends Provider {
-	// Provider name 
-	private static final String NAME = "ProviderRSA";
-
-	// Version of the services provided
-	private static final double VERSION = 1.0;
-
-	private static final String INFO = NAME
-			+ " DSA key, parameter generation and signing; SHA-1 digest"; 
-
-	/**
-	 * Constructs a new instance of the dummy provider.
-	 */
-	public Support_ProviderRSA() {
-		super(NAME, VERSION, INFO);
-		registerServices();
-	}
-
-	/**
-	 * Register the services the receiver provides.
-	 */
-	private void registerServices() {
-		AccessController.doPrivileged(new PrivilegedAction() {
-			public Object run() {
-				// Digest engine
-				put("MessageDigest.SHA",
-						"made.up.provider.name.MessageDigestSHA");
-				put("MessageDigest.MD5",
-						"made.up.provider.name.MessageDigestMD5");
-
-				// Secure Random
-				put("SecureRandom.SHA1PRNG",
-						"made.up.provider.name.SecureRandomImpl");
-
-				// Algorithm parameter generator
-				put("AlgorithmParameterGenerator.DSA",
-						"made.up.provider.name.AlgorithmParameterGeneratorDSA");
-
-				// Algorithm parameters
-				put("AlgorithmParameters.DSA",
-						"made.up.provider.name.AlgorithmParametersDSA");
-
-				// Key pair generator
-				put("KeyPairGenerator.DSA",
-						"made.up.provider.name.KeyPairGeneratorDSA");
-
-				// Key factory
-				put("KeyFactory.DSA",
-						"made.up.provider.name.KeyFactoryDSA");
-				put("KeyFactory.RSA",
-						"made.up.provider.name.KeyFactoryRSA");
-
-				// Signature algorithm
-				put("Signature.SHA1withDSA",
-						"made.up.provider.name.SignatureDSA");
-
-				// KeyStore
-				put("KeyStore.PKCS#12/Netscape",
-						"made.up.provider.name.KeyStore");
-
-				// Certificate
-				put("CertificateFactory.X509",
-						"made.up.provider.name.CertificateFactoryX509");
-				return null;
-			}
-		});
-	}
+/* 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.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.Provider;
+
+/**
+ * This class implements a dummy provider.
+ */
+public class Support_ProviderRSA extends Provider {
+	// Provider name 
+	private static final String NAME = "ProviderRSA";
+
+	// Version of the services provided
+	private static final double VERSION = 1.0;
+
+	private static final String INFO = NAME
+			+ " DSA key, parameter generation and signing; SHA-1 digest"; 
+
+	/**
+	 * Constructs a new instance of the dummy provider.
+	 */
+	public Support_ProviderRSA() {
+		super(NAME, VERSION, INFO);
+		registerServices();
+	}
+
+	/**
+	 * Register the services the receiver provides.
+	 */
+	private void registerServices() {
+		AccessController.doPrivileged(new PrivilegedAction() {
+			public Object run() {
+				// Digest engine
+				put("MessageDigest.SHA",
+						"made.up.provider.name.MessageDigestSHA");
+				put("MessageDigest.MD5",
+						"made.up.provider.name.MessageDigestMD5");
+
+				// Secure Random
+				put("SecureRandom.SHA1PRNG",
+						"made.up.provider.name.SecureRandomImpl");
+
+				// Algorithm parameter generator
+				put("AlgorithmParameterGenerator.DSA",
+						"made.up.provider.name.AlgorithmParameterGeneratorDSA");
+
+				// Algorithm parameters
+				put("AlgorithmParameters.DSA",
+						"made.up.provider.name.AlgorithmParametersDSA");
+
+				// Key pair generator
+				put("KeyPairGenerator.DSA",
+						"made.up.provider.name.KeyPairGeneratorDSA");
+
+				// Key factory
+				put("KeyFactory.DSA",
+						"made.up.provider.name.KeyFactoryDSA");
+				put("KeyFactory.RSA",
+						"made.up.provider.name.KeyFactoryRSA");
+
+				// Signature algorithm
+				put("Signature.SHA1withDSA",
+						"made.up.provider.name.SignatureDSA");
+
+				// KeyStore
+				put("KeyStore.PKCS#12/Netscape",
+						"made.up.provider.name.KeyStore");
+
+				// Certificate
+				put("CertificateFactory.X509",
+						"made.up.provider.name.CertificateFactoryX509");
+				return null;
+			}
+		});
+	}
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_ProviderRSA.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message