1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| package org.jboss.cache.pojo.notification; |
23 |
| |
24 |
| import junit.framework.Test; |
25 |
| import junit.framework.TestSuite; |
26 |
| |
27 |
| import org.jboss.cache.config.Configuration.CacheMode; |
28 |
| import org.jboss.cache.factories.UnitTestCacheConfigurationFactory; |
29 |
| import org.jboss.cache.pojo.PojoCache; |
30 |
| import org.jboss.cache.pojo.PojoCacheFactory; |
31 |
| import org.jboss.cache.pojo.notification.event.Event; |
32 |
| |
33 |
| |
34 |
| |
35 |
| |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
| public class ReplicatedMapTest extends ListTest |
41 |
| { |
42 |
| private PojoCache listenerCache; |
43 |
| |
44 |
4
| public ReplicatedMapTest(String name)
|
45 |
| { |
46 |
4
| super(name);
|
47 |
| } |
48 |
| |
49 |
4
| protected void setUp() throws Exception
|
50 |
| { |
51 |
4
| super.setUp();
|
52 |
| |
53 |
4
| cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
|
54 |
4
| cache.start();
|
55 |
4
| listenerCache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
|
56 |
4
| listenerCache.start();
|
57 |
4
| listenerCache.addListener(listener);
|
58 |
| } |
59 |
| |
60 |
4
| protected void tearDown() throws Exception
|
61 |
| { |
62 |
4
| super.tearDown();
|
63 |
4
| cache.stop();
|
64 |
4
| listenerCache.stop();
|
65 |
| } |
66 |
| |
67 |
24
| protected void verifyNotification(Event notification)
|
68 |
| { |
69 |
24
| assertSame(listenerCache, notification.getContext().getPojoCache());
|
70 |
24
| assertEquals(false, notification.isLocal());
|
71 |
| } |
72 |
| |
73 |
1
| public static Test suite() throws Exception
|
74 |
| { |
75 |
1
| return new TestSuite(ReplicatedMapTest.class);
|
76 |
| } |
77 |
| |
78 |
0
| public static void main(String[] args) throws Exception
|
79 |
| { |
80 |
0
| junit.textui.TestRunner.run(ReplicatedMapTest.suite());
|
81 |
| } |
82 |
| } |