Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surefire version, Java 11 error in ConstructionStageTest, #107

Closed
shirishag75 opened this issue Oct 23, 2018 · 32 comments
Closed

Surefire version, Java 11 error in ConstructionStageTest, #107

shirishag75 opened this issue Oct 23, 2018 · 32 comments

Comments

@shirishag75
Copy link

@shirishag75 shirishag75 commented Oct 23, 2018

Dear all,

Package: openjdk-11-jre-headless
Version: 11~28-3
Severity: normal



-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8), LANGUAGE=en_IN:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages openjdk-11-jre-headless depends on:
ii  ca-certificates-java  20180516
ii  java-common           0.69
ii  libasound2            1.1.6-1
ii  libc6                 2.27-6
ii  libcups2              2.2.8-5
ii  libfontconfig1        2.13.1-1
ii  libfreetype6          2.8.1-2
ii  libgcc1               1:8.2.0-8
ii  libjpeg62-turbo       1:1.5.2-2+b1
ii  liblcms2-2            2.9-3
ii  libnss3               2:3.39-1
ii  libpcsclite1          1.8.24-1
ii  libstdc++6            8.2.0-8
ii  libx11-6              2:1.6.7-1
ii  libxext6              2:1.3.3-1+b2
ii  libxi6                2:1.7.9-1
ii  libxrender1           1:0.9.10-1
ii  libxtst6              2:1.2.3-1
ii  util-linux            2.32.1-0.1
ii  zlib1g                1:1.2.11.dfsg-1

openjdk-11-jre-headless recommends no packages.

Versions of packages openjdk-11-jre-headless suggests:
ii  fonts-dejavu-extra    2.37-1
pn  fonts-indic           <none>
ii  fonts-ipafont-gothic  00303-18
ii  fonts-ipafont-mincho  00303-18
ii  fonts-wqy-microhei    0.2.0-beta-3
ii  libnss-mdns           0.14.1-1

-- no debconf information

This was mentioned in passing but guess should be shared -

/games/mars-sim/mars-sim-core/target/surefire-reports$ cat org.mars_sim.msp.core.structure.construction.ConstructionStageTest.txt
-------------------------------------------------------------------------------
Test set: org.mars_sim.msp.core.structure.construction.ConstructionStageTest
-------------------------------------------------------------------------------
Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.005 sec <<< FAILURE!
testIsComplete(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)  Time elapsed: 0.002 sec  <<< ERROR!
java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.<init>(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testIsComplete(ConstructionStageTest.java:103)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)

