From 67d69752db8fae3dba35aab7930a04abd869053d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 04:44:57 +0000 Subject: [PATCH 1/2] [2.x]: Bump org.apache.uima:uimaj-core from 3.6.0 to 3.6.1 Bumps org.apache.uima:uimaj-core from 3.6.0 to 3.6.1. --- updated-dependencies: - dependency-name: org.apache.uima:uimaj-core dependency-version: 3.6.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d1868406..bf7d5be47 100644 --- a/pom.xml +++ b/pom.xml @@ -183,7 +183,7 @@ 5.13.4 2.0.2 - 3.6.0 + 3.6.1 2.1.9 1.23.0 2.0.17 From 5cf92d701bcff1265b60dba075d63a2c17f1a3f1 Mon Sep 17 00:00:00 2001 From: Martin Wiesner Date: Mon, 6 Oct 2025 11:29:01 +0200 Subject: [PATCH 2/2] OPENNLP-1775: Update Uimaj to 3.6.1 - fixes DictionaryResourceTest xml config to work with latest UimaJ release --- .../test/java/opennlp/uima/AbstractUimaTest.java | 14 ++++++++++---- .../uima/dictionary/DictionaryResourceTest.java | 12 ++++++++---- .../test-descriptors/DictionaryNameFinder.xml | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java b/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java index 709a7f81e..ad05b717c 100644 --- a/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java +++ b/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java @@ -60,13 +60,19 @@ private void adaptModelURL(ResourceSpecifier specifier) { for (ExternalResourceDescription modelDesc : resources) { ResourceSpecifier resourceSpec = modelDesc.getResourceSpecifier(); String genericValue = resourceSpec.getAttributeValue(FILE_URL).toString(); - String modelName = genericValue.split(":")[1]; // always right of 'file:' -> idx 1 + final boolean isDictionary = genericValue.endsWith(".dic"); + String resourceName; + if (genericValue != null && !isDictionary) { + resourceName = genericValue.split(":")[1]; // always right of 'file:' -> idx 1 + } else { + resourceName = genericValue; + } try { - if ("dictionary.dic".equals(modelName)) { - URL fileURL = Paths.get(TARGET_DIR, modelName).toUri().toURL(); + if (isDictionary) { + URL fileURL = Paths.get(TARGET_DIR, resourceName).toUri().toURL(); resourceSpec.setAttributeValue(FILE_URL, fileURL.toExternalForm()); } else { - URL modelURL = OPENNLP_DIR.resolve(modelName).toUri().toURL(); + URL modelURL = OPENNLP_DIR.resolve(resourceName).toUri().toURL(); resourceSpec.setAttributeValue(FILE_URL, modelURL.toExternalForm()); } } catch (MalformedURLException e) { diff --git a/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java b/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java index 846e8c676..66f92e7cf 100644 --- a/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java +++ b/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java @@ -43,6 +43,8 @@ import opennlp.uima.AbstractTest; import opennlp.uima.util.CasUtil; +import static org.junit.jupiter.api.Assertions.assertNotNull; + public class DictionaryResourceTest extends AbstractTest { private static AnalysisEngine AE; @@ -54,15 +56,17 @@ public static void beforeClass() throws Exception { @AfterAll public static void afterClass() { - AE.destroy(); // is this necessary? + if (AE != null) { + AE.destroy(); // is this necessary? + } } private static AnalysisEngine produceAE(String descName) throws IOException, InvalidXMLException, ResourceInitializationException { File descFile = new File(PATH_DESCRIPTORS + "/" + descName); XMLInputSource in = new XMLInputSource(descFile); - ResourceSpecifier specifier = UIMAFramework.getXMLParser() - .parseResourceSpecifier(in); + ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in); + assertNotNull(specifier); return UIMAFramework.produceAnalysisEngine(specifier); } @@ -73,7 +77,7 @@ public void testDictionaryWasLoaded() { final DictionaryResource dic = (DictionaryResource) AE.getResourceManager() .getResource("/opennlp.uima.Dictionary"); final Dictionary d = dic.getDictionary(); - Assertions.assertNotNull(d); + assertNotNull(d); Assertions.assertEquals(6, d.asStringSet().size(), "There should be six entries in the dictionary"); Assertions.assertTrue(d.contains(new StringList("London")), diff --git a/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml b/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml index a4c910678..d0701700f 100644 --- a/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml +++ b/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml @@ -108,7 +108,7 @@ NameFinderDictionary - file:dictionary.dic + dictionary.dic opennlp.uima.dictionary.DictionaryResourceImpl