You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by "rzo1 (via GitHub)" <gi...@apache.org> on 2023/02/07 19:54:38 UTC

[GitHub] [opennlp-sandbox] rzo1 opened a new pull request, #82: Draft: Migrates "opennlp-sandbox" from JUnit 4 to JUnit5

rzo1 opened a new pull request, #82:
URL: https://github.com/apache/opennlp-sandbox/pull/82

   
   - applies bulk migration from JUnit 4 to JUnit 5
   - applies formatting according to OpenNLP style 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on a diff in pull request #82: Migrates "opennlp-sandbox" from JUnit 4 to JUnit5

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on code in PR #82:
URL: https://github.com/apache/opennlp-sandbox/pull/82#discussion_r1099892310


##########
opennlp-similarity/src/test/java/opennlp/tools/parse_thicket/apps/MultiSentenceSearchResultsProcessorTest.java:
##########
@@ -20,21 +20,21 @@
 
 import opennlp.tools.similarity.apps.HitBase;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-	public class MultiSentenceSearchResultsProcessorTest {
+class MultiSentenceSearchResultsProcessorTest {
 
-	private final MultiSentenceSearchResultsProcessor proc = new MultiSentenceSearchResultsProcessor();
+  private final MultiSentenceSearchResultsProcessor proc = new MultiSentenceSearchResultsProcessor();
 
-	@Test
-	@Ignore
-	// TODO OPENNLP-1455 This test case fails with: "UnknownHostException: api.datamarket.azure.com: nodename nor servname provided, or not known"

Review Comment:
   done



##########
corpus-server/corpus-server-connector/src/test/java/org/apache/opennlp/corpus_server/connector/CSCollectionReaderTest.java:
##########
@@ -82,14 +83,12 @@ public static void setUp() throws IOException {
       e.printStackTrace();
       fail(e.getLocalizedMessage());
     }
-    new TestCorpusServer();
   }
 
   @Test
-  @Ignore
-  // TODO Investigate why this test fails with:
-  //  No value has been assigned to the mandatory configuration parameter corpusName.

Review Comment:
   done



##########
corpus-server/corpus-server-connector/src/test/java/org/apache/opennlp/corpus_server/connector/CSCasWriterTest.java:
##########
@@ -53,21 +54,19 @@ public static void setUp() throws IOException {
       tsd.toXML(os);
       CorporaStore corporaStore = new DerbyCorporaStore();
       corporaStore.initialize(BASE_PATH.replace("file:", "").replace("/test-classes", ""));
-      byte[] indexMapping = new byte[]{};
+      byte[] indexMapping = new byte[] {};
       corporaStore.createCorpus("wikinews", os.toByteArray(), indexMapping);
     } catch (Exception e) {
       e.printStackTrace();
       fail(e.getLocalizedMessage());
     }
-    new TestCorpusServer();
   }
 
   @Test
-  @Ignore
-  // TODO Investigate why this test fails with:
-  //  A CasConsumer descriptor specified implementation class "org.apache.opennlp.corpus_server.connector.CSCasWriter",
-  //  but this class does not implement the CasConsumer interface.

Review Comment:
   done



##########
opennlp-similarity/src/test/java/opennlp/tools/parse_thicket/apps/StoryDiscourseNavigatorTest.java:
##########
@@ -18,22 +18,21 @@
 
 import java.util.Arrays;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.similarity.apps.StoryDiscourseNavigator;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class StoryDiscourseNavigatorTest {
+class StoryDiscourseNavigatorTest {
 
-	@Test
-	@Ignore
-	// TODO OPENNLP-1455 This test fails with "UnknownHostException: api.datamarket.azure.com: nodename nor servname provided, or not known"

Review Comment:
   done



##########
opennlp-similarity/src/test/java/opennlp/tools/similarity/apps/taxo_builder/TaxonomyBuildMatchTest.java:
##########
@@ -16,37 +16,37 @@
  */
 package opennlp.tools.similarity.apps.taxo_builder;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class TaxonomyBuildMatchTest {
+class TaxonomyBuildMatchTest {
 
   @Test
-  public void testTaxonomySeedImport() {
+  void testTaxonomySeedImport() {
     AriAdapter ad = new AriAdapter();
     ad.getChainsFromARIfile("src/test/resources/taxonomies/irs_dom.ari");
     assertTrue(ad.lemma_AssocWords.size() > 0);
   }
 
   @Test
-  @Ignore // TODO Check if this test works as expected, and: why it takes so much time.

Review Comment:
   done



##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/MFSEvaluatorTest.java:
##########
@@ -21,18 +21,18 @@
 
 import java.util.ArrayList;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.disambiguator.datareader.SensevalReader;
 
-public class MFSEvaluatorTest extends AbstractEvaluatorTest {
+class MFSEvaluatorTest extends AbstractEvaluatorTest {
 
   static SensevalReader seReader = new SensevalReader();
 
   @Test
-  @Ignore // TODO OPENNLP-1446: Investigate why test fails while parsing 'EnglishLS.train'

Review Comment:
   done



##########
tf-ner-poc/src/test/java/org/apache/opennlp/namefinder/PredictTest.java:
##########
@@ -1,20 +1,20 @@
 package org.apache.opennlp.namefinder;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.util.Span;
 
 import java.io.IOException;
 import java.nio.file.Path;
 
-public class PredictTest {
+class PredictTest {
 
-  @Test @Ignore
-  // TODO This test is not platform neutral and, for instance, fails with:
-  //  "Cannot find TensorFlow native library for OS: darwin, architecture: aarch64"
-  //  We need JUnit 5 in the sandbox to circumvent this, so it can be run in supported environments

Review Comment:
   done



##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/WSDEvaluatorTest.java:
##########
@@ -98,8 +98,8 @@ public void testTraining() {
   }
 
   @Test
-  @Ignore // Make this work once we have migrated to JUnit5 in the sandbox components

Review Comment:
   done



##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/WSDEvaluatorTest.java:
##########
@@ -46,10 +46,10 @@ public class WSDEvaluatorTest extends AbstractEvaluatorTest {
   static WSDModel model;
 
   static ArrayList<String> testWords;
-  
+
   @Test
-  @Ignore // TODO OPENNLP-1446: Investigate why test fails while parsing 'EnglishLS.train'

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne commented on a diff in pull request #82: Migrates "opennlp-sandbox" from JUnit 4 to JUnit5

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on code in PR #82:
URL: https://github.com/apache/opennlp-sandbox/pull/82#discussion_r1099846880


##########
corpus-server/corpus-server-connector/src/test/java/org/apache/opennlp/corpus_server/connector/CSCasWriterTest.java:
##########
@@ -53,21 +54,19 @@ public static void setUp() throws IOException {
       tsd.toXML(os);
       CorporaStore corporaStore = new DerbyCorporaStore();
       corporaStore.initialize(BASE_PATH.replace("file:", "").replace("/test-classes", ""));
-      byte[] indexMapping = new byte[]{};
+      byte[] indexMapping = new byte[] {};
       corporaStore.createCorpus("wikinews", os.toByteArray(), indexMapping);
     } catch (Exception e) {
       e.printStackTrace();
       fail(e.getLocalizedMessage());
     }
-    new TestCorpusServer();
   }
 
   @Test
-  @Ignore
-  // TODO Investigate why this test fails with:
-  //  A CasConsumer descriptor specified implementation class "org.apache.opennlp.corpus_server.connector.CSCasWriter",
-  //  but this class does not implement the CasConsumer interface.

Review Comment:
   This comment should not be lost. Please re-add the 2nd part of the comment.



##########
opennlp-similarity/src/test/java/opennlp/tools/parse_thicket/apps/MultiSentenceSearchResultsProcessorTest.java:
##########
@@ -20,21 +20,21 @@
 
 import opennlp.tools.similarity.apps.HitBase;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-	public class MultiSentenceSearchResultsProcessorTest {
+class MultiSentenceSearchResultsProcessorTest {
 
-	private final MultiSentenceSearchResultsProcessor proc = new MultiSentenceSearchResultsProcessor();
+  private final MultiSentenceSearchResultsProcessor proc = new MultiSentenceSearchResultsProcessor();
 
-	@Test
-	@Ignore
-	// TODO OPENNLP-1455 This test case fails with: "UnknownHostException: api.datamarket.azure.com: nodename nor servname provided, or not known"

Review Comment:
   This JIRA-issue related comment should not be lost. Please re-add it.



##########
corpus-server/corpus-server-connector/src/test/java/org/apache/opennlp/corpus_server/connector/CSCollectionReaderTest.java:
##########
@@ -82,14 +83,12 @@ public static void setUp() throws IOException {
       e.printStackTrace();
       fail(e.getLocalizedMessage());
     }
-    new TestCorpusServer();
   }
 
   @Test
-  @Ignore
-  // TODO Investigate why this test fails with:
-  //  No value has been assigned to the mandatory configuration parameter corpusName.

Review Comment:
   This comment should not be lost. Please re-add that part of the comment.



##########
opennlp-similarity/src/test/java/opennlp/tools/parse_thicket/apps/StoryDiscourseNavigatorTest.java:
##########
@@ -18,22 +18,21 @@
 
 import java.util.Arrays;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.similarity.apps.StoryDiscourseNavigator;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class StoryDiscourseNavigatorTest {
+class StoryDiscourseNavigatorTest {
 
-	@Test
-	@Ignore
-	// TODO OPENNLP-1455 This test fails with "UnknownHostException: api.datamarket.azure.com: nodename nor servname provided, or not known"

Review Comment:
   This JIRA-issue related comment should not be lost. Please re-add it.



##########
opennlp-similarity/src/test/java/opennlp/tools/similarity/apps/taxo_builder/TaxonomyBuildMatchTest.java:
##########
@@ -16,37 +16,37 @@
  */
 package opennlp.tools.similarity.apps.taxo_builder;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class TaxonomyBuildMatchTest {
+class TaxonomyBuildMatchTest {
 
   @Test
-  public void testTaxonomySeedImport() {
+  void testTaxonomySeedImport() {
     AriAdapter ad = new AriAdapter();
     ad.getChainsFromARIfile("src/test/resources/taxonomies/irs_dom.ari");
     assertTrue(ad.lemma_AssocWords.size() > 0);
   }
 
   @Test
-  @Ignore // TODO Check if this test works as expected, and: why it takes so much time.

Review Comment:
   This comment should not be lost. Please re-add it.



##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/MFSEvaluatorTest.java:
##########
@@ -21,18 +21,18 @@
 
 import java.util.ArrayList;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.disambiguator.datareader.SensevalReader;
 
-public class MFSEvaluatorTest extends AbstractEvaluatorTest {
+class MFSEvaluatorTest extends AbstractEvaluatorTest {
 
   static SensevalReader seReader = new SensevalReader();
 
   @Test
-  @Ignore // TODO OPENNLP-1446: Investigate why test fails while parsing 'EnglishLS.train'

Review Comment:
   This JIRA-issue related comment should not be lost. Please re-add it.



##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/WSDEvaluatorTest.java:
##########
@@ -46,10 +46,10 @@ public class WSDEvaluatorTest extends AbstractEvaluatorTest {
   static WSDModel model;
 
   static ArrayList<String> testWords;
-  
+
   @Test
-  @Ignore // TODO OPENNLP-1446: Investigate why test fails while parsing 'EnglishLS.train'

Review Comment:
   This JIRA-issue related comment should not be lost. Please re-add it.



##########
tf-ner-poc/src/test/java/org/apache/opennlp/namefinder/PredictTest.java:
##########
@@ -1,20 +1,20 @@
 package org.apache.opennlp.namefinder;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.util.Span;
 
 import java.io.IOException;
 import java.nio.file.Path;
 
-public class PredictTest {
+class PredictTest {
 
-  @Test @Ignore
-  // TODO This test is not platform neutral and, for instance, fails with:
-  //  "Cannot find TensorFlow native library for OS: darwin, architecture: aarch64"
-  //  We need JUnit 5 in the sandbox to circumvent this, so it can be run in supported environments

Review Comment:
   This comment should not be lost. Please re-add it.



##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/LeskEvaluatorTest.java:
##########
@@ -21,23 +21,23 @@
 
 import java.util.ArrayList;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.disambiguator.datareader.SensevalReader;
 
-public class LeskEvaluatorTest extends AbstractEvaluatorTest {
+class LeskEvaluatorTest extends AbstractEvaluatorTest {
 
   static SensevalReader seReader = new SensevalReader();
 
   @Test
-  @Ignore // TODO OPENNLP-1446: Investigate why test fails while parsing 'EnglishLS.train'

Review Comment:
   This JIRA-issue related comment should not be lost. Please re-add it.



##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/WSDEvaluatorTest.java:
##########
@@ -98,8 +98,8 @@ public void testTraining() {
   }
 
   @Test
-  @Ignore // Make this work once we have migrated to JUnit5 in the sandbox components

Review Comment:
   This comment should not be lost. Please re-add it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on pull request #82: Migrates "opennlp-sandbox" from JUnit 4 to JUnit5

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #82:
URL: https://github.com/apache/opennlp-sandbox/pull/82#issuecomment-1421435604

   @kinow yes. This is one of the toggling Tests, which appears from time to time. Also with JUnit 4  and on Unix/OSX + Windows from time to time 🫠


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on pull request #82: Migrates "opennlp-sandbox" from JUnit 4 to JUnit5

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #82:
URL: https://github.com/apache/opennlp-sandbox/pull/82#issuecomment-1422495088

   Didn't expect the migration tool to kill comments, so good catch @mawiesne - they should be restored now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne merged pull request #82: Migrates "opennlp-sandbox" from JUnit 4 to JUnit5

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne merged PR #82:
URL: https://github.com/apache/opennlp-sandbox/pull/82


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on a diff in pull request #82: Migrates "opennlp-sandbox" from JUnit 4 to JUnit5

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on code in PR #82:
URL: https://github.com/apache/opennlp-sandbox/pull/82#discussion_r1099897290


##########
opennlp-wsd/src/test/java/opennlp/tools/disambiguator/LeskEvaluatorTest.java:
##########
@@ -21,23 +21,23 @@
 
 import java.util.ArrayList;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 import opennlp.tools.disambiguator.datareader.SensevalReader;
 
-public class LeskEvaluatorTest extends AbstractEvaluatorTest {
+class LeskEvaluatorTest extends AbstractEvaluatorTest {
 
   static SensevalReader seReader = new SensevalReader();
 
   @Test
-  @Ignore // TODO OPENNLP-1446: Investigate why test fails while parsing 'EnglishLS.train'

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org