settest.java
来自「Java的面向对象数据库系统的源代码」· Java 代码 · 共 60 行
JAVA
60 行
// 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-@year@ by SMB GmbH. All rights reserved.//// $Id$package test.ozoneDB.DxLib;import org.ozoneDB.DxLib.DxSet;import org.ozoneDB.DxLib.DxHashSet;import org.ozoneDB.DxLib.DxTreeSet;/** * * * @author <a href="http://www.softwarebuero.de/">SMB</a> * @version $Revision$Date$ */public class SetTest extends AbstractTest { public SetTest() { super("testDxSet"); } public SetTest(String name) { super(name); } public void testDxSet() throws Exception { Class[] setFactories = {DxHashSet.class, DxTreeSet.class}; // retainsAll for (int i = 0; i < setFactories.length; i++) { retainsAll((DxSet) setFactories[i].newInstance(), CollectionTest.newDxStrings()); } } /** */ public void retainsAll(DxSet set, Object[] objs) throws Exception { set.addAll(objs); DxSet set2 = (DxSet) set.clone(); startTimer(set.getClass().getName(), "retainsAll"); set.retainAll(set2); assertEquals(set, set2); assertTrue(set.count() > 0); set2.clear(); set.retainAll(set2); assertTrue(set.isEmpty()); stopTimer(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?