You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2020/01/16 11:09:36 UTC

[uima-uimaj] branch master-merge-v2 created (now 04bb4c8)

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

rec pushed a change to branch master-merge-v2
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git.


      at 04bb4c8  Merge branch 'master-v2' into master-merge-v2

This branch includes the following new commits:

     new 04bb4c8  Merge branch 'master-v2' into master-merge-v2

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[uima-uimaj] 01/01: Merge branch 'master-v2' into master-merge-v2

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rec pushed a commit to branch master-merge-v2
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git

commit 04bb4c8fd996b7617deb2157eadb4d1a5cb2a86a
Merge: 91091c4 096aa4e
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Thu Jan 16 12:09:27 2020 +0100

    Merge branch 'master-v2' into master-merge-v2
    
    - Bring master up-to-date with changes in master-v2. This includes primarily the changes for [UIMA-5936] as other changse have already been cherry-picked/merged otherwise
    
    * master-v2:
      [UIMA-5936] PearSpecifier should be able to store every parametertype that analysisEngines support
      [UIMA-5936] PearSpecifier should be able to store every parametertype that analysisEngines support
      [UIMA-5936] PearSpecifier should be able to store every parametertype that analysisEngines support
      [UIMA-5936] PearSpecifier should be able to store every parametertype that analysisEngines support
      [UIMA-6168] copy change from v3, add test
      [UIMA-6165] upgrade the eclipse pluging builds
      [UIMA-6146] remove <h1> from package.html, java 13 javadoc complains
      [UIMA-6141] add combine.self="override" back to <configuration> element
      [UIMA-6141] delete combine.self after close reading of the docs
      [UIMA-6143] point scm dev connection to git repo top level
      [UIMA-6141] move combine.self to proper element
      [UIMA-6138] change scm in pom for git
      [UIMA-6126] add gitattributes, and gitignore for 2 eclipse feature proj
      [UIMA-6126] Add .gitignore file to trunk
      move master-v2 to branches
      [UIMA-6115] rename trunk to master-v2
      [UIMA-5936] PearSpecifier should be able to store every parametertype that analysisEngines support
    
    % Conflicts:
    %	PearPackagingMavenPlugin/pom.xml
    %	aggregate-uimaj-docbooks/pom.xml
    %	aggregate-uimaj-eclipse-plugins/pom.xml
    %	aggregate-uimaj/pom.xml
    %	jVinci/pom.xml
    %	jcasgen-maven-plugin/pom.xml
    %	pom.xml
    %	uima-docbook-overview-and-setup/pom.xml
    %	uima-docbook-references/pom.xml
    %	uima-docbook-tools/pom.xml
    %	uima-docbook-tutorials-and-users-guides/pom.xml
    %	uimaj-adapter-soap/pom.xml
    %	uimaj-adapter-vinci/pom.xml
    %	uimaj-bootstrap/pom.xml
    %	uimaj-component-test-util/pom.xml
    %	uimaj-core/pom.xml
    %	uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
    %	uimaj-core/src/main/java/org/apache/uima/cas/impl/FSsTobeAddedback.java
    %	uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/PearAnalysisEngineWrapperTest.java
    %	uimaj-cpe/pom.xml
    %	uimaj-document-annotation/pom.xml
    %	uimaj-eclipse-feature-runtime/pom.xml
    %	uimaj-eclipse-feature-tools/pom.xml
    %	uimaj-eclipse-update-site/pom.xml
    %	uimaj-ep-cas-editor-ide/pom.xml
    %	uimaj-ep-cas-editor/pom.xml
    %	uimaj-ep-configurator/pom.xml
    %	uimaj-ep-debug/pom.xml
    %	uimaj-ep-jcasgen/pom.xml
    %	uimaj-ep-launcher/pom.xml
    %	uimaj-ep-pear-packager/pom.xml
    %	uimaj-ep-runtime/pom.xml
    %	uimaj-examples/pom.xml
    %	uimaj-json/pom.xml
    %	uimaj-parent/pom.xml
    %	uimaj-test-util/pom.xml
    %	uimaj-tools/pom.xml

 uima-docbook-references/src/docbook/ref.pear.xml   |  25 +-
 .../src/docbook/ref.xml.component_descriptor.xml   |   2 +-
 .../impl/PearAnalysisEngineWrapper.java            |  13 +
 .../org/apache/uima/resource/PearSpecifier.java    |  53 +++-
 .../uima/resource/impl/PearSpecifier_impl.java     |  32 +--
 .../src/main/resources/resourceSpecifierSchema.xsd |   7 +
 .../impl/PearAnalysisEngineWrapperTest.java        | 313 +++++++++++----------
 .../uima/resource/impl/PearSpecifier_implTest.java |  51 ++--
 .../apache/uima/util/impl/XMLParser_implTest.java  |  19 +-
 .../resources/XmlParserTest/TestPearSpecifier.xml  |  58 ++--
 10 files changed, 347 insertions(+), 226 deletions(-)

