commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1102402 [17/20] - in /commons/sandbox/digester3/trunk/src: main/java/org/apache/commons/digester3/ main/java/org/apache/commons/digester3/annotations/ main/java/org/apache/commons/digester3/annotations/handlers/ main/java/org/apache/common...
Date Thu, 12 May 2011 18:03:33 GMT
Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertiesRuleTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertiesRuleTestCase.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertiesRuleTestCase.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertiesRuleTestCase.java Thu May 12 18:03:26 2011
@@ -16,10 +16,8 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -35,12 +33,13 @@ import org.junit.Before;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
-
 /**
- * <p> Test case for <code>SetPropertiesRule</code>.</p>
+ * <p>
+ * Test case for <code>SetPropertiesRule</code>.
+ * </p>
  */
-public class SetPropertiesRuleTestCase {
-
+public class SetPropertiesRuleTestCase
+{
 
     // ----------------------------------------------------- Instance Variables
 
@@ -67,62 +66,52 @@ public class SetPropertiesRuleTestCase {
      */
     protected Digester digester = null;
 
-
     // --------------------------------------------------- Overall Test Methods
 
-
     /**
      * Set up instance variables required by this test case.
      */
     @Before
-    public void setUp() {
+    public void setUp()
+    {
 
         digester = new Digester();
 
     }
 
-
     /**
      * Tear down instance variables required by this test case.
      */
     @After
-    public void tearDown() {
+    public void tearDown()
+    {
 
         digester = null;
 
     }
 
-
-
     // ------------------------------------------------ Individual Test Methods
 
-
     /**
      * Positive test for SetPropertiesRule.
      */
     @Test
-    public void testPositive() throws Exception {
+    public void testPositive()
+        throws Exception
+    {
 
         // Set up the rules we need
-        digester.addObjectCreate("root",
-                                 "org.apache.commons.digester3.SimpleTestBean");
-        digester.addSetProperties("root");
+        digester.addObjectCreate( "root", "org.apache.commons.digester3.SimpleTestBean" );
+        digester.addSetProperties( "root" );
 
         // Parse the input
-        SimpleTestBean bean = digester.parse(xmlTestReader(TEST_XML_1));
+        SimpleTestBean bean = digester.parse( xmlTestReader( TEST_XML_1 ) );
 
         // Check that the properties were set correctly
-        assertEquals("alpha property set",
-                     "ALPHA VALUE",
-                     bean.getAlpha());
-        assertEquals("beta property set",
-                     "BETA VALUE",
-                     bean.getBeta());
-        assertNull("gamma property not set",
-                   bean.getGamma());
-        assertEquals("delta property set",
-                     "DELTA VALUE",
-                     bean.getDeltaValue());
+        assertEquals( "alpha property set", "ALPHA VALUE", bean.getAlpha() );
+        assertEquals( "beta property set", "BETA VALUE", bean.getBeta() );
+        assertNull( "gamma property not set", bean.getGamma() );
+        assertEquals( "delta property set", "DELTA VALUE", bean.getDeltaValue() );
 
     }
 
@@ -130,27 +119,22 @@ public class SetPropertiesRuleTestCase {
      * Positive test for SetPropertyRule ignoring missing properties.
      */
     @Test
-    public void testIgnoreMissing() throws Exception {
+    public void testIgnoreMissing()
+        throws Exception
+    {
 
         // Set up the rules we need
-        digester.addObjectCreate("root",
-                                 "org.apache.commons.digester3.SimpleTestBean");
-        digester.addSetProperties("root");
+        digester.addObjectCreate( "root", "org.apache.commons.digester3.SimpleTestBean" );
+        digester.addSetProperties( "root" );
 
         // Parse the input
-        SimpleTestBean bean = digester.parse(xmlTestReader(TEST_XML_2));
+        SimpleTestBean bean = digester.parse( xmlTestReader( TEST_XML_2 ) );
 
         // Check that the properties were set correctly
-        assertNull("alpha property not set",
-                     bean.getAlpha());
-        assertEquals("beta property set",
-                     "BETA VALUE",
-                     bean.getBeta());
-        assertNull("gamma property not set",
-                   bean.getGamma());
-        assertEquals("delta property set",
-                     "DELTA VALUE",
-                     bean.getDeltaValue());
+        assertNull( "alpha property not set", bean.getAlpha() );
+        assertEquals( "beta property set", "BETA VALUE", bean.getBeta() );
+        assertNull( "gamma property not set", bean.getGamma() );
+        assertEquals( "delta property set", "DELTA VALUE", bean.getDeltaValue() );
 
     }
 
@@ -158,37 +142,51 @@ public class SetPropertiesRuleTestCase {
      * Negative test for SetPropertyRule ignoring missing properties.
      */
     @Test
-    public void testNegativeNotIgnoreMissing() throws Exception {
+    public void testNegativeNotIgnoreMissing()
+        throws Exception
+    {
 
         // Set up the rules we need
-        digester.addObjectCreate("root",
-                                 "org.apache.commons.digester3.SimpleTestBean");
+        digester.addObjectCreate( "root", "org.apache.commons.digester3.SimpleTestBean" );
         SetPropertiesRule rule = new SetPropertiesRule();
-        rule.setIgnoreMissingProperty(false);
-        digester.addRule("root", rule);
+        rule.setIgnoreMissingProperty( false );
+        digester.addRule( "root", rule );
 
-        try {
+        try
+        {
             // Parse the input
-            SimpleTestBean bean = digester.parse(xmlTestReader(TEST_XML_2));
-            fail("Should have thrown NoSuchMethodException");
-            assertNotNull(bean); // just to prevent compiler warning on unused var
-        } catch (Exception e) {
-            if (e instanceof NoSuchMethodException) {
+            SimpleTestBean bean = digester.parse( xmlTestReader( TEST_XML_2 ) );
+            fail( "Should have thrown NoSuchMethodException" );
+            assertNotNull( bean ); // just to prevent compiler warning on unused var
+        }
+        catch ( Exception e )
+        {
+            if ( e instanceof NoSuchMethodException )
+            {
                 // Expected;
-            } else if (e instanceof SAXException) {
-                Exception ee = ((SAXException) e).getException();
-                if (ee != null) {
-                    if (ee instanceof NoSuchMethodException) {
+            }
+            else if ( e instanceof SAXException )
+            {
+                Exception ee = ( (SAXException) e ).getException();
+                if ( ee != null )
+                {
+                    if ( ee instanceof NoSuchMethodException )
+                    {
                         // Expected result
-                    } else {
-                        fail("Should have thrown SE->NoSuchMethodException, threw " + ee);
                     }
-                } else {
-                    fail("Should have thrown NoSuchMethodException, threw " +
-                         e.getClass().getName());
+                    else
+                    {
+                        fail( "Should have thrown SE->NoSuchMethodException, threw " + ee );
+                    }
                 }
-            } else {
-                fail("Should have thrown NoSuchMethodException, threw " + e);
+                else
+                {
+                    fail( "Should have thrown NoSuchMethodException, threw " + e.getClass().getName() );
+                }
+            }
+            else
+            {
+                fail( "Should have thrown NoSuchMethodException, threw " + e );
             }
         }
     }
@@ -197,40 +195,32 @@ public class SetPropertiesRuleTestCase {
      * Negative test for SetPropertyRule ignoring missing properties.
      */
     @Test
-    public void testPositiveNotIgnoreMissingWithIgnoreAttributes() throws Exception {
+    public void testPositiveNotIgnoreMissingWithIgnoreAttributes()
+        throws Exception
+    {
 
         // Set up the rules we need
-        digester.addObjectCreate("root",
-                                 "org.apache.commons.digester3.SimpleTestBean");
-        SetPropertiesRule rule = new SetPropertiesRule(new String[] {"ignore"}, new String[] {});
-        rule.setIgnoreMissingProperty(false);
-        digester.addRule("root", rule);
+        digester.addObjectCreate( "root", "org.apache.commons.digester3.SimpleTestBean" );
+        SetPropertiesRule rule = new SetPropertiesRule( new String[] { "ignore" }, new String[] {} );
+        rule.setIgnoreMissingProperty( false );
+        digester.addRule( "root", rule );
 
         // Parse the input
-        SimpleTestBean bean = digester.parse(xmlTestReader(TEST_XML_3));
-        
+        SimpleTestBean bean = digester.parse( xmlTestReader( TEST_XML_3 ) );
+
         // Check that the properties were set correctly
-        assertEquals("alpha property set",
-                     "ALPHA VALUE",
-                     bean.getAlpha());
-        assertEquals("beta property set",
-                     "BETA VALUE",
-                     bean.getBeta());
-        assertNull("gamma property not set",
-                   bean.getGamma());
-        assertEquals("delta property set",
-                     "DELTA VALUE",
-                     bean.getDeltaValue());
+        assertEquals( "alpha property set", "ALPHA VALUE", bean.getAlpha() );
+        assertEquals( "beta property set", "BETA VALUE", bean.getBeta() );
+        assertNull( "gamma property not set", bean.getGamma() );
+        assertEquals( "delta property set", "DELTA VALUE", bean.getDeltaValue() );
     }
 
-
     /**
      * Get input stream from specified String containing XML data.
      */
-    private Reader xmlTestReader(String xml) {
-        return new StringReader(xml);
+    private Reader xmlTestReader( String xml )
+    {
+        return new StringReader( xml );
     }
 
 }
-
-

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertyRuleTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertyRuleTestCase.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertyRuleTestCase.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SetPropertyRuleTestCase.java Thu May 12 18:03:26 2011
@@ -16,10 +16,8 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -35,170 +33,170 @@ import org.junit.Before;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
-
 /**
- * <p> Test case for <code>SetPropertyRule</code>.</p>
+ * <p>
+ * Test case for <code>SetPropertyRule</code>.
+ * </p>
  */
-public class SetPropertyRuleTestCase {
-
+public class SetPropertyRuleTestCase
+{
 
     // ----------------------------------------------------- Instance Variables
 
     /**
      * Simple test xml document used in the tests.
      */
-    protected final static String TEST_XML_1 =
-        "<?xml version='1.0'?><root>" +
-        "<set name='alpha' value='ALPHA VALUE'/>" +
-        "<set name='beta' value='BETA VALUE'/>" +
-        "<set name='delta' value='DELTA VALUE'/>" +
-        "</root>";
+    protected final static String TEST_XML_1 = "<?xml version='1.0'?><root>"
+        + "<set name='alpha' value='ALPHA VALUE'/>" + "<set name='beta' value='BETA VALUE'/>"
+        + "<set name='delta' value='DELTA VALUE'/>" + "</root>";
 
     /**
      * Simple test xml document used in the tests.
      */
-    protected final static String TEST_XML_2 =
-        "<?xml version='1.0'?><root>" +
-        "<set name='unknown' value='UNKNOWN VALUE'/>" +
-        "</root>";
-
+    protected final static String TEST_XML_2 = "<?xml version='1.0'?><root>"
+        + "<set name='unknown' value='UNKNOWN VALUE'/>" + "</root>";
 
     /**
      * The digester instance we will be processing.
      */
     protected Digester digester = null;
 
-
     // --------------------------------------------------- Overall Test Methods
 
-
     /**
      * Set up instance variables required by this test case.
      */
     @Before
-    public void setUp() {
+    public void setUp()
+    {
 
         digester = new Digester();
 
     }
 
-
     /**
      * Tear down instance variables required by this test case.
      */
     @After
-    public void tearDown() {
+    public void tearDown()
+    {
 
         digester = null;
 
     }
 
-
-
     // ------------------------------------------------ Individual Test Methods
 
-
     /**
      * Positive test for SetPropertyRule.
      */
     @Test
-    public void testPositive() throws Exception {
+    public void testPositive()
+        throws Exception
+    {
 
         // Set up the rules we need
-        digester.addObjectCreate("root",
-                                 "org.apache.commons.digester3.SimpleTestBean");
-        digester.addSetProperty("root/set", "name", "value");
+        digester.addObjectCreate( "root", "org.apache.commons.digester3.SimpleTestBean" );
+        digester.addSetProperty( "root/set", "name", "value" );
 
         // Parse the input
-        SimpleTestBean bean = digester.parse(xmlTestReader(TEST_XML_1));
+        SimpleTestBean bean = digester.parse( xmlTestReader( TEST_XML_1 ) );
 
         // Check that the properties were set correctly
-        assertEquals("alpha property set",
-                     "ALPHA VALUE",
-                     bean.getAlpha());
-        assertEquals("beta property set",
-                     "BETA VALUE",
-                     bean.getBeta());
-        assertNull("gamma property not set",
-                   bean.getGamma());
-        assertEquals("delta property set",
-                     "DELTA VALUE",
-                     bean.getDeltaValue());
+        assertEquals( "alpha property set", "ALPHA VALUE", bean.getAlpha() );
+        assertEquals( "beta property set", "BETA VALUE", bean.getBeta() );
+        assertNull( "gamma property not set", bean.getGamma() );
+        assertEquals( "delta property set", "DELTA VALUE", bean.getDeltaValue() );
 
     }
 
-
     /**
      * Negative test for SetPropertyRule.
      */
     @Test
-    public void testNegative() {
+    public void testNegative()
+    {
 
         // Set up the rules we need
-        digester.addObjectCreate("root",
-                                 "org.apache.commons.digester3.SimpleTestBean");
-        digester.addSetProperty("root/set", "name", "value");
+        digester.addObjectCreate( "root", "org.apache.commons.digester3.SimpleTestBean" );
+        digester.addSetProperty( "root/set", "name", "value" );
 
         // Parse the input (should fail)
-        try {
-            SimpleTestBean bean = digester.parse(xmlTestReader(TEST_XML_2));
-            fail("Should have thrown NoSuchMethodException");
-            assertNotNull(bean); // just to prevent compiler warning on unused var
-        } catch (Exception e) {
-            if (e instanceof NoSuchMethodException) {
+        try
+        {
+            SimpleTestBean bean = digester.parse( xmlTestReader( TEST_XML_2 ) );
+            fail( "Should have thrown NoSuchMethodException" );
+            assertNotNull( bean ); // just to prevent compiler warning on unused var
+        }
+        catch ( Exception e )
+        {
+            if ( e instanceof NoSuchMethodException )
+            {
                 // Expected result
-            } else if (e instanceof InvocationTargetException) {
-                Throwable t =
-                    ((InvocationTargetException) e).getTargetException();
-                if (t instanceof NoSuchMethodException) {
+            }
+            else if ( e instanceof InvocationTargetException )
+            {
+                Throwable t = ( (InvocationTargetException) e ).getTargetException();
+                if ( t instanceof NoSuchMethodException )
+                {
                     // Expected result
-                } else {
-                    fail("Should have thrown ITE->NoSuchMethodException, threw " + t);
                 }
-            } else if (e instanceof SAXException) {
-                Exception ee = ((SAXException) e).getException();
-                if (ee != null) {
-                    if (ee instanceof NoSuchMethodException) {
+                else
+                {
+                    fail( "Should have thrown ITE->NoSuchMethodException, threw " + t );
+                }
+            }
+            else if ( e instanceof SAXException )
+            {
+                Exception ee = ( (SAXException) e ).getException();
+                if ( ee != null )
+                {
+                    if ( ee instanceof NoSuchMethodException )
+                    {
                         // Expected result
-                    } else {
-                        fail("Should have thrown SE->NoSuchMethodException, threw " + ee);
                     }
-                } else {
-                    fail("Should have thrown NoSuchMethodException, threw " +
-                         e.getClass().getName());
+                    else
+                    {
+                        fail( "Should have thrown SE->NoSuchMethodException, threw " + ee );
+                    }
+                }
+                else
+                {
+                    fail( "Should have thrown NoSuchMethodException, threw " + e.getClass().getName() );
                 }
-            } else {
-                fail("Should have thrown NoSuchMethodException, threw " + e);
+            }
+            else
+            {
+                fail( "Should have thrown NoSuchMethodException, threw " + e );
             }
         }
 
     }
 
-
     /**
      * Get input stream from specified String containing XML data.
      */
-    private Reader xmlTestReader(String xml) {
-        return new StringReader(xml);
+    private Reader xmlTestReader( String xml )
+    {
+        return new StringReader( xml );
     }
 
     /**
-     * Test SetPropertyRule when matched XML element has no attributes.
-     * See: DIGESTER-114
+     * Test SetPropertyRule when matched XML element has no attributes. See: DIGESTER-114
      */
     @Test
-    public void testElementWithNoAttributes() throws Exception {
+    public void testElementWithNoAttributes()
+        throws Exception
+    {
         String TEST_XML_3 = "<?xml version='1.0'?><root><set/></root>";
 
         // Set up the rules we need
-        digester.addObjectCreate("root", "org.apache.commons.digester3.SimpleTestBean");
-        digester.addSetProperty("root/set", "name", "value");
+        digester.addObjectCreate( "root", "org.apache.commons.digester3.SimpleTestBean" );
+        digester.addSetProperty( "root/set", "name", "value" );
 
         // Parse the input - should not throw an exception
-        @SuppressWarnings("unused")
-        SimpleTestBean bean = digester.parse(xmlTestReader(TEST_XML_3));
-    } 
+        @SuppressWarnings( "unused" )
+        SimpleTestBean bean = digester.parse( xmlTestReader( TEST_XML_3 ) );
+    }
 
 }
-
-

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/SimpleTestBean.java Thu May 12 18:03:26 2011
@@ -16,14 +16,14 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
-
 /**
- * <p> As it's name suggests just a simple bean used for testing.
+ * <p>
+ * As it's name suggests just a simple bean used for testing.
  */
-public class SimpleTestBean {
+public class SimpleTestBean
+{
 
     private String alpha;
 
@@ -33,54 +33,64 @@ public class SimpleTestBean {
 
     private String delta;
 
-    public String getAlpha() {
+    public String getAlpha()
+    {
         return alpha;
     }
 
-    public void setAlpha(String alpha) {
+    public void setAlpha( String alpha )
+    {
         this.alpha = alpha;
     }
 
-    public String getBeta() {
+    public String getBeta()
+    {
         return beta;
     }
 
-    public void setBeta(String beta) {
+    public void setBeta( String beta )
+    {
         this.beta = beta;
     }
 
-    public String getGamma() {
+    public String getGamma()
+    {
         return gamma;
     }
 
-    public void setGamma(String gamma) {
+    public void setGamma( String gamma )
+    {
         this.gamma = gamma;
     }
 
-    public String getDeltaValue() {      // Retrieves "write only" value
+    public String getDeltaValue()
+    { // Retrieves "write only" value
         return delta;
     }
 
-    public void setDelta(String delta) { // "delta" is a write-only property
+    public void setDelta( String delta )
+    { // "delta" is a write-only property
         this.delta = delta;
     }
-    
-    public void setAlphaBeta(String alpha, String beta) {
-        setAlpha(alpha);
-        setBeta(beta);
+
+    public void setAlphaBeta( String alpha, String beta )
+    {
+        setAlpha( alpha );
+        setBeta( beta );
     }
 
     @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder("[SimpleTestBean]");
-        sb.append(" alpha=");
-        sb.append(alpha);
-        sb.append(" beta=");
-        sb.append(beta);
-        sb.append(" gamma=");
-        sb.append(gamma);
-        sb.append(" delta=");
-        sb.append(delta);
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder( "[SimpleTestBean]" );
+        sb.append( " alpha=" );
+        sb.append( alpha );
+        sb.append( " beta=" );
+        sb.append( beta );
+        sb.append( " gamma=" );
+        sb.append( gamma );
+        sb.append( " delta=" );
+        sb.append( delta );
 
         return sb.toString();
     }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestBean.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestBean.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestBean.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestBean.java Thu May 12 18:03:26 2011
@@ -16,110 +16,116 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
-
 /**
  * General purpose test bean for Digester tests.
- *
+ * 
  * @author Craig R. McClanahan
  * @version $Revision$ $Date$
  */
 
-public class TestBean {
-
+public class TestBean
+{
 
     // ------------------------------------------------------------- Properties
 
-
     /**
      * A boolean property whose initial value is true.
      */
     private boolean booleanProperty = true;
 
-    public boolean getBooleanProperty() {
-        return (booleanProperty);
+    public boolean getBooleanProperty()
+    {
+        return ( booleanProperty );
     }
 
-    public void setBooleanProperty(boolean booleanProperty) {
+    public void setBooleanProperty( boolean booleanProperty )
+    {
         this.booleanProperty = booleanProperty;
     }
 
-
     /**
      * A double property.
      */
     private double doubleProperty = 321.0;
 
-    public double getDoubleProperty() {
-        return (this.doubleProperty);
+    public double getDoubleProperty()
+    {
+        return ( this.doubleProperty );
     }
 
-    public void setDoubleProperty(double doubleProperty) {
+    public void setDoubleProperty( double doubleProperty )
+    {
         this.doubleProperty = doubleProperty;
     }
 
-
     /**
      * A boolean property whose initial value is false
      */
     private boolean falseProperty = false;
 
-    public boolean getFalseProperty() {
-        return (falseProperty);
+    public boolean getFalseProperty()
+    {
+        return ( falseProperty );
     }
 
-    public void setFalseProperty(boolean falseProperty) {
+    public void setFalseProperty( boolean falseProperty )
+    {
         this.falseProperty = falseProperty;
     }
 
-
     /**
      * A float property.
      */
     private float floatProperty = (float) 123.0;
 
-    public float getFloatProperty() {
-        return (this.floatProperty);
+    public float getFloatProperty()
+    {
+        return ( this.floatProperty );
     }
 
-    public void setFloatProperty(float floatProperty) {
+    public void setFloatProperty( float floatProperty )
+    {
         this.floatProperty = floatProperty;
     }
 
-
     /**
      * Integer arrays that are accessed as an array as well as indexed.
      */
     private int intArray[] = { 0, 10, 20, 30, 40 };
 
-    public int[] getIntArray() {
-        return (this.intArray);
+    public int[] getIntArray()
+    {
+        return ( this.intArray );
     }
 
-    public void setIntArray(int intArray[]) {
+    public void setIntArray( int intArray[] )
+    {
         this.intArray = intArray;
     }
 
     private int intIndexed[] = { 0, 10, 20, 30, 40 };
 
-    public int getIntIndexed(int index) {
-        return (intIndexed[index]);
+    public int getIntIndexed( int index )
+    {
+        return ( intIndexed[index] );
     }
 
-    public void setIntIndexed(int index, int value) {
+    public void setIntIndexed( int index, int value )
+    {
         intIndexed[index] = value;
     }
 
-
     private int intMultibox[] = new int[0];
 
-    public int[] getIntMultibox() {
-        return (this.intMultibox);
+    public int[] getIntMultibox()
+    {
+        return ( this.intMultibox );
     }
 
-    public void setIntMultibox(int intMultibox[]) {
+    public void setIntMultibox( int intMultibox[] )
+    {
         this.intMultibox = intMultibox;
     }
 
@@ -128,134 +134,142 @@ public class TestBean {
      */
     private int intProperty = 123;
 
-    public int getIntProperty() {
-        return (this.intProperty);
+    public int getIntProperty()
+    {
+        return ( this.intProperty );
     }
 
-    public void setIntProperty(int intProperty) {
+    public void setIntProperty( int intProperty )
+    {
         this.intProperty = intProperty;
     }
 
-
     /**
      * A long property.
      */
     private long longProperty = 321;
 
-    public long getLongProperty() {
-        return (this.longProperty);
+    public long getLongProperty()
+    {
+        return ( this.longProperty );
     }
 
-    public void setLongProperty(long longProperty) {
+    public void setLongProperty( long longProperty )
+    {
         this.longProperty = longProperty;
     }
 
-
     /**
      * A multiple-String SELECT element.
      */
-    private String[] multipleSelect = { "Multiple 3", "Multiple 5",
-        "Multiple 7" };
+    private String[] multipleSelect = { "Multiple 3", "Multiple 5", "Multiple 7" };
 
-    public String[] getMultipleSelect() {
-        return (this.multipleSelect);
+    public String[] getMultipleSelect()
+    {
+        return ( this.multipleSelect );
     }
 
-    public void setMultipleSelect(String multipleSelect[]) {
+    public void setMultipleSelect( String multipleSelect[] )
+    {
         this.multipleSelect = multipleSelect;
     }
 
-
     /**
      * A nested reference to another test bean (populated as needed).
      */
     private TestBean nested = null;
 
-    public TestBean getNested() {
-        if (nested == null)
+    public TestBean getNested()
+    {
+        if ( nested == null )
             nested = new TestBean();
-        return (nested);
+        return ( nested );
     }
 
-
     /**
      * A String property with an initial value of null.
      */
     private String nullProperty = null;
 
-    public String getNullProperty() {
-        return (this.nullProperty);
+    public String getNullProperty()
+    {
+        return ( this.nullProperty );
     }
 
-    public void setNullProperty(String nullProperty) {
+    public void setNullProperty( String nullProperty )
+    {
         this.nullProperty = nullProperty;
     }
 
-
     /**
      * A short property.
      */
     private short shortProperty = (short) 987;
 
-    public short getShortProperty() {
-        return (this.shortProperty);
+    public short getShortProperty()
+    {
+        return ( this.shortProperty );
     }
 
-    public void setShortProperty(short shortProperty) {
+    public void setShortProperty( short shortProperty )
+    {
         this.shortProperty = shortProperty;
     }
 
-
     /**
      * A single-String value for a SELECT element.
      */
     private String singleSelect = "Single 5";
 
-    public String getSingleSelect() {
-        return (this.singleSelect);
+    public String getSingleSelect()
+    {
+        return ( this.singleSelect );
     }
 
-    public void setSingleSelect(String singleSelect) {
+    public void setSingleSelect( String singleSelect )
+    {
         this.singleSelect = singleSelect;
     }
 
-
     /**
      * String arrays that are accessed as an array as well as indexed.
      */
-    private String stringArray[] =
-            { "String 0", "String 1", "String 2", "String 3", "String 4" };
+    private String stringArray[] = { "String 0", "String 1", "String 2", "String 3", "String 4" };
 
-    public String[] getStringArray() {
-        return (this.stringArray);
+    public String[] getStringArray()
+    {
+        return ( this.stringArray );
     }
 
-    public void setStringArray(String stringArray[]) {
+    public void setStringArray( String stringArray[] )
+    {
         this.stringArray = stringArray;
     }
 
-    private String stringIndexed[] =
-            { "String 0", "String 1", "String 2", "String 3", "String 4" };
+    private String stringIndexed[] = { "String 0", "String 1", "String 2", "String 3", "String 4" };
 
-    public String getStringIndexed(int index) {
-        return (stringIndexed[index]);
+    public String getStringIndexed( int index )
+    {
+        return ( stringIndexed[index] );
     }
 
-    public void setStringIndexed(int index, String value) {
+    public void setStringIndexed( int index, String value )
+    {
         stringIndexed[index] = value;
     }
 
-
     /**
      * A String property.
      */
     private String stringProperty = "This is a string";
 
-    public String getStringProperty() {
-        return (this.stringProperty);
+    public String getStringProperty()
+    {
+        return ( this.stringProperty );
     }
 
-    public void setStringProperty(String stringProperty) {
+    public void setStringProperty( String stringProperty )
+    {
         this.stringProperty = stringProperty;
     }
 
@@ -264,13 +278,14 @@ public class TestBean {
      */
     private String emptyStringProperty = "";
 
-    public String getEmptyStringProperty() {
-        return (this.emptyStringProperty);
+    public String getEmptyStringProperty()
+    {
+        return ( this.emptyStringProperty );
     }
 
-    public void setEmptyStringProperty(String emptyStringProperty) {
+    public void setEmptyStringProperty( String emptyStringProperty )
+    {
         this.emptyStringProperty = emptyStringProperty;
     }
 
-
 }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestEntityResolution.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestEntityResolution.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestEntityResolution.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestEntityResolution.java Thu May 12 18:03:26 2011
@@ -17,8 +17,6 @@
  */
 package org.apache.commons.digester3;
 
-
-
 import java.io.File;
 
 import javax.xml.parsers.SAXParser;
@@ -30,28 +28,32 @@ import org.xml.sax.helpers.DefaultHandle
 
 /**
  * Tests for entity resolution.
+ * 
  * @author <a href='http://commons.apache.org/'>Apache Commons Team</a>
  * @version $Revision$
  */
-public class TestEntityResolution {
+public class TestEntityResolution
+{
 
     @Test
-    public void testParserResolveRelative() throws Exception {
+    public void testParserResolveRelative()
+        throws Exception
+    {
         SAXParserFactory factory = SAXParserFactory.newInstance();
-        factory.setValidating(true);
-        factory.setNamespaceAware(true);
+        factory.setValidating( true );
+        factory.setNamespaceAware( true );
         SAXParser parser = factory.newSAXParser();
-        
-        parser.parse(
-                    new File("src/test/resources/org/apache/commons/digester3/document-with-relative-dtd.xml"), 
-                    new DefaultHandler());
+
+        parser.parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd.xml" ),
+                      new DefaultHandler() );
     }
 
     @Test
-    public void testDigesterResolveRelative() throws Exception {
+    public void testDigesterResolveRelative()
+        throws Exception
+    {
         Digester digester = new Digester();
-        digester.setValidating(true);
-        digester.parse(
-                    new File("src/test/resources/org/apache/commons/digester3/document-with-relative-dtd.xml"));
+        digester.setValidating( true );
+        digester.parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd.xml" ) );
     }
 }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestFactoryCreate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestFactoryCreate.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestFactoryCreate.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestFactoryCreate.java Thu May 12 18:03:26 2011
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
 import static org.junit.Assert.assertEquals;
@@ -33,253 +32,207 @@ import org.xml.sax.Attributes;
 
 /**
  * Test case for factory create rules.
- *
+ * 
  * @author Robert Burrell Donkin
  */
 
-public class TestFactoryCreate {
-        
+public class TestFactoryCreate
+{
+
     // --------------------------------------------------------------- Test cases
-    
-       
+
     @Test
-    public void testPropagateException() throws Exception {
-    
+    public void testPropagateException()
+        throws Exception
+    {
+
         // only used with this method
-        class ThrowExceptionCreateRule extends AbstractObjectCreationFactory {
+        class ThrowExceptionCreateRule
+            extends AbstractObjectCreationFactory
+        {
             @Override
-            public Object createObject(Attributes attributes) throws Exception {
+            public Object createObject( Attributes attributes )
+                throws Exception
+            {
                 throw new RuntimeException();
             }
-        }   
-        
-        
+        }
+
         // now for the tests
         String xml = "<?xml version='1.0' ?><root><element/></root>";
-        
+
         // test default - which is to propagate the exception
         Digester digester = new Digester();
-        digester.addFactoryCreate("root", new ThrowExceptionCreateRule());
-        try {
-        
-            digester.parse(new StringReader(xml));
-            fail("Exception not propagated from create rule (1)");
-        
-        } catch (Exception e) { 
-            /* This is what's expected */ 
+        digester.addFactoryCreate( "root", new ThrowExceptionCreateRule() );
+        try
+        {
+
+            digester.parse( new StringReader( xml ) );
+            fail( "Exception not propagated from create rule (1)" );
+
+        }
+        catch ( Exception e )
+        {
+            /* This is what's expected */
         }
-        
+
         // test propagate exception
         digester = new Digester();
-        digester.addFactoryCreate("root", new ThrowExceptionCreateRule(), false);
-        try {
-        
-            digester.parse(new StringReader(xml));
-            fail("Exception not propagated from create rule (1)");
-        
-        } catch (Exception e) { 
-            /* This is what's expected */ 
+        digester.addFactoryCreate( "root", new ThrowExceptionCreateRule(), false );
+        try
+        {
+
+            digester.parse( new StringReader( xml ) );
+            fail( "Exception not propagated from create rule (1)" );
+
+        }
+        catch ( Exception e )
+        {
+            /* This is what's expected */
         }
-        
+
         // test don't propagate exception
         digester = new Digester();
-        digester.addFactoryCreate("root", new ThrowExceptionCreateRule(), true);
-        try {
-        
-            digester.parse(new StringReader(xml));
-        
-        } catch (Exception e) {
+        digester.addFactoryCreate( "root", new ThrowExceptionCreateRule(), true );
+        try
+        {
+
+            digester.parse( new StringReader( xml ) );
+
+        }
+        catch ( Exception e )
+        {
             // this shouldn't happen
-            fail("Exception should not be propagated");
+            fail( "Exception should not be propagated" );
         }
     }
 
     @Test
-    public void testFactoryCreateRule() throws Exception {
-        tryVariations(true);
-        tryVariations(false);
+    public void testFactoryCreateRule()
+        throws Exception
+    {
+        tryVariations( true );
+        tryVariations( false );
     }
-    
-    private void tryVariations(boolean propagateExceptions) throws Exception {
-        
-        
+
+    private void tryVariations( boolean propagateExceptions )
+        throws Exception
+    {
+
         // test passing object create
         Digester digester = new Digester();
         ObjectCreationFactoryTestImpl factory = new ObjectCreationFactoryTestImpl();
-        digester.addFactoryCreate("root", factory, propagateExceptions);
-        String xml = new String (
-            "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>");
-        digester.parse(new StringReader(xml));
-        
-        assertEquals("Object create not called(1)[" + propagateExceptions + "]", factory.called , true);
-        assertEquals(
-                    "Attribute not passed (1)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("one"), 
-                    "good");
-        assertEquals(
-                    "Attribute not passed (2)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("two"), 
-                    "bad");
-        assertEquals(
-                    "Attribute not passed (3)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("three"), 
-                    "ugly");   
-                    
-        digester = new Digester();
-        digester.addFactoryCreate(
-                                "root", 
-                                "org.apache.commons.digester3.ObjectCreationFactoryTestImpl",
-                                propagateExceptions);
-        digester.addSetNext("root", "add");
-        xml = new String (
-            "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>");        
+        digester.addFactoryCreate( "root", factory, propagateExceptions );
+        String xml = new String( "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>" );
+        digester.parse( new StringReader( xml ) );
+
+        assertEquals( "Object create not called(1)[" + propagateExceptions + "]", factory.called, true );
+        assertEquals( "Attribute not passed (1)[" + propagateExceptions + "]", factory.attributes.getValue( "one" ),
+                      "good" );
+        assertEquals( "Attribute not passed (2)[" + propagateExceptions + "]", factory.attributes.getValue( "two" ),
+                      "bad" );
+        assertEquals( "Attribute not passed (3)[" + propagateExceptions + "]", factory.attributes.getValue( "three" ),
+                      "ugly" );
+
+        digester = new Digester();
+        digester.addFactoryCreate( "root", "org.apache.commons.digester3.ObjectCreationFactoryTestImpl",
+                                   propagateExceptions );
+        digester.addSetNext( "root", "add" );
+        xml = new String( "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>" );
         List<ObjectCreationFactoryTestImpl> list = new ArrayList<ObjectCreationFactoryTestImpl>();
-        digester.push(list);
-        digester.parse(new StringReader(xml));
-        
-        assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = list.get(0);
-        assertEquals("Object create not called(2)[" + propagateExceptions + "]", factory.called , true);
-        assertEquals(
-                    "Attribute not passed (4)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("one"), 
-                    "good");
-        assertEquals(
-                    "Attribute not passed (5)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("two"), 
-                    "bad");
-        assertEquals(
-                    "Attribute not passed (6)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("three"), 
-                    "ugly");   
-                    
-    
-        digester = new Digester();
-        digester.addFactoryCreate(
-                                "root", 
-                                "org.apache.commons.digester3.ObjectCreationFactoryTestImpl",
-                                "override",
-                                propagateExceptions);
-        digester.addSetNext("root", "add");
-        xml = new String (
-            "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>");        
+        digester.push( list );
+        digester.parse( new StringReader( xml ) );
+
+        assertEquals( "List should contain only the factory object", list.size(), 1 );
+        factory = list.get( 0 );
+        assertEquals( "Object create not called(2)[" + propagateExceptions + "]", factory.called, true );
+        assertEquals( "Attribute not passed (4)[" + propagateExceptions + "]", factory.attributes.getValue( "one" ),
+                      "good" );
+        assertEquals( "Attribute not passed (5)[" + propagateExceptions + "]", factory.attributes.getValue( "two" ),
+                      "bad" );
+        assertEquals( "Attribute not passed (6)[" + propagateExceptions + "]", factory.attributes.getValue( "three" ),
+                      "ugly" );
+
+        digester = new Digester();
+        digester.addFactoryCreate( "root", "org.apache.commons.digester3.ObjectCreationFactoryTestImpl", "override",
+                                   propagateExceptions );
+        digester.addSetNext( "root", "add" );
+        xml = new String( "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>" );
         list = new ArrayList<ObjectCreationFactoryTestImpl>();
-        digester.push(list);
-        digester.parse(new StringReader(xml));
-        
-        assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = list.get(0);
-        assertEquals("Object create not called(3)[" + propagateExceptions + "]", factory.called , true);
-        assertEquals(
-                    "Attribute not passed (7)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("one"), 
-                    "good");
-        assertEquals(
-                    "Attribute not passed (8)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("two"), 
-                    "bad");
-        assertEquals(
-                    "Attribute not passed (8)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("three"), 
-                    "ugly");   
-        
-        digester = new Digester();
-        digester.addFactoryCreate(
-                                "root", 
-                                "org.apache.commons.digester3.ObjectCreationFactoryTestImpl",
-                                "override",
-                                propagateExceptions);
-        digester.addSetNext("root", "add");
-        xml = new String (
-            "<?xml version='1.0' ?><root one='good' two='bad' three='ugly' "
-            + " override='org.apache.commons.digester3.OtherTestObjectCreationFactory' >"
-            + "<element/></root>");        
+        digester.push( list );
+        digester.parse( new StringReader( xml ) );
+
+        assertEquals( "List should contain only the factory object", list.size(), 1 );
+        factory = list.get( 0 );
+        assertEquals( "Object create not called(3)[" + propagateExceptions + "]", factory.called, true );
+        assertEquals( "Attribute not passed (7)[" + propagateExceptions + "]", factory.attributes.getValue( "one" ),
+                      "good" );
+        assertEquals( "Attribute not passed (8)[" + propagateExceptions + "]", factory.attributes.getValue( "two" ),
+                      "bad" );
+        assertEquals( "Attribute not passed (8)[" + propagateExceptions + "]", factory.attributes.getValue( "three" ),
+                      "ugly" );
+
+        digester = new Digester();
+        digester.addFactoryCreate( "root", "org.apache.commons.digester3.ObjectCreationFactoryTestImpl", "override",
+                                   propagateExceptions );
+        digester.addSetNext( "root", "add" );
+        xml =
+            new String( "<?xml version='1.0' ?><root one='good' two='bad' three='ugly' "
+                + " override='org.apache.commons.digester3.OtherTestObjectCreationFactory' >" + "<element/></root>" );
         list = new ArrayList<ObjectCreationFactoryTestImpl>();
-        digester.push(list);
-        digester.parse(new StringReader(xml));
-        
-        assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = list.get(0);
-        assertEquals(
-                    "Attribute Override Failed (1)", 
-                    factory.getClass().getName() , 
-                    "org.apache.commons.digester3.OtherTestObjectCreationFactory");
-        assertEquals("Object create not called(4)[" + propagateExceptions + "]", factory.called , true);
-        assertEquals(
-                    "Attribute not passed (10)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("one"), 
-                    "good");
-        assertEquals(
-                    "Attribute not passed (11)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("two"), 
-                    "bad");
-        assertEquals(
-                    "Attribute not passed (12)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("three"), 
-                    "ugly");   
-    
-        digester = new Digester();
-        digester.addFactoryCreate(
-                                "root", 
-                                ObjectCreationFactoryTestImpl.class,
-                                "override",
-                                propagateExceptions);
-        digester.addSetNext("root", "add");
-        xml = new String (
-            "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>");        
+        digester.push( list );
+        digester.parse( new StringReader( xml ) );
+
+        assertEquals( "List should contain only the factory object", list.size(), 1 );
+        factory = list.get( 0 );
+        assertEquals( "Attribute Override Failed (1)", factory.getClass().getName(),
+                      "org.apache.commons.digester3.OtherTestObjectCreationFactory" );
+        assertEquals( "Object create not called(4)[" + propagateExceptions + "]", factory.called, true );
+        assertEquals( "Attribute not passed (10)[" + propagateExceptions + "]", factory.attributes.getValue( "one" ),
+                      "good" );
+        assertEquals( "Attribute not passed (11)[" + propagateExceptions + "]", factory.attributes.getValue( "two" ),
+                      "bad" );
+        assertEquals( "Attribute not passed (12)[" + propagateExceptions + "]", factory.attributes.getValue( "three" ),
+                      "ugly" );
+
+        digester = new Digester();
+        digester.addFactoryCreate( "root", ObjectCreationFactoryTestImpl.class, "override", propagateExceptions );
+        digester.addSetNext( "root", "add" );
+        xml = new String( "<?xml version='1.0' ?><root one='good' two='bad' three='ugly'><element/></root>" );
         list = new ArrayList<ObjectCreationFactoryTestImpl>();
-        digester.push(list);
-        digester.parse(new StringReader(xml));
-        
-        assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = list.get(0);
-        assertEquals("Object create not called(5)[" + propagateExceptions + "]", factory.called , true);
-        assertEquals(
-                    "Attribute not passed (13)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("one"), 
-                    "good");
-        assertEquals(
-                    "Attribute not passed (14)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("two"), 
-                    "bad");
-        assertEquals(
-                    "Attribute not passed (15)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("three"), 
-                    "ugly");   
-        
-        digester = new Digester();
-        digester.addFactoryCreate(
-                                "root", 
-                                ObjectCreationFactoryTestImpl.class,
-                                "override",
-                                propagateExceptions);
-        digester.addSetNext("root", "add");
-        xml = new String (
-            "<?xml version='1.0' ?><root one='good' two='bad' three='ugly' "
-            + " override='org.apache.commons.digester3.OtherTestObjectCreationFactory' >"
-            + "<element/></root>");        
+        digester.push( list );
+        digester.parse( new StringReader( xml ) );
+
+        assertEquals( "List should contain only the factory object", list.size(), 1 );
+        factory = list.get( 0 );
+        assertEquals( "Object create not called(5)[" + propagateExceptions + "]", factory.called, true );
+        assertEquals( "Attribute not passed (13)[" + propagateExceptions + "]", factory.attributes.getValue( "one" ),
+                      "good" );
+        assertEquals( "Attribute not passed (14)[" + propagateExceptions + "]", factory.attributes.getValue( "two" ),
+                      "bad" );
+        assertEquals( "Attribute not passed (15)[" + propagateExceptions + "]", factory.attributes.getValue( "three" ),
+                      "ugly" );
+
+        digester = new Digester();
+        digester.addFactoryCreate( "root", ObjectCreationFactoryTestImpl.class, "override", propagateExceptions );
+        digester.addSetNext( "root", "add" );
+        xml =
+            new String( "<?xml version='1.0' ?><root one='good' two='bad' three='ugly' "
+                + " override='org.apache.commons.digester3.OtherTestObjectCreationFactory' >" + "<element/></root>" );
         list = new ArrayList<ObjectCreationFactoryTestImpl>();
-        digester.push(list);
-        digester.parse(new StringReader(xml));
-        
-        assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = list.get(0);
-        assertEquals(
-                    "Attribute Override Failed (2)", 
-                    factory.getClass().getName() , 
-                    "org.apache.commons.digester3.OtherTestObjectCreationFactory");
-        assertEquals("Object create not called(6)[" + propagateExceptions + "]", factory.called , true);
-        assertEquals(
-                    "Attribute not passed (16)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("one"), 
-                    "good");
-        assertEquals(
-                    "Attribute not passed (17)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("two"), 
-                    "bad");
-        assertEquals(
-                    "Attribute not passed (18)[" + propagateExceptions + "]", 
-                    factory.attributes.getValue("three"), 
-                    "ugly");   
+        digester.push( list );
+        digester.parse( new StringReader( xml ) );
+
+        assertEquals( "List should contain only the factory object", list.size(), 1 );
+        factory = list.get( 0 );
+        assertEquals( "Attribute Override Failed (2)", factory.getClass().getName(),
+                      "org.apache.commons.digester3.OtherTestObjectCreationFactory" );
+        assertEquals( "Object create not called(6)[" + propagateExceptions + "]", factory.called, true );
+        assertEquals( "Attribute not passed (16)[" + propagateExceptions + "]", factory.attributes.getValue( "one" ),
+                      "good" );
+        assertEquals( "Attribute not passed (17)[" + propagateExceptions + "]", factory.attributes.getValue( "two" ),
+                      "bad" );
+        assertEquals( "Attribute not passed (18)[" + propagateExceptions + "]", factory.attributes.getValue( "three" ),
+                      "ugly" );
     }
 }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRule.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRule.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRule.java Thu May 12 18:03:26 2011
@@ -16,29 +16,28 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
-
 import java.util.List;
 
 import org.apache.commons.digester3.Rule;
 import org.xml.sax.Attributes;
 
-
 /**
- * <p>This rule implementation is intended to help test digester.
- * The idea is that you can test which rule matches by looking
- * at the identifier.</p>
- *
+ * <p>
+ * This rule implementation is intended to help test digester. The idea is that you can test which rule matches by
+ * looking at the identifier.
+ * </p>
+ * 
  * @author Robert Burrell Donkin
  */
 
-public class TestRule extends Rule {
+public class TestRule
+    extends Rule
+{
 
     // ----------------------------------------------------- Instance Variables
 
-
     /** String identifing this particular <code>TestRule</code> */
     private String identifier;
 
@@ -52,112 +51,112 @@ public class TestRule extends Rule {
 
     /**
      * Base constructor.
-     *
+     * 
      * @param identifier Used to tell which TestRule is which
      */
-    public TestRule(String identifier) {
-        
+    public TestRule( String identifier )
+    {
+
         this.identifier = identifier;
     }
 
     /**
      * Constructor sets namespace URI.
-     *
+     * 
      * @param identifier Used to tell which TestRule is which
      * @param namespaceURI Set rule namespace
      */
-    public TestRule(
-                    String identifier,
-                    String namespaceURI) {
+    public TestRule( String identifier, String namespaceURI )
+    {
 
         this.identifier = identifier;
-        setNamespaceURI(namespaceURI);
+        setNamespaceURI( namespaceURI );
 
     }
 
-
     // ------------------------------------------------ Rule Implementation
 
-
     /**
      * 'Begin' call.
      */
     @Override
-    public void begin(String namespace, String name, Attributes attributes) throws Exception {
+    public void begin( String namespace, String name, Attributes attributes )
+        throws Exception
+    {
         appendCall();
     }
 
-
     /**
      * 'Body' call.
      */
     @Override
-    public void body(String namespace, String name, String text) throws Exception {
+    public void body( String namespace, String name, String text )
+        throws Exception
+    {
         this.bodyText = text;
         appendCall();
     }
 
-
     /**
      * 'End' call.
      */
     @Override
-    public void end(String namespace, String name) throws Exception {
+    public void end( String namespace, String name )
+        throws Exception
+    {
         appendCall();
     }
 
-
     // ------------------------------------------------ Methods
 
-
     /**
      * If a list has been set, append this to the list.
      */
-    protected void appendCall() {
-        if (order != null)
-            order.add(this);
+    protected void appendCall()
+    {
+        if ( order != null )
+            order.add( this );
     }
 
-
     /**
      * Get the body text that was set.
      */
-    public String getBodyText() {
+    public String getBodyText()
+    {
         return bodyText;
     }
 
-
     /**
      * Get the identifier associated with this test.
      */
-    public String getIdentifier() {
+    public String getIdentifier()
+    {
         return identifier;
     }
 
-
     /**
      * Get call order list.
      */
-    public List<Rule> getOrder() {
+    public List<Rule> getOrder()
+    {
         return order;
     }
 
-
     /**
      * Set call order list
      */
-    public void setOrder(List<Rule> order) {
+    public void setOrder( List<Rule> order )
+    {
         this.order = order;
     }
 
-
     /**
      * Return the identifier.
      */
     @Override
-    public String toString() {
+    public String toString()
+    {
         return identifier;
     }
 
-
 }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRuleSet.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRuleSet.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRuleSet.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/TestRuleSet.java Thu May 12 18:03:26 2011
@@ -16,61 +16,58 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
 import org.apache.commons.digester3.Digester;
 import org.apache.commons.digester3.RuleSetBase;
 
-
 /**
- * RuleSet that mimics the rules set used for Employee and Address creation,
- * optionally associated with a particular namespace URI.
- *
+ * RuleSet that mimics the rules set used for Employee and Address creation, optionally associated with a particular
+ * namespace URI.
+ * 
  * @author Craig R. McClanahan
  * @version $Revision$ $Date$
  */
 
-public class TestRuleSet extends RuleSetBase {
-
+public class TestRuleSet
+    extends RuleSetBase
+{
 
     // ----------------------------------------------------------- Constructors
 
-
     /**
      * Construct an instance of this RuleSet with default values.
      */
-    public TestRuleSet() {
+    public TestRuleSet()
+    {
 
-        this(null, null);
+        this( null, null );
 
     }
 
-
     /**
-     * Construct an instance of this RuleSet associated with the specified
-     * prefix, associated with no namespace URI.
-     *
+     * Construct an instance of this RuleSet associated with the specified prefix, associated with no namespace URI.
+     * 
      * @param prefix Matching pattern prefix (must end with '/') or null.
      */
-    public TestRuleSet(String prefix) {
+    public TestRuleSet( String prefix )
+    {
 
-        this(prefix, null);
+        this( prefix, null );
 
     }
 
-
     /**
-     * Construct an instance of this RuleSet associated with the specified
-     * prefix and namespace URI.
-     *
+     * Construct an instance of this RuleSet associated with the specified prefix and namespace URI.
+     * 
      * @param prefix Matching pattern prefix (must end with '/') or null.
      * @param namespaceURI The namespace URI these rules belong to
      */
-    public TestRuleSet(String prefix, String namespaceURI) {
+    public TestRuleSet( String prefix, String namespaceURI )
+    {
 
         super();
-        if (prefix == null)
+        if ( prefix == null )
             this.prefix = "";
         else
             this.prefix = prefix;
@@ -78,41 +75,31 @@ public class TestRuleSet extends RuleSet
 
     }
 
-
     // ----------------------------------------------------- Instance Variables
 
-
     /**
-     * The prefix for each matching pattern added to the Digester instance,
-     * or an empty String for no prefix.
+     * The prefix for each matching pattern added to the Digester instance, or an empty String for no prefix.
      */
     protected String prefix = null;
 
-
     // --------------------------------------------------------- Public Methods
 
-
     /**
-     * Add the set of Rule instances defined in this RuleSet to the
-     * specified <code>Digester</code> instance, associating them with
-     * our namespace URI (if any).  This method should only be called
-     * by a Digester instance.
-     *
-     * @param digester Digester instance to which the new Rule instances
-     *  should be added.
+     * Add the set of Rule instances defined in this RuleSet to the specified <code>Digester</code> instance,
+     * associating them with our namespace URI (if any). This method should only be called by a Digester instance.
+     * 
+     * @param digester Digester instance to which the new Rule instances should be added.
      */
     @Override
-    public void addRuleInstances(Digester digester) {
+    public void addRuleInstances( Digester digester )
+    {
 
-        digester.addObjectCreate(prefix + "employee", Employee.class);
-        digester.addSetProperties(prefix + "employee");
-        digester.addObjectCreate("employee/address",
-                "org.apache.commons.digester3.Address");
-        digester.addSetProperties(prefix + "employee/address");
-        digester.addSetNext(prefix + "employee/address",
-                "addAddress");
+        digester.addObjectCreate( prefix + "employee", Employee.class );
+        digester.addSetProperties( prefix + "employee" );
+        digester.addObjectCreate( "employee/address", "org.apache.commons.digester3.Address" );
+        digester.addSetProperties( prefix + "employee/address" );
+        digester.addSetNext( prefix + "employee/address", "addAddress" );
 
     }
-    
 
 }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/URLTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/URLTestCase.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/URLTestCase.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/URLTestCase.java Thu May 12 18:03:26 2011
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
 import static org.junit.Assert.*;
@@ -29,100 +28,99 @@ import org.junit.Before;
 import org.junit.Test;
 
 /**
- * <p>Unit tests that exercise the new (in 1.8) methods for passing in
- * <code>URL</code> arguments instead of strings.</p>
+ * <p>
+ * Unit tests that exercise the new (in 1.8) methods for passing in <code>URL</code> arguments instead of strings.
+ * </p>
  */
-public class URLTestCase {
-
+public class URLTestCase
+{
 
     // ----------------------------------------------------- Overall Test Methods
 
-
     /**
      * Set up instance variables required by this test case.
      */
     @Before
-    public void setUp() {
+    public void setUp()
+    {
 
         digester = new Digester();
 
     }
 
-
     /**
      * Tear down instance variables required by this test case.
      */
     @After
-    public void tearDown() {
+    public void tearDown()
+    {
 
         digester = null;
 
     }
 
-
     // ------------------------------------------------------ Manifest Constants
 
-
     /**
-     * <p>Public identifier of the Digester Rules DTD.</p>
+     * <p>
+     * Public identifier of the Digester Rules DTD.
+     * </p>
      */
-    private static final String DIGESTER_RULES_PUBLIC_ID =
-            "-//Jakarta Apache //DTD digester-rules XML V1.0//EN";
-
+    private static final String DIGESTER_RULES_PUBLIC_ID = "-//Jakarta Apache //DTD digester-rules XML V1.0//EN";
 
     /**
-     * <p>System identifier of the Digester Rules DTD.</p>
+     * <p>
+     * System identifier of the Digester Rules DTD.
+     * </p>
      */
-    private static final String DIGESTER_RULES_SYSTEM_ID =
-            "/org/apache/commons/digester3/xmlrules/digester-rules.dtd";
-
+    private static final String DIGESTER_RULES_SYSTEM_ID = "/org/apache/commons/digester3/xmlrules/digester-rules.dtd";
 
     /**
-     * <p>System identifier for the Digester Rules file that we will parse.</p>
+     * <p>
+     * System identifier for the Digester Rules file that we will parse.
+     * </p>
      */
     private static final String TEST_INPUT_SYSTEM_ID =
-            "/org/apache/commons/digester3/xmlrules/test-call-param-rules.xml";
-
+        "/org/apache/commons/digester3/xmlrules/test-call-param-rules.xml";
 
     // ------------------------------------------------------ Instance Variables
 
-
     /**
-     * <p>The <code>Digester</code> instance under test.</p>
+     * <p>
+     * The <code>Digester</code> instance under test.
+     * </p>
      */
     private Digester digester = null;
 
-
-
     // ------------------------------------------------------------ Test Methods
 
-
     // Test a pristine instance
     @Test
-    public void testPristine() {
+    public void testPristine()
+    {
 
-        assertNotNull(digester);
+        assertNotNull( digester );
 
     }
 
-
     // Test parsing a resource, using a registered DTD, both passed with URLs
     @Test
-    public void testResource() throws Exception {
+    public void testResource()
+        throws Exception
+    {
 
         // Register the Digester Rules DTD
-        URL dtd = URLTestCase.class.getResource(DIGESTER_RULES_SYSTEM_ID);
-        assertNotNull(dtd);
-        digester.register(DIGESTER_RULES_PUBLIC_ID, dtd);
+        URL dtd = URLTestCase.class.getResource( DIGESTER_RULES_SYSTEM_ID );
+        assertNotNull( dtd );
+        digester.register( DIGESTER_RULES_PUBLIC_ID, dtd );
 
         // Parse one of the existing test resources twice with
         // the same Digester instance
-        URL xml = URLTestCase.class.getResource(TEST_INPUT_SYSTEM_ID);
-        assertNotNull(xml);
-        digester.parse(xml);
-        digester.parse(xml);
+        URL xml = URLTestCase.class.getResource( TEST_INPUT_SYSTEM_ID );
+        assertNotNull( xml );
+        digester.parse( xml );
+        digester.parse( xml );
 
     }
 
-
 }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/WDRulesWrapperTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/WDRulesWrapperTestCase.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/WDRulesWrapperTestCase.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/WDRulesWrapperTestCase.java Thu May 12 18:03:26 2011
@@ -30,76 +30,80 @@ import org.junit.Test;
 
 /**
  * Test case for WithDefaultsRulesWrapper
- *
+ * 
  * @author Robert Burrell Donkin
  * @version $Revision$ $Date$
  */
 
-public class WDRulesWrapperTestCase {
+public class WDRulesWrapperTestCase
+{
 
     @Test
-    public void testClear() {
+    public void testClear()
+    {
         // test clear wrapped
-        WithDefaultsRulesWrapper rules = new WithDefaultsRulesWrapper(new RulesBase());
-        rules.add("alpha", new TestRule("Tom"));
-        rules.add("alpha", new TestRule("Dick"));
-        rules.add("alpha", new TestRule("Harry"));
-        
-        assertNotNull("Rules should not be null",  rules.rules());
-        assertEquals("Wrong number of rules registered (1)", 3 , rules.rules().size());
+        WithDefaultsRulesWrapper rules = new WithDefaultsRulesWrapper( new RulesBase() );
+        rules.add( "alpha", new TestRule( "Tom" ) );
+        rules.add( "alpha", new TestRule( "Dick" ) );
+        rules.add( "alpha", new TestRule( "Harry" ) );
+
+        assertNotNull( "Rules should not be null", rules.rules() );
+        assertEquals( "Wrong number of rules registered (1)", 3, rules.rules().size() );
         rules.clear();
-        assertEquals("Clear Failed (1)", 0 , rules.rules().size());
-        
+        assertEquals( "Clear Failed (1)", 0, rules.rules().size() );
+
         // mixed
-        rules.add("alpha", new TestRule("Tom"));
-        rules.add("alpha", new TestRule("Dick"));
-        rules.add("alpha", new TestRule("Harry"));
-        rules.addDefault(new TestRule("Roger"));
-        assertEquals("Wrong number of rules registered (2)", 4 , rules.rules().size());
+        rules.add( "alpha", new TestRule( "Tom" ) );
+        rules.add( "alpha", new TestRule( "Dick" ) );
+        rules.add( "alpha", new TestRule( "Harry" ) );
+        rules.addDefault( new TestRule( "Roger" ) );
+        assertEquals( "Wrong number of rules registered (2)", 4, rules.rules().size() );
         rules.clear();
-        assertEquals("Clear Failed (2)", 0 , rules.rules().size());
-        
-        rules.addDefault(new TestRule("Roger"));
-        assertEquals("Wrong number of rules registered (3)", 1 , rules.rules().size());
+        assertEquals( "Clear Failed (2)", 0, rules.rules().size() );
+
+        rules.addDefault( new TestRule( "Roger" ) );
+        assertEquals( "Wrong number of rules registered (3)", 1, rules.rules().size() );
         rules.clear();
-        assertEquals("Clear Failed (3)", 0 , rules.rules().size());
+        assertEquals( "Clear Failed (3)", 0, rules.rules().size() );
     }
 
     @Test
-    public void testRules() {
+    public void testRules()
+    {
         // test rules
-        WithDefaultsRulesWrapper rules = new WithDefaultsRulesWrapper(new RulesBase());
-        rules.add("alpha", new TestRule("Tom"));
-        rules.add("alpha", new TestRule("Dick"));
-        rules.addDefault(new TestRule("Roger"));
-        rules.add("alpha", new TestRule("Harry"));
-        
-        assertNotNull("Rules should not be null",  rules.rules());
-        assertEquals("Wrong order (1)", "Tom" , ((TestRule) rules.rules().get(0)).getIdentifier());
-        assertEquals("Wrong order (2)", "Dick" , ((TestRule) rules.rules().get(1)).getIdentifier());
-        assertEquals("Wrong order (3)", "Roger" , ((TestRule) rules.rules().get(2)).getIdentifier());
-        assertEquals("Wrong order (4)", "Harry" , ((TestRule) rules.rules().get(3)).getIdentifier());
+        WithDefaultsRulesWrapper rules = new WithDefaultsRulesWrapper( new RulesBase() );
+        rules.add( "alpha", new TestRule( "Tom" ) );
+        rules.add( "alpha", new TestRule( "Dick" ) );
+        rules.addDefault( new TestRule( "Roger" ) );
+        rules.add( "alpha", new TestRule( "Harry" ) );
+
+        assertNotNull( "Rules should not be null", rules.rules() );
+        assertEquals( "Wrong order (1)", "Tom", ( (TestRule) rules.rules().get( 0 ) ).getIdentifier() );
+        assertEquals( "Wrong order (2)", "Dick", ( (TestRule) rules.rules().get( 1 ) ).getIdentifier() );
+        assertEquals( "Wrong order (3)", "Roger", ( (TestRule) rules.rules().get( 2 ) ).getIdentifier() );
+        assertEquals( "Wrong order (4)", "Harry", ( (TestRule) rules.rules().get( 3 ) ).getIdentifier() );
     }
 
     @Test
-    public void testMatch() {
+    public void testMatch()
+    {
         // test no defaults
-        WithDefaultsRulesWrapper rules = new WithDefaultsRulesWrapper(new RulesBase());
-        rules.add("alpha", new TestRule("Tom"));
-        rules.add("alpha", new TestRule("Dick"));
-        rules.add("alpha", new TestRule("Harry"));
-        rules.addDefault(new TestRule("Roger"));
-        rules.addDefault(new TestRule("Rabbit"));
-        
-        List<Rule> matches = rules.match("", "alpha");
-        assertEquals("Wrong size (1)", 3 , matches.size());
-        assertEquals("Wrong order (1)", "Tom" , ((TestRule) matches.get(0)).getIdentifier());
-        assertEquals("Wrong order (2)", "Dick" , ((TestRule) matches.get(1)).getIdentifier());
-        assertEquals("Wrong order (3)", "Harry" , ((TestRule) matches.get(2)).getIdentifier());
-        
-        matches = rules.match("", "not-alpha");
-        assertEquals("Wrong size (2)", 2 , matches.size());
-        assertEquals("Wrong order (4)", "Roger" , ((TestRule) matches.get(0)).getIdentifier());
-        assertEquals("Wrong order (5)", "Rabbit" , ((TestRule) matches.get(1)).getIdentifier());
+        WithDefaultsRulesWrapper rules = new WithDefaultsRulesWrapper( new RulesBase() );
+        rules.add( "alpha", new TestRule( "Tom" ) );
+        rules.add( "alpha", new TestRule( "Dick" ) );
+        rules.add( "alpha", new TestRule( "Harry" ) );
+        rules.addDefault( new TestRule( "Roger" ) );
+        rules.addDefault( new TestRule( "Rabbit" ) );
+
+        List<Rule> matches = rules.match( "", "alpha" );
+        assertEquals( "Wrong size (1)", 3, matches.size() );
+        assertEquals( "Wrong order (1)", "Tom", ( (TestRule) matches.get( 0 ) ).getIdentifier() );
+        assertEquals( "Wrong order (2)", "Dick", ( (TestRule) matches.get( 1 ) ).getIdentifier() );
+        assertEquals( "Wrong order (3)", "Harry", ( (TestRule) matches.get( 2 ) ).getIdentifier() );
+
+        matches = rules.match( "", "not-alpha" );
+        assertEquals( "Wrong size (2)", 2, matches.size() );
+        assertEquals( "Wrong order (4)", "Roger", ( (TestRule) matches.get( 0 ) ).getIdentifier() );
+        assertEquals( "Wrong order (5)", "Rabbit", ( (TestRule) matches.get( 1 ) ).getIdentifier() );
     }
 }

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XIncludeTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XIncludeTestCase.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XIncludeTestCase.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XIncludeTestCase.java Thu May 12 18:03:26 2011
@@ -16,10 +16,8 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
@@ -32,111 +30,104 @@ import org.junit.Before;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
-
 /**
- * <p>Tests for XInclude aware parsing.</p>
- *
+ * <p>
+ * Tests for XInclude aware parsing.
+ * </p>
  */
-public class XIncludeTestCase {
-
+public class XIncludeTestCase
+{
 
     // ----------------------------------------------------- Instance Variables
 
-
     /**
      * The digester instance we will be processing.
      */
     protected Digester digester = null;
 
-
     // --------------------------------------------------- Overall Test Methods
 
-
     /**
      * Set up instance variables required by this test case.
      */
     @Before
-    public void setUp() {
+    public void setUp()
+    {
 
         digester = new Digester();
 
     }
 
-
     /**
      * Tear down instance variables required by this test case.
      */
     @After
-    public void tearDown() {
+    public void tearDown()
+    {
 
         digester = null;
 
     }
 
-
-
     // ------------------------------------------------ Individual Test Methods
 
-
     /**
      * Test XInclude.
      */
     @Test
-    public void testXInclude() throws SAXException, IOException {
+    public void testXInclude()
+        throws SAXException, IOException
+    {
 
         // Turn on XInclude processing
-        digester.setNamespaceAware(true);
-        digester.setXIncludeAware(true);
+        digester.setNamespaceAware( true );
+        digester.setXIncludeAware( true );
 
         // Configure the digester as required
-        digester.addObjectCreate("employee", Employee.class);
-        digester.addCallMethod("employee/firstName", "setFirstName", 0);
-        digester.addCallMethod("employee/lastName", "setLastName", 0);
-
-        digester.addObjectCreate("employee/address", Address.class);
-        digester.addCallMethod("employee/address/type", "setType", 0);
-        digester.addCallMethod("employee/address/city", "setCity", 0);
-        digester.addCallMethod("employee/address/state", "setState", 0);
-        digester.addSetNext("employee/address", "addAddress");
+        digester.addObjectCreate( "employee", Employee.class );
+        digester.addCallMethod( "employee/firstName", "setFirstName", 0 );
+        digester.addCallMethod( "employee/lastName", "setLastName", 0 );
+
+        digester.addObjectCreate( "employee/address", Address.class );
+        digester.addCallMethod( "employee/address/type", "setType", 0 );
+        digester.addCallMethod( "employee/address/city", "setCity", 0 );
+        digester.addCallMethod( "employee/address/state", "setState", 0 );
+        digester.addSetNext( "employee/address", "addAddress" );
 
         // Parse our test input
-        Employee employee = digester.parse(getInputStream("Test12.xml"));
-        assertNotNull("failed to parsed an employee", employee);
+        Employee employee = digester.parse( getInputStream( "Test12.xml" ) );
+        assertNotNull( "failed to parsed an employee", employee );
 
         // Test basics
-        assertEquals("First Name", employee.getFirstName());
-        assertEquals("Last Name", employee.getLastName());
+        assertEquals( "First Name", employee.getFirstName() );
+        assertEquals( "Last Name", employee.getLastName() );
 
         // Test includes have been processed
-        Address ha = employee.getAddress("home");
-        assertNotNull(ha);
-        assertEquals("Home City", ha.getCity());
-        assertEquals("HS", ha.getState());
-        Address oa = employee.getAddress("office");
-        assertNotNull(oa);
-        assertEquals("Office City", oa.getCity());
-        assertEquals("OS", oa.getState());
+        Address ha = employee.getAddress( "home" );
+        assertNotNull( ha );
+        assertEquals( "Home City", ha.getCity() );
+        assertEquals( "HS", ha.getState() );
+        Address oa = employee.getAddress( "office" );
+        assertNotNull( oa );
+        assertEquals( "Office City", oa.getCity() );
+        assertEquals( "OS", oa.getState() );
 
     }
 
     // ------------------------------------------------ Utility Support Methods
 
-
     /**
-     * Return an appropriate InputStream for the specified test file (which
-     * must be inside our current package.
-     *
+     * Return an appropriate InputStream for the specified test file (which must be inside our current package.
+     * 
      * @param name Name of the test file we want
-     *
      * @exception IOException if an input/output error occurs
      */
-    protected InputStream getInputStream(String name) throws IOException {
+    protected InputStream getInputStream( String name )
+        throws IOException
+    {
 
-        return (this.getClass().getResourceAsStream
-                ("/org/apache/commons/digester3/" + name));
+        return ( this.getClass().getResourceAsStream( "/org/apache/commons/digester3/" + name ) );
 
     }
 
-
 }
-

Modified: commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XMLSchemaTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XMLSchemaTestCase.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XMLSchemaTestCase.java (original)
+++ commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/XMLSchemaTestCase.java Thu May 12 18:03:26 2011
@@ -16,10 +16,8 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.digester3;
 
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -40,138 +38,144 @@ import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
-
 /**
- * <p>Tests for XInclude aware parsing.</p>
- *
+ * <p>
+ * Tests for XInclude aware parsing.
+ * </p>
  */
-public class XMLSchemaTestCase {
-
+public class XMLSchemaTestCase
+{
 
     // ----------------------------------------------------- Instance Variables
 
-
     /**
      * The digester instance we will be processing.
      */
     protected Digester digester = null;
 
-
     // --------------------------------------------------- Overall Test Methods
 
-
     /**
      * Set up instance variables required by this test case.
      */
     @Before
-    public void setUp() throws SAXException {
+    public void setUp()
+        throws SAXException
+    {
 
         digester = new Digester();
 
         // Use the test schema
-        digester.setNamespaceAware(true);
-        Schema test13schema = SchemaFactory.
-            newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).
-            newSchema(this.getClass().getClassLoader().
-                getResource("org/apache/commons/digester3/Test13.xsd"));
-        digester.setXMLSchema(test13schema);
+        digester.setNamespaceAware( true );
+        Schema test13schema =
+            SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI ).newSchema( this.getClass().getClassLoader().getResource( "org/apache/commons/digester3/Test13.xsd" ) );
+        digester.setXMLSchema( test13schema );
 
         // Configure the digester as required
-        digester.addObjectCreate("employee", Employee.class);
-        digester.addCallMethod("employee/firstName", "setFirstName", 0);
-        digester.addCallMethod("employee/lastName", "setLastName", 0);
-
-        digester.addObjectCreate("employee/address", Address.class);
-        digester.addCallMethod("employee/address/type", "setType", 0);
-        digester.addCallMethod("employee/address/city", "setCity", 0);
-        digester.addCallMethod("employee/address/state", "setState", 0);
-        digester.addSetNext("employee/address", "addAddress");
+        digester.addObjectCreate( "employee", Employee.class );
+        digester.addCallMethod( "employee/firstName", "setFirstName", 0 );
+        digester.addCallMethod( "employee/lastName", "setLastName", 0 );
+
+        digester.addObjectCreate( "employee/address", Address.class );
+        digester.addCallMethod( "employee/address/type", "setType", 0 );
+        digester.addCallMethod( "employee/address/city", "setCity", 0 );
+        digester.addCallMethod( "employee/address/state", "setState", 0 );
+        digester.addSetNext( "employee/address", "addAddress" );
 
     }
 
-
     /**
      * Tear down instance variables required by this test case.
      */
     @After
-    public void tearDown() {
+    public void tearDown()
+    {
 
         digester = null;
 
     }
 
-
-
     // ------------------------------------------------ Individual Test Methods
 
-
     /**
      * Test XML Schema validation.
      */
     @Test
-    public void testGoodDocument() throws SAXException, IOException {
+    public void testGoodDocument()
+        throws SAXException, IOException
+    {
 
         // Listen to validation errors
         TestErrorHandler teh = new TestErrorHandler();
-        digester.setErrorHandler(teh);
+        digester.setErrorHandler( teh );
 
         // Parse our test input
-        Employee employee = digester.parse(getInputStream("Test13-01.xml"));
-        assertNotNull("failed to parsed an employee", employee);
-        assertTrue("Test13-01 should not generate errors in Schema validation", teh.clean);
+        Employee employee = digester.parse( getInputStream( "Test13-01.xml" ) );
+        assertNotNull( "failed to parsed an employee", employee );
+        assertTrue( "Test13-01 should not generate errors in Schema validation", teh.clean );
 
         // Test document has been processed
-        Address ha = employee.getAddress("home");
-        assertNotNull(ha);
-        assertEquals("Home City", ha.getCity());
-        assertEquals("HS", ha.getState());
+        Address ha = employee.getAddress( "home" );
+        assertNotNull( ha );
+        assertEquals( "Home City", ha.getCity() );
+        assertEquals( "HS", ha.getState() );
 
     }
 
     @Test
-    public void testBadDocument() throws SAXException, IOException {
+    public void testBadDocument()
+        throws SAXException, IOException
+    {
 
         // Listen to validation errors
         TestErrorHandler teh = new TestErrorHandler();
-        digester.setErrorHandler(teh);
+        digester.setErrorHandler( teh );
 
         // Parse our test input
-        digester.parse(getInputStream("Test13-02.xml"));
-        assertFalse("Test13-02 should generate errors in Schema validation", teh.clean);
+        digester.parse( getInputStream( "Test13-02.xml" ) );
+        assertFalse( "Test13-02 should generate errors in Schema validation", teh.clean );
 
     }
 
     // ------------------------------------ Utility Support Methods and Classes
 
-
     /**
-     * Return an appropriate InputStream for the specified test file (which
-     * must be inside our current package.
-     *
+     * Return an appropriate InputStream for the specified test file (which must be inside our current package.
+     * 
      * @param name Name of the test file we want
-     *
      * @exception IOException if an input/output error occurs
      */
-    protected InputStream getInputStream(String name) throws IOException {
+    protected InputStream getInputStream( String name )
+        throws IOException
+    {
 
-        return (this.getClass().getResourceAsStream
-                ("/org/apache/commons/digester3/" + name));
+        return ( this.getClass().getResourceAsStream( "/org/apache/commons/digester3/" + name ) );
 
     }
 
-    static final class TestErrorHandler implements ErrorHandler {
+    static final class TestErrorHandler
+        implements ErrorHandler
+    {
         public boolean clean = true;
-        public TestErrorHandler() { }
-        public void error(SAXParseException exception) {
+
+        public TestErrorHandler()
+        {
+        }
+
+        public void error( SAXParseException exception )
+        {
             clean = false;
         }
-        public void fatalError(SAXParseException exception) {
+
+        public void fatalError( SAXParseException exception )
+        {
             clean = false;
         }
-        public void warning(SAXParseException exception) {
+
+        public void warning( SAXParseException exception )
+        {
             clean = false;
         }
     }
 
 }
-



Mime
View raw message