Revision: 17634
          http://sourceforge.net/p/gate/code/17634
Author:   markagreenwood
Date:     2014-03-11 20:00:01 +0000 (Tue, 11 Mar 2014)
Log Message:
-----------
upgraded JUnit and fixed the tests so that they will now run reliably under 
both Java 6 and Java 7

Modified Paths:
--------------
    gate/trunk/build/deploy/maven/gate-core.pom.template
    gate/trunk/ivy.xml
    gate/trunk/src/test/gate/creole/TestPR.java
    gate/trunk/src/test/gate/creole/ir/TestIndex.java
    gate/trunk/src/test/gate/util/TestDiffer.java

Modified: gate/trunk/build/deploy/maven/gate-core.pom.template
===================================================================
--- gate/trunk/build/deploy/maven/gate-core.pom.template        2014-03-11 
18:43:59 UTC (rev 17633)
+++ gate/trunk/build/deploy/maven/gate-core.pom.template        2014-03-11 
20:00:01 UTC (rev 17634)
@@ -278,15 +278,8 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.10</version>
+            <version>4.11</version>
             <scope>compile</scope>
-            <exclusions>
-                <!-- we don't use the hamcrest matchers -->
-                <exclusion>
-                    <groupId>org.hamcrest</groupId>
-                    <artifactId>hamcrest-core</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
 
     </dependencies>

Modified: gate/trunk/ivy.xml
===================================================================
--- gate/trunk/ivy.xml  2014-03-11 18:43:59 UTC (rev 17633)
+++ gate/trunk/ivy.xml  2014-03-11 20:00:01 UTC (rev 17634)
@@ -104,7 +104,7 @@
     <dependency org="xmlunit" name="xmlunit" rev="1.5" conf="required->master" 
/>
 
     <!-- Used for testing GATE -->
-    <dependency org="junit" name="junit" rev="4.10" conf="compile->master" />
+    <dependency org="junit" name="junit" rev="4.11" 
conf="compile->master,compile" />
 
     <!-- exclude stuff that is part of Java 6 core -->
     <exclude org="xml-apis" module="xml-apis" />

Modified: gate/trunk/src/test/gate/creole/TestPR.java
===================================================================
--- gate/trunk/src/test/gate/creole/TestPR.java 2014-03-11 18:43:59 UTC (rev 
17633)
+++ gate/trunk/src/test/gate/creole/TestPR.java 2014-03-11 20:00:01 UTC (rev 
17634)
@@ -16,22 +16,41 @@
 
 package gate.creole;
 
-import java.net.URL;
-import java.util.*;
-
-import junit.framework.*;
-
-import gate.*;
+import gate.Annotation;
+import gate.AnnotationSet;
+import gate.DataStore;
+import gate.Document;
+import gate.Factory;
+import gate.FeatureMap;
 import gate.corpora.TestDocument;
 import gate.creole.gazetteer.DefaultGazetteer;
 import gate.creole.orthomatcher.OrthoMatcher;
 import gate.creole.splitter.SentenceSplitter;
 import gate.creole.tokeniser.DefaultTokeniser;
 import gate.jape.JapeException;
-import gate.jape.constraint.*;
+import gate.jape.constraint.AbstractConstraintPredicate;
+import gate.jape.constraint.AnnotationAccessor;
+import gate.jape.constraint.ConstraintPredicate;
+import gate.jape.constraint.MetaPropertyAccessor;
 import gate.util.AnnotationDiffer;
 
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
 /** Test the PRs on three documents */