testAddWorkTime(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.<init>(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testAddWorkTime(ConstructionStageTest.java:88)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)

testGetInfo(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.<init>(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testGetInfo(ConstructionStageTest.java:68)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)

testConstructionStage(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.<init>(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testConstructionStage(ConstructionStageTest.java:58)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)

testGetCompletedWorkTime(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.<init>(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testGetCompletedWorkTime(ConstructionStageTest.java:78)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)
@mokun
Copy link
Member

@mokun mokun commented Oct 23, 2018

@shirishag75 , can you fill out the issue template in future ?

It's good to let everyone know the system on which you run the test. Appreciate that.

This seems to be openjdk 11 related.

ConstructionSiteTest suffers the same fates as ConstructionStageTest.

The updateAllAssociatedPeople() is the culprit again.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 23, 2018

I edited the bug so that system information is shared as well.

Another point is that the surefire-report that we are using here is version 2.20.1 while in Debian buster we have the latest 2.22.1 in Debian/buster

$ dpkg -l libsurefire-java
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version      Architecture Description
+++-================-============-============-=================================
ii  libsurefire-java 2.22.1-1     all          Surefire test framework for Java

This is for @seamlik

@seamlik
Copy link

@seamlik seamlik commented Oct 24, 2018

What version is the Surefire in Debian is irrelevant, as Maven will honor the original POM and download the artifacts online.

Debian's artifacts will only be used when building a Debian package that fully complies to The Debian Policy.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 24, 2018

True, that was my amateur way of motivating you to see if something can be worked out :)

@mokun
Copy link
Member

@mokun mokun commented Oct 24, 2018

What version is the Surefire in Debian is irrelevant, as Maven will honor the original POM and download the artifacts online.
Debian's artifacts will only be used when building a Debian package that fully complies to The Debian Policy.

True. I have no control over what version of surefire it will use.

I do need to point out the fact that I encounter no issue when running maven test in java 10.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 28, 2018

ah, then perhaps it is that because I have both the jdk installed -

$ sudo update-java-alternatives --list
[sudo] password for shirish: 
java-1.10.0-openjdk-amd64      1101       /usr/lib/jvm/java-1.10.0-openjdk-amd64
java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64

Although TEST-org.mars_sim.msp.core.structure.consttructionStageTest.xml does tell that it uses java 11 instead of 10

~/games/mars-sim/mars-sim-core/target/surefire-reports$ cat TEST-org.mars_sim.msp.core.structure.consttructionStageTest.xml
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="5" failures="0" name="org.mars_sim.msp.core.structure.construction.ConstructionStageTest" time="0.004" errors="5" skipped="0">
  <properties>
    <property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
    <property name="java.vm.version" value="11.0.1+13-Debian-2"/>
    <property name="sun.boot.library.path" value="/usr/lib/jvm/java-11-openjdk-amd64/lib"/>
    <property name="maven.multiModuleProjectDirectory" value="/home/shirish/games/mars-sim"/>
    <property name="java.vm.vendor" value="Oracle Corporation"/>
    <property name="java.vendor.url" value="http://java.oracle.com/"/>
    <property name="guice.disable.misplaced.annotation.check" value="true"/>
    <property name="path.separator" value=":"/>
    <property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
    <property name="sun.os.patch.level" value="unknown"/>
    <property name="user.country" value="IN"/>
    <property name="sun.java.launcher" value="SUN_STANDARD"/>
    <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
    <property name="user.dir" value="/home/shirish/games/mars-sim"/>
    <property name="java.vm.compressedOopsMode" value="32-bit"/>
    <property name="java.runtime.version" value="11.0.1+13-Debian-2"/>
    <property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
    <property name="os.arch" value="amd64"/>
    <property name="java.io.tmpdir" value="/tmp"/>
    <property name="line.separator" value="
"/>
    <property name="java.vm.specification.vendor" value="Oracle Corporation"/>
    <property name="os.name" value="Linux"/>
    <property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
    <property name="sun.jnu.encoding" value="UTF-8"/>
    <property name="java.library.path" value="/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
    <property name="maven.conf" value="/usr/share/maven/conf"/>
    <property name="jdk.debug" value="release"/>
    <property name="java.class.version" value="55.0"/>
    <property name="java.specification.name" value="Java Platform API Specification"/>
    <property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
    <property name="os.version" value="4.18.0-2-amd64"/>
    <property name="library.jansi.path" value="/usr/share/maven/lib/jansi-native"/>
    <property name="user.home" value="/home/shirish"/>
    <property name="user.timezone" value="Asia/Kolkata"/>
    <property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
    <property name="file.encoding" value="UTF-8"/>
    <property name="java.specification.version" value="11"/>
    <property name="user.name" value="shirish"/>
    <property name="java.class.path" value="/usr/share/maven/boot/plexus-classworlds-2.x.jar"/>
    <property name="org.slf4j.simpleLogger.defaultLogLevel" value="debug"/>
    <property name="java.vm.specification.version" value="11"/>
    <property name="sun.arch.data.model" value="64"/>
    <property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher package -X"/>
    <property name="java.home" value="/usr/lib/jvm/java-11-openjdk-amd64"/>
    <property name="user.language" value="en"/>
    <property name="java.specification.vendor" value="Oracle Corporation"/>
    <property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
    <property name="java.vm.info" value="mixed mode, sharing"/>
    <property name="java.version" value="11.0.1"/>
    <property name="securerandom.source" value="file:/dev/./urandom"/>
    <property name="java.vendor" value="Oracle Corporation"/>
    <property name="maven.home" value="/usr/share/maven"/>
    <property name="file.separator" value="/"/>
    <property name="java.version.date" value="2018-10-16"/>
    <property name="java.vendor.url.bug" value="http://bugreport.java.com/bugreport/"/>
    <property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
    <property name="sun.cpu.endian" value="little"/>
    <property name="sun.cpu.isalist" value=""/>
  </properties>
  <testcase classname="org.mars_sim.msp.core.structure.construction.ConstructionStageTest" name="testIsComplete" time="0.002">
    <error type="java.lang.NullPointerException">java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.&lt;init&gt;(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testIsComplete(ConstructionStageTest.java:103)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)
</error>
  </testcase>
  <testcase classname="org.mars_sim.msp.core.structure.construction.ConstructionStageTest" name="testAddWorkTime" time="0.001">
    <error type="java.lang.NullPointerException">java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.&lt;init&gt;(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testAddWorkTime(ConstructionStageTest.java:88)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)
</error>
  </testcase>
  <testcase classname="org.mars_sim.msp.core.structure.construction.ConstructionStageTest" name="testGetInfo" time="0">
    <error type="java.lang.NullPointerException">java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.&lt;init&gt;(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testGetInfo(ConstructionStageTest.java:68)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)
</error>
  </testcase>
  <testcase classname="org.mars_sim.msp.core.structure.construction.ConstructionStageTest" name="testConstructionStage" time="0.001">
    <error type="java.lang.NullPointerException">java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.&lt;init&gt;(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testConstructionStage(ConstructionStageTest.java:58)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)
</error>
  </testcase>
  <testcase classname="org.mars_sim.msp.core.structure.construction.ConstructionStageTest" name="testGetCompletedWorkTime" time="0">
    <error type="java.lang.NullPointerException">java.lang.NullPointerException
        at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1860)
        at org.mars_sim.msp.core.structure.Settlement.&lt;init&gt;(Settlement.java:275)
        at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:284)
        at org.mars_sim.msp.core.structure.construction.ConstructionStageTest.testGetCompletedWorkTime(ConstructionStageTest.java:78)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)
