You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2005/03/27 19:42:23 UTC

cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/context/WEB-INF/myapp MyAppComponent.jwc

hlship      2005/03/27 09:42:23

  Modified:    framework/src/java/org/apache/tapestry/resolver
                        ResolverStrings.properties
                        AbstractSpecificationResolver.java
                        PageSpecificationResolverImpl.java
                        PageSpecificationResolver.java
                        ComponentSpecificationResolverImpl.java
                        ResolverMessages.java
               framework/src/java/org/apache/tapestry/engine
                        IPageSource.java RequestCycle.java Namespace.java
                        NullWriter.java
               framework/src/test/org/apache/tapestry/junit/utils
                        TestDataSqueezer.java
               framework/src/java/org/apache/tapestry IRequestCycle.java
                        INamespace.java
  Added:       framework/src/test/org/apache/tapestry/resolver/context
                        ContextRootComponent.jwc
               framework/src/test/org/apache/tapestry/resolver/context/WEB-INF
                        MyWebInfComponent.jwc
               framework/src/test/org/apache/tapestry/resolver
                        LibraryStandin.library
                        TestComponentSpecificationResolver.java
                        AbstractSpecificationResolverTestCase.java
                        MyComponent.jwc
               framework/src/java/org/apache/tapestry
                        ComponentNotFoundException.java
                        PageNotFoundException.java
               framework/src/test/org/apache/tapestry/resolver/context/WEB-INF/myapp
                        MyAppComponent.jwc
  Log:
  Add unit tests for ComponentSpecificationResolver.
  
  Revision  Changes    Path
  1.1                  jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/context/ContextRootComponent.jwc
  
  Index: ContextRootComponent.jwc
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 
     Copyright 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.
  -->
  
  <!DOCTYPE component-specification PUBLIC
    "-//Apache Software Foundation//Tapestry Specification 3.1//EN" 
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
  	
  <component-specification/>
  
  
  
  1.1                  jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/context/WEB-INF/MyWebInfComponent.jwc
  
  Index: MyWebInfComponent.jwc
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 
     Copyright 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.
  -->
  
  <!DOCTYPE component-specification PUBLIC
    "-//Apache Software Foundation//Tapestry Specification 3.1//EN" 
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
  	
  <component-specification/>
  
  
  
  1.1                  jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/LibraryStandin.library
  
  Index: LibraryStandin.library
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 
     Copyright 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.
  -->
  
  <!DOCTYPE library-specification PUBLIC
    "-//Apache Software Foundation//Tapestry Specification 3.1//EN" 
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
  	
  <library-specification/>
  
  
  
  1.1                  jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/TestComponentSpecificationResolver.java
  
  Index: TestComponentSpecificationResolver.java
  ===================================================================
  // Copyright 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.
  
  package org.apache.tapestry.resolver;
  
  import java.net.URL;
  
  import org.apache.commons.logging.Log;
  import org.apache.hivemind.ApplicationRuntimeException;
  import org.apache.hivemind.Location;
  import org.apache.hivemind.Resource;
  import org.apache.hivemind.util.URLResource;
  import org.apache.tapestry.INamespace;
  import org.apache.tapestry.IRequestCycle;
  import org.apache.tapestry.engine.ISpecificationSource;
  import org.apache.tapestry.spec.IComponentSpecification;
  import org.easymock.MockControl;
  
  /**
   * Tests for {@link org.apache.tapestry.resolver.ComponentSpecificationResolverImpl}.
   * 
   * @author Howard M. Lewis Ship
   * @since 3.1
   */
  public class TestComponentSpecificationResolver extends AbstractSpecificationResolverTestCase
  {
      protected IComponentSpecification newSpecification()
      {
          return (IComponentSpecification) newMock(IComponentSpecification.class);
      }
  
      protected IRequestCycle newCycle()
      {
          return (IRequestCycle) newMock(IRequestCycle.class);
      }
  
      protected Log newLog()
      {
          return (Log) newMock(Log.class);
      }
  
      protected URL newURL(String file)
      {
          return getClass().getResource(file);
      }
  
      protected Resource newResource(URL url)
      {
          MockControl control = newControl(Resource.class);
          Resource resource = (Resource) control.getMock();
  
          resource.getResourceURL();
          control.setReturnValue(url);
  
          return resource;
      }
  
      protected Resource newResource(String path)
      {
          return new URLResource(newURL(path));
      }
  
      protected ISpecificationSource newSource(Resource resource, IComponentSpecification spec)
      {
          MockControl control = newControl(ISpecificationSource.class);
          ISpecificationSource source = (ISpecificationSource) control.getMock();
  
          source.getComponentSpecification(resource);
          control.setReturnValue(spec);
  
          return source;
      }
  
      protected void train(Log log, MockControl control, String message)
      {
          log.isDebugEnabled();
          control.setReturnValue(true);
  
          log.debug(message);
      }
  
      protected ISpecificationSource newSource(INamespace framework)
      {
          MockControl control = newControl(ISpecificationSource.class);
          ISpecificationSource source = (ISpecificationSource) control.getMock();
  
          source.getFrameworkNamespace();
          control.setReturnValue(framework);
  
          return source;
      }
  
      private ISpecificationResolverDelegate newDelegate(IRequestCycle cycle, INamespace namespace,
              IComponentSpecification spec)
      {
          MockControl control = newControl(ISpecificationResolverDelegate.class);
          ISpecificationResolverDelegate delegate = (ISpecificationResolverDelegate) control
                  .getMock();
  
          delegate.findComponentSpecification(cycle, namespace, "DelegateComponent");
          control.setReturnValue(spec);
  
          return delegate;
      }
  
      public void testFoundInNamespace()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl control = newControl(INamespace.class);
          INamespace namespace = (INamespace) control.getMock();
  
          namespace.containsComponentType("MyComponent");
          control.setReturnValue(true);
  
          namespace.getComponentSpecification("MyComponent");
          control.setReturnValue(spec);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
  
          resolver.resolve(cycle, namespace, "MyComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(namespace, resolver.getNamespace());
  
          verifyControls();
      }
  
      public void testFoundInChildNamespace()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          MockControl libraryc = newControl(INamespace.class);
          INamespace library = (INamespace) libraryc.getMock();
  
          namespace.getChildNamespace("lib");
          namespacec.setReturnValue(library);
  
          library.containsComponentType("MyComponent");
          libraryc.setReturnValue(true);
  
          library.getComponentSpecification("MyComponent");
          libraryc.setReturnValue(spec);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
  
          resolver.resolve(cycle, namespace, "lib:MyComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(library, resolver.getNamespace());
  
          verifyControls();
      }
  
      public void testSearchFoundRelative()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl logc = newControl(Log.class);
          Log log = (Log) logc.getMock();
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          Resource namespaceLocation = newResource("LibraryStandin.library");
          Resource specLocation = namespaceLocation.getRelativeResource("MyComponent.jwc");
  
          ISpecificationSource source = newSource(specLocation, spec);
  
          namespace.containsComponentType("MyComponent");
          namespacec.setReturnValue(false);
  
          train(log, logc, ResolverMessages.resolvingComponent("MyComponent", namespace));
  
          namespace.getSpecificationLocation();
          namespacec.setReturnValue(namespaceLocation);
  
          train(log, logc, ResolverMessages.checkingResource(specLocation));
          train(log, logc, ResolverMessages.installingComponent("MyComponent", namespace, spec));
  
          namespace.installComponentSpecification("MyComponent", spec);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
          resolver.setLog(log);
          resolver.setSpecificationSource(source);
  
          resolver.resolve(cycle, namespace, "MyComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(namespace, resolver.getNamespace());
  
          verifyControls();
      }
  
      public void testFoundInFrameworkNamespace()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl logc = newControl(Log.class);
          Log log = (Log) logc.getMock();
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          MockControl frameworkc = newControl(INamespace.class);
          INamespace framework = (INamespace) frameworkc.getMock();
  
          Resource namespaceLocation = newResource("LibraryStandin.library");
  
          namespace.containsComponentType("FrameworkComponent");
          namespacec.setReturnValue(false);
  
          train(log, logc, ResolverMessages.resolvingComponent("FrameworkComponent", namespace));
  
          namespace.getSpecificationLocation();
          namespacec.setReturnValue(namespaceLocation);
  
          train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                  .getRelativeResource("FrameworkComponent.jwc")));
  
          namespace.isApplicationNamespace();
          namespacec.setReturnValue(false);
  
          ISpecificationSource source = newSource(framework);
  
          framework.containsComponentType("FrameworkComponent");
          frameworkc.setReturnValue(true);
  
          framework.getComponentSpecification("FrameworkComponent");
          frameworkc.setReturnValue(spec);
  
          train(log, logc, ResolverMessages
                  .installingComponent("FrameworkComponent", namespace, spec));
          namespace.installComponentSpecification("FrameworkComponent", spec);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
          resolver.setLog(log);
          resolver.setSpecificationSource(source);
  
          resolver.resolve(cycle, namespace, "FrameworkComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(namespace, resolver.getNamespace());
  
          verifyControls();
      }
  
      public void testProvidedByDelegate()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl logc = newControl(Log.class);
          Log log = (Log) logc.getMock();
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          MockControl frameworkc = newControl(INamespace.class);
          INamespace framework = (INamespace) frameworkc.getMock();
  
          ISpecificationResolverDelegate delegate = newDelegate(cycle, namespace, spec);
  
          Resource namespaceLocation = newResource("LibraryStandin.library");
  
          namespace.containsComponentType("DelegateComponent");
          namespacec.setReturnValue(false);
  
          train(log, logc, ResolverMessages.resolvingComponent("DelegateComponent", namespace));
  
          namespace.getSpecificationLocation();
          namespacec.setReturnValue(namespaceLocation);
  
          train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                  .getRelativeResource("DelegateComponent.jwc")));
  
          namespace.isApplicationNamespace();
          namespacec.setReturnValue(false);
  
          ISpecificationSource source = newSource(framework);
  
          framework.containsComponentType("DelegateComponent");
          frameworkc.setReturnValue(false);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
          resolver.setLog(log);
          resolver.setSpecificationSource(source);
          resolver.setDelegate(delegate);
  
          resolver.resolve(cycle, namespace, "DelegateComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(namespace, resolver.getNamespace());
  
          verifyControls();
      }
  
      public void testNotFound()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
  
          MockControl logc = newControl(Log.class);
          Log log = (Log) logc.getMock();
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          MockControl frameworkc = newControl(INamespace.class);
          INamespace framework = (INamespace) frameworkc.getMock();
  
          ISpecificationResolverDelegate delegate = newDelegate(cycle, namespace, null);
  
          Resource namespaceLocation = newResource("LibraryStandin.library");
  
          namespace.containsComponentType("DelegateComponent");
          namespacec.setReturnValue(false);
  
          train(log, logc, ResolverMessages.resolvingComponent("DelegateComponent", namespace));
  
          namespace.getSpecificationLocation();
          namespacec.setReturnValue(namespaceLocation);
  
          train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                  .getRelativeResource("DelegateComponent.jwc")));
  
          namespace.isApplicationNamespace();
          namespacec.setReturnValue(false);
  
          ISpecificationSource source = newSource(framework);
  
          framework.containsComponentType("DelegateComponent");
          frameworkc.setReturnValue(false);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
          resolver.setLog(log);
          resolver.setSpecificationSource(source);
          resolver.setDelegate(delegate);
  
          try
          {
              resolver.resolve(cycle, namespace, "DelegateComponent", l);
              unreachable();
          }
          catch (ApplicationRuntimeException ex)
          {
              assertEquals(
                      "Component 'DelegateComponent' not found in EasyMock for interface org.apache.tapestry.INamespace.",
                      ex.getMessage());
              assertSame(l, ex.getLocation());
          }
  
          verifyControls();
      }
  
      /**
       * Test for checking inside the WEB-INF/app folder (app is the application id, i.e., the servlet
       * name).
       */
  
      public void testFoundInAppFolder()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl logc = newControl(Log.class);
          Log log = (Log) logc.getMock();
  
          Resource contextRoot = newResource("context/");
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          Resource namespaceLocation = newResource("LibraryStandin.library");
          Resource specLocation = contextRoot.getRelativeResource("WEB-INF/myapp/MyAppComponent.jwc");
  
          ISpecificationSource source = newSource(specLocation, spec);
  
          namespace.containsComponentType("MyAppComponent");
          namespacec.setReturnValue(false);
  
          train(log, logc, ResolverMessages.resolvingComponent("MyAppComponent", namespace));
  
          namespace.getSpecificationLocation();
          namespacec.setReturnValue(namespaceLocation);
  
          train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                  .getRelativeResource("MyAppComponent.jwc")));
  
          namespace.isApplicationNamespace();
          namespacec.setReturnValue(true);
  
          train(log, logc, ResolverMessages.checkingResource(specLocation));
          train(log, logc, ResolverMessages.installingComponent("MyAppComponent", namespace, spec));
  
          namespace.installComponentSpecification("MyAppComponent", spec);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
          resolver.setLog(log);
          resolver.setSpecificationSource(source);
          resolver.setContextRoot(contextRoot);
          resolver.setApplicationId("myapp");
          resolver.initializeService();
  
          resolver.resolve(cycle, namespace, "MyAppComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(namespace, resolver.getNamespace());
  
          verifyControls();
      }
  
      public void testFoundInWebInfFolder()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl logc = newControl(Log.class);
          Log log = (Log) logc.getMock();
  
          Resource contextRoot = newResource("context/");
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          Resource namespaceLocation = newResource("LibraryStandin.library");
          Resource specLocation = contextRoot.getRelativeResource("WEB-INF/MyWebInfComponent.jwc");
  
          ISpecificationSource source = newSource(specLocation, spec);
  
          namespace.containsComponentType("MyWebInfComponent");
          namespacec.setReturnValue(false);
  
          train(log, logc, ResolverMessages.resolvingComponent("MyWebInfComponent", namespace));
  
          namespace.getSpecificationLocation();
          namespacec.setReturnValue(namespaceLocation);
  
          train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                  .getRelativeResource("MyWebInfComponent.jwc")));
  
          namespace.isApplicationNamespace();
          namespacec.setReturnValue(true);
  
          train(log, logc, ResolverMessages.checkingResource(contextRoot
                  .getRelativeResource("WEB-INF/myapp/MyWebInfComponent.jwc")));
          train(log, logc, ResolverMessages.checkingResource(specLocation));
          train(log, logc, ResolverMessages.installingComponent("MyWebInfComponent", namespace, spec));
  
          namespace.installComponentSpecification("MyWebInfComponent", spec);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
          resolver.setLog(log);
          resolver.setSpecificationSource(source);
          resolver.setContextRoot(contextRoot);
          resolver.setApplicationId("myapp");
          resolver.initializeService();
  
          resolver.resolve(cycle, namespace, "MyWebInfComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(namespace, resolver.getNamespace());
  
          verifyControls();
      }
  
      public void testFoundInContextRoot()
      {
          IRequestCycle cycle = newCycle();
          Location l = fabricateLocation(13);
          IComponentSpecification spec = newSpecification();
  
          MockControl logc = newControl(Log.class);
          Log log = (Log) logc.getMock();
  
          Resource contextRoot = newResource("context/");
  
          MockControl namespacec = newControl(INamespace.class);
          INamespace namespace = (INamespace) namespacec.getMock();
  
          Resource namespaceLocation = newResource("LibraryStandin.library");
          Resource specLocation = contextRoot.getRelativeResource("ContextRootComponent.jwc");
  
          ISpecificationSource source = newSource(specLocation, spec);
  
          namespace.containsComponentType("ContextRootComponent");
          namespacec.setReturnValue(false);
  
          train(log, logc, ResolverMessages.resolvingComponent("ContextRootComponent", namespace));
  
          namespace.getSpecificationLocation();
          namespacec.setReturnValue(namespaceLocation);
  
          train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                  .getRelativeResource("ContextRootComponent.jwc")));
  
          namespace.isApplicationNamespace();
          namespacec.setReturnValue(true);
  
          train(log, logc, ResolverMessages.checkingResource(contextRoot
                  .getRelativeResource("WEB-INF/myapp/ContextRootComponent.jwc")));
          train(log, logc, ResolverMessages.checkingResource(contextRoot
                  .getRelativeResource("WEB-INF/ContextRootComponent.jwc")));
          train(log, logc, ResolverMessages.checkingResource(specLocation));
          train(log, logc, ResolverMessages.installingComponent(
                  "ContextRootComponent",
                  namespace,
                  spec));
  
          namespace.installComponentSpecification("ContextRootComponent", spec);
  
          replayControls();
  
          ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
          resolver.setLog(log);
          resolver.setSpecificationSource(source);
          resolver.setContextRoot(contextRoot);
          resolver.setApplicationId("myapp");
          resolver.initializeService();
  
          resolver.resolve(cycle, namespace, "ContextRootComponent", l);
  
          assertSame(spec, resolver.getSpecification());
          assertSame(namespace, resolver.getNamespace());
  
          verifyControls();
      }
  }
  
  
  1.1                  jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/AbstractSpecificationResolverTestCase.java
  
  Index: AbstractSpecificationResolverTestCase.java
  ===================================================================
  // Copyright 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.
  
  package org.apache.tapestry.resolver;
  
  import org.apache.hivemind.test.HiveMindTestCase;
  
  /**
   * Base class for testing specification resolvers.
   * 
   * @author Howard M. Lewis Ship
   * @since 3.1
   */
  public class AbstractSpecificationResolverTestCase extends HiveMindTestCase
  {
  
  }
  
  
  1.1                  jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/MyComponent.jwc
  
  Index: MyComponent.jwc
  ===================================================================
  Standin for a component spec found relative to LibraryStandin.library.<!-- 
     Copyright 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.
  -->
  
  
  
  
  1.3       +3 -0      jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/ResolverStrings.properties
  
  Index: ResolverStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/ResolverStrings.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ResolverStrings.properties	6 Jan 2005 02:17:32 -0000	1.2
  +++ ResolverStrings.properties	27 Mar 2005 17:42:23 -0000	1.3
  @@ -14,3 +14,6 @@
   
   no-such-component-type=Component ''{0}'' not found in {1}.
   no-such-page=Page ''{0}'' not found in {1}.
  +resolving-component=Resolving component ''{0}'' in {0}.
  +checking-resource=Checking: {0}
  +installing-component=Installing component type ''{0}'' into {1} as {2}.
  
  
  
  1.8       +1 -3      jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/AbstractSpecificationResolver.java
  
  Index: AbstractSpecificationResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/AbstractSpecificationResolver.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractSpecificationResolver.java	29 Jan 2005 16:45:14 -0000	1.7
  +++ AbstractSpecificationResolver.java	27 Mar 2005 17:42:23 -0000	1.8
  @@ -14,11 +14,9 @@
   
   package org.apache.tapestry.resolver;
   
  -import javax.servlet.ServletContext;
  -
   import org.apache.hivemind.Resource;
  -import org.apache.hivemind.util.ContextResource;
   import org.apache.tapestry.INamespace;
  +import org.apache.tapestry.Tapestry;
   import org.apache.tapestry.engine.ISpecificationSource;
   import org.apache.tapestry.spec.IComponentSpecification;
   
  
  
  
  1.6       +2 -3      jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/PageSpecificationResolverImpl.java
  
  Index: PageSpecificationResolverImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/PageSpecificationResolverImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PageSpecificationResolverImpl.java	8 Feb 2005 16:00:50 -0000	1.5
  +++ PageSpecificationResolverImpl.java	27 Mar 2005 17:42:23 -0000	1.6
  @@ -19,6 +19,7 @@
   import org.apache.hivemind.Resource;
   import org.apache.tapestry.INamespace;
   import org.apache.tapestry.IRequestCycle;
  +import org.apache.tapestry.PageNotFoundException;
   import org.apache.tapestry.Tapestry;
   import org.apache.tapestry.services.ComponentPropertySource;
   import org.apache.tapestry.spec.ComponentSpecification;
  @@ -136,9 +137,7 @@
           searchForPage(cycle);
   
           if (getSpecification() == null)
  -            throw new ApplicationRuntimeException(ResolverMessages.noSuchPage(
  -                    _simpleName,
  -                    namespace));
  +            throw new PageNotFoundException(ResolverMessages.noSuchPage(_simpleName, namespace));
       }
   
       public String getSimplePageName()
  
  
  
  1.5       +8 -8      jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/PageSpecificationResolver.java
  
  Index: PageSpecificationResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/PageSpecificationResolver.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PageSpecificationResolver.java	6 Jan 2005 02:17:31 -0000	1.4
  +++ PageSpecificationResolver.java	27 Mar 2005 17:42:23 -0000	1.5
  @@ -20,31 +20,31 @@
   
   /**
    * Service interface for locating a page specification given its name.
  - *
  + * 
    * @author Howard Lewis Ship
    * @since 3.1
    */
   public interface PageSpecificationResolver
   {
       /**
  -     *  Resolve the name (which may have a library id prefix) to a namespace
  -     *  (see {@link #getNamespace()}) and a specification (see {@link #getSpecification()}).
  -     * 
  -     *  @throws ApplicationRuntimeException if the name cannot be resolved
  +     * Resolve the name (which may have a library id prefix) to a namespace (see
  +     * {@link #getNamespace()}) and a specification (see {@link #getSpecification()}).
        * 
  +     * @throws org.apache.tapestry.PageNotFoundException
  +     *             if the name cannot be resolved to the name of a page
        */
       public void resolve(IRequestCycle cycle, String prefixedName);
  -    
  +
       /**
        * Returns just the name of the page, unqualified by any namespace.
        */
       public String getSimplePageName();
  -    
  +
       /**
        * Returns the namespace containing the page.
        */
       public INamespace getNamespace();
  -    
  +
       /**
        * Returns the specification for the page.
        */
  
  
  
  1.5       +73 -91    jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java
  
  Index: ComponentSpecificationResolverImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/ComponentSpecificationResolverImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ComponentSpecificationResolverImpl.java	29 Jan 2005 16:45:14 -0000	1.4
  +++ ComponentSpecificationResolverImpl.java	27 Mar 2005 17:42:23 -0000	1.5
  @@ -23,45 +23,35 @@
   import org.apache.tapestry.spec.IComponentSpecification;
   
   /**
  - *  Utility class that understands the rules of component types (which
  - *  may optionally have a library prefix) and can resolve 
  - *  the type to a {@link org.apache.tapestry.INamespace} and a 
  - *  {@link org.apache.tapestry.spec.IComponentSpecification}.
  + * Utility class that understands the rules of component types (which may optionally have a library
  + * prefix) and can resolve the type to a {@link org.apache.tapestry.INamespace}and a
  + * {@link org.apache.tapestry.spec.IComponentSpecification}.
  + * <p>
  + * Like {@link org.apache.tapestry.resolver.PageSpecificationResolver}, if the component is not
  + * defined explicitly in the namespace, a search may occur: Performs the tricky work of resolving a
  + * page name to a page specification. The search for pages in the application namespace is the most
  + * complicated, since Tapestry searches for pages that aren't explicitly defined in the application
  + * specification. The search, based on the <i>simple-name </i> of the page, goes as follows:
  + * <ul>
  + * <li>As declared in the application specification
  + * <li><i>type </i>.jwc in the same folder as the application specification
  + * <li><i>type </i> jwc in the WEB-INF/ <i>servlet-name </i> directory of the context root
  + * <li><i>type </i>.jwc in WEB-INF
  + * <li><i>type </i>.jwc in the application root (within the context root)
  + * <li>By searching the framework namespace
  + * </ul>
  + * The search for components in library namespaces is more abbreviated:
  + * <li>As declared in the library specification
  + * <li><i>type </i>.jwc in the same folder as the library specification
  + * <li>By searching the framework namespace
  + * </ul>
    * 
  - *  <p>Like {@link org.apache.tapestry.resolver.PageSpecificationResolver},
  - *  if the component is not defined explicitly in the namespace, a search
  - *  may occur:
  - * 
  - *  Performs the tricky work of resolving a page name to a page specification.
  - *  The search for pages in the application namespace is the most complicated,
  - *  since Tapestry searches for pages that aren't explicitly defined in the
  - *  application specification.  The search, based on the <i>simple-name</i>
  - *  of the page, goes as follows:
  - * 
  - *  <ul>
  - *  <li>As declared in the application specification
  - *  <li><i>type</i>.jwc in the same folder as the application specification
  - *  <li><i>type</i> jwc in the WEB-INF/<i>servlet-name</i> directory of the context root
  - *  <li><i>type</i>.jwc in WEB-INF
  - *  <li><i>type</i>.jwc in the application root (within the context root)
  - *  <li>By searching the framework namespace
  - *  </ul> 
  - * 
  - *  The search for components in library namespaces is more abbreviated:
  - *  <li>As declared in the library specification
  - *  <li><i>type</i>.jwc in the same folder as the library specification
  - *  <li>By searching the framework namespace
  - *  </ul>
  - *
  - * 
  - *  @author Howard Lewis Ship
  - *  @since 3.0
  - *
  + * @author Howard Lewis Ship
  + * @since 3.0
    */
   
  -public class ComponentSpecificationResolverImpl
  -    extends AbstractSpecificationResolver
  -    implements ComponentSpecificationResolver
  +public class ComponentSpecificationResolverImpl extends AbstractSpecificationResolver implements
  +        ComponentSpecificationResolver
   {
       /** Set by container */
       private Log _log;
  @@ -77,29 +67,23 @@
       }
   
       /**
  -     *  Passed the namespace of a container (to resolve the type in)
  -     *  and the type to resolve, performs the processing.  A "bare type"
  -     *  (without a library prefix) may be in the containerNamespace,
  -     *  or the framework namespace
  -     *  (a search occurs in that order).
  -     * 
  -     *  @param cycle current request cycle
  -     *  @param containerNamespace namespace that may contain
  -     *  a library referenced in the type
  -     *  @param type the component specification
  -     *  to  find, either a simple name, or prefixed with a library id
  -     *  (defined for the container namespace)
  -     * 
  -     *  @see #getNamespace()
  -     *  @see #getSpecification()
  +     * Passed the namespace of a container (to resolve the type in) and the type to resolve,
  +     * performs the processing. A "bare type" (without a library prefix) may be in the
  +     * containerNamespace, or the framework namespace (a search occurs in that order).
        * 
  +     * @param cycle
  +     *            current request cycle
  +     * @param containerNamespace
  +     *            namespace that may contain a library referenced in the type
  +     * @param type
  +     *            the component specification to find, either a simple name, or prefixed with a
  +     *            library id (defined for the container namespace)
  +     * @see #getNamespace()
  +     * @see #getSpecification()
        */
   
  -    public void resolve(
  -        IRequestCycle cycle,
  -        INamespace containerNamespace,
  -        String type,
  -        Location location)
  +    public void resolve(IRequestCycle cycle, INamespace containerNamespace, String type,
  +            Location location)
       {
           int colonx = type.indexOf(':');
   
  @@ -115,26 +99,26 @@
       }
   
       /**
  -     *  Like {@link #resolve(org.apache.tapestry.IRequestCycle, org.apache.tapestry.INamespace, java.lang.String, org.apache.tapestry.ILocation)},
  -     *  but used when the type has already been parsed into a library id and a simple type.
  -     * 
  -     *  @param cycle current request cycle
  -     *  @param containerNamespace namespace that may contain
  -     *  a library referenced in the type
  -     *  @param libraryId the library id within the container namespace, or null
  -     *  @param type the component specification
  -     *  to  find as a simple name (without a library prefix)
  -     *  @param location of reference to be resolved
  -     *  @throws ApplicationRuntimeException if the type cannot be resolved
  +     * Like
  +     * {@link #resolve(org.apache.tapestry.IRequestCycle, org.apache.tapestry.INamespace, java.lang.String, org.apache.tapestry.ILocation)},
  +     * but used when the type has already been parsed into a library id and a simple type.
        * 
  +     * @param cycle
  +     *            current request cycle
  +     * @param containerNamespace
  +     *            namespace that may contain a library referenced in the type
  +     * @param libraryId
  +     *            the library id within the container namespace, or null
  +     * @param type
  +     *            the component specification to find as a simple name (without a library prefix)
  +     * @param location
  +     *            of reference to be resolved
  +     * @throws ApplicationRuntimeException
  +     *             if the type cannot be resolved
        */
   
  -    public void resolve(
  -        IRequestCycle cycle,
  -        INamespace containerNamespace,
  -        String libraryId,
  -        String type,
  -        Location location)
  +    public void resolve(IRequestCycle cycle, INamespace containerNamespace, String libraryId,
  +            String type, Location location)
       {
           reset();
           _type = type;
  @@ -159,20 +143,21 @@
           if (getSpecification() == null)
           {
   
  -            throw new ApplicationRuntimeException(
  -                ResolverMessages.noSuchComponentType(type, namespace),
  -                location,
  -                null);
  +            throw new ApplicationRuntimeException(ResolverMessages.noSuchComponentType(
  +                    type,
  +                    namespace), location, null);
   
           }
       }
   
  +    // TODO: This looks like a chain-of-command to me
  +
       private void searchForComponent(IRequestCycle cycle)
       {
           INamespace namespace = getNamespace();
   
           if (_log.isDebugEnabled())
  -            _log.debug("Resolving unknown component '" + _type + "' in " + namespace);
  +            _log.debug(ResolverMessages.resolvingComponent(_type, namespace));
   
           String expectedName = _type + ".jwc";
           Resource namespaceLocation = namespace.getSpecificationLocation();
  @@ -206,15 +191,18 @@
           if (framework.containsComponentType(_type))
           {
               setSpecification(framework.getComponentSpecification(_type));
  +            
  +            install();
  +            
               return;
           }
   
  -        IComponentSpecification specification =
  -            getDelegate().findComponentSpecification(cycle, namespace, _type);
  -
  +        IComponentSpecification specification = getDelegate().findComponentSpecification(
  +                cycle,
  +                namespace,
  +                _type);
  +        
           setSpecification(specification);
  -
  -        // If not found by here, an exception will be thrown.
       }
   
       private boolean found(Resource resource)
  @@ -238,13 +226,7 @@
           IComponentSpecification specification = getSpecification();
   
           if (_log.isDebugEnabled())
  -            _log.debug(
  -                "Installing component type "
  -                    + _type
  -                    + " into "
  -                    + namespace
  -                    + " as "
  -                    + specification);
  +            _log.debug(ResolverMessages.installingComponent(_type, namespace, specification));
   
           namespace.installComponentSpecification(_type, specification);
       }
  @@ -254,4 +236,4 @@
           _log = log;
       }
   
  -}
  +}
  \ No newline at end of file
  
  
  
  1.4       +25 -7     jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/ResolverMessages.java
  
  Index: ResolverMessages.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/ResolverMessages.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ResolverMessages.java	5 Jan 2005 23:17:33 -0000	1.3
  +++ ResolverMessages.java	27 Mar 2005 17:42:23 -0000	1.4
  @@ -14,27 +14,45 @@
   
   package org.apache.tapestry.resolver;
   
  +import org.apache.hivemind.Resource;
   import org.apache.hivemind.impl.MessageFormatter;
   import org.apache.tapestry.INamespace;
  +import org.apache.tapestry.spec.IComponentSpecification;
   
   /**
    * Messages for the resolver package.
  - *
  + * 
    * @author Howard Lewis Ship
    * @since 3.1
    */
   class ResolverMessages
   {
  -    private static final MessageFormatter _formatter =
  -        new MessageFormatter(ResolverMessages.class, "ResolverStrings");
  +    private static final MessageFormatter _formatter = new MessageFormatter(ResolverMessages.class,
  +            "ResolverStrings");
   
  -    public static String noSuchComponentType(String type, INamespace namespace)
  +    static String noSuchComponentType(String type, INamespace namespace)
       {
  -        return _formatter.format("no-such-component-type", type, namespace.getNamespaceId());
  +        return _formatter.format("no-such-component-type", type, namespace);
       }
   
  -    public static String noSuchPage(String name, INamespace namespace)
  +    static String noSuchPage(String name, INamespace namespace)
       {
           return _formatter.format("no-such-page", name, namespace.getNamespaceId());
       }
  -}
  +
  +    static String resolvingComponent(String type, INamespace namespace)
  +    {
  +        return _formatter.format("resolving-component", type, namespace);
  +    }
  +
  +    static String checkingResource(Resource resource)
  +    {
  +        return _formatter.format("checking-resource", resource);
  +    }
  +
  +    static String installingComponent(String type, INamespace namespace,
  +            IComponentSpecification specification)
  +    {
  +        return _formatter.format("installing-component", type, namespace, specification);
  +    }
  +}
  \ No newline at end of file
  
  
  
  1.5       +29 -29    jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/IPageSource.java
  
  Index: IPageSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/IPageSource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IPageSource.java	6 Jan 2005 02:17:12 -0000	1.4
  +++ IPageSource.java	27 Mar 2005 17:42:23 -0000	1.5
  @@ -19,48 +19,48 @@
   import org.apache.tapestry.IRequestCycle;
   
   /**
  - *  Abstracts the process of loading pages from thier specifications as
  - *  well as pooling of pages once loaded.  
  - *
  - *  <p>If the required page is not available, a page source may use an
  - *  instance of {@link IPageLoader} to actually load the
  - *  page (and all of its nested components).
  - *
  - *  @author Howard Lewis Ship
  + * Abstracts the process of loading pages from thier specifications as well as pooling of pages once
  + * loaded.
  + * <p>
  + * If the required page is not available, a page source may use an instance of {@link IPageLoader}
  + * to actually load the page (and all of its nested components).
    * 
  - **/
  + * @author Howard Lewis Ship
  + */
   
   public interface IPageSource
   {
       /**
  -     *  Gets a given page for the engine.  This may involve using a previously
  -     *  loaded page from a pool of available pages, or the page may be loaded as needed.
  +     * Gets a given page for the engine. This may involve using a previously loaded page from a pool
  +     * of available pages, or the page may be loaded as needed.
        * 
  -     *  @param cycle the current request cycle
  -     *  @param pageName the name of the page.  May be qualified with a library id prefix, which
  -     *  may even be nested. Unqualified names are searched for extensively in the application
  -     *  namespace, and then in the framework namespace.
  -     *  @param monitor informed of any page loading activity
  -     *
  -     **/
  +     * @param cycle
  +     *            the current request cycle
  +     * @param pageName
  +     *            the name of the page. May be qualified with a library id prefix, which may even be
  +     *            nested. Unqualified names are searched for extensively in the application
  +     *            namespace, and then in the framework namespace.
  +     * @param monitor
  +     *            informed of any page loading activity
  +     * @throws org.apache.tapestry.PageNotFoundException
  +     *             if pageName can't be resolved to a page specification (from which a page instance
  +     *             can be generated).
  +     * @see org.apache.tapestry.resolver.PageSpecificationResolver#resolve(IRequestCycle, String)
  +     */
   
       public IPage getPage(IRequestCycle cycle, String pageName, IMonitor monitor);
   
       /**
  -     *  Invoked after the engine is done with the page
  -     *  (typically, after the response to the client has been sent).
  -     *  The page is returned to the pool for later reuse.
  -     *
  -     **/
  +     * Invoked after the engine is done with the page (typically, after the response to the client
  +     * has been sent). The page is returned to the pool for later reuse.
  +     */
   
       public void releasePage(IPage page);
   
       /**
  -     * 
  -     *  @since 3.0
  -     * 
  -     **/
  -    
  +     * @since 3.0
  +     */
  +
       public ClassResolver getClassResolver();
  -        
  +
   }
  \ No newline at end of file
  
  
  
  1.15      +20 -7     jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/RequestCycle.java
  
  Index: RequestCycle.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/RequestCycle.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- RequestCycle.java	24 Mar 2005 16:50:16 -0000	1.14
  +++ RequestCycle.java	27 Mar 2005 17:42:23 -0000	1.15
  @@ -230,9 +230,24 @@
   
           if (result == null)
           {
  +            result = loadPage(name);
  +
  +            if (_loadedPages == null)
  +                _loadedPages = new HashMap();
  +
  +            _loadedPages.put(name, result);
  +        }
  +
  +        return result;
  +    }
  +
  +    private IPage loadPage(String name)
  +    {
  +        try
  +        {
               _monitor.pageLoadBegin(name);
   
  -            result = _pageSource.getPage(this, name, _monitor);
  +            IPage result = _pageSource.getPage(this, name, _monitor);
   
               // Get the recorder that will eventually observe and record
               // changes to persistent properties of the page.
  @@ -255,15 +270,13 @@
   
               result.attach(_engine, this);
   
  +            return result;
  +        }
  +        finally
  +        {
               _monitor.pageLoadEnd(name);
  -
  -            if (_loadedPages == null)
  -                _loadedPages = new HashMap();
  -
  -            _loadedPages.put(name, result);
           }
   
  -        return result;
       }
   
       /**
  
  
  
  1.6       +2 -27     jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/Namespace.java
  
  Index: Namespace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/Namespace.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Namespace.java	28 Feb 2005 18:44:52 -0000	1.5
  +++ Namespace.java	27 Mar 2005 17:42:23 -0000	1.6
  @@ -207,16 +207,6 @@
           return result;
       }
   
  -    public String getServiceClassName(String name)
  -    {
  -        return _specification.getServiceClassName(name);
  -    }
  -
  -    public List getServiceNames()
  -    {
  -        return _specification.getServiceNames();
  -    }
  -
       public ILibrarySpecification getSpecification()
       {
           return _specification;
  @@ -315,7 +305,7 @@
           return new Namespace(id, this, ls, _specificationSource, _resolver);
       }
   
  -    public boolean containsPage(String name)
  +    public synchronized boolean containsPage(String name)
       {
           return _pages.containsKey(name) || (_specification.getPageSpecificationPath(name) != null);
       }
  @@ -364,27 +354,12 @@
   
       /** @since 3.0 * */
   
  -    public boolean containsComponentType(String type)
  +    public synchronized boolean containsComponentType(String type)
       {
           return _components.containsKey(type)
                   || (_specification.getComponentSpecificationPath(type) != null);
       }
   
  -    /** @since 3.0 * */
  -
  -    public List getComponentTypes()
  -    {
  -        Set types = new HashSet();
  -
  -        types.addAll(_components.keySet());
  -        types.addAll(_specification.getComponentTypes());
  -
  -        List result = new ArrayList(types);
  -
  -        Collections.sort(result);
  -
  -        return result;
  -    }
   
       /** @since 3.0 * */
   
  
  
  
  1.5       +4 -0      jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/NullWriter.java
  
  Index: NullWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/NullWriter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NullWriter.java	25 Mar 2005 21:18:39 -0000	1.4
  +++ NullWriter.java	27 Mar 2005 17:42:23 -0000	1.5
  @@ -149,4 +149,8 @@
       public void print(char[] data, int offset, int length, boolean raw)
       {
       }
  +
  +    public void print(String value, boolean raw)
  +    {
  +    }
   }
  \ No newline at end of file
  
  
  
  1.5       +7 -2      jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/utils/TestDataSqueezer.java
  
  Index: TestDataSqueezer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/utils/TestDataSqueezer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestDataSqueezer.java	6 Jan 2005 02:17:29 -0000	1.4
  +++ TestDataSqueezer.java	27 Mar 2005 17:42:23 -0000	1.5
  @@ -35,7 +35,7 @@
   import org.apache.tapestry.util.io.ISqueezeAdaptor;
   
   /**
  - * A series of tests for {@link DataSqueezerImpl}and friends.
  + * A series of tests for {@link DataSqueezerImpl}&nbsp;and friends.
    * 
    * @author Howard Lewis Ship
    */
  @@ -364,7 +364,12 @@
   
       public void testClassLoader() throws Exception
       {
  -        File dir = new File(System.getProperty("PROJECT_ROOT", ".") + "/examples/Workbench/classes");
  +        // TODO: Change the build to download some JAR file,
  +        // and change this code to reference a class within that
  +        // JAR file.
  +        
  +        File dir = new File(System.getProperty("PROJECT_ROOT", ".")
  +                + "/examples/Workbench/target/classes");
   
           if (!dir.exists())
           {
  
  
  
  1.13      +3 -0      jakarta-tapestry/framework/src/java/org/apache/tapestry/IRequestCycle.java
  
  Index: IRequestCycle.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/IRequestCycle.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- IRequestCycle.java	24 Mar 2005 16:50:15 -0000	1.12
  +++ IRequestCycle.java	27 Mar 2005 17:42:23 -0000	1.13
  @@ -104,6 +104,9 @@
        * Returns the page with the given name. If the page has been previously loaded in the current
        * request cycle, that page is returned. Otherwise, the engine's page loader is used to load the
        * page.
  +     * 
  +     * @throws PageNotFoundException if the page does not exist.
  +     * @see org.apache.tapestry.engine.IPageSource#getPage(IRequestCycle, String, IMonitor)
        */
   
       public IPage getPage(String name);
  
  
  
  1.5       +3 -33     jakarta-tapestry/framework/src/java/org/apache/tapestry/INamespace.java
  
  Index: INamespace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/INamespace.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- INamespace.java	28 Feb 2005 18:44:51 -0000	1.4
  +++ INamespace.java	27 Mar 2005 17:42:23 -0000	1.5
  @@ -16,12 +16,12 @@
   
   import java.util.List;
   
  +import org.apache.hivemind.ApplicationRuntimeException;
   import org.apache.hivemind.Locatable;
   import org.apache.hivemind.Resource;
   import org.apache.tapestry.engine.IPropertySource;
   import org.apache.tapestry.spec.IComponentSpecification;
   import org.apache.tapestry.spec.ILibrarySpecification;
  -import org.apache.tapestry.util.IPropertyHolder;
   
   /**
    * Organizes different libraries of Tapestry pages, components and services into "frameworks", used
  @@ -31,8 +31,8 @@
    * library may contain a page or component that won't be "known" until the name is resolved (because
    * it involves searching for a particular named file).
    * <p>
  - * A namespace implements {@link org.apache.tapestry.engine.IPropertySource}, exposing the properties
  - * provided in the namespace's specification.
  + * A namespace implements {@link org.apache.tapestry.engine.IPropertySource}, exposing the
  + * properties provided in the namespace's specification.
    * 
    * @see org.apache.tapestry.resolver.PageSpecificationResolver
    * @see org.apache.tapestry.resolver.ComponentSpecificationResolver
  @@ -157,36 +157,6 @@
       public boolean containsComponentType(String type);
   
       /**
  -     * Returns a sorted list of component types. May return an empty list, but won't return null.
  -     * The return list is immutable. Represents just the known component types (additional types may
  -     * be discoverred dynamically).
  -     * <p>
  -     * Is this method even needed?
  -     * 
  -     * @since 3.0
  -     */
  -
  -    public List getComponentTypes();
  -
  -    /**
  -     * Returns the class name of a service provided by the namespace.
  -     * 
  -     * @param name
  -     *            the name of the service.
  -     * @return the complete class name of the service, or null if the namespace does not contain the
  -     *         named service.
  -     */
  -
  -    public String getServiceClassName(String name);
  -
  -    /**
  -     * Returns the names of all services provided by the namespace, as a sorted, immutable list. May
  -     * return the empty list, but won't return null.
  -     */
  -
  -    public List getServiceNames();
  -
  -    /**
        * Returns the {@link org.apache.tapestry.spec.LibrarySpecification}from which this namespace
        * was created.
        */
  
  
  
  1.1                  jakarta-tapestry/framework/src/java/org/apache/tapestry/ComponentNotFoundException.java
  
  Index: ComponentNotFoundException.java
  ===================================================================
  // Copyright 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.
  
  package org.apache.tapestry;
  
  import org.apache.hivemind.ApplicationRuntimeException;
  
  /**
   * Exception thrown when a component type can not be resolved to a particular component
   * specification.
   * 
   * @author Howard M. Lewis Ship
   * @since 3.1
   */
  public class ComponentNotFoundException extends ApplicationRuntimeException
  {
      public ComponentNotFoundException(String message)
      {
          super(message);
      }
  }
  
  
  1.1                  jakarta-tapestry/framework/src/java/org/apache/tapestry/PageNotFoundException.java
  
  Index: PageNotFoundException.java
  ===================================================================
  // Copyright 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.
  
  package org.apache.tapestry;
  
  import org.apache.hivemind.ApplicationRuntimeException;
  
  /**
   * Subclass of {@link org.apache.hivemind.ApplicationRuntimeException}&nbsp;thrown when a requested
   * page does not exist.
   * 
   * @author Howard M. Lewis Ship
   * @since 3.1
   */
  public class PageNotFoundException extends ApplicationRuntimeException
  {
  
      public PageNotFoundException(String message)
      {
          super(message);
      }
  }
  
  
  1.1                  jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/context/WEB-INF/myapp/MyAppComponent.jwc
  
  Index: MyAppComponent.jwc
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 
     Copyright 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.
  -->
  
  <!DOCTYPE component-specification PUBLIC
    "-//Apache Software Foundation//Tapestry Specification 3.1//EN" 
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
  	
  <component-specification/>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org