You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2002/02/25 23:04:25 UTC

cvs commit: jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/expression TestEvaluation.java

rdonkin     02/02/25 14:04:24

  Modified:    betwixt/src/java/org/apache/commons/betwixt/expression
                        Context.java
               betwixt/src/test/org/apache/commons/betwixt TestAll.java
  Removed:     betwixt/src/test/org/apache/commons/betwixt/expression
                        TestEvaluation.java
  Log:
  Removed bits and pieces left over from first ID-IDREF implementation strategy
  
  Revision  Changes    Path
  1.8       +8 -48     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Context.java	19 Feb 2002 06:10:27 -0000	1.7
  +++ Context.java	25 Feb 2002 22:04:24 -0000	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java,v 1.7 2002/02/19 06:10:27 jstrachan Exp $
  - * $Revision: 1.7 $
  - * $Date: 2002/02/19 06:10:27 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java,v 1.8 2002/02/25 22:04:24 rdonkin Exp $
  + * $Revision: 1.8 $
  + * $Date: 2002/02/25 22:04:24 $
    *
    * ====================================================================
    *
  @@ -56,7 +56,7 @@
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - * $Id: Context.java,v 1.7 2002/02/19 06:10:27 jstrachan Exp $
  + * $Id: Context.java,v 1.8 2002/02/25 22:04:24 rdonkin Exp $
    */
   package org.apache.commons.betwixt.expression;
   
  @@ -86,7 +86,7 @@
     * If the child is a parent then that operation fails. </p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.7 $
  +  * @version $Revision: 1.8 $
     */
   public class Context {
   
  @@ -96,9 +96,8 @@
       private Map variables = new HashMap();
       /** Logging uses commons-logging <code>Log</code> named <code>org.apache.commons.betwixt</code> */
       private Log log; 
  -    /** The parent context from this one descends */
  -    private Context parent;
       
  +    /** Construct context with default log */
       public Context() {
           this.log = LogFactory.getLog( getClass() );
       }
  @@ -125,33 +124,12 @@
           this.log = log;
       }
   
  -    /** Child context constructor sets evaluted bean, context variables and log.
  -      *
  -      * @param bean evaluate expressions against this bean 
  -      * @param variables context variables
  -      * @param log log to this logger
  -      * @param parent the parent of this child context
  -      */
  -    protected Context(Object bean, Map variables, Log log, Context parent) {
  -        this.bean = bean;
  -        this.variables = variables;
  -        this.log = log;
  -        this.parent = parent;
  -    }
  -
       /** Returns a new child context with the given bean but the same log and variables. 
        *
        * @param newBean create a child context for this bean
  -     * @throws CyclicReferenceException if the given bean is already in a parent context
        */
  -    public Context newContext(Object newBean) throws CyclicReferenceException {
  -        // first check that we aren't introducing a cycle
  -        if (isAncester(newBean)) {
  -            log.info("Found cyclic reference!");
  -            log.debug(newBean);
  -            throw new CyclicReferenceException();
  -        }
  -        return new Context(newBean, variables, log, this);
  +    public Context newContext(Object newBean) {
  +        return new Context(newBean, variables, log);
       }
       
       /** Returns the current bean.
  @@ -200,23 +178,5 @@
        */
       public void setLog() {
           this.log = log;
  -    }
  -    
  -    
  -    /** 
  -     * <p> Check whether <code>someBean</code> is evaluated by a parent context.
  -     */ 
  -    protected boolean isAncester(Object someBean)
  -    {
  -        // in this case we *want* to use instance equality
  -        if (someBean == bean) {
  -            return true;
  -        }
  -        
  -        if (parent == null) {
  -            return false;
  -        }
  -        
  -        return parent.isAncester(someBean);
       }
   }
  
  
  
  1.7       +5 -7      jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java
  
  Index: TestAll.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestAll.java	19 Feb 2002 06:10:27 -0000	1.6
  +++ TestAll.java	25 Feb 2002 22:04:24 -0000	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java,v 1.6 2002/02/19 06:10:27 jstrachan Exp $
  - * $Revision: 1.6 $
  - * $Date: 2002/02/19 06:10:27 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java,v 1.7 2002/02/25 22:04:24 rdonkin Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/02/25 22:04:24 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: TestAll.java,v 1.6 2002/02/19 06:10:27 jstrachan Exp $
  + * $Id: TestAll.java,v 1.7 2002/02/25 22:04:24 rdonkin Exp $
    */
   package org.apache.commons.betwixt;
   
  @@ -66,12 +66,11 @@
   import junit.framework.TestSuite;
   import junit.textui.TestRunner;
   
  -import org.apache.commons.betwixt.expression.TestEvaluation;
   
   /** Entry point for all JUnit tests.
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.6 $
  +  * @version $Revision: 1.7 $
    */
   public class TestAll extends TestCase {
       
  @@ -83,7 +82,6 @@
           TestSuite suite = new TestSuite();
           suite.addTest(TestBeanWriter.suite());
           suite.addTest(TestXMLIntrospector.suite());
  -        suite.addTest(TestEvaluation.suite());
           suite.addTest(TestXMLBeanInfoDigester.suite());
           suite.addTest(TestRSSRoundTrip.suite());
           return suite;
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>