Skip to content

Commit

Permalink
Merge pull request #124 from apache/refactoring/122-Resolve-split-pac…
Browse files Browse the repository at this point in the history
…kage-between-ruta-core-and-ruta-core-ext

Issue #122: Resolve split package between ruta-core and ruta-core-ext
  • Loading branch information
reckart authored Feb 13, 2023
2 parents d444c1d + cd66098 commit 6454d49
Show file tree
Hide file tree
Showing 33 changed files with 580 additions and 50 deletions.
6 changes: 2 additions & 4 deletions installEclipseSettings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# under the License.

# Formatter settings
JDT_CORE_PREFS="/Users/rec/uima-code-style-settings/org.eclipse.jdt.core.prefs"
JDT_CORE_PREFS="src/main/eclipse/org.eclipse.jdt.core.prefs"

# Save actions
JDT_UI_PREFS="/Users/rec/uima-code-style-settings/org.eclipse.jdt.ui.prefs"
JDT_UI_PREFS="src/main/eclipse/org.eclipse.jdt.ui.prefs"

function installPrefs {
mkdir -p $1/.settings/
Expand All @@ -29,7 +29,6 @@ function installPrefs {
}

installPrefs example-projects
installPrefs ruta-basic-type
installPrefs ruta-core
installPrefs ruta-core-ext
installPrefs ruta-docbook
Expand All @@ -46,4 +45,3 @@ installPrefs ruta-ep-textruler
installPrefs ruta-maven-archetype
installPrefs ruta-maven-plugin
installPrefs ruta-parent
installPrefs ruta-typesystem
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<excludes combine.children="append">
<!-- These configuration files cannot bear a license header -->
<exclude>.github/**/*</exclude>
<exclude>src/main/eclipse/*.prefs</exclude>
<!-- workaround https://issues.apache.org/jira/browse/RAT-97 -->
<exclude>example-projects/**</exclude>
<exclude>ruta-core/**</exclude>
Expand Down
3 changes: 3 additions & 0 deletions ruta-core-ext/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/META-INF/
/.apt_generated/
/.apt_generated_tests/
Empty file.
13 changes: 7 additions & 6 deletions ruta-core-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
-->
<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>
<artifactId>ruta-core-ext</artifactId>

<name>Apache UIMA Ruta: ${project.artifactId}</name>
<url>${uimaWebsiteUrl}</url>
<description>Additional extensions of the UIMA Ruta language</description>

<parent>
<groupId>org.apache.uima</groupId>
Expand All @@ -32,6 +27,13 @@
<relativePath>../ruta-parent/pom.xml</relativePath>
</parent>

<artifactId>ruta-core-ext</artifactId>
<packaging>bundle</packaging>

<name>Apache UIMA Ruta: ${project.artifactId}</name>
<url>${uimaWebsiteUrl}</url>
<description>Additional extensions of the UIMA Ruta language</description>

<properties>
<uimaScmProject>${project.artifactId}</uimaScmProject>
<postNoticeText />
Expand Down Expand Up @@ -84,5 +86,4 @@
</plugins>
</pluginManagement>
</build>

</project>

This file was deleted.

This file was deleted.

21 changes: 13 additions & 8 deletions ruta-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,20 @@
<argLine>-Xmx650M</argLine>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- Exclude generated jcas classes -->
<sourceFileExcludes>
<sourceFileExclude>**/org/apache/uima/ruta/type/*.java</sourceFileExclude>
</sourceFileExcludes>
</configuration>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<excludes combine.children="append">
<exclude>src/test/resources/org/apache/uima/ruta/action/*.*</exclude> <!-- test data -->
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,31 @@
public class MarkTableReloadTest {

@Test
public void test() {
public void test() throws Exception {
String name = this.getClass().getSimpleName();
String namespace = this.getClass().getPackage().getName().replaceAll("\\.", "/");

Map<String, String> complexTypes = new TreeMap<String, String>();
String typeName = "org.apache.uima.Person";
complexTypes.put(typeName, "uima.tcas.Annotation");

Map<String, List<TestFeature>> features = new TreeMap<String, List<TestFeature>>();
List<TestFeature> list = new ArrayList<RutaTestUtils.TestFeature>();
features.put(typeName, list);
String fn1 = "firstname";
list.add(new TestFeature(fn1, "", "uima.cas.String"));
String fn2 = "system";
list.add(new TestFeature(fn2, "", "uima.cas.String"));

CAS cas = null;
try {
String ruleFileName = namespace + "/" + name + RutaEngine.SCRIPT_FILE_EXTENSION;
String textFileName = namespace + "/" + name + ".txt";
Map<String, Object> parameters = new HashMap<>();
parameters.put(RutaEngine.PARAM_ADDITIONAL_EXTENSIONS, new String[] {MarkReloadExtension.class.getName()});
parameters.put(RutaEngine.PARAM_SEEDERS, new String[] {DefaultSeeder.class.getName()});
cas = RutaTestUtils.process(ruleFileName, textFileName, parameters, 50, complexTypes, features, namespace + "/", null);
} catch (Exception e) {
e.printStackTrace();
assert (false);
}

String ruleFileName = namespace + "/" + name + RutaEngine.SCRIPT_FILE_EXTENSION;
String textFileName = namespace + "/" + name + ".txt";
Map<String, Object> parameters = new HashMap<>();
parameters.put(RutaEngine.PARAM_ADDITIONAL_EXTENSIONS,
new String[] { MarkReloadExtension.class.getName() });
parameters.put(RutaEngine.PARAM_SEEDERS, new String[] { DefaultSeeder.class.getName() });
CAS cas = RutaTestUtils.process(ruleFileName, textFileName, parameters, 50, complexTypes,
features, namespace + "/", null);

Type t = null;
AnnotationIndex<AnnotationFS> ai = null;
FSIterator<AnnotationFS> iterator = null;
Expand All @@ -80,46 +77,46 @@ public void test() {
Feature f1 = t.getFeatureByBaseName(fn1);
Feature f2 = t.getFeatureByBaseName(fn2);
ai = cas.getAnnotationIndex(t);

assertEquals(6, ai.size());
iterator = ai.iterator();

next = iterator.next();
v1 = next.getStringValue(f1);
v2 = next.getStringValue(f2);
assertEquals("Peter", v1);
assertEquals("Ruta", v2);

next = iterator.next();
v1 = next.getStringValue(f1);
v2 = next.getStringValue(f2);
assertEquals("Marshall", v1);
assertEquals("UIMA", v2);

next = iterator.next();
v1 = next.getStringValue(f1);
v2 = next.getStringValue(f2);
assertEquals("Joern", v1);
assertEquals("CAS Editor", v2);

next = iterator.next();
v1 = next.getStringValue(f1);
v2 = next.getStringValue(f2);
assertEquals("Peter", v1);
assertEquals("Ruta", v2);

next = iterator.next();
v1 = next.getStringValue(f1);
v2 = next.getStringValue(f2);
assertEquals("Marshall", v1);
assertEquals("UIMA", v2);

next = iterator.next();
v1 = next.getStringValue(f1);
v2 = next.getStringValue(f2);
assertEquals("Joern", v1);
assertEquals("CAS Editor", v2);
cas.release();
assertEquals("CAS Editor", v2);

cas.release();
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1 0 0
2 0 0
1 0 0
2 0 0
2 changes: 2 additions & 0 deletions ruta-eclipse-feature/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.apt_generated/
/.apt_generated_tests/
Loading

0 comments on commit 6454d49

Please sign in to comment.