KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > ClusterMembershipEventTest


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tctest;
6
7 import EDU.oswego.cs.dl.util.concurrent.CyclicBarrier;
8 import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
9
10 import com.tc.config.schema.builder.InstrumentedClassConfigBuilder;
11 import com.tc.config.schema.builder.LockConfigBuilder;
12 import com.tc.config.schema.builder.RootConfigBuilder;
13 import com.tc.config.schema.test.InstrumentedClassConfigBuilderImpl;
14 import com.tc.config.schema.test.L2ConfigBuilder;
15 import com.tc.config.schema.test.LockConfigBuilderImpl;
16 import com.tc.config.schema.test.RootConfigBuilderImpl;
17 import com.tc.config.schema.test.TerracottaConfigBuilder;
18
19 public class ClusterMembershipEventTest extends ServerCrashingTestBase {
20
21   private static final int NODE_COUNT = 5;
22     
23   public ClusterMembershipEventTest() {
24     super(NODE_COUNT);
25 // this.disableAllUntil("2007-02-27");
26
}
27
28   protected Class JavaDoc getApplicationClass() {
29     return ClusterMembershipEventTestApp.class;
30   }
31
32   protected void createConfig(TerracottaConfigBuilder cb) {
33     // persistent mode
34
cb.getServers().getL2s()[0].setPersistenceMode(L2ConfigBuilder.PERSISTENCE_MODE_PERMANENT_STORE);
35
36     // locks
37
LockConfigBuilder[] locks = new LockConfigBuilder[] {
38         new LockConfigBuilderImpl(LockConfigBuilder.TAG_AUTO_LOCK, CyclicBarrier.class, LockConfigBuilder.LEVEL_WRITE),
39         new LockConfigBuilderImpl(LockConfigBuilder.TAG_AUTO_LOCK, SynchronizedInt.class, LockConfigBuilder.LEVEL_WRITE),
40         new LockConfigBuilderImpl(LockConfigBuilder.TAG_AUTO_LOCK, getApplicationClass(), LockConfigBuilder.LEVEL_WRITE) };
41
42     cb.getApplication().getDSO().setLocks(locks);
43
44     // include classes
45
InstrumentedClassConfigBuilder[] instrClasses = new InstrumentedClassConfigBuilder[] {
46         new InstrumentedClassConfigBuilderImpl(CyclicBarrier.class),
47         new InstrumentedClassConfigBuilderImpl(SynchronizedInt.class),
48         new InstrumentedClassConfigBuilderImpl(getApplicationClass()) };
49
50     cb.getApplication().getDSO().setInstrumentedClasses(instrClasses);
51     
52     // roots
53
RootConfigBuilder[] roots = new RootConfigBuilder[] { new RootConfigBuilderImpl(getApplicationClass(), "barrier") };
54     cb.getApplication().getDSO().setRoots(roots);
55     
56   }
57
58 }
59
Popular Tags