1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package org.jboss.cache.loader; |
8 |
| |
9 |
| import org.apache.commons.logging.Log; |
10 |
| import org.apache.commons.logging.LogFactory; |
11 |
| |
12 |
| import java.util.Properties; |
13 |
| |
14 |
| import junit.framework.Test; |
15 |
| import junit.framework.TestSuite; |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| public class C3p0JDBCCacheLoaderTest extends JDBCCacheLoaderTest |
24 |
| { |
25 |
| private static final Log log = LogFactory.getLog(C3p0JDBCCacheLoaderTest.class); |
26 |
| private static final String CF_CLASS = "org.jboss.cache.loader.C3p0ConnectionFactory"; |
27 |
| |
28 |
60
| public C3p0JDBCCacheLoaderTest(String name)
|
29 |
| { |
30 |
60
| super(name);
|
31 |
| } |
32 |
| |
33 |
60
| protected void configureCache() throws Exception
|
34 |
| { |
35 |
60
| Properties prop = getProperties();
|
36 |
| |
37 |
60
| String props = "cache.jdbc.driver =" + prop.getProperty("cache.jdbc.driver") + "\n" +
|
38 |
| "cache.jdbc.url=" + prop.getProperty("cache.jdbc.url") + "\n" + |
39 |
| "cache.jdbc.user=" + prop.getProperty("cache.jdbc.user") + "\n" + |
40 |
| "cache.jdbc.password=" + prop.getProperty("cache.jdbc.password") + "\n" + |
41 |
| "cache.jdbc.node.type=" + prop.getProperty("cache.jdbc.node.type") + "\n" + |
42 |
| "cache.jdbc.connection.factory=" + CF_CLASS; |
43 |
| |
44 |
60
| cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig("",
|
45 |
| "org.jboss.cache.loader.JDBCCacheLoader", props, false, true, false)); |
46 |
| } |
47 |
| |
48 |
1
| public static Test suite()
|
49 |
| { |
50 |
1
| return new TestSuite(C3p0JDBCCacheLoaderTest.class);
|
51 |
| } |
52 |
| } |