diff --cc uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/PearAnalysisEngineWrapperTest.java
index 9df9401,ffc10fe..a11e8ee
--- a/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/PearAnalysisEngineWrapperTest.java
+++ b/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/PearAnalysisEngineWrapperTest.java
@@@ -1,148 -1,166 +1,165 @@@
- /*
-  * 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.analysis_engine.impl;
- 
- import java.io.File;
- import java.io.IOException;
- import java.util.HashMap;
- 
- import org.apache.uima.pear.tools.PackageBrowser;
- import org.apache.uima.pear.tools.PackageInstaller;
- import org.apache.uima.pear.util.FileUtil;
- import org.apache.uima.resource.Parameter;
- import org.apache.uima.resource.PearSpecifier;
- import org.apache.uima.resource.impl.Parameter_impl;
- import org.apache.uima.resource.impl.PearSpecifier_impl;
- import org.apache.uima.test.junit_extension.JUnitExtension;
- import org.junit.Assert;
- 
- import junit.framework.TestCase;
- 
- public class PearAnalysisEngineWrapperTest extends TestCase {
- 
-   private final static String PARAMETER_NAME = "StringParam";
- 
-   private final static String PARAMETER_VALUE = "test";
- 
-   private final static String PARAMETER_VALUE_OVERRIDE = "testOverride";
- 
-   private PearAnalysisEngineWrapper pearAnalysisEngineWrapper;
- 
-   private File tempInstallDirectory = null;
- 
-   private PackageBrowser installedPearPackage;
- 
-   public PearAnalysisEngineWrapperTest(String arg0) {
- 
-     super(arg0);
-   }
- 
-   @Override
-   protected void setUp() throws Exception {
- 
-     this.pearAnalysisEngineWrapper = new PearAnalysisEngineWrapper();
- 
-     this.tempInstallDirectory = this.createInstallationDirectory();
- 
-     this.installedPearPackage = this.installPearPackage();
-   }
- 
-   @Override
-   protected void tearDown() throws Exception {
-     this.removeInstallationDirectory();
-   }
- 
-   public void testInitializeWithOverride() throws Exception {
- 
-     PearSpecifier pearSpecifier = this.createPearSpecifierWithParameters();
- 
-     boolean initialized = this.pearAnalysisEngineWrapper.initialize(pearSpecifier,
-         new HashMap<>());
- 
-     Assert.assertTrue("Pear was not initialized", initialized);
- 
-     String stringParamValue = (String) this.pearAnalysisEngineWrapper
-             .getConfigParameterValue(PearAnalysisEngineWrapperTest.PARAMETER_NAME);
- 
-     Assert.assertEquals("The value of StringParam was not overridden",
-             PearAnalysisEngineWrapperTest.PARAMETER_VALUE_OVERRIDE, stringParamValue);
-   }
- 
-   private PearSpecifier createPearSpecifierWithParameters() {
- 
-     Parameter parameterStringParam = new Parameter_impl();
-     parameterStringParam.setName(PearAnalysisEngineWrapperTest.PARAMETER_NAME);
-     parameterStringParam.setValue(PearAnalysisEngineWrapperTest.PARAMETER_VALUE_OVERRIDE);
- 
-     PearSpecifier_impl pearSpecifier_impl = new PearSpecifier_impl();
-     pearSpecifier_impl.setPearPath(this.installedPearPackage.getRootDirectory().toString());
-     pearSpecifier_impl.setParameters(new Parameter[] { parameterStringParam });
-     return pearSpecifier_impl;
-   }
- 
-   public void testInitializeWithoutOverride() throws Exception {
- 
-     PearSpecifier pearSpecifier = this.createPearSpecifierWithoutParameters();
- 
-     boolean initialized = this.pearAnalysisEngineWrapper.initialize(pearSpecifier,
-         new HashMap<>());
- 
-     Assert.assertTrue("Pear was not initialized", initialized);
- 
-     String stringParamValue = (String) this.pearAnalysisEngineWrapper
-             .getConfigParameterValue(PearAnalysisEngineWrapperTest.PARAMETER_NAME);
- 
-     Assert.assertEquals("The value of StringParam has changed",
-             PearAnalysisEngineWrapperTest.PARAMETER_VALUE, stringParamValue);
-   }
- 
-   private PearSpecifier createPearSpecifierWithoutParameters() {
- 
-     PearSpecifier_impl pearSpecifier_impl = new PearSpecifier_impl();
-     pearSpecifier_impl.setPearPath(this.installedPearPackage.getRootDirectory().toString());
-     return pearSpecifier_impl;
-   }
- 
-   private File createInstallationDirectory() throws IOException {
- 
-     File tempDirectory = File.createTempFile("pear_verification_test_", "tmp");
-     if (tempDirectory.delete()) {
- 
-       if (!tempDirectory.mkdirs()) {
-         throw new IllegalStateException(
-                 "Tmp directory (" + tempDirectory + ") could not be created");
-       }
-     }
- 
-     return tempDirectory;
-   }
- 
-   private PackageBrowser installPearPackage() {
-     File pearFile = JUnitExtension.getFile("pearTests/analysisEngineWithParameters.pear");
-     Assert.assertNotNull("analysisEngine.pear file not found", pearFile);
- 
-     return PackageInstaller.installPackage(this.tempInstallDirectory, pearFile, false);
-   }
- 
-   private void removeInstallationDirectory() throws IOException {
-     if (this.tempInstallDirectory != null) {
-       FileUtil.deleteDirectory(this.tempInstallDirectory);
-     }
-   }
- }
+ /*
+  * 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.analysis_engine.impl;
+ 
+ import static org.assertj.core.api.Assertions.assertThat;
+ 
+ import java.io.File;
+ import java.io.IOException;
+ import java.util.HashMap;
+ 
+ import org.apache.uima.pear.tools.PackageBrowser;
+ import org.apache.uima.pear.tools.PackageInstaller;
+ import org.apache.uima.pear.util.FileUtil;
+ import org.apache.uima.resource.PearSpecifier;
+ import org.apache.uima.resource.impl.Parameter_impl;
+ import org.apache.uima.resource.impl.PearSpecifier_impl;
+ import org.apache.uima.resource.metadata.impl.NameValuePair_impl;
+ import org.apache.uima.test.junit_extension.JUnitExtension;
+ import org.junit.Assert;
+ 
+ import junit.framework.TestCase;
+ 
+ public class PearAnalysisEngineWrapperTest extends TestCase {
+ 
+   // This parameter is defined in the PEAR specifier file!
+   private final static String PARAMETER_NAME = "StringParam";
+ 
+   private final static String PARAMETER_VALUE = "test";
+ 
+   private final static String PARAMETER_VALUE_OVERRIDE = "testOverride";
+ 
+   private PearAnalysisEngineWrapper pearAnalysisEngineWrapper;
+ 
+   private File tempInstallDirectory = null;
+ 
+   private PackageBrowser installedPearPackage;
+ 
+   public PearAnalysisEngineWrapperTest(String arg0) {
+ 
+     super(arg0);
+   }
+ 
+   @Override
+   protected void setUp() throws Exception {
+ 
+     this.pearAnalysisEngineWrapper = new PearAnalysisEngineWrapper();
+ 
+     this.tempInstallDirectory = this.createInstallationDirectory();
+ 
+     this.installedPearPackage = this.installPearPackage();
+   }
+ 
+   @Override
+   protected void tearDown() throws Exception {
+     this.removeInstallationDirectory();
+   }
+ 
+   public void testInitializeWithOverride() throws Exception {
+ 
+     PearSpecifier_impl pearSpecifier = new PearSpecifier_impl();
+     pearSpecifier.setPearPath(this.installedPearPackage.getRootDirectory().toString());
+     pearSpecifier.setPearParameters(new NameValuePair_impl(PARAMETER_NAME, PARAMETER_VALUE_OVERRIDE));
+ 
+     boolean initialized = this.pearAnalysisEngineWrapper.initialize(pearSpecifier, new HashMap<>());
+ 
+     assertThat(initialized).isTrue().as("Pear was initialized");
+     assertThat(pearAnalysisEngineWrapper.getConfigParameterValue(PARAMETER_NAME))
+         .isEqualTo(PARAMETER_VALUE_OVERRIDE)
+         .as("The value of StringParam was overridden");
+   }
+ 
+   public void testInitializeWithOverrideLegacy() throws Exception {
+ 
+     PearSpecifier_impl pearSpecifier = new PearSpecifier_impl();
+     pearSpecifier.setPearPath(this.installedPearPackage.getRootDirectory().toString());
+     pearSpecifier.setParameters(new Parameter_impl(PARAMETER_NAME, PARAMETER_VALUE_OVERRIDE));
+ 
+     boolean initialized = this.pearAnalysisEngineWrapper.initialize(pearSpecifier, new HashMap<>());
+ 
+     assertThat(initialized).isTrue().as("Pear was initialized");
+     assertThat(pearAnalysisEngineWrapper.getConfigParameterValue(PARAMETER_NAME))
+         .isEqualTo(PARAMETER_VALUE_OVERRIDE)
+         .as("The value of StringParam was overridden");
+   }
+ 
+   public void testInitializeWithOverrideModernTakingPrecedenceOverLegacy() throws Exception {
+ 
+     PearSpecifier_impl pearSpecifier = new PearSpecifier_impl();
+     pearSpecifier.setPearPath(this.installedPearPackage.getRootDirectory().toString());
+     pearSpecifier.setParameters(new Parameter_impl(PARAMETER_NAME, "legacy"));
+     pearSpecifier.setPearParameters(new NameValuePair_impl(PARAMETER_NAME, "modern"));
+ 
+     boolean initialized = this.pearAnalysisEngineWrapper.initialize(pearSpecifier, new HashMap<>());
+ 
+     assertThat(initialized).isTrue().as("Pear was initialized");
+     assertThat(pearAnalysisEngineWrapper.getConfigParameterValue(PARAMETER_NAME))
+         .isEqualTo("modern")
+         .as("The value of StringParam was overridden");
+   }
+ 
+   public void testInitializeWithoutOverride() throws Exception {
+ 
+     PearSpecifier pearSpecifier = this.createPearSpecifierWithoutParameters();
+ 
 -    boolean initialized = this.pearAnalysisEngineWrapper.initialize(pearSpecifier,
 -            new HashMap<String, Object>());
++    boolean initialized = this.pearAnalysisEngineWrapper.initialize(pearSpecifier, new HashMap<>());
+ 
+     Assert.assertTrue("Pear was not initialized", initialized);
+ 
+     String stringParamValue = (String) this.pearAnalysisEngineWrapper
+             .getConfigParameterValue(PearAnalysisEngineWrapperTest.PARAMETER_NAME);
+ 
+     Assert.assertEquals("The value of StringParam has changed",
+             PearAnalysisEngineWrapperTest.PARAMETER_VALUE, stringParamValue);
+   }
+ 
+   private PearSpecifier createPearSpecifierWithoutParameters() {
+ 
+     PearSpecifier_impl pearSpecifier_impl = new PearSpecifier_impl();
+     pearSpecifier_impl.setPearPath(this.installedPearPackage.getRootDirectory().toString());
+     return pearSpecifier_impl;
+   }
+ 
+   private File createInstallationDirectory() throws IOException {
+ 
+     File tempDirectory = File.createTempFile("pear_verification_test_", "tmp");
+     if (tempDirectory.delete()) {
+ 
+       if (!tempDirectory.mkdirs()) {
+         throw new IllegalStateException(
+                 "Tmp directory (" + tempDirectory + ") could not be created");
+       }
+     }
+ 
+     return tempDirectory;
+   }
+ 
+   private PackageBrowser installPearPackage() {
+     File pearFile = JUnitExtension.getFile("pearTests/analysisEngineWithParameters.pear");
+     Assert.assertNotNull("analysisEngine.pear file not found", pearFile);
+ 
+     return PackageInstaller.installPackage(this.tempInstallDirectory, pearFile, false);
+   }
+ 
+   private void removeInstallationDirectory() throws IOException {
+     if (this.tempInstallDirectory != null) {
+       FileUtil.deleteDirectory(this.tempInstallDirectory);
+     }
+   }
+ }