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 com.tc.config.schema.setup.TestTVSConfigurationSetupManagerFactory;
08: import com.terracottatech.config.PersistenceMode;
09:
10: public abstract class GCTestBase extends TransparentTestBase implements
11: TestConfigurator {
12:
13: private final int NODE_COUNT = 3;
14: private final int LOOP_ITERATION_COUNT = 1;
15: private final int GARBAGE_COLLECTION_INTERVAL = 10;
16: private final boolean GC_ENABLED = true;
17: private final boolean GC_VERBOSE = true;
18:
19: public void setUp() throws Exception {
20: super .setUp();
21: doSetUp(this );
22: }
23:
24: public void doSetUp(TransparentTestIface t) throws Exception {
25: t.getTransparentAppConfig().setClientCount(getNodeCount())
26: .setIntensity(LOOP_ITERATION_COUNT);
27: t.initializeTestRunner();
28: }
29:
30: protected void setupConfig(
31: TestTVSConfigurationSetupManagerFactory configFactory) {
32: configFactory.setGCEnabled(getGCEnabled());
33: configFactory.setGCVerbose(getGCVerbose());
34: configFactory
35: .setGCIntervalInSec(getGarbageCollectionInterval());
36: configFactory
37: .setPersistenceMode(PersistenceMode.TEMPORARY_SWAP_ONLY);
38: }
39:
40: protected boolean getGCEnabled() {
41: return GC_ENABLED;
42: }
43:
44: public int getGCIntervalInSeconds() {
45: return GARBAGE_COLLECTION_INTERVAL;
46: }
47:
48: protected boolean getGCVerbose() {
49: return GC_VERBOSE;
50: }
51:
52: protected int getGarbageCollectionInterval() {
53: return GARBAGE_COLLECTION_INTERVAL;
54: }
55:
56: protected int getNodeCount() {
57: return NODE_COUNT;
58: }
59:
60: }
|