+@FixMethodOrder(MethodSorters.JVM)
 public class TestPR extends TestCase
 {
   /** Debug flag */
@@ -100,7 +119,7 @@
   public void tearDown() throws Exception {
   } // tearDown
 
-  public void testTokenizer() throws Exception {
+  public void test001Tokenizer() throws Exception {
     FeatureMap params = Factory.newFeatureMap();
     DefaultTokeniser tokeniser = (DefaultTokeniser) Factory.createResource(
                     "gate.creole.tokeniser.DefaultTokeniser", params);
@@ -143,7 +162,7 @@
 
   }// testTokenizer
 
-  public void testGazetteer() throws Exception {
+  public void test002Gazetteer() throws Exception {
     FeatureMap params = Factory.newFeatureMap();
     DefaultGazetteer gaz = (DefaultGazetteer) Factory.createResource(
                           "gate.creole.gazetteer.DefaultGazetteer", params);
@@ -195,7 +214,7 @@
             
doc3.getAnnotations().get(ANNIEConstants.LOOKUP_ANNOTATION_TYPE).size());
   }//testGazetteer
 
-  public void testSplitter() throws Exception {
+  public void test003Splitter() throws Exception {
     FeatureMap params = Factory.newFeatureMap();
     SentenceSplitter splitter = (SentenceSplitter) Factory.createResource(
                           "gate.creole.splitter.SentenceSplitter", params);
@@ -253,7 +272,7 @@
       doc3.getAnnotations().get("Split").size()== 122);
   }//testSplitter
 
-  public void testTagger() throws Exception {
+  public void test004Tagger() throws Exception {
     FeatureMap params = Factory.newFeatureMap();
     POSTagger tagger = (POSTagger) Factory.createResource(
                           "gate.creole.POSTagger", params);
@@ -301,7 +320,7 @@
       annots.size() == 1447);
   }//testTagger()
 
-  public void testTransducer() throws Exception {
+  public void test005Transducer() throws Exception {
     FeatureMap params = Factory.newFeatureMap();
     ANNIETransducer transducer = (ANNIETransducer) Factory.createResource(
                           "gate.creole.ANNIETransducer", params);
@@ -394,7 +413,7 @@
             
doc4.getAnnotations().get(ANNIEConstants.PERSON_ANNOTATION_TYPE).size());
   }//testTransducer
 
-  public void testCustomConstraintDefs() throws Exception {
+  public void test006CustomConstraintDefs() throws Exception {
     FeatureMap params = Factory.newFeatureMap();
 
     List<String> operators = new ArrayList<String>();
@@ -422,7 +441,7 @@
     assertEquals("Accessor not set", testAccessor.getClass(), 
returnAccessor.getClass());
   }
 
-  public void testOrthomatcher() throws Exception {
+  public void test007Orthomatcher() throws Exception {
     FeatureMap params = Factory.newFeatureMap();
 
     OrthoMatcher orthomatcher = (OrthoMatcher) Factory.createResource(
@@ -486,7 +505,7 @@
   }//testOrthomatcher
 
   /** A test for comparing the annotation sets*/
-  public void testAllPR() throws Exception {
+  public void test008AllPR() throws Exception {
 
     // verify if the saved data store is the same with the just processed file
     // first document
@@ -676,7 +695,7 @@
     return new TestSuite(TestPR.class);
   } // suite
 
-  public static void main(String[] args) {
+  /*public static void main(String[] args) {
     try{
       Gate.init();
       TestPR testPR = new TestPR("");
@@ -692,5 +711,5 @@
     } catch(Exception e) {
       e.printStackTrace();
     }
-  } // main
+  }*/ // main
 } // class TestPR

Modified: gate/trunk/src/test/gate/creole/ir/TestIndex.java
===================================================================
--- gate/trunk/src/test/gate/creole/ir/TestIndex.java   2014-03-11 18:43:59 UTC 
(rev 17633)
+++ gate/trunk/src/test/gate/creole/ir/TestIndex.java   2014-03-11 20:00:01 UTC 
(rev 17634)
@@ -15,17 +15,24 @@
 
 package gate.creole.ir;
 
+import gate.Corpus;
+import gate.DataStore;
+import gate.Document;
+import gate.Factory;
+import gate.Gate;
+import gate.corpora.TestDocument;
+import gate.creole.ir.lucene.LuceneSearch;
+import gate.util.GateException;
+
 import java.io.File;
 import java.net.URL;
 import java.util.Iterator;
 
-import junit.framework.*;
+import org.junit.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
 
-import gate.*;
-import gate.corpora.TestDocument;
-import gate.creole.ir.lucene.LuceneSearch;
-import gate.util.GateException;
-
 public class TestIndex extends TestCase{
 
   private static String TEMP_LOCATION = null;

Modified: gate/trunk/src/test/gate/util/TestDiffer.java
===================================================================
--- gate/trunk/src/test/gate/util/TestDiffer.java       2014-03-11 18:43:59 UTC 
(rev 17633)
+++ gate/trunk/src/test/gate/util/TestDiffer.java       2014-03-11 20:00:01 UTC 
(rev 17634)
@@ -15,14 +15,21 @@
 
 package gate.util;
 
+import gate.Annotation;
+import gate.AnnotationSet;
+import gate.Document;
+import gate.Factory;
+import gate.FeatureMap;
+
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.*;
+import org.junit.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
 
-import gate.*;
-
 public class TestDiffer extends TestCase{
   /** Construction */
   public TestDiffer(String name) { super(name); }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to