1 5 package com.tctest.perf.collections; 6 7 import com.tctest.TransparentTestBase; 8 import com.tctest.TransparentTestIface; 9 10 import java.util.Properties ; 11 12 public class AbstractPerfTestBase extends TransparentTestBase { 13 14 private int nodes = 3; 15 private int threads = 3; 16 private int intensity = 10; 17 private long maxTimeout = 25; private Class TestClass; 19 20 static final String PERF_NODE_COUNT = "PerfNodeCount"; 21 static final String PERF_THREAD_COUNT = "PerfThreadCount"; 22 static final String PERF_INTENSITY = "PerfIntensity"; 23 static final String PERF_TIMEOUT = "PerfTimeoutMinutes"; 24 25 public AbstractPerfTestBase(Class appCls) { 26 Properties props = System.getProperties(); 27 nodes = new Integer (props.getProperty(PERF_NODE_COUNT, String.valueOf(nodes))).intValue(); 28 threads = new Integer (props.getProperty(PERF_THREAD_COUNT, String.valueOf(threads))).intValue(); 29 intensity = new Integer (props.getProperty(PERF_INTENSITY, String.valueOf(intensity))).intValue(); 30 maxTimeout = new Long (props.getProperty(PERF_TIMEOUT, String.valueOf(maxTimeout))).longValue(); 31 TestClass = appCls; 32 } 33 34 public void doSetUp(TransparentTestIface t) throws Exception { 35 t.getTransparentAppConfig().setClientCount(nodes).setApplicationInstancePerClientCount(threads) 36 .setIntensity(intensity); 37 t.initializeTestRunner(); 38 t.getRunnerConfig().setExecutionTimeout(maxTimeout * 60 * 1000); 39 } 40 41 protected Class getApplicationClass() { 42 return TestClass; 43 } 44 45 } | Popular Tags |