harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r469039 - in /incubator/harmony/enhanced/classlib/trunk/modules/print/src: main/java/common/javax/print/ test/api/java/common/org/ test/api/java/common/org/apache/ test/api/java/common/org/apache/harmony/ test/api/java/common/org/apache/har...
Date Mon, 30 Oct 2006 01:01:43 GMT
Author: ndbeyer
Date: Sun Oct 29 17:01:43 2006
New Revision: 469039

URL: http://svn.apache.org/viewvc?view=rev&rev=469039
Log:
PrintException
* add test case
* modify PrintException(Exception) constructor to match behavior of RI

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/print/
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/print/PrintExceptionTest.java
  (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/PrintException.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/PrintException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/PrintException.java?view=diff&rev=469039&r1=469038&r2=469039
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/PrintException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/PrintException.java
Sun Oct 29 17:01:43 2006
@@ -14,29 +14,25 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Elena V. Sayapina 
- * @version $Revision: 1.4 $ 
- */ 
 
 package javax.print;
 
-
 public class PrintException extends Exception {
+    private static final long serialVersionUID = -5932531546705242471L;
 
     public PrintException() {
         super();
     }
 
-    public PrintException(String string) {
-        super(string);
+    public PrintException(String message) {
+        super(message);
     }
 
-    public PrintException(Exception exception) {
-        super(exception);
+    public PrintException(Exception cause) {
+        super((cause != null ? cause.toString() : null), cause);
     }
 
-    public PrintException(String string, Exception exception) {
-        super(string, exception);
+    public PrintException(String message, Exception cause) {
+        super(message, cause);
     }
 }

Added: incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/print/PrintExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/print/PrintExceptionTest.java?view=auto&rev=469039
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/print/PrintExceptionTest.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/print/PrintExceptionTest.java
Sun Oct 29 17:01:43 2006
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.print.tests.javax.print;
+
+import javax.print.PrintException;
+import junit.framework.TestCase;
+
+public class PrintExceptionTest extends TestCase {
+    /**
+     * Test method for {@link javax.print.PrintException#PrintException()}.
+     */
+    public void testPrintException() {
+        PrintException pe = new PrintException();
+        assertNull(pe.getMessage());
+        assertNull(pe.getCause());
+    }
+
+    /**
+     * Test method for {@link javax.print.PrintException#PrintException(java.lang.String)}.
+     */
+    public void testPrintExceptionString() {
+        PrintException pe = new PrintException("message");
+        assertEquals("message", pe.getMessage());
+        assertNull(pe.getCause());
+    }
+
+    /**
+     * Test method for {@link javax.print.PrintException#PrintException(java.lang.Exception)}.
+     */
+    public void testPrintExceptionException() {
+        NullPointerException npe = new NullPointerException("npe");
+        PrintException pe = new PrintException(npe);
+        assertNotNull(pe.getMessage());
+        assertSame(npe, pe.getCause());
+        
+        pe = new PrintException((Exception)null);
+        assertNull(pe.getMessage());
+        assertNull(pe.getCause());
+    }
+
+    /**
+     * Test method for {@link javax.print.PrintException#PrintException(java.lang.String,
java.lang.Exception)}.
+     */
+    public void testPrintExceptionStringException() {
+        NullPointerException npe = new NullPointerException("npe");
+        PrintException pe = new PrintException("message", npe);
+        assertEquals("message", pe.getMessage());
+        assertSame(npe, pe.getCause());
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/org/apache/harmony/print/tests/javax/print/PrintExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message