tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r749064 - in /tapestry/tapestry5/trunk/tapestry-ioc/src: main/java/org/apache/tapestry5/ioc/internal/services/ test/java/org/apache/tapestry5/ioc/internal/services/
Date Sun, 01 Mar 2009 17:24:41 GMT
Author: hlship
Date: Sun Mar  1 17:24:41 2009
New Revision: 749064

URL: http://svn.apache.org/viewvc?rev=749064&view=rev
Log:
Lazy advice should not exclude methods that throw checked exceptions.

Modified:
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImpl.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImplTest.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyService.java

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImpl.java?rev=749064&r1=749063&r2=749064&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImpl.java
Sun Mar  1 17:24:41 2009
@@ -86,11 +86,6 @@
 
         if (!method.getReturnType().isInterface()) return false;
 
-        for (Class extype : method.getExceptionTypes())
-        {
-            if (!RuntimeException.class.isAssignableFrom(extype)) return false;
-        }
-
         return true;
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImplTest.java?rev=749064&r1=749063&r2=749064&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImplTest.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyAdvisorImplTest.java
Sun Mar  1 17:24:41 2009
@@ -22,6 +22,10 @@
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+/**
+ * This tests {@link org.apache.tapestry5.ioc.internal.services.LazyAdvisorImpl}, but also
tests a lot of {@link
+ * org.apache.tapestry5.ioc.internal.services.ThunkCreatorImpl} (which was refactored out
of LazyAdvisorImpl).
+ */
 public class LazyAdvisorImplTest extends IOCInternalTestCase
 {
     private AspectDecorator aspectDecorator;
@@ -109,25 +113,6 @@
     }
 
     @Test
-    public void checked_exception_prevents_lazy() throws Exception
-    {
-        LazyService service = mockLazyService();
-        Greeter greeter = newMock(Greeter.class);
-
-        expect(service.notLazyCreateGreeter()).andReturn(greeter);
-
-        replay();
-
-        LazyService advised = advise(service);
-
-        Greeter actual = advised.notLazyCreateGreeter();
-
-        assertSame(actual, greeter);
-
-        verify();
-    }
-
-    @Test
     public void notlazy_annotation()
     {
         LazyService service = mockLazyService();

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyService.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyService.java?rev=749064&r1=749063&r2=749064&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyService.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/LazyService.java
Sun Mar  1 17:24:41 2009
@@ -17,8 +17,6 @@
 import org.apache.tapestry5.ioc.Greeter;
 import org.apache.tapestry5.ioc.annotations.NotLazy;
 
-import java.sql.SQLException;
-
 /**
  * Used to test {@link org.apache.tapestry5.ioc.services.LazyAdvisor}, as it has a mix of
lazy and not lazy methods.
  */
@@ -37,6 +35,4 @@
 
     @NotLazy
     Greeter notLazyFromAnnotationGreeter();
-
-    Greeter notLazyCreateGreeter() throws SQLException;
 }



Mime
View raw message