tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-tapestry/junit/src/org/apache/tapestry/junit MockApplicationSpecification.java MockTypeConverter.java MockEngine.java MockPage.java
Date Tue, 18 Nov 2003 20:30:52 GMT
ehatcher    2003/11/18 12:30:52

  Modified:    junit/src/org/apache/tapestry/junit MockEngine.java
                        MockPage.java
  Added:       junit/src/org/apache/tapestry/junit
                        MockApplicationSpecification.java
                        MockTypeConverter.java
  Log:
  update Mock's to allow for application specification and extensions
  
  Revision  Changes    Path
  1.6       +8 -2      jakarta-tapestry/junit/src/org/apache/tapestry/junit/MockEngine.java
  
  Index: MockEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/MockEngine.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MockEngine.java	29 Jun 2003 18:23:27 -0000	1.5
  +++ MockEngine.java	18 Nov 2003 20:30:52 -0000	1.6
  @@ -94,6 +94,7 @@
   
       private Pool _pool = new Pool();
       private String _servletPath;
  +    private IApplicationSpecification applicationSpecification;
   
       public void forgetPage(String name)
       {
  @@ -140,7 +141,12 @@
   
       public IApplicationSpecification getSpecification()
       {
  -        return null;
  +        return applicationSpecification;
  +    }
  +
  +    public void setSpecification(IApplicationSpecification appSpec)
  +    {
  +        this.applicationSpecification = appSpec;
       }
   
       public ISpecificationSource getSpecificationSource()
  
  
  
  1.11      +2 -2      jakarta-tapestry/junit/src/org/apache/tapestry/junit/MockPage.java
  
  Index: MockPage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/MockPage.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MockPage.java	9 Sep 2003 21:57:26 -0000	1.10
  +++ MockPage.java	18 Nov 2003 20:30:52 -0000	1.11
  @@ -274,7 +274,7 @@
       /**
        *  Gets the string source from the engine, gets the strings
        *  from the string source, and invokes
  -     *  {@link org.apache.tapestry.IComponentStrings#getString(String)}.
  +     *  {@link org.apache.tapestry.IMessages#getMessage(String)}.
        * 
        **/
   
  
  
  
  1.1                  jakarta-tapestry/junit/src/org/apache/tapestry/junit/MockApplicationSpecification.java
  
  Index: MockApplicationSpecification.java
  ===================================================================
  package org.apache.tapestry.junit;
  
  import org.apache.tapestry.spec.IApplicationSpecification;
  import org.apache.tapestry.spec.IExtensionSpecification;
  import org.apache.tapestry.IResourceResolver;
  import org.apache.tapestry.IResourceLocation;
  import org.apache.tapestry.ILocation;
  
  import java.util.List;
  import java.util.Map;
  import java.util.HashMap;
  
  public class MockApplicationSpecification implements IApplicationSpecification {
      private Map extensions = new HashMap();
  
      public String getLibrarySpecificationPath(String id) {
          return null;
      }
  
      public void setLibrarySpecificationPath(String id, String path) {
      }
  
      public List getLibraryIds() {
          return null;
      }
  
      public String getPageSpecificationPath(String name) {
          return null;
      }
  
      public void setPageSpecificationPath(String name, String path) {
      }
  
      public List getPageNames() {
          return null;
      }
  
      public void setComponentSpecificationPath(String type, String path) {
      }
  
      public String getComponentSpecificationPath(String type) {
          return null;
      }
  
      public List getComponentTypes() {
          return null;
      }
  
      public String getServiceClassName(String name) {
          return null;
      }
  
      public List getServiceNames() {
          return null;
      }
  
      public void setServiceClassName(String name, String className) {
      }
  
      public String getDescription() {
          return null;
      }
  
      public void setDescription(String description) {
      }
  
      public Map getExtensionSpecifications() {
          return null;
      }
  
      public void addExtensionSpecification(String name, IExtensionSpecification extension)
{
      }
  
      public List getExtensionNames() {
          return null;
      }
  
      public IExtensionSpecification getExtensionSpecification(String name) {
          return null;
      }
  
      public Object getExtension(String name) {
          return getExtension(name, null);
      }
  
      /**
       * Ignore type constraint for now, just returns item from
       * map from {@link #setExtensions(Map)} the specified name.
       */
      public Object getExtension(String name, Class typeConstraint) {
          return extensions.get(name);
      }
  
      public boolean checkExtension(String name) {
          return extensions.get(name) != null;
      }
  
      public void setExtensions(Map extensions) {
          this.extensions = extensions;
      }
  
      public void instantiateImmediateExtensions() {
      }
  
      public IResourceResolver getResourceResolver() {
          return null;
      }
  
      public void setResourceResolver(IResourceResolver resolver) {
      }
  
      public String getPublicId() {
          return null;
      }
  
      public void setPublicId(String value) {
      }
  
      public IResourceLocation getSpecificationLocation() {
          return null;
      }
  
      public void setSpecificationLocation(IResourceLocation specificationLocation) {
      }
  
      public List getPropertyNames() {
          return null;
      }
  
      public void setProperty(String name, String value) {
      }
  
      public void removeProperty(String name) {
      }
  
      public String getProperty(String name) {
          return null;
      }
  
      public void setLocation(ILocation location) {
      }
  
      public ILocation getLocation() {
          return null;
      }
  
      public String getName() {
          return null;
      }
  
      public void setEngineClassName(String value) {
      }
  
      public String getEngineClassName() {
          return null;
      }
  
      public void setName(String name) {
      }
  }
  
  
  
  1.1                  jakarta-tapestry/junit/src/org/apache/tapestry/junit/MockTypeConverter.java
  
  Index: MockTypeConverter.java
  ===================================================================
  package org.apache.tapestry.junit;
  
  import ognl.DefaultTypeConverter;
  
  import java.util.Map;
  import java.util.Date;
  import java.sql.Timestamp;
  
  public class MockTypeConverter extends DefaultTypeConverter {
      public Object convertValue(Map context, Object value, Class toType) {
          Object result = null;
  
          if ((toType == Timestamp.class) && (value instanceof Date)) {
              return new Timestamp(((Date) value).getTime());
          } else {
              result = super.convertValue(context, value, toType);
          }
          return result;
      }
  }
  
  
  

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


Mime
View raw message