📄 openxmltestcase.java
字号:
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by ozone-db.org.
//
// The original code and portions created by SMB are
// Copyright (C) 1997-2001 by SMB GmbH. All rights reserved.
//
// $Id: OpenXmlTestCase.java,v 1.1 2003/11/02 17:29:30 per_nyfelt Exp $
package test.openxml;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import junit.framework.TestCase;
import org.ozoneDB.ExternalDatabase;
/**
* This is the fixture for the openXml tests
* @author Per Nyfelt
*/
public class OpenXmlTestCase extends TestCase {
/** the datbase used for all tests */
protected ExternalDatabase db;
protected String xmlTestDataFileName = OpenXmlTestSuite.xmlTestDataFileName;
public OpenXmlTestCase(String name) {
super(name);
}
public void setUp() throws Exception {
Properties props = loadProps(OpenXmlTestSuite.propertiesFileName);
String dbURI = props.getProperty("dbURI");
db = ExternalDatabase.openDatabase(dbURI);
db.reloadClasses();
}
public void tearDown() throws Exception {
db.close();
}
/**
* Helper method to load the OpenXmlTestCase.properties file
*
* @return the loaded properties
*/
private Properties loadProps(String propsFileName) {
Properties defaultProps = new Properties();
// set default parameters
defaultProps.put("dbURI", "ozonedb:remote://localhost:3333");
Properties props = new Properties(defaultProps);
// now load the props file
try {
props.load(new FileInputStream(new File(propsFileName)));
} catch (Exception e) {
System.out.println("Didn't find props file, using defaults");
props.list(System.out);
}
return props;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -