harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r392296 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/lang/ test/java/org/apache/harmony/tests/java/lang/
Date Fri, 07 Apr 2006 14:09:55 GMT
Author: tellison
Date: Fri Apr  7 07:09:53 2006
New Revision: 392296

URL: http://svn.apache.org/viewcvs?rev=392296&view=rev
Log:
Apply patch HARMONY-288 ([classlib][luni] TypeNotPresentException)

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/TypeNotPresentException.java
  (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/TypeNotPresentExceptionTest.java
  (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/TypeNotPresentException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/TypeNotPresentException.java?rev=392296&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/TypeNotPresentException.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/TypeNotPresentException.java
Fri Apr  7 07:09:53 2006
@@ -0,0 +1,56 @@
+/* Copyright 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 java.lang;
+
+/**
+ * <p>
+ * Indicates that a class, interface, enum or annotation type cannot be found.
+ * This exception is an unchecked alternative to
+ * {@link java.lang.ClassNotFoundException}.
+ * </p>
+ * 
+ * @since 1.5
+ * @author Nathan Beyer (Harmony)
+ */
+public class TypeNotPresentException extends RuntimeException {
+    private String typeName;
+
+    /**
+     * <p>
+     * Constructs an instance will a fully qualified type name and an optional
+     * cause.
+     * </p>
+     * 
+     * @param typeName The fully qualified type name.
+     * @param cause The <code>Throwable</code> that caused this exception or
+     *        <code>null</code>.
+     */
+    public TypeNotPresentException(String typeName, Throwable cause) {
+        super("Type " + typeName + " not present", cause);
+        this.typeName = typeName;
+    }
+
+    /**
+     * <p>
+     * The fully qualified type name.
+     * </p>
+     * 
+     * @return A String instance.
+     */
+    public String typeName() {
+        return typeName;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/TypeNotPresentException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java?rev=392296&r1=392295&r2=392296&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java
Fri Apr  7 07:09:53 2006
@@ -39,6 +39,7 @@
 		suite.addTestSuite(IntegerTest.class);
 		suite.addTestSuite(ShortTest.class);
 		suite.addTestSuite(LongTest.class);
+		suite.addTestSuite(TypeNotPresentExceptionTest.class);
 		//$JUnit-END$
 		return suite;
 	}

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/TypeNotPresentExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/TypeNotPresentExceptionTest.java?rev=392296&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/TypeNotPresentExceptionTest.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/TypeNotPresentExceptionTest.java
Fri Apr  7 07:09:53 2006
@@ -0,0 +1,53 @@
+/* Copyright 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.tests.java.lang;
+
+import junit.framework.TestCase;
+
+public class TypeNotPresentExceptionTest extends TestCase {
+
+    /**
+     * @tests java.lang.TypeNotPresentException.TypeNotPresentException(String, Throwable)
+     */
+    public void test_constructorLjava_lang_StringLjava_lang_Throwable() {
+        TypeNotPresentException e = new TypeNotPresentException(null, null);
+        assertNotNull(e);
+        String m = e.getMessage();
+        assertNotNull(m);
+        
+        e = new TypeNotPresentException(getClass().getName(), null);
+        assertNotNull(e);
+        m = e.getMessage();
+        assertNotNull(m);
+        
+        NullPointerException npe = new NullPointerException();
+        e = new TypeNotPresentException(getClass().getName(), npe);
+        assertNotNull(e.getMessage());
+        assertSame(npe, e.getCause());
+    }
+
+    /**
+     * @tests java.lang.TypeNotPresentException.typeName()
+     */
+    public void test_typeName() {
+        TypeNotPresentException e = new TypeNotPresentException(null, null);
+        assertNull(e.typeName());
+        
+        e = new TypeNotPresentException(getClass().getName(), null);
+        assertEquals(getClass().getName(), e.typeName());
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/TypeNotPresentExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message