You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by an...@apache.org on 2006/08/12 02:12:22 UTC

svn commit: r430927 - in /tapestry/tapestry4/trunk/tapestry-framework/src: java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java test/org/apache/tapestry/resolver/TestComponentSpecificationResolver.java

Author: andyhot
Date: Fri Aug 11 17:12:21 2006
New Revision: 430927

URL: http://svn.apache.org/viewvc?rev=430927&view=rev
Log:
TAPESTRY-618: Better error reporting when an unknown library prefix is used

Modified:
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/resolver/TestComponentSpecificationResolver.java

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java?rev=430927&r1=430926&r2=430927&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java Fri Aug 11 17:12:21 2006
@@ -137,7 +137,15 @@
         reset();
         _type = type;
 
-        INamespace namespace = findNamespaceForId(containerNamespace, libraryId);
+        INamespace namespace;
+        try
+        {
+            namespace = findNamespaceForId(containerNamespace, libraryId);
+        }
+        catch (ApplicationRuntimeException e)
+        {
+            throw new ApplicationRuntimeException(e.getMessage(), location, e);
+        }
 
         setNamespace(namespace);
 

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/resolver/TestComponentSpecificationResolver.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/resolver/TestComponentSpecificationResolver.java?rev=430927&r1=430926&r2=430927&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/resolver/TestComponentSpecificationResolver.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/resolver/TestComponentSpecificationResolver.java Fri Aug 11 17:12:21 2006
@@ -73,6 +73,34 @@
 
         return delegate;
     }
+    
+    public void testNotFoundInAnyNamespace()
+    {
+        IRequestCycle cycle = newCycle();
+        Location l = newLocation();
+        
+        INamespace namespace = newMock(INamespace.class);
+        
+        ApplicationRuntimeException exception = new ApplicationRuntimeException("");
+
+        expect(namespace.getChildNamespace("invalid")).andThrow(exception);
+        
+        replay();
+
+        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
+
+        try
+        {
+            resolver.resolve(cycle, namespace, "invalid:MyComponent", l);
+            unreachable();
+        }
+        catch (ApplicationRuntimeException ex)
+        {
+            assertSame(ex.getCause(), exception);
+        }
+
+        verify();
+    }    
 
     public void testFoundInNamespace()
     {