KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > persist > test > EvolveTestInit


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2000,2006 Oracle. All rights reserved.
5  *
6  * $Id: EvolveTestInit.java,v 1.3 2006/10/30 21:14:55 bostic Exp $
7  */

8 package com.sleepycat.persist.test;
9
10 import java.io.IOException JavaDoc;
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()
27         throws Exception JavaDoc {
28
29         return getSuite(EvolveTestInit.class);
30     }
31
32     @Override JavaDoc
33     public void setUp()
34         throws IOException JavaDoc {
35
36         envHome = getTestInitHome();
37         envHome.mkdir();
38         TestUtils.removeLogFiles("Setup", envHome, false);
39     }
40
41     public void testInit()
42         throws Exception JavaDoc {
43
44         openEnv();
45         if (!openStoreReadWrite()) {
46             fail();
47         }
48         caseObj.writeObjects(store);
49         caseObj.checkUnevolvedModel(store.getModel(), env);
50         closeAll();
51     }
52 }
53
Popular Tags