You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2010/11/16 22:26:24 UTC

svn commit: r1035820 - in /tiles/sandbox/trunk/tiles3/tiles-velocity/src: main/java/org/apache/tiles/velocity/TilesVelocityException.java test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java

Author: apetrelli
Date: Tue Nov 16 21:26:24 2010
New Revision: 1035820

URL: http://svn.apache.org/viewvc?rev=1035820&view=rev
Log:
TILESSB-11
Some tests to complete main Tiles coverage.

Added:
    tiles/sandbox/trunk/tiles3/tiles-velocity/src/test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java   (with props)
Modified:
    tiles/sandbox/trunk/tiles3/tiles-velocity/src/main/java/org/apache/tiles/velocity/TilesVelocityException.java

Modified: tiles/sandbox/trunk/tiles3/tiles-velocity/src/main/java/org/apache/tiles/velocity/TilesVelocityException.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-velocity/src/main/java/org/apache/tiles/velocity/TilesVelocityException.java?rev=1035820&r1=1035819&r2=1035820&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-velocity/src/main/java/org/apache/tiles/velocity/TilesVelocityException.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-velocity/src/main/java/org/apache/tiles/velocity/TilesVelocityException.java Tue Nov 16 21:26:24 2010
@@ -55,7 +55,7 @@ public class TilesVelocityException exte
      * @param e The cause of the exception.
      * @since 2.2.0
      */
-    public TilesVelocityException(Exception e) {
+    public TilesVelocityException(Throwable e) {
         super(e);
     }
 
@@ -66,7 +66,7 @@ public class TilesVelocityException exte
      * @param e The cause of the exception.
      * @since 2.2.0
      */
-    public TilesVelocityException(String message, Exception e) {
+    public TilesVelocityException(String message, Throwable e) {
         super(message, e);
     }
 }

Added: tiles/sandbox/trunk/tiles3/tiles-velocity/src/test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-velocity/src/test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java?rev=1035820&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-velocity/src/test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java (added)
+++ tiles/sandbox/trunk/tiles3/tiles-velocity/src/test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java Tue Nov 16 21:26:24 2010
@@ -0,0 +1,77 @@
+/*
+ * $Id$
+ *
+ * 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.tiles.velocity;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+/**
+ * Tests {@link TilesVelocityException}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TilesVelocityExceptionTest {
+
+    /**
+     * Test method for {@link TilesVelocityException#TilesVelocityException()}.
+     */
+    @Test
+    public void testTilesVelocityException() {
+        TilesVelocityException exception = new TilesVelocityException();
+        assertNull(exception.getMessage());
+        assertNull(exception.getCause());
+    }
+
+    /**
+     * Test method for {@link TilesVelocityException#TilesVelocityException(java.lang.String)}.
+     */
+    @Test
+    public void testTilesVelocityExceptionString() {
+        TilesVelocityException exception = new TilesVelocityException("my message");
+        assertEquals("my message", exception.getMessage());
+        assertNull(exception.getCause());
+    }
+
+    /**
+     * Test method for {@link TilesVelocityException#TilesVelocityException(java.lang.Throwable)}.
+     */
+    @Test
+    public void testTilesVelocityExceptionThrowable() {
+        Throwable cause = new Throwable();
+        TilesVelocityException exception = new TilesVelocityException(cause);
+        assertEquals(cause.toString(), exception.getMessage());
+        assertEquals(cause, exception.getCause());
+    }
+
+    /**
+     * Test method for {@link TilesVelocityException#TilesVelocityException(java.lang.String, java.lang.Throwable)}.
+     */
+    @Test
+    public void testTilesVelocityExceptionStringThrowable() {
+        Throwable cause = new Throwable();
+        TilesVelocityException exception = new TilesVelocityException("my message", cause);
+        assertEquals("my message", exception.getMessage());
+        assertEquals(cause, exception.getCause());
+    }
+
+}

Propchange: tiles/sandbox/trunk/tiles3/tiles-velocity/src/test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/sandbox/trunk/tiles3/tiles-velocity/src/test/java/org/apache/tiles/velocity/TilesVelocityExceptionTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL