1   package jgroup.arm;
2   
3   import jgroup.core.ConfigManager;
4   import jgroup.core.ConfigurationException;
5   import jgroup.core.arm.DistributionScheme;
6   import jgroup.relacs.config.AppConfig;
7   import jgroup.relacs.config.DistributedSystemConfig;
8   import junit.framework.TestCase;
9   
10  public class ReplicaCountTest extends TestCase
11  {
12  
13    private int gid = 200;
14    private DistributionScheme ds;
15    private AppConfig app;
16  
17    public static ReplicaCount getReplicaCount(int gid) throws ConfigurationException
18    {
19      String siteconfig = System.getProperty("jgroup.system.config",
20          "file:target/classes/siteconfig/partition-config.xml");
21      // Do init without activating the logging
22      ConfigManager.init(siteconfig);
23      GroupTable groupTable = new GroupTable(1000, gid);
24      DistributedSystemConfig dsc = ConfigManager.getDistributedSystem();
25      return new ReplicaCount(groupTable, dsc.getDomainSet());
26    }
27  
28    protected void setUp() throws Exception
29    {
30      super.setUp();
31      app = AppConfig.getApplication(gid);
32      ds = getReplicaCount(gid);
33    }
34  
35    /*
36     * Test method for 'jgroup.arm.ReplicaCount.ReplicaCount(GroupTable)'
37     */
38    public final void testReplicaCount()
39    {
40      /* Make sure that the ReplicaCount object was created */
41      assertTrue(!ds.equals(null));
42    }
43  
44    /*
45     * Test method for 'jgroup.arm.ReplicaCount.assignReplicas(AppConfig)'
46     */
47    public final void testAssignReplicas()
48    {
49  //    ds.assignReplicas(app);
50    }
51  
52    /*
53     * Test method for 'jgroup.arm.ReplicaCount.collocateReplicas(AppConfig, AppConfig)'
54     */
55    public final void testCollocateReplicas()
56    {
57  
58    }
59  
60    /*
61     * Test method for 'jgroup.arm.ReplicaCount.removeReplicas(AppConfig)'
62     */
63    public final void testRemoveReplicas()
64    {
65  
66    }
67  
68    /*
69     * Test method for 'jgroup.arm.ReplicaCount.reassignReplica(AppConfig, Host)'
70     */
71    public final void testReassignReplica()
72    {
73  
74    }
75  
76    /*
77     * Test method for 'jgroup.arm.ReplicaCount.viewChangeEvent(View)'
78     */
79    public final void testViewChangeEvent()
80    {
81  
82    }
83  
84    /*
85     * Test method for 'jgroup.arm.ReplicaCount.removeReplica(Host)'
86     */
87    public final void testRemoveReplica()
88    {
89  
90    }
91  
92    /*
93     * Test method for 'jgroup.arm.ReplicaCount.updateHost(Host)'
94     */
95    public final void testUpdateHost()
96    {
97  
98    }
99  
100 }