📄 test.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: Test.java,v 1.6 2000/10/28 16:55:15 daniela Exp $package org.ozoneDB.DxLib.test;import java.lang.*;import java.util.*;import org.ozoneDB.DxLib.*;/** */class Test extends Object { final static int SIZE = 2000; /** */ public static void main( String[] args ) throws Exception { // collTests(); // setTests(); mapTests(); } /** */ public static void collTests() throws Exception { Class[] factories = {DxListBag.class, DxArrayBag.class, DxHashSet.class, DxTreeSet.class, DxHashMap.class, DxTreeMap.class}; CollectionTest collTest = new CollectionTest(); System.out.println( "\n*** CollectionTest ***\n" ); // add_iterate for (int i = 0; i < factories.length; i++) { collTest.add_iterate( (DxCollection)factories[i].newInstance(), CollectionTest.newDxStrings() ); } collTest.add_iterate( new DxTreeSet( new DxStringComparator() ), CollectionTest.newStrings() ); collTest.add_iterate( new DxTreeMap( new DxStringComparator() ), CollectionTest.newStrings() ); // contains for (int i = 0; i < factories.length; i++) { collTest.contains( (DxCollection)factories[i].newInstance(), CollectionTest.newDxStrings() ); } collTest.contains( new DxTreeSet( new DxStringComparator() ), CollectionTest.newStrings() ); collTest.contains( new DxTreeMap( new DxStringComparator() ), CollectionTest.newStrings() ); // containsAll for (int i = 0; i < factories.length; i++) { collTest.containsAll( (DxCollection)factories[i].newInstance(), CollectionTest.newDxStrings() ); } // remove_count_isEmpty for (int i = 0; i < factories.length; i++) { collTest.remove_count_isEmpty( (DxCollection)factories[i].newInstance(), CollectionTest.newDxStrings() ); } // removeAll for (int i = 0; i < factories.length; i++) { collTest.removeAll( (DxCollection)factories[i].newInstance(), CollectionTest.newDxStrings() ); } // equals for (int i = 0; i < factories.length; i++) { collTest.equals( (DxCollection)factories[i].newInstance(), (DxCollection)factories[i].newInstance(), CollectionTest.newDxStrings() ); } // toArray_clone_clear for (int i = 0; i < factories.length; i++) { collTest.toArray_clone_clear( (DxCollection)factories[i].newInstance(), CollectionTest.newDxStrings() ); } } /** */ public static void setTests() throws Exception { Class[] setFactories = {DxHashSet.class, DxTreeSet.class}; SetTest setTest = new SetTest(); System.out.println( "\n*** SetTest ***\n" ); // retainsAll for (int i = 0; i < setFactories.length; i++) { setTest.retainsAll( (DxSet)setFactories[i].newInstance(), CollectionTest.newDxStrings() ); } } /** */ public static void mapTests() throws Exception { Class[] factories = {DxHashMap.class, DxTreeMap.class, DxMultiMap.class}; MapTest test = new MapTest(); System.out.println( "\n*** MapTest ***\n" ); // for (int i = 0; i < factories.length; i++) { test.containsKey( (DxMap)factories[i].newInstance(), CollectionTest.newDxStrings() ); } DxDiskHashMap map = new DxDiskHashMap( "/tmp/test/page", 30, 10, 8 ); test.containsKey( map, CollectionTest.newIntegers() ); map.printStatistics(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -