db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/broker HsqldbShutdown.java AllTests.java
Date Wed, 02 Feb 2005 20:10:26 GMT
brj         2005/02/02 12:10:26

  Modified:    src/test/org/apache/ojb/broker AllTests.java
  Added:       src/test/org/apache/ojb/broker HsqldbShutdown.java
  Log:
  shutdown hsql after broker.AllTests
  
  Revision  Changes    Path
  1.60      +1 -1      db-ojb/src/test/org/apache/ojb/broker/AllTests.java
  
  Index: AllTests.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/AllTests.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- AllTests.java	2 Feb 2005 20:03:15 -0000	1.59
  +++ AllTests.java	2 Feb 2005 20:10:26 -0000	1.60
  @@ -128,7 +128,7 @@
           suite.addTestSuite(NoPkReferenceTest.class);
           
           // BRJ: ensure shutdown of hsqldb
  -        // suite.addTestSuite(HsqldbShutdown.class);        
  +        suite.addTestSuite(HsqldbShutdown.class);        
           return suite;
       }
   }
  
  
  
  1.1                  db-ojb/src/test/org/apache/ojb/broker/HsqldbShutdown.java
  
  Index: HsqldbShutdown.java
  ===================================================================
  package org.apache.ojb.broker;
  
  /* Copyright 2003-2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  import java.sql.Connection;
  import java.sql.SQLException;
  import java.sql.Statement;
  
  import org.apache.ojb.broker.platforms.Platform;
  import org.apache.ojb.broker.platforms.PlatformHsqldbImpl;
  import org.apache.ojb.junit.PBTestCase;
  
  /**
   * Performs a shutdown of hsqldb.
   *
   * @author <a href="mailto:jbraeuchi@gmx.ch">Jakob Braeuchi</a>
   * @version $Id: HsqldbShutdown.java,v 1.1 2005/02/02 20:10:26 brj Exp $
   */
  public class HsqldbShutdown extends PBTestCase
  {
      public void testHsqldbShutdown()
      {
          Platform platform = broker.serviceConnectionManager().getSupportedPlatform();
  
          if(platform instanceof PlatformHsqldbImpl)
          {
              Connection con = null;
              Statement stmt = null;
              
              try
              {
                  con = broker.serviceConnectionManager().getConnection();
                  stmt = con.createStatement();
                  stmt.execute("shutdown");
              }
              catch (Exception e)
              {
                  e.printStackTrace();
              }
              finally
              {
                  try
                  {
                      stmt.close();
                      con.close();
                  }
                  catch (SQLException e1)
                  {
                      e1.printStackTrace();
                  }
              }
          }
  
      }
  }
  
  
  

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


Mime
View raw message