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/dotbetwixt TestLoopType.java
Date Wed, 21 Jan 2004 21:24:25 GMT
rdonkin     2004/01/21 13:24:25

  Modified:    betwixt/src/test/org/apache/commons/betwixt/dotbetwixt Tag:
                        REFACTORING-BRANCH_2004-01-13 TestLoopType.java
  Log:
  Added a load of stuff to be used in unit tests for new addDefault properties then realized
that i was just about to refactor the structure of the stuff i planned to test. These will
be used later (if not yet)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.2   +31 -3     jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/Attic/TestLoopType.java
  
  Index: TestLoopType.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/Attic/TestLoopType.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- TestLoopType.java	20 Jan 2004 23:01:26 -0000	1.1.2.1
  +++ TestLoopType.java	21 Jan 2004 21:24:25 -0000	1.1.2.2
  @@ -67,6 +67,7 @@
   
   import junit.framework.TestCase;
   
  +import org.apache.commons.betwixt.AttributeDescriptor;
   import org.apache.commons.betwixt.ElementDescriptor;
   import org.apache.commons.betwixt.XMLBeanInfo;
   import org.apache.commons.betwixt.XMLIntrospector;
  @@ -118,7 +119,34 @@
           assertEquals("element name matches", "ignore", ignoreDescriptor.getLocalName());
           ElementDescriptor[] childDescriptors = ignoreDescriptor.getElementDescriptors();
           assertEquals("number of child elements", 1, childDescriptors.length);
  +     
  +    }
  +    
  +
  +    public void testIgnoredAdders() throws Exception {
  +        XMLIntrospector introspector = new XMLIntrospector();
  +        XMLBeanInfo beanInfo = introspector.introspect(IgnoreAddersBean.class);
  +        ElementDescriptor ignoreDescriptor = beanInfo.getElementDescriptor();
  +        
  +        assertEquals("element name matches", "ignore", ignoreDescriptor.getLocalName());
  +        ElementDescriptor[] childDescriptors = ignoreDescriptor.getElementDescriptors();
  +        assertEquals("number of child elements", 1, childDescriptors.length);
                       
  +    }
  +    
  +    //TODO: complete these tests after refactoring the element descriptors produced is
complete
  +    public void _testAddDefaults() throws Exception {
  +        XMLIntrospector introspector = new XMLIntrospector();
  +        XMLBeanInfo beanInfo = introspector.introspect(LibraryBean.class);
  +        ElementDescriptor libraryDescriptor = beanInfo.getElementDescriptor();
  +        
  +        AttributeDescriptor[] libraryAttributeDescriptors = libraryDescriptor.getAttributeDescriptors();
  +        assertEquals("Only one attribute", 1, libraryAttributeDescriptors.length);
  +        
  +        ElementDescriptor[] libraryElementDescriptors = libraryDescriptor.getElementDescriptors();
  +        assertEquals("Only one element", 1, libraryElementDescriptors.length);
  +        
  +        
       }
   }
   
  
  
  

---------------------------------------------------------------------
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