KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > logicalcobwebs > proxool > configuration > ConfiguratorTest


1 /*
2  * This software is released under a licence similar to the Apache Software Licence.
3  * See org.logicalcobwebs.proxool.package.html for details.
4  * The latest version is available at http://proxool.sourceforge.net
5  */

6 package org.logicalcobwebs.proxool.configuration;
7
8 import org.apache.commons.logging.Log;
9 import org.apache.commons.logging.LogFactory;
10 import org.logicalcobwebs.proxool.AbstractProxoolTest;
11 import org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF;
12 import org.logicalcobwebs.proxool.ProxoolConstants;
13 import org.logicalcobwebs.proxool.ProxoolFacade;
14 import org.logicalcobwebs.proxool.TestConstants;
15 import org.logicalcobwebs.proxool.TestHelper;
16
17 import java.util.Properties JavaDoc;
18
19 /**
20  * Tests that the programatic configuration of Proxool works.
21  *
22  * @version $Revision: 1.16 $, $Date: 2006/01/18 14:40:06 $
23  * @author Bill Horsman (bill@logicalcobwebs.co.uk)
24  * @author $Author: billhorsman $ (current maintainer)
25  * @since Proxool 0.5
26  */

27 public class ConfiguratorTest extends AbstractProxoolTest {
28
29     private static final Log LOG = LogFactory.getLog(ConfiguratorTest.class);
30
31     private static final String JavaDoc TEST_TABLE = "test";
32
33     /**
34      * @see junit.framework.TestCase#TestCase
35      */

36     public ConfiguratorTest(String JavaDoc name) {
37         super(name);
38     }
39
40     public void testConfigurator() throws Exception JavaDoc {
41
42         String JavaDoc testName = "configurator";
43         String JavaDoc alias = testName;
44
45         String JavaDoc url = TestHelper.buildProxoolUrl(alias,
46                 TestConstants.HYPERSONIC_DRIVER,
47                 TestConstants.HYPERSONIC_TEST_URL);
48         Properties JavaDoc info = new Properties JavaDoc();
49         info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER);
50         info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD);
51         ProxoolFacade.registerConnectionPool(url, info);
52
53         Properties JavaDoc newInfo = new Properties JavaDoc();
54         newInfo.setProperty(ProxoolConstants.PROTOTYPE_COUNT_PROPERTY, "3");
55         ProxoolFacade.updateConnectionPool(url, newInfo);
56
57         final ConnectionPoolDefinitionIF cpd = ProxoolFacade.getConnectionPoolDefinition(alias);
58         assertNotNull("definition is null", cpd);
59         assertEquals("prototypeCount", 3, cpd.getPrototypeCount());
60
61     }
62
63 }
64
65 /*
66  Revision history:
67  $Log: ConfiguratorTest.java,v $
68  Revision 1.16 2006/01/18 14:40:06 billhorsman
69  Unbundled Jakarta's Commons Logging.
70
71  Revision 1.15 2003/03/04 10:24:41 billhorsman
72  removed try blocks around each test
73
74  Revision 1.14 2003/03/03 17:09:17 billhorsman
75  all tests now extend AbstractProxoolTest
76
77  Revision 1.13 2003/03/03 11:12:06 billhorsman
78  fixed licence
79
80  Revision 1.12 2003/02/27 18:01:49 billhorsman
81  completely rethought the test structure. it's now
82  more obvious. no new tests yet though.
83
84  Revision 1.11 2003/02/19 15:14:26 billhorsman
85  fixed copyright (copy and paste error,
86  not copyright change)
87
88  Revision 1.10 2003/02/07 10:11:35 billhorsman
89  fix
90
91  Revision 1.9 2003/02/07 09:35:52 billhorsman
92  changed alias for testConfigurator
93
94  Revision 1.8 2003/02/06 17:41:03 billhorsman
95  now uses imported logging
96
97  Revision 1.7 2003/01/22 17:35:03 billhorsman
98  checkstyle
99
100  Revision 1.6 2003/01/18 15:13:14 billhorsman
101  Signature changes (new ProxoolException
102  thrown) on the ProxoolFacade API.
103
104  Revision 1.5 2003/01/17 00:38:12 billhorsman
105  wide ranging changes to clarify use of alias and url -
106  this has led to some signature changes (new exceptions
107  thrown) on the ProxoolFacade API.
108
109  Revision 1.4 2002/12/26 11:35:02 billhorsman
110  Removed test regarding property configurator.
111
112  Revision 1.3 2002/12/16 17:06:53 billhorsman
113  new test structure
114
115  Revision 1.2 2002/12/15 19:41:28 chr32
116  Style fixes.
117
118  Revision 1.1 2002/12/15 19:10:49 chr32
119  Init rev.
120
121  Revision 1.4 2002/12/04 13:20:11 billhorsman
122  ConfigurationListenerIF test
123
124  Revision 1.3 2002/11/09 16:00:45 billhorsman
125  fix doc
126
127  Revision 1.2 2002/11/02 13:57:34 billhorsman
128  checkstyle
129
130  Revision 1.1 2002/11/02 11:37:48 billhorsman
131  New tests
132
133  Revision 1.4 2002/10/29 23:17:38 billhorsman
134  Cleaned up SQL stuff
135
136  Revision 1.3 2002/10/27 13:05:02 billhorsman
137  checkstyle
138
139  Revision 1.2 2002/10/27 12:03:33 billhorsman
140  clear up of tests
141
142  Revision 1.1 2002/10/25 10:41:07 billhorsman
143  draft changes to test globalSetup
144
145 */

146
Popular Tags