View Javadoc

1   /**
2    *  Copyright 2003-2006 Greg Luck
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  
17  package net.sf.ehcache.distribution;
18  
19  import net.sf.ehcache.CacheManager;
20  import net.sf.ehcache.AbstractCacheTest;
21  
22  /**
23   * @author <a href="mailto:gluck@thoughtworks.com">Greg Luck</a>
24   * @version $Id: ManualRMIPeerProviderTest.java 51 2006-04-24 09:21:10Z gregluck $
25   */
26  public class ManualRMIPeerProviderTest extends MulticastRMIPeerProviderTest {
27  
28  
29      /**
30       * {@inheritDoc}
31       */
32      protected void setUp() throws Exception {
33          if (JVMUtil.isSingleRMIRegistryPerVM()) {
34              return;
35          }
36  
37          manager1 = new CacheManager(AbstractCacheTest.TEST_CONFIG_DIR + "distribution/ehcache-manual-distributed1.xml");
38          manager2 = new CacheManager(AbstractCacheTest.TEST_CONFIG_DIR + "distribution/ehcache-manual-distributed2.xml");
39  
40          //Allow cluster setup
41          Thread.sleep(100);
42      }
43  
44      /**
45       * The manual test only has two CacheManagers in the cluster, so there is only ever one other.
46       */
47      protected int expectedPeers() {
48          return 1;
49      }
50  
51  
52  }