portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/rdbms/src/test/org/apache/jetspeed/components TestRDBMS.java
Date Thu, 27 May 2004 22:01:03 GMT
weaver      2004/05/27 15:01:03

  Modified:    components/rdbms/src/test/org/apache/jetspeed/components
                        TestRDBMS.java
  Added:       components/rdbms/src/test log4j.properties
  Removed:     components/rdbms/src/test Log4j.properties
               components/rdbms/src/java/org/apache/jetspeed/containers
                        rdbms.container.groovy
  Log:
  JS2-59 <http://nagoya.apache.org/jira/browse/JS2-59>
  lc'd log4j.properties
  
  Revision  Changes    Path
  1.2       +43 -0     jakarta-jetspeed-2/components/rdbms/src/test/log4j.properties
  
  
  
  
  1.7       +12 -12    jakarta-jetspeed-2/components/rdbms/src/test/org/apache/jetspeed/components/TestRDBMS.java
  
  Index: TestRDBMS.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/rdbms/src/test/org/apache/jetspeed/components/TestRDBMS.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestRDBMS.java	27 May 2004 19:41:36 -0000	1.6
  +++ TestRDBMS.java	27 May 2004 22:01:03 -0000	1.7
  @@ -21,11 +21,14 @@
   import javax.sql.DataSource;
   
   import junit.framework.Test;
  +import junit.framework.TestCase;
  +import junit.framework.TestSuite;
   
   import org.apache.jetspeed.components.datasource.BoundDBCPDatasourceComponent;
   import org.apache.jetspeed.components.datasource.DBCPDatasourceComponent;
   import org.apache.jetspeed.components.datasource.DatasourceComponent;
   import org.apache.jetspeed.components.jndi.JNDIComponent;
  +import org.apache.jetspeed.components.util.DatasourceTestCase;
   import org.picocontainer.MutablePicoContainer;
   /**
    * <p>
  @@ -36,13 +39,12 @@
    * @version $ $
    *  
    */
  -public class TestRDBMS extends AbstractComponentAwareTestCase
  +public class TestRDBMS extends DatasourceTestCase
   {
       public static Test suite()
       {
  -        ComponentAwareTestSuite suite = new ComponentAwareTestSuite(TestRDBMS.class);
  -        suite.setScript("org/apache/jetspeed/containers/rdbms.container.groovy");
  -        return suite;
  +        // All methods starting with "test" will be executed in the test suite.
  +        return new TestSuite(TestRDBMS.class);
       }
       /**
        * Defines the testcase name for JUnit.
  @@ -52,27 +54,25 @@
        */
       public TestRDBMS(String name)
       {
  -        super(name, "./src/test/Log4j.properties");
  +        super(name);
       }
       
       public void testDBCP_1() throws Exception
       {
           assertTrue(DatasourceComponent.class.isAssignableFrom(DBCPDatasourceComponent.class));
  -        MutablePicoContainer defaultContainer = getComponentManager().getRootContainer();
  -        DatasourceComponent dsc = (DatasourceComponent) defaultContainer
  -        .getComponentInstance(DatasourceComponent.class);
  +
           InitialContext context = new InitialContext();
           //look up from jndi
           assertNotNull(context.lookup("java:comp/env/jdbc/jetspeed"));
  -        assertNotNull(dsc);
  -        DataSource ds = dsc.getDatasource();
  +        assertNotNull(datasourceComponent);
  +        DataSource ds = datasourceComponent.getDatasource();
           assertNotNull(ds);
           Connection conn = ds.getConnection();
           assertNotNull(conn);
           assertFalse(conn.isClosed());
           conn.close();
  -        ((BoundDBCPDatasourceComponent)dsc).stop();
  -        JNDIComponent jndi = (JNDIComponent)defaultContainer.getComponentInstance(JNDIComponent.class);
  +        ((BoundDBCPDatasourceComponent)datasourceComponent).stop();
  +        
           
           try
           {
  
  
  

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


Mime
View raw message