commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1209990 - /commons/proper/digester/trunk/src/test/java/org/apache/commons/digester3/Digester153TestCase.java
Date Sat, 03 Dec 2011 19:45:03 GMT
Author: simonetripodi
Date: Sat Dec  3 19:45:03 2011
New Revision: 1209990

URL: http://svn.apache.org/viewvc?rev=1209990&view=rev
Log:
restored constructor test that binds constructor rules via binder APIs

Modified:
    commons/proper/digester/trunk/src/test/java/org/apache/commons/digester3/Digester153TestCase.java

Modified: commons/proper/digester/trunk/src/test/java/org/apache/commons/digester3/Digester153TestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/java/org/apache/commons/digester3/Digester153TestCase.java?rev=1209990&r1=1209989&r2=1209990&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/java/org/apache/commons/digester3/Digester153TestCase.java
(original)
+++ commons/proper/digester/trunk/src/test/java/org/apache/commons/digester3/Digester153TestCase.java
Sat Dec  3 19:45:03 2011
@@ -20,17 +20,13 @@ package org.apache.commons.digester3;
  */
 
 import static org.apache.commons.digester3.binder.DigesterLoader.newLoader;
-
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.digester3.annotations.FromAnnotationsRuleModule;
 import org.apache.commons.digester3.binder.AbstractRulesModule;
 import org.apache.commons.digester3.binder.RulesModule;
-import org.apache.commons.digester3.xmlrules.FromXmlRulesModule;
 import org.junit.Test;
-import org.xml.sax.SAXParseException;
 
 /**
  * {@link https://issues.apache.org/jira/browse/DIGESTER-153}
@@ -89,7 +85,6 @@ public final class Digester153TestCase
         assertEquals( Float.valueOf( 5.5f ), Float.valueOf( bean.getFloatProperty() ) );
     }
 
-    /*
     @Test
     public void basicConstructorViaBinder()
         throws Exception
@@ -101,14 +96,15 @@ public final class Digester153TestCase
             protected void configure()
             {
                 forPattern( "toplevel/bean" )
-                    .createObject().ofType( TestBean.class )
-                        .addConstructorArgument( "boolean" ).ofType( boolean.class )
-                        .addConstructorArgument( "double" ).ofType( double.class );
+                    .createObject().ofType( TestBean.class ).usingConstructor( boolean.class,
double.class )
+                    .then()
+                    .callParam().fromAttribute( "boolean" ).ofIndex( 0 )
+                    .then()
+                    .callParam().fromAttribute( "double" ).ofIndex( 1 );
             }
 
         } );
     }
-    */
 
     @Test
     public void basicConstructorViaAnnotations()



Mime
View raw message