Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThrowableTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThrowableTest.java?rev=437974&r1=437973&r2=437974&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThrowableTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThrowableTest.java
Mon Aug 28 22:40:44 2006
@@ -1,181 +1,181 @@
-/* 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 org.apache.harmony.luni.tests.java.lang;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-import junit.framework.TestCase;
-
-public class ThrowableTest extends TestCase {
-
- /**
- * @tests java.lang.Throwable#Throwable()
- */
- public void test_Constructor() {
- Throwable e = new Throwable();
- assertNull(e.getMessage());
- assertNull(e.getLocalizedMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests java.lang.Throwable#Throwable(java.lang.String)
- */
- public void test_ConstructorLjava_lang_String() {
- Throwable e = new Throwable("fixture");
- assertEquals("fixture", e.getMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests java.lang.Throwable#fillInStackTrace()
- */
- public void test_fillInStackTrace() {
- // Test for method java.lang.Throwable
- // java.lang.Throwable.fillInStackTrace()
- class Test implements Runnable {
- public int x;
-
- public Test(int x) {
- this.x = x;
- }
-
- public void anotherMethod() {
- if (true)
- throw new IndexOutOfBoundsException();
- }
-
- public void run() {
- if (x == 0)
- throw new IndexOutOfBoundsException();
- try {
- anotherMethod();
- } catch (IndexOutOfBoundsException e) {
- e.fillInStackTrace();
- throw e;
- }
- }
- }
- ByteArrayOutputStream bao = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(bao);
- try {
- new Test(0).run();
- } catch (Throwable e) {
- e.printStackTrace(ps);
- }
- ps.flush();
- String s = fixStacktrace(new String(bao.toByteArray(), 0, bao.size()));
-
- bao.reset();
- try {
- new Test(1).run();
- } catch (Throwable e) {
- e.printStackTrace(ps);
- }
- ps.close();
- String s2 = fixStacktrace(new String(bao.toByteArray(), 0, bao.size()));
- assertTrue("Invalid stackTrace? length: " + s2.length() + "\n" + s2, s2
- .length() > 300);
- assertTrue("Incorrect stackTrace printed: \n" + s2
- + "\n\nCompared with:\n" + s, s2.equals(s));
- }
-
- private String fixStacktrace(String trace) {
- // remove linenumbers
- StringBuffer sb = new StringBuffer();
- int lastIndex = 0;
- while (lastIndex < trace.length()) {
- int index = trace.indexOf('\n', lastIndex);
- if (index == -1)
- index = trace.length();
- String line = trace.substring(lastIndex, index);
- lastIndex = index + 1;
-
- index = line.indexOf("(");
- if (index > -1) {
- line = line.substring(0, index);
- }
- // Usually the construction of the exception is removed
- // however if running with the JIT, it may not be removed
- if (line.indexOf("java.lang.Throwable") > -1)
- continue;
- sb.append(line);
- sb.append('\n');
- }
- return sb.toString();
- }
-
- /**
- * @tests java.lang.Throwable#printStackTrace()
- */
- public void test_printStackTrace() {
- // Test for method void java.lang.Throwable.printStackTrace()
- Throwable x = new ClassNotFoundException("A Test Message");
- ByteArrayOutputStream bao = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(bao);
- PrintStream err = System.err;
- System.setErr(ps);
- x.printStackTrace();
- System.setErr(err);
- ps.close();
- String s = new String(bao.toByteArray(), 0, bao.size());
- assertTrue("Incorrect stackTrace printed:\n" + s, s != null
- && s.length() > 400);
- }
-
- /**
- * @tests java.lang.Throwable#printStackTrace(java.io.PrintStream)
- */
- public void test_printStackTraceLjava_io_PrintStream() {
- // Test for method void
- // java.lang.Throwable.printStackTrace(java.io.PrintStream)
- ByteArrayOutputStream bao = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(bao);
- Throwable x = new java.net.UnknownHostException("A Message");
- x.printStackTrace(ps);
- ps.close();
- String s = new String(bao.toByteArray(), 0, bao.size());
- assertTrue("Incorrect stackTrace printed:\n" + s, s != null
- && s.length() > 400);
- }
-
- /**
- * @tests java.lang.Throwable#printStackTrace(java.io.PrintWriter)
- */
- public void test_printStackTraceLjava_io_PrintWriter() {
- // Test for method void
- // java.lang.Throwable.printStackTrace(java.io.PrintWriter)
- // SM
- ByteArrayOutputStream bao = new ByteArrayOutputStream();
- PrintWriter pw = new PrintWriter(bao);
- Throwable x = new java.net.UnknownHostException("A Message");
- x.printStackTrace(pw);
- pw.close();
- String s = new String(bao.toByteArray(), 0, bao.size());
- assertTrue("Incorrect stackTrace printed:\n" + s, s != null
- && s.length() > 400);
- }
-
- /**
- * @tests java.lang.Throwable#toString()
- */
- public void test_toString() {
- Throwable e = new Throwable("Throw");
- assertEquals("java.lang.Throwable: Throw", e.toString());
-
- }
-}
+/* 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 org.apache.harmony.luni.tests.java.lang;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+import junit.framework.TestCase;
+
+public class ThrowableTest extends TestCase {
+
+ /**
+ * @tests java.lang.Throwable#Throwable()
+ */
+ public void test_Constructor() {
+ Throwable e = new Throwable();
+ assertNull(e.getMessage());
+ assertNull(e.getLocalizedMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests java.lang.Throwable#Throwable(java.lang.String)
+ */
+ public void test_ConstructorLjava_lang_String() {
+ Throwable e = new Throwable("fixture");
+ assertEquals("fixture", e.getMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests java.lang.Throwable#fillInStackTrace()
+ */
+ public void test_fillInStackTrace() {
+ // Test for method java.lang.Throwable
+ // java.lang.Throwable.fillInStackTrace()
+ class Test implements Runnable {
+ public int x;
+
+ public Test(int x) {
+ this.x = x;
+ }
+
+ public void anotherMethod() {
+ if (true)
+ throw new IndexOutOfBoundsException();
+ }
+
+ public void run() {
+ if (x == 0)
+ throw new IndexOutOfBoundsException();
+ try {
+ anotherMethod();
+ } catch (IndexOutOfBoundsException e) {
+ e.fillInStackTrace();
+ throw e;
+ }
+ }
+ }
+ ByteArrayOutputStream bao = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(bao);
+ try {
+ new Test(0).run();
+ } catch (Throwable e) {
+ e.printStackTrace(ps);
+ }
+ ps.flush();
+ String s = fixStacktrace(new String(bao.toByteArray(), 0, bao.size()));
+
+ bao.reset();
+ try {
+ new Test(1).run();
+ } catch (Throwable e) {
+ e.printStackTrace(ps);
+ }
+ ps.close();
+ String s2 = fixStacktrace(new String(bao.toByteArray(), 0, bao.size()));
+ assertTrue("Invalid stackTrace? length: " + s2.length() + "\n" + s2, s2
+ .length() > 300);
+ assertTrue("Incorrect stackTrace printed: \n" + s2
+ + "\n\nCompared with:\n" + s, s2.equals(s));
+ }
+
+ private String fixStacktrace(String trace) {
+ // remove linenumbers
+ StringBuffer sb = new StringBuffer();
+ int lastIndex = 0;
+ while (lastIndex < trace.length()) {
+ int index = trace.indexOf('\n', lastIndex);
+ if (index == -1)
+ index = trace.length();
+ String line = trace.substring(lastIndex, index);
+ lastIndex = index + 1;
+
+ index = line.indexOf("(");
+ if (index > -1) {
+ line = line.substring(0, index);
+ }
+ // Usually the construction of the exception is removed
+ // however if running with the JIT, it may not be removed
+ if (line.indexOf("java.lang.Throwable") > -1)
+ continue;
+ sb.append(line);
+ sb.append('\n');
+ }
+ return sb.toString();
+ }
+
+ /**
+ * @tests java.lang.Throwable#printStackTrace()
+ */
+ public void test_printStackTrace() {
+ // Test for method void java.lang.Throwable.printStackTrace()
+ Throwable x = new ClassNotFoundException("A Test Message");
+ ByteArrayOutputStream bao = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(bao);
+ PrintStream err = System.err;
+ System.setErr(ps);
+ x.printStackTrace();
+ System.setErr(err);
+ ps.close();
+ String s = new String(bao.toByteArray(), 0, bao.size());
+ assertTrue("Incorrect stackTrace printed:\n" + s, s != null
+ && s.length() > 400);
+ }
+
+ /**
+ * @tests java.lang.Throwable#printStackTrace(java.io.PrintStream)
+ */
+ public void test_printStackTraceLjava_io_PrintStream() {
+ // Test for method void
+ // java.lang.Throwable.printStackTrace(java.io.PrintStream)
+ ByteArrayOutputStream bao = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(bao);
+ Throwable x = new java.net.UnknownHostException("A Message");
+ x.printStackTrace(ps);
+ ps.close();
+ String s = new String(bao.toByteArray(), 0, bao.size());
+ assertTrue("Incorrect stackTrace printed:\n" + s, s != null
+ && s.length() > 400);
+ }
+
+ /**
+ * @tests java.lang.Throwable#printStackTrace(java.io.PrintWriter)
+ */
+ public void test_printStackTraceLjava_io_PrintWriter() {
+ // Test for method void
+ // java.lang.Throwable.printStackTrace(java.io.PrintWriter)
+ // SM
+ ByteArrayOutputStream bao = new ByteArrayOutputStream();
+ PrintWriter pw = new PrintWriter(bao);
+ Throwable x = new java.net.UnknownHostException("A Message");
+ x.printStackTrace(pw);
+ pw.close();
+ String s = new String(bao.toByteArray(), 0, bao.size());
+ assertTrue("Incorrect stackTrace printed:\n" + s, s != null
+ && s.length() > 400);
+ }
+
+ /**
+ * @tests java.lang.Throwable#toString()
+ */
+ public void test_toString() {
+ Throwable e = new Throwable("Throw");
+ assertEquals("java.lang.Throwable: Throw", e.toString());
+
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThrowableTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnknownErrorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnknownErrorTest.java?rev=437974&r1=437973&r2=437974&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnknownErrorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnknownErrorTest.java
Mon Aug 28 22:40:44 2006
@@ -1,40 +1,40 @@
-/* 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 org.apache.harmony.luni.tests.java.lang;
-
-import junit.framework.TestCase;
-
-public class UnknownErrorTest extends TestCase {
-
- /**
- * @tests java.lang.UnknownError#UnknownError()
- */
- public void test_Constructor() {
- UnknownError e = new UnknownError();
- assertNull(e.getMessage());
- assertNull(e.getLocalizedMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests java.lang.UnknownError#UnknownError(java.lang.String)
- */
- public void test_ConstructorLjava_lang_String() {
- UnknownError e = new UnknownError("fixture");
- assertEquals("fixture", e.getMessage());
- assertNull(e.getCause());
- }
-}
+/* 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 org.apache.harmony.luni.tests.java.lang;
+
+import junit.framework.TestCase;
+
+public class UnknownErrorTest extends TestCase {
+
+ /**
+ * @tests java.lang.UnknownError#UnknownError()
+ */
+ public void test_Constructor() {
+ UnknownError e = new UnknownError();
+ assertNull(e.getMessage());
+ assertNull(e.getLocalizedMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests java.lang.UnknownError#UnknownError(java.lang.String)
+ */
+ public void test_ConstructorLjava_lang_String() {
+ UnknownError e = new UnknownError("fixture");
+ assertEquals("fixture", e.getMessage());
+ assertNull(e.getCause());
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnknownErrorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsatisfiedLinkErrorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsatisfiedLinkErrorTest.java?rev=437974&r1=437973&r2=437974&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsatisfiedLinkErrorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsatisfiedLinkErrorTest.java
Mon Aug 28 22:40:44 2006
@@ -1,40 +1,40 @@
-/* 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 org.apache.harmony.luni.tests.java.lang;
-
-import junit.framework.TestCase;
-
-public class UnsatisfiedLinkErrorTest extends TestCase {
-
- /**
- * @tests java.lang.UnsatisfiedLinkError#UnsatisfiedLinkError()
- */
- public void test_Constructor() {
- UnsatisfiedLinkError e = new UnsatisfiedLinkError();
- assertNull(e.getMessage());
- assertNull(e.getLocalizedMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests java.lang.UnsatisfiedLinkError#UnsatisfiedLinkError(java.lang.String)
- */
- public void test_ConstructorLjava_lang_String() {
- UnsatisfiedLinkError e = new UnsatisfiedLinkError("fixture");
- assertEquals("fixture", e.getMessage());
- assertNull(e.getCause());
- }
-}
+/* 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 org.apache.harmony.luni.tests.java.lang;
+
+import junit.framework.TestCase;
+
+public class UnsatisfiedLinkErrorTest extends TestCase {
+
+ /**
+ * @tests java.lang.UnsatisfiedLinkError#UnsatisfiedLinkError()
+ */
+ public void test_Constructor() {
+ UnsatisfiedLinkError e = new UnsatisfiedLinkError();
+ assertNull(e.getMessage());
+ assertNull(e.getLocalizedMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests java.lang.UnsatisfiedLinkError#UnsatisfiedLinkError(java.lang.String)
+ */
+ public void test_ConstructorLjava_lang_String() {
+ UnsatisfiedLinkError e = new UnsatisfiedLinkError("fixture");
+ assertEquals("fixture", e.getMessage());
+ assertNull(e.getCause());
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsatisfiedLinkErrorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsupportedOperationExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsupportedOperationExceptionTest.java?rev=437974&r1=437973&r2=437974&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsupportedOperationExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsupportedOperationExceptionTest.java
Mon Aug 28 22:40:44 2006
@@ -1,63 +1,63 @@
-/* Copyright 1998, 2006 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 org.apache.harmony.luni.tests.java.lang;
-
-import junit.framework.TestCase;
-import tests.util.SerializationTester;
-
-public class UnsupportedOperationExceptionTest extends TestCase {
-
- private static final String SERIALIZATION_FILE_NAME =
- "serialization/java/lang/UnsupportedOperationException.ser"; //$NON-NLS-1$
-
- /**
- * @tests java.lang.UnsupportedOperationException#UnsupportedOperationException()
- */
- public void test_Constructor() {
- UnsupportedOperationException e = new UnsupportedOperationException();
- assertNull(e.getMessage());
- assertNull(e.getLocalizedMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests java.lang.UnsupportedOperationException#UnsupportedOperationException(java.lang.String)
- */
- public void test_ConstructorLjava_lang_String() {
- UnsupportedOperationException e = new UnsupportedOperationException("fixture");
- assertEquals("fixture", e.getMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests serialization/deserilazation.
- */
- public void test_serialization() throws Exception {
- UnsupportedOperationException srcUnsupportedOperationException = new UnsupportedOperationException();
- UnsupportedOperationException destUnsupportedOperationException = (UnsupportedOperationException)
SerializationTester
- .getDeserilizedObject(srcUnsupportedOperationException);
- }
-
- /**
- * @tests serialization/deserilazation compatibility with RI.
- */
- public void test_serializationCompatibility() throws Exception {
- UnsupportedOperationException srcUnsupportedOperationException = new UnsupportedOperationException();
- UnsupportedOperationException destUnsupportedOperationException = (UnsupportedOperationException)
SerializationTester
- .readObject(srcUnsupportedOperationException,
- SERIALIZATION_FILE_NAME);
- }
-}
+/* Copyright 1998, 2006 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 org.apache.harmony.luni.tests.java.lang;
+
+import junit.framework.TestCase;
+import tests.util.SerializationTester;
+
+public class UnsupportedOperationExceptionTest extends TestCase {
+
+ private static final String SERIALIZATION_FILE_NAME =
+ "serialization/java/lang/UnsupportedOperationException.ser"; //$NON-NLS-1$
+
+ /**
+ * @tests java.lang.UnsupportedOperationException#UnsupportedOperationException()
+ */
+ public void test_Constructor() {
+ UnsupportedOperationException e = new UnsupportedOperationException();
+ assertNull(e.getMessage());
+ assertNull(e.getLocalizedMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests java.lang.UnsupportedOperationException#UnsupportedOperationException(java.lang.String)
+ */
+ public void test_ConstructorLjava_lang_String() {
+ UnsupportedOperationException e = new UnsupportedOperationException("fixture");
+ assertEquals("fixture", e.getMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests serialization/deserilazation.
+ */
+ public void test_serialization() throws Exception {
+ UnsupportedOperationException srcUnsupportedOperationException = new UnsupportedOperationException();
+ UnsupportedOperationException destUnsupportedOperationException = (UnsupportedOperationException)
SerializationTester
+ .getDeserilizedObject(srcUnsupportedOperationException);
+ }
+
+ /**
+ * @tests serialization/deserilazation compatibility with RI.
+ */
+ public void test_serializationCompatibility() throws Exception {
+ UnsupportedOperationException srcUnsupportedOperationException = new UnsupportedOperationException();
+ UnsupportedOperationException destUnsupportedOperationException = (UnsupportedOperationException)
SerializationTester
+ .readObject(srcUnsupportedOperationException,
+ SERIALIZATION_FILE_NAME);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/UnsupportedOperationExceptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VerifyErrorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VerifyErrorTest.java?rev=437974&r1=437973&r2=437974&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VerifyErrorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VerifyErrorTest.java
Mon Aug 28 22:40:44 2006
@@ -1,40 +1,40 @@
-/* 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 org.apache.harmony.luni.tests.java.lang;
-
-import junit.framework.TestCase;
-
-public class VerifyErrorTest extends TestCase {
-
- /**
- * @tests java.lang.VerifyError#VerifyError()
- */
- public void test_Constructor() {
- VerifyError e = new VerifyError();
- assertNull(e.getMessage());
- assertNull(e.getLocalizedMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests java.lang.VerifyError#VerifyError(java.lang.String)
- */
- public void test_ConstructorLjava_lang_String() {
- VerifyError e = new VerifyError("fixture");
- assertEquals("fixture", e.getMessage());
- assertNull(e.getCause());
- }
-}
+/* 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 org.apache.harmony.luni.tests.java.lang;
+
+import junit.framework.TestCase;
+
+public class VerifyErrorTest extends TestCase {
+
+ /**
+ * @tests java.lang.VerifyError#VerifyError()
+ */
+ public void test_Constructor() {
+ VerifyError e = new VerifyError();
+ assertNull(e.getMessage());
+ assertNull(e.getLocalizedMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests java.lang.VerifyError#VerifyError(java.lang.String)
+ */
+ public void test_ConstructorLjava_lang_String() {
+ VerifyError e = new VerifyError("fixture");
+ assertEquals("fixture", e.getMessage());
+ assertNull(e.getCause());
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VerifyErrorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VirtualMachineErrorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VirtualMachineErrorTest.java?rev=437974&r1=437973&r2=437974&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VirtualMachineErrorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VirtualMachineErrorTest.java
Mon Aug 28 22:40:44 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 org.apache.harmony.luni.tests.java.lang;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("serial")
-public class VirtualMachineErrorTest extends TestCase {
-
- /**
- * @tests java.lang.VirtualMachineError#VirtualMachineError()
- */
- public void test_Constructor() {
- VirtualMachineError e = new VirtualMachineError() {};
- assertNull(e.getMessage());
- assertNull(e.getLocalizedMessage());
- assertNull(e.getCause());
- }
-
- /**
- * @tests java.lang.VirtualMachineError#VirtualMachineError(java.lang.String)
- */
- public void test_ConstructorLjava_lang_String() {
- VirtualMachineError e = new VirtualMachineError("fixture") {};
- assertEquals("fixture", e.getMessage());
- assertNull(e.getCause());
- }
-}
+/* 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 org.apache.harmony.luni.tests.java.lang;
+
+import junit.framework.TestCase;
+
+@SuppressWarnings("serial")
+public class VirtualMachineErrorTest extends TestCase {
+
+ /**
+ * @tests java.lang.VirtualMachineError#VirtualMachineError()
+ */
+ public void test_Constructor() {
+ VirtualMachineError e = new VirtualMachineError() {};
+ assertNull(e.getMessage());
+ assertNull(e.getLocalizedMessage());
+ assertNull(e.getCause());
+ }
+
+ /**
+ * @tests java.lang.VirtualMachineError#VirtualMachineError(java.lang.String)
+ */
+ public void test_ConstructorLjava_lang_String() {
+ VirtualMachineError e = new VirtualMachineError("fixture") {};
+ assertEquals("fixture", e.getMessage());
+ assertNull(e.getCause());
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/VirtualMachineErrorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
|