KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > persist > db > driver > DriverTests


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: DriverTests.java,v 1.14 2007/01/07 06:14:51 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.driver;
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.driver.AddBatchTest.AddBatchTestInternal;
31 import org.opensubsystems.core.persist.db.driver
32
       .DBProcReturnInsertedRowsCountTest.DBProcReturnInsertedRowsCountTestInternal;
33 import org.opensubsystems.core.persist.db.driver
34
       .DateTest.DateTestInternal;
35 import org.opensubsystems.core.persist.db.driver
36
       .DeleteWithSubqueryTest.DeleteWithSubqueryTestInternal;
37 import org.opensubsystems.core.persist.db.driver
38
       .GeneratedKeyTest.GeneratedKeyTestInternal;
39 import org.opensubsystems.core.persist.db.driver
40
       .PreparedStatementTest.PreparedStatementTestInternal;
41 import org.opensubsystems.core.persist.db.driver.QueryTest.QueryTestInternal;
42 import org.opensubsystems.core.persist.db.driver.SameColumnTest.SameColumnTestInternal;
43 import org.opensubsystems.core.persist.db.driver
44
       .SelectAfterInsertIntoUniqueColumnTest.SelectAfterInsertIntoUniqueColumnTestInternal;
45 import org.opensubsystems.core.persist.db.driver
46
       .SetNullColumnTest.SetNullColumnTestInternal;
47 import org.opensubsystems.core.persist.db.driver.TimeTest.TimeTestInternal;
48 import org.opensubsystems.core.persist.db.driver.TimestampTest.TimestampTestInternal;
49 import org.opensubsystems.core.persist.db.driver.TransactionTest.TransactionTestInternal;
50 import org.opensubsystems.core.persist.db.driver
51
       .UpdatableResultSetTest.UpdatableResultSetTestInternal;
52 import org.opensubsystems.core.persist.db.driver
53
       .UpdateDBProcWithoutOutputTest.UpdateDBProcWithoutOutputTestInternal;
54
55 /**
56  * Test suite containing all tests verifying behaviour of different database
57  * drivers.
58  *
59  * @version $Id: DriverTests.java,v 1.14 2007/01/07 06:14:51 bastafidli Exp $
60  * @author Miro Halas
61  * @code.reviewer Miro Halas
62  * @code.reviewed 1.10 2005/07/29 07:36:55 bastafidli
63  */

64 public final class DriverTests
65 {
66    // Constructors /////////////////////////////////////////////////////////////
67

68    /**
69     * Private constructor since this class cannot be instantiated
70     */

71    private DriverTests(
72    )
73    {
74       // Do nothing
75
}
76    
77    // Public methods ///////////////////////////////////////////////////////////
78

79    /**
80     * Create suite of all database driver tests.
81     *
82     * @return Test - suite of tests to run
83     */

84    public static Test suite(
85    )
86    {
87       TestSuite suite = new DatabaseTestSuite("Test for database driver");
88       addGenericTests(suite);
89       TestSetup wrapper = new DatabaseTestSetup(suite);
90
91       return wrapper;
92    }
93
94    /**
95     * Add all generic database tests to given suite.
96     *
97     * @param suite - suite to add tests to
98     */

99    public static void addGenericTests(
100       TestSuite suite
101    )
102    {
103       suite.addTestSuite(AddBatchTestInternal.class);
104       suite.addTestSuite(DateTestInternal.class);
105       suite.addTestSuite(DBProcReturnInsertedRowsCountTestInternal.class);
106       suite.addTestSuite(DeleteWithSubqueryTestInternal.class);
107       suite.addTestSuite(GeneratedKeyTestInternal.class);
108       suite.addTestSuite(PreparedStatementTestInternal.class);
109       suite.addTestSuite(QueryTestInternal.class);
110       suite.addTestSuite(SameColumnTestInternal.class);
111       suite.addTestSuite(SelectAfterInsertIntoUniqueColumnTestInternal.class);
112       suite.addTestSuite(SetNullColumnTestInternal.class);
113       suite.addTestSuite(TimestampTestInternal.class);
114       suite.addTestSuite(TimeTestInternal.class);
115       suite.addTestSuite(TransactionTestInternal.class);
116       suite.addTestSuite(UpdatableResultSetTestInternal.class);
117       suite.addTestSuite(UpdateDBProcWithoutOutputTestInternal.class);
118    }
119 }
120
Popular Tags