1 package test.ozoneDB.xml.dom4j;2 3 import junit.framework.Test;4 import junit.framework.TestCase;5 import junit.framework.TestSuite;6 import junit.textui.TestRunner;7 8 import java.util.ArrayList ;9 import java.util.Collections ;10 import java.util.Iterator ;11 import java.util.List ;12 13 public class Dom4jTestSuite extends TestCase {14 15 public static void main( String args[] ) throws Exception {16 TestRunner.run(suite());17 }18 19 public static Test suite() {20 List allTests = new ArrayList ();21 allTests.add(new TestSuite(DocumentHelperTest.class));22 allTests.add(new TestSuite(InsertAndRetrievalTest.class));23 allTests.add(new TestSuite(LoadFromExternalTest.class));24 25 /* we randomize the order so it is not fixed what test comes before what26 which would indicate a dependency between tests which brakes a unit27 tests atomic nature */28 Collections.shuffle(allTests);29 30 TestSuite suite = new TestSuite("All Ozone-Dom4j Tests");31 for (Iterator it = allTests.iterator(); it.hasNext();) {32 suite.addTest((Test)it.next());33 }34 return suite;35 }36 37 public Dom4jTestSuite(String name) {38 super(name);39 }40 }41 42