01: /*
02: * $Id: VendorNameTest.java,v 1.3 2004/10/05 20:13:04 spal Exp $
03: * $Source: /cvsroot/sqlunit/sqlunit/test/java/VendorNameTest.java,v $
04: * SQLUnit - a test harness for unit testing database stored procedures.
05: * Copyright (C) 2003 The SQLUnit Team
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * as published by the Free Software Foundation; either version 2
10: * of the License, or (at your option) any later version.
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: package net.sourceforge.sqlunit.test;
22:
23: import junit.framework.Test;
24: import junit.framework.TestCase;
25: import junit.framework.TestSuite;
26:
27: import java.sql.Connection;
28: import java.sql.DriverManager;
29:
30: /**
31: * Tests for vendor name.
32: * @author Sujit Pal (spal@users.sourceforge.net)
33: * @version $Revision: 1.3 $
34: */
35: public class VendorNameTest extends TestCase {
36:
37: /**
38: * Boilerplate main method.
39: * @param argv the arguments (none).
40: */
41: public static void main(final String[] argv) {
42: junit.textui.TestRunner.run(suite());
43: }
44:
45: /**
46: * Boilerplate suite() method.
47: * @return a Test object.
48: */
49: public static Test suite() {
50: return new TestSuite(VendorNameTest.class);
51: }
52:
53: /**
54: * Boilerplate constructor.
55: * @param name the name of this test class.
56: */
57: public VendorNameTest(final String name) {
58: super (name);
59: }
60:
61: /**
62: * Checking to see what the product name is for MockDatabase.
63: * @exception Exception if there was a problem.
64: */
65: public final void testWhatItLooksLike() throws Exception {
66: Class
67: .forName("net.sourceforge.sqlunit.test.mock.SQLUnitMockDriver");
68: Connection conn = DriverManager
69: .getConnection(
70: "jdbc:mock:net.sourceforge.sqlunit.test.mock.SQLUnitMockDatabase",
71: "defaultuser", "defaultuser");
72: assertEquals("Bad product name returned", "MockDatabase", conn
73: .getMetaData().getDatabaseProductName());
74: }
75: }
|