You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2020/10/15 14:20:21 UTC

[uima-ruta] branch master updated: UIMA-6271: Ruta: option to validate internal indexing in RutaEngine

This is an automated email from the ASF dual-hosted git repository.

pkluegl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git


The following commit(s) were added to refs/heads/master by this push:
     new 970575d  UIMA-6271: Ruta: option to validate internal indexing in RutaEngine
970575d is described below

commit 970575dac0472554f91106370cfd2d705c0b9582
Author: Peter Klügl <pe...@averbis.com>
AuthorDate: Thu Oct 15 16:19:53 2020 +0200

    UIMA-6271: Ruta: option to validate internal indexing in RutaEngine
    
    - go back to released uimafit version and replace managedJCas fro now in test
---
 ruta-core/pom.xml                                  | 34 +++++++++++-----------
 .../org/apache/uima/ruta/RutaBasicUtilsTest.java   | 24 +++++++++++++--
 ruta-parent/pom.xml                                |  2 +-
 3 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/ruta-core/pom.xml b/ruta-core/pom.xml
index bf8bdac..98423c7 100644
--- a/ruta-core/pom.xml
+++ b/ruta-core/pom.xml
@@ -152,23 +152,23 @@
       <scope>test</scope>
     </dependency>
     
-    <dependency>
-      <groupId>org.apache.uima</groupId>
-      <artifactId>uimafit-junit</artifactId>
-      <version>${uimafit-version}</version>
-      <scope>test</scope>
-      <!-- Exclude aop stuff, which is not need by uimafit and only introduces a non-asl license -->
-      <exclusions>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-aop</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>aopalliance</groupId>
-          <artifactId>aopalliance</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
+<!--     <dependency> -->
+<!--       <groupId>org.apache.uima</groupId> -->
+<!--       <artifactId>uimafit-junit</artifactId> -->
+<!--       <version>${uimafit-version}</version> -->
+<!--       <scope>test</scope> -->
+<!--       Exclude aop stuff, which is not need by uimafit and only introduces a non-asl license -->
+<!--       <exclusions> -->
+<!--         <exclusion> -->
+<!--           <groupId>org.springframework</groupId> -->
+<!--           <artifactId>spring-aop</artifactId> -->
+<!--         </exclusion> -->
+<!--         <exclusion> -->
+<!--           <groupId>aopalliance</groupId> -->
+<!--           <artifactId>aopalliance</artifactId> -->
+<!--         </exclusion> -->
+<!--       </exclusions> -->
+<!--     </dependency> -->
 
     <dependency>
       <groupId>org.slf4j</groupId>
diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/RutaBasicUtilsTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/RutaBasicUtilsTest.java
index 89e11e2..bf55a78 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/RutaBasicUtilsTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/RutaBasicUtilsTest.java
@@ -22,17 +22,35 @@ import java.util.Arrays;
 
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.cas.CAS;
-import org.apache.uima.fit.testing.junit.ManagedJCas;
+import org.apache.uima.fit.factory.JCasFactory;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.ruta.engine.Ruta;
 import org.apache.uima.ruta.type.CW;
 import org.apache.uima.ruta.type.RutaBasic;
-import org.junit.Rule;
+import org.junit.Before;
 import org.junit.Test;
 
 public class RutaBasicUtilsTest {
 
-  public @Rule ManagedJCas managedJCas = new ManagedJCas();
+  // TODO use uimafit when released instead
+  // public @Rule ManagedJCas managedJCas = new ManagedJCas();
+
+  private static ThreadLocal<JCas> managedJCas = new ThreadLocal<>();
+
+  static {
+
+    try {
+      JCas jCas = JCasFactory.createJCas();
+      managedJCas.set(jCas);
+    } catch (Exception e) {
+      throw new IllegalStateException(e);
+    }
+  }
+
+  @Before
+  public void setup() {
+    managedJCas.get().reset();
+  }
 
   @Test(expected = AnalysisEngineProcessException.class)
   public void testBreakOnNoBasics() throws AnalysisEngineProcessException {
diff --git a/ruta-parent/pom.xml b/ruta-parent/pom.xml
index 8807769..537a602 100644
--- a/ruta-parent/pom.xml
+++ b/ruta-parent/pom.xml
@@ -131,7 +131,7 @@
       Creative Commons Attribution 3.0 License.
     </postNoticeText>
     <uimaVersion>3.1.1</uimaVersion>
-    <uimafit-version>3.1.1-SNAPSHOT</uimafit-version>
+    <uimafit-version>3.1.0</uimafit-version>
     <spring-version>4.3.22.RELEASE</spring-version>
     <!--
       BACKWARD_COMPATIBLE_IMPLEMENTER - patch version (=.=.+)