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 2016/01/11 19:34:48 UTC
svn commit: r1724106 - in /uima/ruta/trunk/ruta-maven-plugin: ./
src/it/conflictingShortName/ src/it/conflictingShortName/src/
src/it/conflictingShortName/src/main/
src/it/conflictingShortName/src/main/resources/
src/it/conflictingShortName/src/main/ru...
Author: pkluegl
Date: Mon Jan 11 18:34:48 2016
New Revision: 1724106
URL: http://svn.apache.org/viewvc?rev=1724106&view=rev
Log:
UIMA-4581
- added more complex integration test
Added:
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/pom.xml (with props)
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemOne.xml (with props)
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemTwo.xml (with props)
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Main.ruta
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/One.ruta
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Two.ruta
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/maven/
uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/maven/ConflictingShortNameTest.java (with props)
Modified:
uima/ruta/trunk/ruta-maven-plugin/pom.xml
Modified: uima/ruta/trunk/ruta-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/pom.xml?rev=1724106&r1=1724105&r2=1724106&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/pom.xml (original)
+++ uima/ruta/trunk/ruta-maven-plugin/pom.xml Mon Jan 11 18:34:48 2016
@@ -128,7 +128,7 @@
<goal>package</goal>
<goal>integration-test</goal>
</goals>
- <invokerTest>importByName,multimodule,wordlists</invokerTest>
+ <invokerTest>conflictingShortName,importByName,multimodule,wordlists</invokerTest>
</configuration>
<executions>
<execution>
Added: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/pom.xml
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/pom.xml?rev=1724106&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/pom.xml (added)
+++ uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/pom.xml Mon Jan 11 18:34:48 2016
@@ -0,0 +1,85 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>conflictingShortName</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>ruta-core</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/ruta</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>${project.build.directory}/generated-sources/ruta/descriptor</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>ruta-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <scriptFiles>
+ <directory>${basedir}/src/main/ruta</directory>
+ <includes>
+ <include>**/*.ruta</include>
+ </includes>
+ </scriptFiles>
+ <typeSystemOutputDirectory>${project.build.directory}/generated-sources/ruta/descriptor</typeSystemOutputDirectory>
+ <analysisEngineOutputDirectory>${project.build.directory}/generated-sources/ruta/descriptor</analysisEngineOutputDirectory>
+ <descriptorPaths>
+ <descriptorPath>${project.build.directory}/generated-sources/ruta/descriptor</descriptorPath>
+ </descriptorPaths>
+ <analysisEngineSuffix>Engine</analysisEngineSuffix>
+ <typeSystemSuffix>TypeSystem</typeSystemSuffix>
+ <encoding>UTF-8</encoding>
+ <importByName>true</importByName>
+ <addRutaNature>false</addRutaNature>
+ </configuration>
+ <executions>
+ <execution>
+ <id>descriptors</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Propchange: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemOne.xml
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemOne.xml?rev=1724106&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemOne.xml (added)
+++ uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemOne.xml Mon Jan 11 18:34:48 2016
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <name>TypeSystemOne</name>
+ <description/>
+ <version>1.0</version>
+ <vendor/>
+ <types>
+ <typeDescription>
+ <name>my.package.one.ExternalType</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+ </types>
+</typeSystemDescription>
Propchange: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemOne.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemTwo.xml
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemTwo.xml?rev=1724106&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemTwo.xml (added)
+++ uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemTwo.xml Mon Jan 11 18:34:48 2016
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <name>TypeSystemTwo</name>
+ <description/>
+ <version>1.0</version>
+ <vendor/>
+ <types>
+ <typeDescription>
+ <name>my.package.two.ExternalType</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+ </types>
+</typeSystemDescription>
Propchange: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/resources/TypeSystemTwo.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Main.ruta
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Main.ruta?rev=1724106&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Main.ruta (added)
+++ uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Main.ruta Mon Jan 11 18:34:48 2016
@@ -0,0 +1,7 @@
+PACKAGE my.package;
+
+SCRIPT my.package.One;
+SCRIPT my.package.Two;
+
+CALL(One);
+CALL(Two);
\ No newline at end of file
Added: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/One.ruta
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/One.ruta?rev=1724106&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/One.ruta (added)
+++ uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/One.ruta Mon Jan 11 18:34:48 2016
@@ -0,0 +1,8 @@
+PACKAGE my.package;
+
+TYPESYSTEM TypeSystemOne;
+
+DECLARE LocalType;
+
+Document{-> LocalType};
+Document{-> ExternalType};
\ No newline at end of file
Added: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Two.ruta
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Two.ruta?rev=1724106&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Two.ruta (added)
+++ uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/main/ruta/my/package/Two.ruta Mon Jan 11 18:34:48 2016
@@ -0,0 +1,8 @@
+PACKAGE my.package;
+
+TYPESYSTEM TypeSystemTwo;
+
+DECLARE LocalType;
+
+Document{-> LocalType};
+Document{-> ExternalType};
\ No newline at end of file
Added: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/maven/ConflictingShortNameTest.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/maven/ConflictingShortNameTest.java?rev=1724106&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/maven/ConflictingShortNameTest.java (added)
+++ uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/maven/ConflictingShortNameTest.java Mon Jan 11 18:34:48 2016
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.ruta.maven;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.analysis_engine.AnalysisEngine;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.cas.text.AnnotationIndex;
+import org.apache.uima.ruta.engine.RutaEngine;
+import org.apache.uima.util.XMLInputSource;
+import org.junit.Test;
+
+public class ConflictingShortNameTest {
+
+ @Test
+ public void test() throws Exception{
+ File descDirectory = new File("target/generated-sources/ruta/descriptor");
+ File aeFile1 = new File(descDirectory, "my/package/MainEngine.xml");
+ assertTrue(aeFile1.exists());
+
+ AnalysisEngineDescription aed = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(new XMLInputSource(aeFile1));
+ AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aed);
+ ae.setConfigParameterValue(RutaEngine.PARAM_STRICT_IMPORTS, true);
+ ae.reconfigure();
+ CAS cas = ae.newCAS();
+ cas.setDocumentText("Test");
+ ae.process(cas);
+
+ Type type1 = cas.getTypeSystem().getType("my.package.One.LocalType");
+ AnnotationIndex<AnnotationFS> ai1 = cas.getAnnotationIndex(type1);
+ assertEquals(1, ai1.size());
+ assertEquals("Test", ai1.iterator().next().getCoveredText());
+
+ Type type2 = cas.getTypeSystem().getType("my.package.Two.LocalType");
+ AnnotationIndex<AnnotationFS> ai2 = cas.getAnnotationIndex(type2);
+ assertEquals(1, ai2.size());
+ assertEquals("Test", ai2.iterator().next().getCoveredText());
+
+ Type type3 = cas.getTypeSystem().getType("my.package.one.ExternalType");
+ AnnotationIndex<AnnotationFS> ai3 = cas.getAnnotationIndex(type3);
+ assertEquals(1, ai3.size());
+ assertEquals("Test", ai3.iterator().next().getCoveredText());
+
+ Type type4 = cas.getTypeSystem().getType("my.package.two.ExternalType");
+ AnnotationIndex<AnnotationFS> ai4 = cas.getAnnotationIndex(type4);
+ assertEquals(1, ai4.size());
+ assertEquals("Test", ai4.iterator().next().getCoveredText());
+
+ cas.release();
+ }
+
+}
Propchange: uima/ruta/trunk/ruta-maven-plugin/src/it/conflictingShortName/src/test/java/org/apache/uima/ruta/maven/ConflictingShortNameTest.java
------------------------------------------------------------------------------
svn:eol-style = native