cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r552766 - in /cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src: main/java/org/apache/cocoon/components/expression/javascript/ main/java/org/apache/cocoon/template/environment/ test/java/org/apache/cocoon/comp...
Date Tue, 03 Jul 2007 09:44:13 GMT
Author: gkossakowski
Date: Tue Jul  3 02:44:12 2007
New Revision: 552766

URL: http://svn.apache.org/viewvc?view=rev&rev=552766
Log:
COCOON-2082:
* Remove CascadingRuntimeExceptions, Java 1.4 supports cascading exceptions natively.
* Use Spring BeanFactory to obtain Spring-managed beans.

Modified:
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/components/expression/ExpressionTestCase.java
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/environment/FOMTestCase.java

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java?view=diff&rev=552766&r1=552765&r2=552766
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/javascript/JavaScriptExpression.java
Tue Jul  3 02:44:12 2007
@@ -20,7 +20,6 @@
 import java.util.Map;
 import java.io.StringReader;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.cocoon.components.expression.AbstractExpression;
 import org.apache.cocoon.components.expression.ExpressionContext;
 import org.apache.cocoon.components.expression.ExpressionException;
@@ -53,7 +52,7 @@
             if (e instanceof RuntimeException) {
                 throw (RuntimeException)e;
             } else{
-                throw new CascadingRuntimeException("Runtime exception.", e);
+                throw new RuntimeException("Runtime exception.", e);
             }
         } finally {
             Context.exit();
@@ -81,7 +80,7 @@
             if (e instanceof RuntimeException) {
                 throw (RuntimeException)e;
             } else {
-                throw new CascadingRuntimeException("Runtime exception", e);
+                throw new RuntimeException("Runtime exception", e);
             }
         } finally {
             Context.exit();

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java?view=diff&rev=552766&r1=552765&r2=552766
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java
Tue Jul  3 02:44:12 2007
@@ -18,7 +18,6 @@
 
 import java.util.Map;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.components.expression.ExpressionContext;
 import org.apache.cocoon.components.flow.FlowHelper;
@@ -55,7 +54,7 @@
                 scope.setParentScope(null);
                 return scope;
             } catch (Exception e) {
-                throw new CascadingRuntimeException("Exception", e);
+                throw new RuntimeException("Exception", e);
             }
         } finally {
             Context.exit();

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/components/expression/ExpressionTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/components/expression/ExpressionTestCase.java?view=diff&rev=552766&r1=552765&r2=552766
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/components/expression/ExpressionTestCase.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/components/expression/ExpressionTestCase.java
Tue Jul  3 02:44:12 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.cocoon.components.expression;
 
-import org.apache.avalon.framework.service.ServiceException;
 import org.apache.cocoon.CocoonTestCase;
 
 public class ExpressionTestCase extends CocoonTestCase {
@@ -46,30 +45,28 @@
         assertEquals("bar", context.getContextBean());
     }
 
-    public void testFactoryJexl() throws ExpressionException, ServiceException {
-        ExpressionFactory factory = (ExpressionFactory)this.lookup(ExpressionFactory.ROLE);
+    public void testFactoryJexl() throws ExpressionException {
+        ExpressionFactory factory = (ExpressionFactory) this.getBeanFactory().getBean(ExpressionFactory.ROLE);
         assertNotNull("Test lookup of expression factory", factory);
 
         Expression expression = factory.getExpression("jexl", "1+2");
         assertNotNull("Test expression compilation", expression);
 
         assertEquals(new Long(3), expression.evaluate(new ExpressionContext()));
-        this.release(factory);
     }
 
-    public void testFactoryJXPath() throws ExpressionException, ServiceException {
-        ExpressionFactory factory = (ExpressionFactory)this.lookup(ExpressionFactory.ROLE);
+    public void testFactoryJXPath() throws ExpressionException {
+        ExpressionFactory factory = (ExpressionFactory) this.getBeanFactory().getBean(ExpressionFactory.ROLE);
         assertNotNull("Test lookup of expression factory", factory);
 
         Expression expression = factory.getExpression("jxpath", "1+2");
         assertNotNull("Test expression compilation", expression);
 
         assertEquals(new Double(3), expression.evaluate(new ExpressionContext()));
-        this.release(factory);
     }
 
-    public void testFactoryPluggable() throws ExpressionException, ServiceException {
-        ExpressionFactory factory = (ExpressionFactory)this.lookup(ExpressionFactory.ROLE);
+    public void testFactoryPluggable() throws ExpressionException {
+        ExpressionFactory factory = (ExpressionFactory) this.getBeanFactory().getBean(ExpressionFactory.ROLE);
         assertNotNull("Test lookup of expression factory", factory);
 
         Expression expression = factory.getExpression("1+2");
@@ -83,8 +80,6 @@
         expression = factory.getExpression("jxpath:1+2");
         assertNotNull("Test expression compilation", expression);
         assertEquals(new Double(3), expression.evaluate(new ExpressionContext()));
-
-        this.release(factory);
     }
 }
 

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/environment/FOMTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/environment/FOMTestCase.java?view=diff&rev=552766&r1=552765&r2=552766
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/environment/FOMTestCase.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/test/java/org/apache/cocoon/environment/FOMTestCase.java
Tue Jul  3 02:44:12 2007
@@ -17,7 +17,6 @@
 package org.apache.cocoon.environment;
 
 import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.service.ServiceException;
 import org.apache.cocoon.SitemapComponentTestCase;
 import org.apache.cocoon.components.expression.Expression;
 import org.apache.cocoon.components.expression.ExpressionContext;
@@ -27,8 +26,8 @@
 
 public class FOMTestCase extends SitemapComponentTestCase {
 
-    public void testFOMJexl() throws ExpressionException, ServiceException {
-        ExpressionFactory factory = (ExpressionFactory)this.lookup(ExpressionFactory.ROLE);
+    public void testFOMJexl() throws ExpressionException {
+        ExpressionFactory factory = (ExpressionFactory) this.getBeanFactory().getBean(ExpressionFactory.ROLE);
         Parameters parameters = new Parameters();
         parameters.setParameter("test", "foo");
         ExpressionContext fomContext =
@@ -39,11 +38,10 @@
 
         expression = factory.getExpression("jexl", "cocoon.request.protocol");
         assertEquals("HTTP/1.1", expression.evaluate(fomContext));
-        this.release(factory);
     }
 
-    public void testFOMJXPath() throws ExpressionException, ServiceException {
-        ExpressionFactory factory = (ExpressionFactory)this.lookup(ExpressionFactory.ROLE);
+    public void testFOMJXPath() throws ExpressionException {
+        ExpressionFactory factory = (ExpressionFactory) this.getBeanFactory().getBean(ExpressionFactory.ROLE);
         Parameters parameters = new Parameters();
         parameters.setParameter("test", "foo");
         ExpressionContext fomContext =
@@ -54,7 +52,6 @@
 
         expression = factory.getExpression("jxpath", "$cocoon/request/protocol");
         assertEquals("HTTP/1.1", expression.evaluate(fomContext));
-        this.release(factory);
     }
 }
 



Mime
View raw message