01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2000,2008 Oracle. All rights reserved.
05: *
06: * $Id: EvolveTestInit.java,v 1.3.2.3 2008/01/07 15:14:35 cwl Exp $
07: */
08: package com.sleepycat.persist.test;
09:
10: import java.io.IOException;
11:
12: import junit.framework.Test;
13:
14: import com.sleepycat.je.util.TestUtils;
15:
16: /**
17: * Runs part one of the EvolveTest. This part is run with the old/original
18: * version of EvolveClasses in the classpath. It creates a fresh environment
19: * and store containing instances of the original class. When EvolveTest is
20: * run, it will read/write/evolve these objects from the store created here.
21: *
22: * @author Mark Hayes
23: */
24: public class EvolveTestInit extends EvolveTestBase {
25:
26: public static Test suite() throws Exception {
27:
28: return getSuite(EvolveTestInit.class);
29: }
30:
31: boolean useEvolvedClass() {
32: return false;
33: }
34:
35: @Override
36: public void setUp() throws IOException {
37:
38: envHome = getTestInitHome(false /*evolved*/);
39: envHome.mkdirs();
40: TestUtils.removeLogFiles("Setup", envHome, false);
41: }
42:
43: public void testInit() throws Exception {
44:
45: openEnv();
46: if (!openStoreReadWrite()) {
47: fail();
48: }
49: caseObj.writeObjects(store);
50: caseObj.checkUnevolvedModel(store.getModel(), env);
51: closeAll();
52: }
53: }
|