libdb/test/csharp/HeapDatabaseConfigTest.cs
2011-09-13 13:44:24 -04:00

57 lines
No EOL
1.8 KiB
C#

/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
*
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using NUnit.Framework;
using BerkeleyDB;
namespace CsharpAPITest {
[TestFixture]
public class HeapDatabaseConfigTest : DatabaseConfigTest {
[TestFixtureSetUp]
public override void SetUpTestFixture() {
testFixtureName = "HeapDatabaseConfigTest";
base.SetUpTestfixture();
}
[Test]
new public void TestConfigWithoutEnv() {
testName = "TestConfigWithoutEnv";
SetUpTest(false);
XmlElement xmlElem = Configuration.TestSetUp(
testFixtureName, testName);
HeapDatabaseConfig heapDBConfig =
new HeapDatabaseConfig();
Config(xmlElem, ref heapDBConfig, true);
Confirm(xmlElem, heapDBConfig, true);
}
public static void Confirm(XmlElement xmlElement,
HeapDatabaseConfig heapDBConfig, bool compulsory) {
DatabaseConfig dbConfig = heapDBConfig;
Confirm(xmlElement, dbConfig, compulsory);
// Confirm Heap database specific configuration
Configuration.ConfirmCreatePolicy(xmlElement, "Creation",
heapDBConfig.Creation, compulsory);
}
public static void Config(XmlElement xmlElement,
ref HeapDatabaseConfig heapDBConfig, bool compulsory) {
DatabaseConfig dbConfig = heapDBConfig;
Config(xmlElement, ref dbConfig, compulsory);
// Configure specific fields/properties of Heap database
Configuration.ConfigCreatePolicy(xmlElement, "Creation",
ref heapDBConfig.Creation, compulsory);
}
}
}