</error>
  </testcase>
</testsuite>

Just a note, this is the only test in the entire test-suite which fails, all the others pass at this point in time.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Nov 8, 2018

Update -

$ sudo update-java-alternatives --list
java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64

Tests in error: 
  testIsComplete(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testAddWorkTime(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testGetInfo(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testConstructionStage(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testGetCompletedWorkTime(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)

Tests run: 205, Failures: 0, Errors: 5, Skipped: 0
mokun added a commit that referenced this issue Nov 13, 2018
r4543
2018-11-12

Note: this builds addresses the request to comment out a unit test
for Java 11 testing in issue
#107

## CHANGE
1. Modify determinedSettlementParkedLocationAndFacing() in
   GroundVehicle for passing maven test.
   - the value of "total" cannot be -1 during unit test.
mokun added a commit that referenced this issue Nov 13, 2018
r4544
2018-11-12

Note: this builds addresses the request to comment out a unit test
for Java 11 testing in issue
#107

## CHANGES
1. Comment out the line for loading ConstructionStageTest in
   JUnitTests.
@mokun mokun changed the title error in surefire-reports, specifically org.mars_sim.msp.core.structure.construction.ConstructionStageTest Surefire version, Java 11 error in ConstructionStageTest, Nov 13, 2018
@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Nov 13, 2018

Thank you for the workaround, hopefully some days down the line we would have a real fix. I was able to move a bit forward but got stuck again, another issue, another day :)

@mokun
Copy link
Member

@mokun mokun commented Nov 13, 2018

Since your are using the headless edition, in your mars-sim's pom.xml, comment out the mars-sim-network, mars-sim-main and mars-sim-ui, before you run maven test.

	<modules>
		<!--module>mars-sim-android</module -->
		<module>mars-sim-core</module>
		<module>mars-sim-headless</module>
		<!--module>mars-sim-main</module -->
		<module>mars-sim-mapdata</module>
		<!--module>mars-sim-network</module -->
		<!-- module>mars-sim-service</module-->
		<!--module>mars-sim-ui</module -->
	</modules>
@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 3, 2018

any update on the java 1 error in ConstructionStageTest, it would be nice if we are able to figure out what's wrong in here and fix it.

@mokun
Copy link
Member

@mokun mokun commented Dec 5, 2018

In my setup, there's nothing wrong with ConstructionStageTest at all.

I just re-enabled it and put it to test. See below :


[INFO] --- jdeb:1.6:jdeb (default) @ mars-sim-main ---
[INFO] Creating debian package: D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main_3.1.0~b2_all.deb
[INFO] Building conffiles
[INFO] Skipping 'conffiles' generation. No entries defined in maven/pom or ant/build.xml.
[INFO] Creating changes file: D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main_3.1.0~b2_all.changes
[INFO] Attaching created debian package D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main_3.1.0~b2_all.deb
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mars-sim-main ---
[INFO] Installing D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main-3.1.0-b2.jar to C:\Users\mkhelios\.m2\repository\net\sf\mars-sim\mars-sim-main\3.1.0-b2\mars-sim-main-3.1.0-b2.jar
[INFO] Installing D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\pom.xml to C:\Users\mkhelios\.m2\repository\net\sf\mars-sim\mars-sim-main\3.1.0-b2\mars-sim-main-3.1.0-b2.pom
[INFO] Installing D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main-3.1.0-b2-jar-with-dependencies.jar to C:\Users\mkhelios\.m2\repository\net\sf\mars-sim\mars-sim-main\3.1.0-b2\mars-sim-main-3.1.0-b2-jar-with-dependencies.jar
[INFO] Installing D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main_3.1.0~b2_all.deb to C:\Users\mkhelios\.m2\repository\net\sf\mars-sim\mars-sim-main\3.1.0-b2\mars-sim-main-3.1.0-b2.deb
[INFO] Installing D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main-3.1.0-b2-jar-with-dependencies.jar to C:\Users\mkhelios\.m2\repository\net\sf\mars-sim\mars-sim-main\3.1.0-b2\mars-sim-main-3.1.0-b2-jar-with-dependencies.jar
[INFO] Installing D:\eclipse\jee-2018-09\git\mars-sim\mars-sim-main\target\mars-sim-main_3.1.0~b2_all.deb to C:\Users\mkhelios\.m2\repository\net\sf\mars-sim\mars-sim-main\3.1.0-b2\mars-sim-main-3.1.0-b2.deb
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] mars-sim 3.1.0-b2 .................................. SUCCESS [  0.391 s]
[INFO] mars-sim-mapdata ................................... SUCCESS [  2.960 s]
[INFO] mars-sim-core ...................................... SUCCESS [ 47.814 s]
[INFO] mars-sim-headless .................................. SUCCESS [ 15.148 s]
[INFO] mars-sim-network ................................... SUCCESS [  2.359 s]
[INFO] mars-sim-ui ........................................ SUCCESS [01:03 min]
[INFO] mars-sim-main 3.1.0-b2 ............................. SUCCESS [ 39.369 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:34 min (Wall Clock)
[INFO] Finished at: 2018-12-05T12:54:33-08:00
[INFO] ------------------------------------------------------------------------
mokun referenced this issue Dec 5, 2018
r4642
2018-12-05

## CHANGE
1. Reactivate ConstructionSiteTest and ConstructionStageTest in
   JUnitTests.
2. Relocate a static method from AmountResource to ResourceUtil.
3. Relocate a static method from ItemResource to ItemResourceUtil.
@mokun
Copy link
Member

@mokun mokun commented Dec 5, 2018

I just reactivated the two tests.

See if you can get them working in your setup. May be you want to try out just one at a time.

All you have to do is to comment them out if they don't compile.

public class JUnitTests extends TestCase {
    /**
     * Collection of external test suites to be included in current testing.
     */
    public static Test suite() {
        TestSuite suite = new TestSuite();
        
        suite.addTestSuite(ConstructionManagerTest.class);
        suite.addTestSuite(ConstructionSiteTest.class);
        suite.addTestSuite(ConstructionStageInfoTest.class);
        suite.addTestSuite(ConstructionStageTest.class);
        suite.addTestSuite(ConstructionVehicleTypeTest.class);
        
        return suite;
    }
}

For instances, you can use // as follows to comment out the ConstructionSiteTest in JUniTests inside the construction directory if it fails the maven test :

// suite.addTestSuite(ConstructionSiteTest.class);

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 5, 2018

I am still getting the error, see at https://paste.debian.net/1054577/

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 5, 2018

I just reactivated the two tests.

For instances, you can use // as follows to comment out the ConstructionSiteTest in JUniTests inside the construction directory if it fails the maven test :

// suite.addTestSuite(ConstructionSiteTest.class);

Can you share the whole path of the Construction directory ?

Got it, it seems to be ~/games/mars-sim/mars-sim-core/src/main/java/org/mars_sim/msp/core/structure/construction$ leafpad JUnitTests.java

if I'm not wrong.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 6, 2018

This is the end result it shows atm -

Results :

Tests in error: 
  testGetCurrentConstructionStage(org.mars_sim.msp.core.structure.construction.ConstructionSiteTest)
  testAddNewStage(org.mars_sim.msp.core.structure.construction.ConstructionSiteTest)
  testSetUndergoingConstruction(org.mars_sim.msp.core.structure.construction.ConstructionSiteTest)
  testIsAllConstructionComplete(org.mars_sim.msp.core.structure.construction.ConstructionSiteTest)
  testGetNextStageType(org.mars_sim.msp.core.structure.construction.ConstructionSiteTest)
  testIsComplete(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testAddWorkTime(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testGetInfo(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testConstructionStage(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)
  testGetCompletedWorkTime(org.mars_sim.msp.core.structure.construction.ConstructionStageTest)

Tests run: 210, Failures: 0, Errors: 10, Skipped: 0

@mokun
Copy link
Member

@mokun mokun commented Dec 6, 2018

Got it, it seems to be ~/games/mars-sim/mars-sim-core/src/main/java/org/mars_sim/msp/core/structure/construction$ leafpad JUnitTests.java

No. It's inside the /core/src/test/ directory, not the /core/src/main/.

See JUnitTests

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 6, 2018

I did the changes and compile but no change -

I am still getting the same error :(

shirish@debian:~/games/mars-sim/mars-sim-core/src/test/java/org/mars_sim/msp/core/structure/construction$ cat JUnitTests.java

.....
     // suite.addTestSuite(ConstructionManagerTest.class);
     // suite.addTestSuite(ConstructionSiteTest.class);
     // suite.addTestSuite(ConstructionStageInfoTest.class);
     // suite.addTestSuite(ConstructionStageTest.class);
     // suite.addTestSuite(ConstructionVehicleTypeTest.class);
......
mokun referenced this issue Dec 7, 2018
r4647
2018-12-06

## RELATED
1. #162
2. #163
3. #122

## CHANGE
1. Update google guice to guice 4.2.2 to the "illegal reflective
   access operation" by com.google.inject.internal.cglib.core.
   $ReflectUtils$1 when running maven test.
2. Add slf4j-simple 1.7.25 in order to remove the slf4j error at the
   start of the sim.
@mokun
Copy link
Member

@mokun mokun commented Dec 7, 2018

With the new google guice 4.2.2 from the last build, I hope it takes care of the reflection access issue.

Let me know if you can run maven test successfully. If not, comment out those modules that requires openjfx. See if it has to do with openjfx

	<modules>
		<!--module>mars-sim-android</module -->
		<module>mars-sim-core</module>
		<module>mars-sim-headless</module>
		<!--module>mars-sim-main</module -->
		<module>mars-sim-mapdata</module>
		<!--module>mars-sim-network</module -->
		<!-- module>mars-sim-service</module-->
		<!--module>mars-sim-ui</module -->
	</modules>
@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 7, 2018

I am still running into the whole shebang -

testGetCurrentConstructionStage(org.mars_sim.msp.core.structure.construction.ConstructionSiteTest)  Time elapsed: 0.004 sec  <<< ERROR!
java.lang.NullPointerException

and what all comes underneath it.

In pom.xml only three modules are activated, mars-sim-core, mars-sim-headless and mars-sim-mapdata. All the rest are not activated. I am stumped :(

@mokun
Copy link
Member

@mokun mokun commented Dec 8, 2018

Can you post the stack trace on a few lines before and after it encounters NullPointerException in ConstructionSiteTest ? Thanks !

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 8, 2018

Is this good enough or no ?

https://paste.debian.net/1054902/

@mokun
Copy link
Member

@mokun mokun commented Dec 8, 2018

It's the method updateAllAssociatedPeople() in Settlement.java again that openjdk 11 somehow didn't like

testGetCurrentConstructionStage(org.mars_sim.msp.core.structure.construction.ConstructionSiteTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NullPointerException 
at org.mars_sim.msp.core.structure.Settlement.updateAllAssociatedPeople(Settlement.java:1994)
at org.mars_sim.msp.core.structure.Settlement.<init>(Settlement.java:315)
at org.mars_sim.msp.core.structure.Settlement.createConstructionStage(Settlement.java:324)
at org.mars_sim.msp.core.structure.construction.ConstructionSiteTest.setUp(ConstructionSiteTest.java:44)
at junit.framework.TestCase.runBare(TestCase.java:139)
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)
@mokun
Copy link
Member

@mokun mokun commented Dec 8, 2018

Can you comment that out in Settlement.java to see if the null issue go away ?

	private Settlement() {
		super(null, null);
		location = getCoordinates();
//		unitManager = Simulation.instance().getUnitManager();

//		updateAllAssociatedPeople();
//		updateAllAssociatedRobots();
	}

Chances are that the NullPointerException has to do with the UnitManager instance being null inside updateAllAssociatedPeople().

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 8, 2018

After doing the above, I was able to build without an issue. Got a success at the end -

INFO] Creating debian package: /home/shirish/games/mars-sim/mars-sim-headless/target/mars-sim-headless_3.1.0~b2_all.deb
[INFO] Building conffiles
[INFO] Skipping 'conffiles' generation. No entries defined in maven/pom or ant/build.xml.
[INFO] Creating changes file: /home/shirish/games/mars-sim/mars-sim-headless/target/mars-sim-headless_3.1.0~b2_all.changes
[INFO] Attaching created debian package /home/shirish/games/mars-sim/mars-sim-headless/target/mars-sim-headless_3.1.0~b2_all.deb
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for mars-sim 3.1.0-b2:
[INFO] 
[INFO] mars-sim ........................................... SUCCESS [  0.003 s]
[INFO] mars-sim-mapdata ................................... SUCCESS [  2.153 s]
[INFO] mars-sim-core ...................................... SUCCESS [ 26.335 s]
[INFO] mars-sim-headless .................................. SUCCESS [ 12.906 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  41.531 s
[INFO] Finished at: 2018-12-08T11:16:13+05:30
[INFO] ------------------------------------------------------------------------

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 8, 2018

The only difference in the output is -

2018-12-08T11:43:19.2 (Info) UnitManager :  - - - - - - - - - - - - Sol 125 - - - - - - - - - - - - 
2018-12-08T11:43:30.0 (Info) UnitManager :  - - - - - - - - - - - - Sol 126 - - - - - - - - - - - - 
2018-12-08T11:43:40.8 (Info) UnitManager :  - - - - - - - - - - - - Sol 127 - - - - - - - - - - - -

So for some days there is just no data. Perhaps this can be fixed.

@mokun
Copy link
Member

@mokun mokun commented Dec 8, 2018

Can you turn on log finer to see if people are going from place to place ?

@mokun
Copy link
Member

@mokun mokun commented Dec 8, 2018

Let's close this thread and not mixing in other things here. If encountering any bugs, open a new issue.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Dec 14, 2018

I had to remove Settlement.java, git pull again and again do the fixing so was able to package and play the new version.

mokun added a commit that referenced this issue Dec 14, 2018
r4671
2018-12-14

## ISSUE
1. #107

## CHANGE
1. Comment out the followings in Settlement
   - updateAllAssociatedPeople()
   - updateAllAssociatedRobots()
@mokun
Copy link
Member

@mokun mokun commented Feb 1, 2019

I'm reading this on the java 11 migration.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Feb 1, 2019

sounds like the right thing to do. Having a single pom with reduce complexity like anything. I was sold in the first para itself.

I tried running mvn versions:display-plugin-updates

Seems we would have to update whole lot of modules. Does seem like lot of work. Let me see if it does its cycle and produces some sort of report on what it thinks would be best for our project.

Interesting, see https://paste.debian.net/1064231/ . Seems everything works once everything is updated. It does tell us many things.

@mokun
Copy link
Member

@mokun mokun commented Feb 1, 2019

I tried running mvn versions:display-plugin-updates. Seems we would have to update whole lot of modules. Does seem like lot of work.

We already have the latest version on all plugins.

mokun added a commit that referenced this issue Feb 2, 2019
r4862
2019-02-02

Note: this builds enables trouble-free switching between Java
compiler version (namely 8, 9, 10, or 11) in the
<release> tag in mars-sim's pom.xml as follows :

	<modelVersion>4.0.0</modelVersion>
	<groupId>net.sf</groupId>
	<artifactId>mars-sim</artifactId>
	<packaging>pom</packaging>
	<version>3.1.0-b2</version>
	<name>mars-sim</name>
	<url>https://github.com/mars-sim/mars-sim</url>
	<inceptionYear>2009</inceptionYear>
	<properties>
		<release>8</release>
		<project.version>3.1.0-b2</project.version>

## ISSUE
1. #107
2. #74

## CHANGE
1. Modify PromptComboBoxRenderer to extend
   DefaultListCellRenderer in a number of TabPanel* class,
   BuildingPanelFarming and SettlementTransparentPanel
2. Add markdowngenerator in mars-sim-core's pom.xml.
3. Remove xstream in mars-sim-core's pom.xml.
@mokun
Copy link
Member

@mokun mokun commented Oct 14, 2020

This is an old. closed

@mokun mokun closed this Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants