01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tctest;
06:
07: import EDU.oswego.cs.dl.util.concurrent.CyclicBarrier;
08: import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
09:
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: // disableAllUntil("2007-06-25");
26: }
27:
28: protected Class getApplicationClass() {
29: return ClusterMembershipEventTestApp.class;
30: }
31:
32: protected void createConfig(TerracottaConfigBuilder cb) {
33: // persistent mode
34: cb.getServers().getL2s()[0]
35: .setPersistenceMode(L2ConfigBuilder.PERSISTENCE_MODE_PERMANENT_STORE);
36:
37: // locks
38: LockConfigBuilder[] locks = new LockConfigBuilder[] {
39: new LockConfigBuilderImpl(
40: LockConfigBuilder.TAG_AUTO_LOCK,
41: CyclicBarrier.class,
42: LockConfigBuilder.LEVEL_WRITE),
43: new LockConfigBuilderImpl(
44: LockConfigBuilder.TAG_AUTO_LOCK,
45: SynchronizedInt.class,
46: LockConfigBuilder.LEVEL_WRITE),
47: new LockConfigBuilderImpl(
48: LockConfigBuilder.TAG_AUTO_LOCK,
49: getApplicationClass(),
50: LockConfigBuilder.LEVEL_WRITE) };
51:
52: cb.getApplication().getDSO().setLocks(locks);
53:
54: // include classes
55: InstrumentedClassConfigBuilder[] instrClasses = new InstrumentedClassConfigBuilder[] {
56: new InstrumentedClassConfigBuilderImpl(
57: CyclicBarrier.class),
58: new InstrumentedClassConfigBuilderImpl(
59: SynchronizedInt.class),
60: new InstrumentedClassConfigBuilderImpl(
61: getApplicationClass()) };
62:
63: cb.getApplication().getDSO().setInstrumentedClasses(
64: instrClasses);
65:
66: // roots
67: RootConfigBuilder[] roots = new RootConfigBuilder[] { new RootConfigBuilderImpl(
68: getApplicationClass(), "barrier") };
69: cb.getApplication().getDSO().setRoots(roots);
70:
71: }
72:
73: }
|