You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by eb...@apache.org on 2004/06/02 19:18:01 UTC

cvs commit: jakarta-commons/configuration/src/test/org/apache/commons/configuration TestConfigurationXMLDocument.java TestJNDIEnvironmentValues.java TestStrictConfigurationComparator.java

ebourg      2004/06/02 10:18:01

  Modified:    configuration/src/test/org/apache/commons/configuration
                        TestConfigurationXMLDocument.java
                        TestJNDIEnvironmentValues.java
                        TestStrictConfigurationComparator.java
  Log:
  Removed useless constructors in the test cases
  
  Revision  Changes    Path
  1.7       +6 -12     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestConfigurationXMLDocument.java
  
  Index: TestConfigurationXMLDocument.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestConfigurationXMLDocument.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestConfigurationXMLDocument.java	4 May 2004 22:14:29 -0000	1.6
  +++ TestConfigurationXMLDocument.java	2 Jun 2004 17:18:01 -0000	1.7
  @@ -45,13 +45,8 @@
       private ConfigurationFactory configFactory;
       private ConfigurationXMLDocument configDoc;
       
  -    private ArrayList tables;
  +    private List tables;
       private int counter;
  -    
  -    public TestConfigurationXMLDocument(String arg0)
  -    {
  -        super(arg0);
  -    }
   
       protected void setUp() throws Exception
       {
  @@ -143,8 +138,7 @@
           assertEquals("tiger", cd.getPasswd()); 
       }
       
  -    private void checkDocument(Document doc, String root)
  -    throws Exception
  +    private void checkDocument(Document doc, String root) throws Exception
       {
           Element rt = doc.getRootElement();
           assertEquals(root, rt.getName());
  @@ -161,8 +155,7 @@
           checkAttribute(rt, "connection.class.property(1)", "value", "scott");
       }
       
  -    private void checkDocument(org.w3c.dom.Document doc, String root)
  -    throws Exception
  +    private void checkDocument(org.w3c.dom.Document doc, String root) throws Exception
       {
           DOMReader reader = new DOMReader();
           checkDocument(reader.read(doc), root);
  @@ -289,6 +282,7 @@
       /**
        * Helper method for counting the number of occurrences of a certain
        * element constellation in a XML string.
  +     *
        * @param match the match string for the element constellation
        * @param doc the XML as string
        * @return the number of occurrences
  @@ -390,7 +384,7 @@
       public static class Table
       {
           /** Stores the list of fields.*/
  -        private ArrayList fields;
  +        private List fields;
           
           /** Stores the table name.*/
           private String name;
  
  
  
  1.5       +5 -15     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestJNDIEnvironmentValues.java
  
  Index: TestJNDIEnvironmentValues.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestJNDIEnvironmentValues.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestJNDIEnvironmentValues.java	4 May 2004 22:14:29 -0000	1.4
  +++ TestJNDIEnvironmentValues.java	2 Jun 2004 17:18:01 -0000	1.5
  @@ -24,11 +24,7 @@
   public class TestJNDIEnvironmentValues extends TestCase
   {
       private JNDIConfiguration conf = null;
  -    public TestJNDIEnvironmentValues(String testName)
  -    {
  -        super(testName);
  -    }
  -    
  +
       public void setUp() throws Exception{
           System.setProperty("java.naming.factory.initial","org.apache.commons.configuration.MockStaticMemoryInitialContextFactory");
           
  @@ -38,14 +34,12 @@
   
       public void testSimpleGet() throws Exception
       {
  -        
           String s = conf.getString("test.key");
           assertEquals("jndivalue", s);
       }
   
       public void testMoreGets() throws Exception
       {
  -
           String s = conf.getString("test.key");
           assertEquals("jndivalue", s);
           assertEquals("jndivalue2", conf.getString("test.key2"));
  @@ -63,26 +57,22 @@
           {
               assertTrue(nsee.getMessage(),nsee.getMessage().indexOf("test.imaginarykey")!=-1);
           }
  -
       }
  +
       public void testGetMissingKeyWithDefault() throws Exception
       {
  -
           String result = conf.getString("test.imaginarykey", "bob");
           assertEquals("bob", result);
  -
       }
  +
       public void testContainsKey() throws Exception
       {
  -
           assertTrue(conf.containsKey("test.key"));
  -
           assertTrue(!conf.containsKey("test.imaginerykey"));
  -
       }
       
  -    public void testClearProperty() {
  -
  +    public void testClearProperty()
  +    {
           assertNotNull("null short for the 'test.short' key", conf.getShort("test.short", null));
           conf.clearProperty("test.short");
           assertNull("'test.short' property not cleared", conf.getShort("test.short", null));
  
  
  
  1.3       +0 -10     jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestStrictConfigurationComparator.java
  
  Index: TestStrictConfigurationComparator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestStrictConfigurationComparator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestStrictConfigurationComparator.java	27 Feb 2004 17:41:34 -0000	1.2
  +++ TestStrictConfigurationComparator.java	2 Jun 2004 17:18:01 -0000	1.3
  @@ -36,16 +36,6 @@
       protected Configuration configuration = new BaseConfiguration();
   
       /**
  -     * Constructor.
  -     *
  -     * @param testName The test name
  -     */
  -    public TestStrictConfigurationComparator(String testName)
  -    {
  -        super(testName);
  -    }
  -
  -    /**
        * Tests the comparator.
        */
       public void testCompare()
  
  
  

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