commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/chain/src/test/org/apache/commons/chain/impl CatalogFactoryBaseTestCase.java
Date Mon, 18 Oct 2004 01:09:06 GMT
craigmcc    2004/10/17 18:09:06

  Modified:    chain/src/test/org/apache/commons/chain/config
                        ConfigParser2TestCase.java
                        ConfigParserTestCase.java test-config-2.xml
                        test-config.xml
               chain/src/test/org/apache/commons/chain/impl
                        CatalogFactoryBaseTestCase.java
  Log:
  Update tests to reflect the modified APIs and logic.
  
  Revision  Changes    Path
  1.2       +1 -0      jakarta-commons/chain/src/test/org/apache/commons/chain/config/ConfigParser2TestCase.java
  
  Index: ConfigParser2TestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/chain/src/test/org/apache/commons/chain/config/ConfigParser2TestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConfigParser2TestCase.java	16 Jul 2004 19:06:01 -0000	1.1
  +++ ConfigParser2TestCase.java	18 Oct 2004 01:09:05 -0000	1.2
  @@ -330,6 +330,7 @@
       // Load the specified catalog from the specified resource path
       protected void load(String path) throws Exception {
           parser.parse(catalog, this.getClass().getResource(path));
  +        catalog = CatalogFactoryBase.getInstance().getCatalog("foo");
       }
   
   
  
  
  
  1.8       +2 -1      jakarta-commons/chain/src/test/org/apache/commons/chain/config/ConfigParserTestCase.java
  
  Index: ConfigParserTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/chain/src/test/org/apache/commons/chain/config/ConfigParserTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConfigParserTestCase.java	16 Jul 2004 17:53:39 -0000	1.7
  +++ ConfigParserTestCase.java	18 Oct 2004 01:09:06 -0000	1.8
  @@ -327,7 +327,8 @@
   
       // Load the specified catalog from the specified resource path
       protected void load(String path) throws Exception {
  -        parser.parse(catalog, this.getClass().getResource(path));
  +        parser.parse(this.getClass().getResource(path));
  +        catalog = CatalogFactoryBase.getInstance().getCatalog();
       }
   
   
  
  
  
  1.2       +2 -2      jakarta-commons/chain/src/test/org/apache/commons/chain/config/test-config-2.xml
  
  Index: test-config-2.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/chain/src/test/org/apache/commons/chain/config/test-config-2.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test-config-2.xml	16 Jul 2004 19:06:01 -0000	1.1
  +++ test-config-2.xml	18 Oct 2004 01:09:06 -0000	1.2
  @@ -1,4 +1,4 @@
  -<chains>
  +<catalog name="foo">
   
     <!-- Define command and chain aliases -->
     <define    name="adding-command"
  @@ -95,4 +95,4 @@
                                        id3="c"/>
     </test-chain>
   
  -</chains>
  +</catalog>
  
  
  
  1.2       +2 -2      jakarta-commons/chain/src/test/org/apache/commons/chain/config/test-config.xml
  
  Index: test-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/chain/src/test/org/apache/commons/chain/config/test-config.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test-config.xml	11 Aug 2003 04:44:18 -0000	1.1
  +++ test-config.xml	18 Oct 2004 01:09:06 -0000	1.2
  @@ -1,4 +1,4 @@
  -<chains>
  +<catalog>
   
     <!-- Single command "chains" from CatalogBaseTestCase -->
     <command   name="AddingCommand"
  @@ -99,4 +99,4 @@
           className="org.apache.commons.chain.impl.NonDelegatingFilter"/>
     </chain>
   
  -</chains>
  +</catalog>
  
  
  
  1.2       +7 -11     jakarta-commons/chain/src/test/org/apache/commons/chain/impl/CatalogFactoryBaseTestCase.java
  
  Index: CatalogFactoryBaseTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/chain/src/test/org/apache/commons/chain/impl/CatalogFactoryBaseTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CatalogFactoryBaseTestCase.java	17 Oct 2004 22:39:00 -0000	1.1
  +++ CatalogFactoryBaseTestCase.java	18 Oct 2004 01:09:06 -0000	1.2
  @@ -22,7 +22,6 @@
   import org.apache.commons.chain.CatalogFactory;
   import org.apache.commons.chain.Command;
   import org.apache.commons.chain.impl.CatalogBase;
  -import org.apache.commons.chain.impl.CatalogFactoryBase;
   import java.util.Iterator;
   
   /**
  @@ -64,7 +63,7 @@
        * <p>Set up instance variables required by this test case.</p>
        */
       public void setUp() {
  -        factory = CatalogFactoryBase.getInstance();
  +        factory = CatalogFactory.getInstance();
       }
   
   
  @@ -93,11 +92,7 @@
   
           Catalog catalog = new CatalogBase();
           factory.setCatalog(catalog);
  -        assertEquals(catalog, factory.getCatalog());
  -        assertEquals(catalog,
  -               factory.getCatalog("org.apache.commons.chain.DEFAULT_CATALOG"));
  -        assertEquals(1, getCatalogCount());
  -        factory.clear();
  +        assertTrue(catalog == factory.getCatalog());
           assertEquals(0, getCatalogCount());
   
       }
  @@ -126,11 +121,12 @@
           catalog = new CatalogBase();
           factory.addCatalog("foo", catalog);
           assertTrue(catalog == factory.getCatalog("foo"));
  -        assertEquals(2, getCatalogCount());
  +        assertEquals(1, getCatalogCount());
           factory.addCatalog("foo", new CatalogBase());
  -        assertEquals(2, getCatalogCount());
  +        assertEquals(1, getCatalogCount());
           assertTrue(!(catalog == factory.getCatalog("foo")));
  -        factory.clear();
  +        CatalogFactory.clear();
  +        factory = CatalogFactory.getInstance();
           assertEquals(0, getCatalogCount());
   
       }
  
  
  

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


Mime
View raw message