📄 suite.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-2000 by SMB GmbH. All rights reserved.//// $Id: Suite.java,v 1.6 2000/10/28 16:55:19 daniela Exp $package org.ozoneDB.test;import java.io.*;import java.util.*;import org.ozoneDB.*;import test.framework.*;/** * This is the driver that runs the entire test suite. * * * @author <a href="http://www.softwarebuero.de/">SMB</a> * @version $Revision: 1.6 $Date: 2000/10/28 16:55:19 $ */public class Suite { protected final static String dbDir = "/tmp/db"; protected final static String dbHost = "localhost"; protected final static int dbPort = 3333; protected static ExternalDatabase db; protected static boolean debug; public static void main( String[] args ) throws Exception { // create the suite of all tests TestSuite suite = new TestSuite(); org.ozoneDB.test.args.ArgsTest.addSuite( suite ); org.ozoneDB.test.simple.SimpleTest.addSuite( suite ); org.ozoneDB.test.tx.TxTest.addSuite( suite ); main( args, suite ); } public static void main( String[] args, TestSuite suite ) throws Exception { boolean remote = false; boolean local = false; boolean clientcache = false; if (args.length == 0) { printUsage(); } for (int i = 0; i < args.length; i++) { if (args[i].equals( "-local" )) { local = true; } else if (args[i].equals( "-remote" )) { remote = true; } else if (args[i].equals( "-client" ) || args[i].equals( "-clientcache" )) { clientcache = true; } else if (args[i].equals( "-debug" )) { debug = true; } else { printUsage(); } } System.out.println( "Test: remote=" + remote + " local=" + local + " clientcache=" + clientcache ); if (local) { System.out.println( "Performing LocalDatabase test suite..." ); initLocalDB(); if (clientcache) { System.out.println( " with client cache..." ); initClientCacheDB(); } OzoneTestRunner.run( suite ); db.close(); } if (remote) { System.out.println( "Performing RemoteDatabase test suite..." ); initRemoteDB(); if (clientcache) { System.out.println( " with client cache..." ); initClientCacheDB(); } OzoneTestRunner.run( suite ); db.close(); } } protected static void printUsage() { System.out.println( "usage: suite [-local | -remote] [-clientcache] [-debug]" ); System.exit( 1 ); } public static void setUp( OzoneTestCase test ) { test.db = db; test.debug = debug; } protected static void tearDown( OzoneTestCase test ) { } // protected void startRemoteServer() throws Exception { // } // // // protected void stopRemoteServer() throws Exception { // } // protected static void createDB() throws Exception { // db = new LocalDatabase(); // ((LocalDatabase)db).open (dbDir); // } protected static void initRemoteDB() throws Exception { db = new RemoteDatabase(); ((RemoteDatabase)db).open( "localhost", 3333 ); } protected static void initLocalDB() throws Exception { db = ExternalDatabase.openDatabase( "ozonedb:local://" + dbDir ); // db = new LocalDatabase(); // ((LocalDatabase)db).open (dbDir); } protected static void initClientCacheDB() throws Exception { db = new ClientCacheDatabase( db, true ); ExternalTransaction tx = db.newTransaction(); tx.begin(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -