1 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 } 27 28 protected Class getApplicationClass() { 29 return ClusterMembershipEventTestApp.class; 30 } 31 32 protected void createConfig(TerracottaConfigBuilder cb) { 33 cb.getServers().getL2s()[0].setPersistenceMode(L2ConfigBuilder.PERSISTENCE_MODE_PERMANENT_STORE); 35 36 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 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 RootConfigBuilder[] roots = new RootConfigBuilder[] { new RootConfigBuilderImpl(getApplicationClass(), "barrier") }; 54 cb.getApplication().getDSO().setRoots(roots); 55 56 } 57 58 } 59 | Popular Tags |