1 9 10 package com.sleepycat.je.test; 11 12 import java.util.Enumeration; 13 14 import junit.framework.TestSuite; 15 16 import com.sleepycat.je.EnvironmentConfig; 17 import com.sleepycat.je.util.TestUtils; 18 19 23 public class TxnTestSuite extends TestSuite { 24 25 28 public TxnTestSuite(Class testCaseClass, EnvironmentConfig envConfig) { 29 30 this(testCaseClass, envConfig, null); 31 } 32 33 37 public TxnTestSuite(Class testCaseClass, 38 EnvironmentConfig envConfig, 39 String[] txnTypes) { 40 if (txnTypes == null) { 41 txnTypes = new String[] { TxnTestCase.TXN_NULL, 42 TxnTestCase.TXN_USER, 43 TxnTestCase.TXN_AUTO }; 44 } 45 if (envConfig == null) { 46 envConfig = TestUtils.initEnvConfig(); 47 envConfig.setAllowCreate(true); 48 envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC)); 49 } 50 for (int i = 0; i < txnTypes.length; i += 1) { 51 TestSuite suite = new TestSuite(testCaseClass); 52 Enumeration e = suite.tests(); 53 while (e.hasMoreElements()) { 54 TxnTestCase test = (TxnTestCase) e.nextElement(); 55 test.txnInit(envConfig, txnTypes[i]); 56 addTest(test); 57 } 58 } 59 } 60 } 61 | Popular Tags |