KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > tests > JDBCCacheLoaderTest


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.cache.tests;
8
9 import junit.framework.Test;
10 import junit.framework.TestSuite;
11
12 import java.util.Properties JavaDoc;
13
14 /**
15  * This test has MySQL hard-coded. To run it, run MySQL first: mysqld -u=root
16  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
17  * @version <tt>$Revision: 1.4.2.1 $</tt>
18  */

19 public class JDBCCacheLoaderTest
20    extends CacheLoaderTestsBase
21 {
22
23    protected void configureCache() throws Exception JavaDoc
24    {
25       cache.setCacheLoaderClass("org.jboss.cache.loader.JDBCCacheLoader");
26       Properties JavaDoc props=new Properties JavaDoc();
27       // hard-coding MySQL for now...
28
props.setProperty("cache.jdbc.driver", "com.mysql.jdbc.Driver");
29       props.setProperty("cache.jdbc.url", "jdbc:mysql://localhost:3306/jbossdb");
30       props.setProperty("cache.jdbc.user", "root");
31       props.setProperty("cache.jdbc.password", "");
32       cache.setCacheLoaderConfig(props);
33    }
34
35    public static Test suite()
36    {
37       return new TestSuite(JDBCCacheLoaderTest.class);
38    }
39 }
40
Popular Tags