1 |
| package org.jboss.cache.passivation; |
2 |
| |
3 |
| import junit.framework.Test; |
4 |
| import junit.framework.TestSuite; |
5 |
| import org.jboss.cache.CacheImpl; |
6 |
| import org.jboss.cache.DefaultCacheFactory; |
7 |
| import org.jboss.cache.config.Configuration; |
8 |
| import org.jboss.cache.loader.DelegatingCacheLoader; |
9 |
| import org.jboss.cache.loader.LocalDelegatingCacheLoader; |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| public class PassivationToLocalDelegatingCacheLoaderTest extends PassivationTestsBase |
18 |
| { |
19 |
| CacheImpl delegating_cache; |
20 |
| DelegatingCacheLoader cache_loader; |
21 |
| |
22 |
| |
23 |
45
| protected void configureCache() throws Exception
|
24 |
| { |
25 |
45
| delegating_cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
|
26 |
45
| delegating_cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
|
27 |
45
| delegating_cache.create();
|
28 |
45
| delegating_cache.start();
|
29 |
45
| cache_loader = new LocalDelegatingCacheLoader(delegating_cache);
|
30 |
| |
31 |
45
| cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig("", "org.jboss.cache.loader.LocalDelegatingCacheLoader", "", false, false));
|
32 |
| |
33 |
45
| cache.setCacheLoader(cache_loader);
|
34 |
| } |
35 |
| |
36 |
45
| protected void tearDown() throws Exception
|
37 |
| { |
38 |
45
| super.tearDown();
|
39 |
45
| delegating_cache.stop();
|
40 |
45
| delegating_cache.destroy();
|
41 |
| } |
42 |
| |
43 |
1
| public void testLoadAndStore() throws Exception
|
44 |
| { |
45 |
| |
46 |
| |
47 |
| } |
48 |
| |
49 |
| |
50 |
1
| public static Test suite()
|
51 |
| { |
52 |
1
| return new TestSuite(PassivationToLocalDelegatingCacheLoaderTest.class);
|
53 |
| } |
54 |
| |
55 |
| |
56 |
0
| public static void main(String[] args)
|
57 |
| { |
58 |
0
| junit.textui.TestRunner.run(suite());
|
59 |
| } |
60 |
| |
61 |
| } |