GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
75 stars 29 forks source link

Cannot mvn install: NPE during tests #68

Closed johann-petrak closed 5 years ago

johann-petrak commented 5 years ago

Tried this on a new machine: Debian 9.7 stretch, with Oracle java 1.8.0_202 and maven 3.6.0 installed. Latest gate-core master (0147dec62f6c694a81180965c09eccfb530238da)

The .m2/settings.xml file is shown below.

When I do mvn install compilation works fine but then I get:

java.lang.NullPointerException
    at gate.Factory.createResource(Factory.java:182)
    at gate.Factory.newCorpus(Factory.java:475)
    at gate.corpora.TestCorpus.testCreation(TestCorpus.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at junit.framework.TestCase.runTest(TestCase.java:176)
    at junit.framework.TestCase.runBare(TestCase.java:141)
    at junit.framework.TestResult$1.protect(TestResult.java:122)
    at junit.framework.TestResult.runProtected(TestResult.java:142)
    at junit.framework.TestResult.run(TestResult.java:125)
    at junit.framework.TestCase.run(TestCase.java:129)
    at junit.framework.TestSuite.runTest(TestSuite.java:252)
    at junit.framework.TestSuite.run(TestSuite.java:247)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testDocumentAddition(gate.corpora.TestCorpus)  Time elapsed: 0.004 sec  <<< ERROR!
java.lang.NullPointerException
    at gate.Factory.createResource(Factory.java:182)
    at gate.Factory.newCorpus(Factory.java:475)
    at gate.corpora.TestCorpus.testDocumentAddition(TestCorpus.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at junit.framework.TestCase.runTest(TestCase.java:176)
    at junit.framework.TestCase.runBare(TestCase.java:141)
    at junit.framework.TestResult$1.protect(TestResult.java:122)
    at junit.framework.TestResult.runProtected(TestResult.java:142)
    at junit.framework.TestResult.run(TestResult.java:125)
    at junit.framework.TestCase.run(TestCase.java:129)
    at junit.framework.TestSuite.runTest(TestSuite.java:252)
    at junit.framework.TestSuite.run(TestSuite.java:247)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

(some other plugins I tried compile fine on that machine)

Settings file used:

<settings>
  <profiles>
    <profile>
      <id>gate-development</id>
      <repositories>
        <repository>
          <id>gate-maven-snapshots</id>
          <name>GATE Snapshot Repository</name>
          <url>http://repo.gate.ac.uk/content/repositories/snapshots/</url>
        </repository>
      </repositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>gate-development</activeProfile>
  </activeProfiles>
</settings>
greenwoodma commented 5 years ago

Looking at the stack trace that looks as if the test was run before the CreoleRegister was created, i.e. before Gate.init() was called. I've had problems in the past when some of the old tests are run out of order they end up not working properly and I'm wondering if this is related. Any chance you could run it again and see what order the tests are run in before it fails, and then do the same again on a machine where it works so we can double check (the test logs in the target folder might actually show this without having to re-run).

johann-petrak commented 5 years ago

Here is the full test log on the machine where it fails:

[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gate-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 91 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ gate-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ gate-core ---
[INFO] Surefire report directory: /home/johann/gate-home/GIT/gate-core/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running gate.corpora.TestCorpus
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.424 sec <<< FAILURE!
testCreation(gate.corpora.TestCorpus)  Time elapsed: 0.192 sec  <<< ERROR!
java.lang.NullPointerException
    at gate.Factory.createResource(Factory.java:182)
    at gate.Factory.newCorpus(Factory.java:475)
    at gate.corpora.TestCorpus.testCreation(TestCorpus.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at junit.framework.TestCase.runTest(TestCase.java:176)
    at junit.framework.TestCase.runBare(TestCase.java:141)
    at junit.framework.TestResult$1.protect(TestResult.java:122)
    at junit.framework.TestResult.runProtected(TestResult.java:142)
    at junit.framework.TestResult.run(TestResult.java:125)
    at junit.framework.TestCase.run(TestCase.java:129)
    at junit.framework.TestSuite.runTest(TestSuite.java:252)
    at junit.framework.TestSuite.run(TestSuite.java:247)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testDocumentAddition(gate.corpora.TestCorpus)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NullPointerException
    at gate.Factory.createResource(Factory.java:182)
    at gate.Factory.newCorpus(Factory.java:475)
    at gate.corpora.TestCorpus.testDocumentAddition(TestCorpus.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at junit.framework.TestCase.runTest(TestCase.java:176)
    at junit.framework.TestCase.runBare(TestCase.java:141)
    at junit.framework.TestResult$1.protect(TestResult.java:122)
    at junit.framework.TestResult.runProtected(TestResult.java:142)
    at junit.framework.TestResult.run(TestResult.java:125)
    at junit.framework.TestCase.run(TestCase.java:129)
    at junit.framework.TestSuite.runTest(TestSuite.java:252)
    at junit.framework.TestSuite.run(TestSuite.java:247)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running gate.corpora.TestTikaFormats
log4j:WARN No appenders could be found for logger (gate.creole.CreoleRegisterImpl).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Feb 04, 2019 11:36:34 AM org.apache.tika.config.InitializableProblemHandler$3 handleInitializableProblem
WARNUNG: J2KImageReader not loaded. JPEG2000 files will not be processed.
See https://pdfbox.apache.org/2.0/dependencies.html#jai-image-io
for optional dependencies.

Feb 04, 2019 11:36:34 AM org.apache.tika.config.InitializableProblemHandler$3 handleInitializableProblem
WARNUNG: org.xerial's sqlite-jdbc is not loaded.
Please provide the jar on your classpath to parse sqlite files.
See tika-parsers/pom.xml for the correct version.
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.149 sec
Running gate.corpora.TestDocumentStaxUtils
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
Running gate.corpora.TestDocument
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.206 sec
Running gate.html.TestHtml
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.08 sec
Running gate.util.TestFeatureMap
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Running gate.util.TestDiffer
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.148 sec
Running gate.util.TestTools
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec
Running gate.util.TestFiles
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
Running gate.util.TestClassificationMeasures
ClassificationMeasures: Annotation in set 1 with no counterpart in set 2 detected! Ignoring.
AnnotationImpl: id=15647; type=sent; features={Op=zzzzz}; start=NodeImpl: id=3025; offset=257; end=NodeImpl: id=3026; offset=413

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.52 sec
Running gate.util.TestAnnotationMerging
The 1 annotator cause different
The 1 annotator cause different
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 sec
Running gate.util.TestRBTreeMap
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running gate.annotation.TestAnnotation
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.508 sec
Running gate.creole.TestCreoleAnnotationHandler
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.768 sec
Running gate.creole.TestCreole
Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.163 sec
Running gate.creole.TestXSchema
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
Running gate.creole.DynamicRegistrationTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec
Running gate.creole.TestResourceReference
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.029 sec
Running gate.email.TestEmail
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.039 sec
Running gate.TestUtils
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.028 sec
Running gate.sgml.TestSgml
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.131 sec
Running gate.config.TestConfig
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.177 sec
Running gate.xml.TestXml
Saved to temp file :file:/tmp/gateResource4950887568307497797.tmp
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.961 sec
Running gate.xml.TestRepositioningInfo
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.048 sec
Running gate.persist.TestPersist
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.133 sec

Results :

Tests in error: 
  testCreation(gate.corpora.TestCorpus)
  testDocumentAddition(gate.corpora.TestCorpus)

Tests run: 103, Failures: 0, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  45.645 s
[INFO] Finished at: 2019-02-04T11:36:48+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project gate-core: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/johann/gate-home/GIT/gate-core/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
johann-petrak commented 5 years ago

Here is the log from a machine where it works:

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gate-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 91 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ gate-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 31 source files to /data/johann/gate-home/GIT/gate-core/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ gate-core ---
[INFO] Surefire report directory: /data/johann/gate-home/GIT/gate-core/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running gate.TestUtils
log4j:WARN No appenders could be found for logger (gate.creole.CreoleRegisterImpl).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.814 sec
Running gate.xml.TestXml
Saved to temp file :file:/tmp/gateResource875129810374294698.tmp
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.639 sec
Running gate.xml.TestRepositioningInfo
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.03 sec
Running gate.annotation.TestAnnotation
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.246 sec
Running gate.creole.TestXSchema
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.029 sec
Running gate.creole.TestCreoleAnnotationHandler
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.918 sec
Running gate.creole.DynamicRegistrationTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.228 sec
Running gate.creole.TestResourceReference
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.645 sec
Running gate.creole.TestCreole
Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.532 sec
Running gate.config.TestConfig
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.145 sec
Running gate.html.TestHtml
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02 sec
Running gate.persist.TestPersist
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.246 sec
Running gate.util.TestDiffer
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.129 sec
Running gate.util.TestAnnotationMerging
The 1 annotator cause different
The 1 annotator cause different
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec
Running gate.util.TestTools
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 sec
Running gate.util.TestRBTreeMap
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running gate.util.TestClassificationMeasures
ClassificationMeasures: Annotation in set 1 with no counterpart in set 2 detected! Ignoring.
AnnotationImpl: id=15647; type=sent; features={Op=zzzzz}; start=NodeImpl: id=3025; offset=257; end=NodeImpl: id=3026; offset=413

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.61 sec
Running gate.util.TestFiles
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 sec
Running gate.util.TestFeatureMap
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running gate.email.TestEmail
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 sec
Running gate.corpora.TestCorpus
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
Running gate.corpora.TestTikaFormats
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Feb 04, 2019 10:40:19 AM org.apache.tika.config.InitializableProblemHandler$3 handleInitializableProblem
WARNING: J2KImageReader not loaded. JPEG2000 files will not be processed.
See https://pdfbox.apache.org/2.0/dependencies.html#jai-image-io
for optional dependencies.

Feb 04, 2019 10:40:19 AM org.apache.tika.config.InitializableProblemHandler$3 handleInitializableProblem
WARNING: org.xerial's sqlite-jdbc is not loaded.
Please provide the jar on your classpath to parse sqlite files.
See tika-parsers/pom.xml for the correct version.
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 15.035 sec
Running gate.corpora.TestDocument
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec
Running gate.corpora.TestDocumentStaxUtils
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Running gate.sgml.TestSgml
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.094 sec

Results :

Tests run: 103, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.1:report (default-report) @ gate-core ---
[INFO] Loading execution data file /data/johann/gate-home/GIT/gate-core/target/jacoco.exec
[INFO] Analyzed bundle 'GATE Core' with 1431 classes
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ gate-core ---
[INFO] Building jar: /data/johann/gate-home/GIT/gate-core/target/gate-core-8.6-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ gate-core ---
[INFO] Installing /data/johann/gate-home/GIT/gate-core/target/gate-core-8.6-SNAPSHOT.jar to /home/johann/.m2/repository/uk/ac/gate/gate-core/8.6-SNAPSHOT/gate-core-8.6-SNAPSHOT.jar
[INFO] Installing /data/johann/gate-home/GIT/gate-core/pom.xml to /home/johann/.m2/repository/uk/ac/gate/gate-core/8.6-SNAPSHOT/gate-core-8.6-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-invoker-plugin:3.1.0:run (default) @ gate-core ---
[WARNING] Filtering of parent/child POMs is not supported without cloning the projects
[INFO] Building: distro/pom.xml
[INFO]           distro/pom.xml ................................... SUCCESS (6.6 s)
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 1, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:16 min
[INFO] Finished at: 2019-02-04T10:40:49Z
[INFO] Final Memory: 63M/1239M
[INFO] ----------------------------------------------------------------
greenwoodma commented 5 years ago

Yes, as I thought the tests are begin run in a different order. When it fails it's running gate.corpora.TestCorpus first and when it works it's running gate.TestUtils. Looking at the code gate.corpora.TestCorpus doesn't do Gate.init() so it fails when it tries to create a resource if it's run as the very first test.

The fix is to ensure that each of the test classes can be run independently and without regard to the order of the other tests.

greenwoodma commented 5 years ago

@johann-petrak try it now and see what happens. Hopefully it will just work, but you might hit another test that has the same problem, so I'll let you close the issue if it all works properly.

Note, I haven't been through all the tests by hand so this could crop up again if there are any more with the same problem, but they are at least easy to fix if they do.

johann-petrak commented 5 years ago

Great! Works fine on that machine now (TestCorpus still was the first test run)!