1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2000, 2013 Oracle and/or its affiliates.  All rights reserved.
5  *
6  */
7 package com.sleepycat.persist.test;
8 
9 import junit.framework.Test;
10 
11 import com.sleepycat.util.test.SharedTestUtils;
12 
13 /**
14  * Runs part one of the EvolveTest.  This part is run with the old/original
15  * version of EvolveClasses in the classpath.  It creates a fresh environment
16  * and store containing instances of the original class.  When EvolveTest is
17  * run, it will read/write/evolve these objects from the store created here.
18  *
19  * @author Mark Hayes
20  */
21 public class EvolveTestInit extends EvolveTestBase {
22 
suite()23     public static Test suite()
24         throws Exception {
25 
26         return getSuite(EvolveTestInit.class);
27     }
28 
29     @Override
useEvolvedClass()30     boolean useEvolvedClass() {
31         return false;
32     }
33 
34     @Override
setUp()35     public void setUp() {
36         envHome = getTestInitHome(false /*evolved*/);
37         envHome.mkdirs();
38         SharedTestUtils.emptyDir(envHome);
39     }
40 
testInit()41     public void testInit()
42         throws Exception {
43 
44         openEnv();
45         if (!openStoreReadWrite()) {
46             fail();
47         }
48         caseObj.writeObjects(store);
49         caseObj.checkUnevolvedModel(store.getModel(), env);
50         closeAll();
51     }
52 }
53