[jsword-svn] r2152 - in trunk/jsword/src: main/java/org/crosswire/jsword/book/sword main/java/org/crosswire/jsword/versification test/java

dmsmith at crosswire.org dmsmith at crosswire.org
Sat Apr 9 09:13:42 MST 2011


Author: dmsmith
Date: 2011-04-09 09:13:42 -0700 (Sat, 09 Apr 2011)
New Revision: 2152

Added:
   trunk/jsword/src/test/java/CommonAllTests.java
Modified:
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/TreeKeyIndex.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java
   trunk/jsword/src/test/java/AllTests.java
   trunk/jsword/src/test/java/Bench.java
   trunk/jsword/src/test/java/JSwordAllTests.java
Log:
Improve JSword tests

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/TreeKeyIndex.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/TreeKeyIndex.java	2011-04-09 16:11:15 UTC (rev 2151)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/TreeKeyIndex.java	2011-04-09 16:13:42 UTC (rev 2152)
@@ -160,12 +160,8 @@
         return node;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.crosswire.common.activate.Activatable#activate(org.crosswire.common
-     * .activate.Lock)
+    /* (non-Javadoc)
+     * @see org.crosswire.common.activate.Activatable#activate(org.crosswire.common.activate.Lock)
      */
     public final void activate(Lock lock) {
         String path = null;
@@ -204,12 +200,8 @@
         active = true;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.crosswire.common.activate.Activatable#deactivate(org.crosswire.common
-     * .activate.Lock)
+    /* (non-Javadoc)
+     * @see org.crosswire.common.activate.Activatable#deactivate(org.crosswire.common.activate.Lock)
      */
     public final void deactivate(Lock lock) {
         try {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java	2011-04-09 16:11:15 UTC (rev 2151)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java	2011-04-09 16:13:42 UTC (rev 2152)
@@ -151,6 +151,7 @@
         return osis;
     }
 
+    @Override
     public String toString() {
         return osis;
     }

Modified: trunk/jsword/src/test/java/AllTests.java
===================================================================
--- trunk/jsword/src/test/java/AllTests.java	2011-04-09 16:11:15 UTC (rev 2151)
+++ trunk/jsword/src/test/java/AllTests.java	2011-04-09 16:13:42 UTC (rev 2152)
@@ -38,14 +38,8 @@
 
     public static Test suite() {
         TestSuite suite = new TestSuite();
-
-        suite.addTest(org.crosswire.common.util.AllTests.suite());
-        suite.addTest(org.crosswire.common.progress.AllTests.suite());
-        suite.addTest(org.crosswire.common.diff.AllTests.suite());
-        suite.addTest(org.crosswire.common.history.AllTests.suite());
-        suite.addTest(org.crosswire.common.xml.AllTests.suite());
-        suite.addTest(org.crosswire.common.icu.AllTests.suite());
-
+        suite.addTest(CommonAllTests.suite());
+        suite.addTest(JSwordAllTests.suite());
         return suite;
     }
 }

Modified: trunk/jsword/src/test/java/Bench.java
===================================================================
--- trunk/jsword/src/test/java/Bench.java	2011-04-09 16:11:15 UTC (rev 2151)
+++ trunk/jsword/src/test/java/Bench.java	2011-04-09 16:13:42 UTC (rev 2152)
@@ -22,7 +22,7 @@
         if (args.length == 0) {
             usage();
             versions();
-            System.exit(1);
+            //System.exit(1);
         }
 
         List<Book> dicts = Books.installed().getBooks(BookFilters.getOnlyBibles());
@@ -32,7 +32,7 @@
         speed.run();
 
         double time = speed.getBenchmark() / 1000.0;
-        System.out.println("CBench mark for '" + args[0] + "': " + time + "s");
+        System.out.println("CBench mark for '" + version + "': " + time + "s");
     }
 
     /**

Added: trunk/jsword/src/test/java/CommonAllTests.java
===================================================================
--- trunk/jsword/src/test/java/CommonAllTests.java	                        (rev 0)
+++ trunk/jsword/src/test/java/CommonAllTests.java	2011-04-09 16:13:42 UTC (rev 2152)
@@ -0,0 +1,49 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: JSwordAllTests.java 2114 2011-03-12 16:35:31Z dmsmith $
+ */
+// package default;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * JUnit Test.
+ * 
+ * @see gnu.lgpl.License for license details.<br>
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ */
+public class CommonAllTests extends TestCase {
+    public CommonAllTests(String s) {
+        super(s);
+    }
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite();
+        suite.addTest(org.crosswire.common.util.AllTests.suite());
+        suite.addTest(org.crosswire.common.progress.AllTests.suite());
+        suite.addTest(org.crosswire.common.diff.AllTests.suite());
+        suite.addTest(org.crosswire.common.history.AllTests.suite());
+        suite.addTest(org.crosswire.common.xml.AllTests.suite());
+        suite.addTest(org.crosswire.common.icu.AllTests.suite());
+        return suite;
+    }
+}

