commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt TestDescriptors.java
Date Sun, 18 Apr 2004 20:29:07 GMT
rdonkin     2004/04/18 13:29:07

  Modified:    betwixt/src/java/org/apache/commons/betwixt Tag:
                        REFACTORING-BRANCH_2004-01-13
                        ElementDescriptor.java
               betwixt/src/java/org/apache/commons/betwixt/io/read Tag:
                        REFACTORING-BRANCH_2004-01-13 ReadContext.java
               betwixt/src/test/org/apache/commons/betwixt Tag:
                        REFACTORING-BRANCH_2004-01-13 TestDescriptors.java
  Log:
  Removed redundent method
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.14.2.5  +4 -29     jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/ElementDescriptor.java
  
  Index: ElementDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/ElementDescriptor.java,v
  retrieving revision 1.14.2.4
  retrieving revision 1.14.2.5
  diff -u -r1.14.2.4 -r1.14.2.5
  --- ElementDescriptor.java	22 Jan 2004 11:00:03 -0000	1.14.2.4
  +++ ElementDescriptor.java	18 Apr 2004 20:29:07 -0000	1.14.2.5
  @@ -366,32 +366,7 @@
           }
           return elementDescriptor;
       }
  -    
  -    /**
  -      * Gets a child ElementDescriptor matching the given path if one exists.
  -      *
  -      * @param pathIterator an Iterator containing String's, 
  -      * each string being an element name in the path
  -      * @returns the child ElementDescriptor with the given name if one exists, 
  -      * otherwise null
  -      */
  -    public ElementDescriptor getElementDescriptor(Iterator pathIterator) {
  -    
  -        ElementDescriptor elementDescriptor = null;
  -        if (pathIterator.hasNext()) {
  -            String nextName = (String) pathIterator.next();
  -            ElementDescriptor childDescriptor = getElementDescriptor(nextName);
  -            if (childDescriptor != null) {
  -                elementDescriptor = childDescriptor.getElementDescriptor(pathIterator);
  -            }
   
  -        }
  -        else
  -        {
  -            elementDescriptor = this;
  -        }
  -        return elementDescriptor;
  -    }
   
       /** 
        * Sets the descriptors for the child element of the element this describes. 
  
  
  
  No                   revision
  No                   revision
  1.4.2.10  +4 -6      jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ReadContext.java
  
  Index: ReadContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ReadContext.java,v
  retrieving revision 1.4.2.9
  retrieving revision 1.4.2.10
  diff -u -r1.4.2.9 -r1.4.2.10
  --- ReadContext.java	18 Apr 2004 20:20:31 -0000	1.4.2.9
  +++ ReadContext.java	18 Apr 2004 20:29:07 -0000	1.4.2.10
  @@ -62,8 +62,6 @@
   
   import java.beans.IntrospectionException;
   import java.util.HashMap;
  -import java.util.Iterator;
  -import java.util.NoSuchElementException;
   
   import org.apache.commons.betwixt.AttributeDescriptor;
   import org.apache.commons.betwixt.BindingConfiguration;
  
  
  
  No                   revision
  No                   revision
  1.4.2.2   +4 -94     jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/TestDescriptors.java
  
  Index: TestDescriptors.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/TestDescriptors.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- TestDescriptors.java	13 Jan 2004 21:49:46 -0000	1.4.2.1
  +++ TestDescriptors.java	18 Apr 2004 20:29:07 -0000	1.4.2.2
  @@ -159,95 +159,5 @@
           returned = descriptor.getElementDescriptor("Barney");
           assertTrue("Barney is not a Flintstone", returned == null);
       }
  -    
  -    public void testGetElementDescriptorIteratorNoMatch() 
  -    {
  -        ElementDescriptor rootDescriptor = new ElementDescriptor("root");
  -        
  -        ElementDescriptor levelOneDescriptor = new ElementDescriptor("level1:A");
  -        rootDescriptor.addElementDescriptor(levelOneDescriptor);
  -        rootDescriptor.addElementDescriptor(new ElementDescriptor("level1:B"));
  -        
  -        ElementDescriptor levelTwoDescriptor = new ElementDescriptor("level2:A");
  -        levelOneDescriptor.addElementDescriptor(levelTwoDescriptor);
  -        levelOneDescriptor.addElementDescriptor(new ElementDescriptor("level2:B"));   
   
  -        
  -        levelTwoDescriptor.addElementDescriptor(new ElementDescriptor("level3:A"));
  -        levelTwoDescriptor.addElementDescriptor(new ElementDescriptor("level3:B"));   
     
  -        
  -        ArrayList list = new ArrayList();
  -        list.add("level1:A");
  -        list.add("level2:B");
  -        list.add("level3:A");
  -        
  -        ElementDescriptor returned = rootDescriptor.getElementDescriptor(list.iterator());
  -        assertEquals("No match (1)", null, returned);
  -        
  -        list = new ArrayList();
  -        list.add("level1:A");
  -        list.add("level2:C");
  -        
  -        returned = rootDescriptor.getElementDescriptor(list.iterator());
  -        assertEquals("No match (2)", null, returned);
  -        
  -        list = new ArrayList();
  -        list.add("level1:B");
  -        list.add("level2:A");
  -        list.add("level3:A");
  -        
  -        returned = rootDescriptor.getElementDescriptor(list.iterator());
  -        assertEquals("No match (3)", null, returned);
  -    }
  -    
  -    
  -    public void testGetElementDescriptorIteratorMatchOne() 
  -    {
  -        ElementDescriptor rootDescriptor = new ElementDescriptor("root");
  -        
  -        ElementDescriptor levelOneDescriptor = new ElementDescriptor("level1:A");
  -        rootDescriptor.addElementDescriptor(levelOneDescriptor);
  -        rootDescriptor.addElementDescriptor(new ElementDescriptor("level1:B"));
  -        
  -        ElementDescriptor levelTwoDescriptor = new ElementDescriptor("level2:A");
  -        levelOneDescriptor.addElementDescriptor(levelTwoDescriptor);
  -        levelOneDescriptor.addElementDescriptor(new ElementDescriptor("level2:B"));   
   
  -        
  -        levelTwoDescriptor.addElementDescriptor(new ElementDescriptor("level3:A"));
  -        levelTwoDescriptor.addElementDescriptor(new ElementDescriptor("level3:B"));   
     
  -        
  -        ArrayList list = new ArrayList();
  -        list.add("level1:A");
  -        
  -        ElementDescriptor returned = rootDescriptor.getElementDescriptor(list.iterator());
  -        assertTrue("Match found", returned != null);
  -        assertEquals("Returned name", "level1:A", returned.getLocalName());
  -    }
  -    
  -    
  -    
  -    public void testGetElementDescriptorIteratorMatchDeep() 
  -    {
  -        ElementDescriptor rootDescriptor = new ElementDescriptor("root");
  -        
  -        ElementDescriptor levelOneDescriptor = new ElementDescriptor("level1:A");
  -        rootDescriptor.addElementDescriptor(levelOneDescriptor);
  -        rootDescriptor.addElementDescriptor(new ElementDescriptor("level1:B"));
  -        
  -        ElementDescriptor levelTwoDescriptor = new ElementDescriptor("level2:A");
  -        levelOneDescriptor.addElementDescriptor(levelTwoDescriptor);
  -        levelOneDescriptor.addElementDescriptor(new ElementDescriptor("level2:B"));   
   
  -        
  -        levelTwoDescriptor.addElementDescriptor(new ElementDescriptor("level3:A"));
  -        levelTwoDescriptor.addElementDescriptor(new ElementDescriptor("level3:B"));   
     
  -        
  -        ArrayList list = new ArrayList();
  -        list.add("level1:A");
  -        list.add("level2:A");
  -        list.add("level3:B");
  -        
  -        ElementDescriptor returned = rootDescriptor.getElementDescriptor(list.iterator());
  -        assertTrue("Match found", returned != null);
  -        assertEquals("Returned name", "level3:B", returned.getLocalName());
  -    }
   }
   
  
  
  

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


Mime
View raw message