01: ///////////////////////////////
02: // Makumba, Makumba tag library
03: // Copyright (C) 2000-2003 http://www.makumba.org
04: //
05: // This library is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU Lesser General Public
07: // License as published by the Free Software Foundation; either
08: // version 2.1 of the License, or (at your option) any later version.
09: //
10: // This library is distributed in the hope that it will be useful,
11: // but WITHOUT ANY WARRANTY; without even the implied warranty of
12: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: // Lesser General Public License for more details.
14: //
15: // You should have received a copy of the GNU Lesser General Public
16: // License along with this library; if not, write to the Free Software
17: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: //
19: // -------------
20: // $Id: config.java 2119 2007-11-22 01:12:14Z cristian_bogdan $
21: // $Name$
22: /////////////////////////////////////
23:
24: package test;
25:
26: import junit.framework.Test;
27: import junit.framework.TestCase;
28: import junit.framework.TestSuite;
29:
30: import org.makumba.ConfigFileError;
31: import org.makumba.Transaction;
32: import org.makumba.MakumbaSystem;
33: import org.makumba.providers.TransactionProvider;
34:
35: /**
36: * Testing configuration related operations
37: * @author Stefan Baebler
38: */
39: public class config extends TestCase {
40: public config(String name) {
41: super (name);
42: }
43:
44: public static void main(String[] args) {
45: junit.textui.TestRunner.run(suite());
46: }
47:
48: public static Test suite() {
49: return new TestSuite(config.class);
50: }
51:
52: private TransactionProvider tp = new TransactionProvider();
53:
54: public void testBiuldInfo() {
55: System.out.println("\nTesting Makumba version: "
56: + MakumbaSystem.getVersion() + "\n built on: "
57: + MakumbaSystem.getBuildDate()
58: + "\n using locale: "
59: + MakumbaSystem.getLocale());
60: }
61:
62: public void testNoDefaultDB() {
63: try {
64: String defaultDB = tp.getDefaultDataSourceName();
65: fail("Should raise ConfigFileError, but found: "
66: + defaultDB);
67: } catch (ConfigFileError e) {
68: }
69: }
70:
71: /**
72: * http://bugzilla.makumba.org/cgi-bin/bugzilla/show_bug.cgi?id=527
73: * but wasn not discussed since then
74: */
75: public void DISABLED_testDBDiscovery() {
76: String preferredDB = tp
77: .getDataSourceName("test/testDatabase.properties");
78: // TODO change Database to Transaction
79: Transaction db = tp.getConnectionTo(preferredDB);
80: assertEquals(preferredDB, db.getName());
81: db.close();
82: }
83:
84: }
|