Modified: trunk/jsword/src/test/java/JSwordAllTests.java
===================================================================
--- trunk/jsword/src/test/java/JSwordAllTests.java	2011-04-09 16:11:15 UTC (rev 2151)
+++ trunk/jsword/src/test/java/JSwordAllTests.java	2011-04-09 16:13:42 UTC (rev 2152)
@@ -38,63 +38,11 @@
 
     public static Test suite() {
         TestSuite suite = new TestSuite();
-
-        suite.addTest(org.crosswire.common.util.AllTests.suite());
-        suite.addTest(org.crosswire.common.progress.AllTests.suite());
-        suite.addTest(org.crosswire.common.diff.AllTests.suite());
-        suite.addTest(org.crosswire.common.history.AllTests.suite());
-        suite.addTest(org.crosswire.common.xml.AllTests.suite());
-        suite.addTest(org.crosswire.common.icu.AllTests.suite());
-
-        suite.addTestSuite(org.crosswire.jsword.passage.BibleInfoTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageConstantsTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageMixTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageSizeTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageSpeedTest.class);
-        // commented out because it causes OutOfMemoryErrors.
-        // suite.addTestSuite(org.crosswire.jsword.passage.PassageSpeedOptTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageTallyTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageTally2Test.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageUtilTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.PassageWriteSpeedTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.VerseTest.class);
-        suite.addTestSuite(org.crosswire.jsword.passage.VerseRangeTest.class);
-
-        suite.addTestSuite(org.crosswire.jsword.book.BooksTest.class);
-        suite.addTestSuite(org.crosswire.jsword.book.BookMetaDataTest.class);
-        suite.addTestSuite(org.crosswire.jsword.book.SentanceUtilTest.class);
-
-        // run independently:
-        // suite.addTestSuite(org.crosswire.jsword.book.ReadEverything.class);
-        // commented out because the tests were very poor.
-        // suite.addTestSuite(org.crosswire.jsword.book.OsisTest.class);
-
-        // Not a JUnit test
-        // suite.addTestSuite(org.crosswire.jsword.book.test.Speed.class);
-
-        /*
-         * FIXME
-         * suite.addTestSuite(org.crosswire.jsword.index.search.parse.ParserTest
-         * .class);
-         * suite.addTestSuite(org.crosswire.jsword.index.search.parse.WordsTest
-         * .class);
-         */
-
-        suite.addTestSuite(org.crosswire.jsword.book.sword.ConfigEntryTableTest.class);
-        suite.addTestSuite(org.crosswire.jsword.book.sword.RawFileBackendTest.class);
-        suite.addTestSuite(org.crosswire.jsword.book.sword.GenBookTest.class);
-        suite.addTestSuite(org.crosswire.jsword.book.sword.SwordBookDriverTest.class);
-        suite.addTestSuite(org.crosswire.jsword.book.sword.SwordBookMetaDataTest.class);
-        suite.addTestSuite(org.crosswire.jsword.book.sword.SwordBookTest.class);
-
-        suite.addTestSuite(org.crosswire.jsword.bridge.DwrBridgeTest.class);
-
-        suite.addTestSuite(org.crosswire.jsword.index.lucene.analysis.AnalyzerFactoryTest.class);
-        suite.addTestSuite(org.crosswire.jsword.index.lucene.analysis.ChineseLuceneAnalyzerTest.class);
-        suite.addTestSuite(org.crosswire.jsword.index.lucene.analysis.ConfigurableSnowballAnalyzerTest.class);
-        suite.addTestSuite(org.crosswire.jsword.index.lucene.analysis.EnglishLuceneAnalyzerTest.class);
-        suite.addTestSuite(org.crosswire.jsword.index.lucene.analysis.GreekLuceneAnalyzerTest.class);
-        suite.addTestSuite(org.crosswire.jsword.index.lucene.analysis.ThaiLuceneAnalyzerTest.class);
+        suite.addTest(org.crosswire.jsword.book.AllTests.suite());
+        suite.addTest(org.crosswire.jsword.book.sword.AllTests.suite());
+        suite.addTest(org.crosswire.jsword.passage.AllTests.suite());
+        suite.addTest(org.crosswire.jsword.bridge.AllTests.suite());
+        suite.addTest(org.crosswire.jsword.index.lucene.analysis.AllTests.suite());
         return suite;
     }
 }




More information about the jsword-svn mailing list