KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cache > test > generic > PropertyConfiguratorUnitTestCase


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.test.cache.test.generic;
8
9
10 import junit.framework.Test;
11 import junit.framework.TestCase;
12 import junit.framework.TestSuite;
13 import org.jboss.cache.PropertyConfigurator;
14 import org.jboss.cache.TreeCache;
15
16 /**
17  * @version $Revision: 1.4 $
18  */

19 public class PropertyConfiguratorUnitTestCase extends TestCase
20 {
21
22    public PropertyConfiguratorUnitTestCase(String JavaDoc s)
23    {
24       super(s);
25    }
26
27    public void setUp() throws Exception JavaDoc
28    {
29       super.setUp();
30    }
31
32    public void tearDown() throws Exception JavaDoc
33    {
34       super.tearDown();
35    }
36
37    public void testConfigure()
38    {
39       try {
40          TreeCache cache = new TreeCache();
41          PropertyConfigurator config = new PropertyConfigurator();
42          config.configure(cache, "META-INF/local-service.xml");
43          log("Cluster properties: " + cache.getClusterProperties());
44       } catch (Exception JavaDoc ex) {
45          ex.printStackTrace();
46          fail(ex.toString());
47       }
48    }
49
50    void log(String JavaDoc msg)
51    {
52       System.out.println("-- " + msg);
53    }
54
55    public static Test suite()
56    {
57       return new TestSuite(PropertyConfiguratorUnitTestCase.class);
58    }
59
60    public static void main(String JavaDoc[] args)
61    {
62       junit.textui.TestRunner.run(suite());
63    }
64
65 }
66
Popular Tags