KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > dbi > DbConfigManagerTest


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

8
9 package com.sleepycat.je.dbi;
10
11 import junit.framework.TestCase;
12
13 import com.sleepycat.je.DatabaseException;
14 import com.sleepycat.je.EnvironmentConfig;
15 import com.sleepycat.je.config.EnvironmentParams;
16 import com.sleepycat.je.util.TestUtils;
17
18 public class DbConfigManagerTest extends TestCase {
19
20     /**
21      * Test that parameter defaults work, that we can add and get
22      * parameters
23      */

24     public void testBasicParams()
25     throws DatabaseException {
26
27         EnvironmentConfig envConfig = TestUtils.initEnvConfig();
28         envConfig.setCacheSize(2000);
29         DbConfigManager configManager = new DbConfigManager(envConfig);
30
31         /**
32          * Longs: The config manager should return the value for an
33          * explicitly set param and the default for one not set.
34          *
35          */

36         assertEquals(2000,
37                      configManager.getLong(EnvironmentParams.MAX_MEMORY));
38         assertEquals(EnvironmentParams.ENV_RECOVERY.getDefault(),
39                      configManager.get(EnvironmentParams.ENV_RECOVERY));
40     }
41 }
42
Popular Tags