KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > tests > aop > RecursiveRefAopTest


1 package org.jboss.cache.tests.aop;
2
3 import junit.framework.TestCase;
4 import org.apache.commons.logging.Log;
5 import org.apache.commons.logging.LogFactory;
6 import org.jboss.cache.PropertyConfigurator;
7 import org.jboss.cache.aop.TreeCacheAop;
8
9 import java.util.HashMap JavaDoc;
10 import java.util.Map JavaDoc;
11
12 public class RecursiveRefAopTest extends TestCase
13 {
14    private static final String JavaDoc CONFIG_FILENAME = "META-INF/local-service.xml";
15    private TreeCacheAop treeCache;
16    Log log=LogFactory.getLog(ReplicatedAopTest.class);
17
18    private Map JavaDoc cachedMap;
19
20    public RecursiveRefAopTest(String JavaDoc name)
21    {
22       super(name);
23    }
24
25    protected void setUp() throws Exception JavaDoc
26    {
27       super.setUp();
28       log.info("setUp() ....");
29       treeCache = new TreeCacheAop();
30
31       PropertyConfigurator cacheConfig = new PropertyConfigurator();
32       cacheConfig.configure(treeCache, CONFIG_FILENAME);
33       treeCache.startService();
34       treeCache.putObject("/aop/test", new HashMap JavaDoc());
35       cachedMap = (Map JavaDoc) treeCache.getObject("/aop/test");
36    }
37
38    protected void tearDown() throws Exception JavaDoc
39    {
40       super.tearDown();
41    }
42
43    public void testDummy() {
44
45    }
46
47    /**
48     * This test feature is not currently supported now since we can't support key is non-primitive object
49     * that overrides the hashCode().
50     */

51    public void XtestRecuriveMapKey()
52    {
53       try {
54          IdObject id = new IdObject("1");
55          ValueObject value = new ValueObject(id, 3.0f);
56          cachedMap.put(id, value);
57       } // try
58
catch (Exception JavaDoc x) {
59          x.printStackTrace();
60          fail("testFailed");
61       } // catch
62
} // initCache
63

64
65 } // class TestRunner
66

67
68
Popular Tags