KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > persist > db > connectionpool > ConnectionPoolTests


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ConnectionPoolTests.java,v 1.3 2007/01/07 06:14:20 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21
22 package org.opensubsystems.core.persist.db.connectionpool;
23
24 import junit.extensions.TestSetup;
25 import junit.framework.Test;
26 import junit.framework.TestSuite;
27
28 import org.opensubsystems.core.persist.db.DatabaseTestSetup;
29 import org.opensubsystems.core.persist.db.DatabaseTestSuite;
30 import org.opensubsystems.core.persist.db.connectionpool
31
       .C3P0DatabaseConnectionFactoryTest.C3P0DatabaseConnectionFactoryTestInternal;
32 import org.opensubsystems.core.persist.db.connectionpool
33
       .DBCPDatabaseConnectionFactoryTest.DBCPDatabaseConnectionFactoryTestInternal;
34 import org.opensubsystems.core.persist.db.connectionpool
35
       .ProxoolDatabaseConnectionFactoryTest.ProxoolDatabaseConnectionFactoryTestInternal;
36 import org.opensubsystems.core.persist.db.connectionpool
37
       .XAPoolDatabaseConnectionFactoryTest.XAPoolDatabaseConnectionFactoryTestInternal;
38
39 /**
40  * Test suite containing all tests verifying behaviour of different connection
41  * pools.
42  *
43  * @version $Id: ConnectionPoolTests.java,v 1.3 2007/01/07 06:14:20 bastafidli Exp $
44  * @author Miro Halas
45  * @code.reviewer Miro Halas
46  * @code.reviewed Initial revision
47  */

48 public final class ConnectionPoolTests
49 {
50    // Constructors /////////////////////////////////////////////////////////////
51

52    /**
53     * Private constructor since this class cannot be instantiated
54     */

55    private ConnectionPoolTests(
56    )
57    {
58       // Do nothing
59
}
60    
61    // Public methods ///////////////////////////////////////////////////////////
62

63    /**
64     * Create suite of all database driver tests.
65     *
66     * @return Test - suite of tests to run
67     */

68    public static Test suite(
69    )
70    {
71       TestSuite suite = new DatabaseTestSuite("Test for connection pools");
72       addGenericTests(suite);
73       TestSetup wrapper = new DatabaseTestSetup(suite);
74
75       return wrapper;
76    }
77
78    /**
79     * Add all generic database tests to given suite.
80     *
81     * @param suite - suite to add tests to
82     */

83    public static void addGenericTests(
84       TestSuite suite
85    )
86    {
87       suite.addTestSuite(C3P0DatabaseConnectionFactoryTestInternal.class);
88       suite.addTestSuite(DBCPDatabaseConnectionFactoryTestInternal.class);
89       suite.addTestSuite(ProxoolDatabaseConnectionFactoryTestInternal.class);
90       suite.addTestSuite(XAPoolDatabaseConnectionFactoryTestInternal.class);
91    }
92 }
93
Popular Tags