2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 2002, 2012 Oracle and/or its affiliates. All rights reserved.
9 package com.sleepycat.db.util;
12 import java.io.FileNotFoundException;
14 import junit.framework.TestCase;
16 import com.sleepycat.db.DatabaseException;
17 import com.sleepycat.db.Environment;
18 import com.sleepycat.db.EnvironmentConfig;
20 public class DualTestCase extends TestCase {
22 private Environment env;
23 private boolean setUpInvoked = false;
25 public DualTestCase() {
29 protected DualTestCase(String name) {
34 protected void setUp()
42 protected void tearDown()
46 throw new IllegalStateException
47 ("tearDown was invoked without a corresponding setUp() call");
53 protected Environment create(File envHome, EnvironmentConfig envConfig)
54 throws DatabaseException {
57 env = new Environment(envHome, envConfig);
58 } catch (FileNotFoundException e) {
59 throw new RuntimeException(e);
64 protected void close(Environment environment)
65 throws DatabaseException {
71 protected void destroy()
76 /* Close in case we hit an exception and didn't close */
78 } catch (RuntimeException e) {
79 /* OK if already closed */
85 public static boolean isReplicatedTest(Class<?> testCaseClass) {