continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r441197 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/ test/java/org/apache/maven/continuum/ test/resources/org/apache/maven/continuum/
Date Thu, 07 Sep 2006 20:06:40 GMT
Author: evenisse
Date: Thu Sep  7 13:06:40 2006
New Revision: 441197

URL: http://svn.apache.org/viewvc?view=rev&rev=441197
Log:
Re-add test that check ContinuumException isn't wrapped again.

Added:
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/TestAction.java
  (with props)
Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=441197&r1=441196&r2=441197
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Thu Sep  7 13:06:40 2006
@@ -2243,7 +2243,7 @@
     // Workflow
     // ----------------------------------------------------------------------
 
-    private void executeAction( String actionName, Map context )
+    protected void executeAction( String actionName, Map context )
         throws ContinuumException
     {
         try

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?view=diff&rev=441197&r1=441196&r2=441197
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Thu Sep  7 13:06:40 2006
@@ -239,4 +239,25 @@
 
         assertTrue ( "remove project group failed", projectGroupList.size() == 0 );
     }
+
+    public void testExecuteAction()
+        throws Exception
+    {
+        DefaultContinuum continuum = (DefaultContinuum) lookup( Continuum.ROLE );
+
+        String exceptionName = ContinuumException.class.getName();
+        try
+        {
+            continuum.executeAction( "testAction", new HashMap() );
+        }
+        catch ( ContinuumException e )
+        {
+            //expected, check for twice wrapped exception
+            if ( e.getCause() != null )
+            {
+                assertFalse( exceptionName + " is wrapped in " + exceptionName, e.getCause().getClass()
+                    .equals( ContinuumException.class ) );
+            }
+        }
+    }
 }

Added: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/TestAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/TestAction.java?view=auto&rev=441197
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/TestAction.java
(added)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/TestAction.java
Thu Sep  7 13:06:40 2006
@@ -0,0 +1,35 @@
+package org.apache.maven.continuum;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+
+import org.codehaus.plexus.action.AbstractAction;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class TestAction
+    extends AbstractAction
+{
+    public void execute( Map context )
+        throws Exception
+    {
+        throw new ContinuumException( "TestAction exception." );
+    }
+}

Propchange: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/TestAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/TestAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml?view=diff&rev=441197&r1=441196&r2=441197
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/DefaultContinuumTest.xml
Thu Sep  7 13:06:40 2006
@@ -7,6 +7,11 @@
         <toOverride>nobody@localhost</toOverride>
       </configuration>
     </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>testAction</role-hint>
+      <implementation>org.apache.maven.continuum.TestAction</implementation>
+    </component>
     <!--
      |
      | These point to the flows that we use as part of the runtime.



Mime
View raw message