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

Test failure when trying to build v1.0 #2339

Open
marcusyoung opened this Issue Sep 9, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@marcusyoung

marcusyoung commented Sep 9, 2016

I get the following test error so am unable to build version 1.0:


Test set: org.opentripplanner.updater.bike_rental.TestShareBikeRentalStationSource

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.072 sec <<< FAILURE!
testShareBike(org.opentripplanner.updater.bike_rental.TestShareBikeRentalStationSource) Time elapsed: 0.035 sec <<< FAILURE!
junit.framework.AssertionFailedError: null
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at junit.framework.Assert.assertTrue(Assert.java:27)
at org.opentripplanner.updater.bike_rental.TestShareBikeRentalStationSource.testShareBike(TestShareBikeRentalStationSource.java:16)
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:497)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
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:497)
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:103)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

@barbeau

This comment has been minimized.

Collaborator

barbeau commented Sep 9, 2016

@marcusyoung Note that you can still build the project and skip the tests with mvn install -DskipTests.

@abyrd

This comment has been minimized.

Member

abyrd commented Sep 12, 2016

I'm still unable to reproduce this, but leaving the ticket open until we try the build on more platforms.

@barbeau

This comment has been minimized.

Collaborator

barbeau commented Sep 12, 2016

I'm able to reproduce this with a clean clone and mvn install on the master branch, on Windows 10 Pro and Java 1.8.0_91 64-bit.

Looks like the test failure boils down to not finding the share-bike.json file:

Bike rental station TNB at 48.107697, -1.673695
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.064 sec
Running org.opentripplanner.updater.bike_rental.TestShareBikeRentalStationSource
09:32:47.616 WARN (ShareBikeRentalDataSource.java:77) Unable to extract url parameter 'SystemID' query parameter from sharebike url, using random value 4fab207a-30d4-4f15-acc2-f510cbec9fed
09:32:47.631 WARN (GenericJsonBikeRentalDataSource.java:99) Error reading bike rental feed from file:src/test/resources/bike/share-bike.json?SystemID=dummyid
java.io.FileNotFoundException: src\test\resources\bike\share-bike.json?SystemID=dummyid (The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileInputStream.open0(Native Method) ~[na:1.8.0_60]
        at java.io.FileInputStream.open(FileInputStream.java:195) ~[na:1.8.0_60]
        at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[na:1.8.0_60]
        at java.io.FileInputStream.<init>(FileInputStream.java:93) ~[na:1.8.0_60]
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) ~[na:1.8.0_60]
        at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) ~[na:1.8.0_60]
        at java.net.URL.openStream(URL.java:1038) ~[na:1.8.0_60]
        at org.opentripplanner.updater.bike_rental.GenericJsonBikeRentalDataSource.update(GenericJsonBikeRentalDataSource.java:83) ~[classes/:na]
        at org.opentripplanner.updater.bike_rental.TestShareBikeRentalStationSource.testShareBike(TestShareBikeRentalStationSource.java:16) [test-classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
        at junit.framework.TestCase.runTest(TestCase.java:168) [junit-4.8.1.jar:na]
        at junit.framework.TestCase.runBare(TestCase.java:134) [junit-4.8.1.jar:na]
        at junit.framework.TestResult$1.protect(TestResult.java:110) [junit-4.8.1.jar:na]
        at junit.framework.TestResult.runProtected(TestResult.java:128) [junit-4.8.1.jar:na]
        at junit.framework.TestResult.run(TestResult.java:113) [junit-4.8.1.jar:na]
        at junit.framework.TestCase.run(TestCase.java:124) [junit-4.8.1.jar:na]
        at junit.framework.TestSuite.runTest(TestSuite.java:232) [junit-4.8.1.jar:na]
        at junit.framework.TestSuite.run(TestSuite.java:227) [junit-4.8.1.jar:na]
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) [junit-4.8.1.jar:na]
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236) [surefire-junit4-2.12.jar:2.12]
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134) [surefire-junit4-2.12.jar:2.12]
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113) [surefire-junit4-2.12.jar:2.12]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.087 sec <<< FAILURE!
...
Results :

Failed tests:   testShareBike(org.opentripplanner.updater.bike_rental.TestShareBikeRentalStationSource)

Tests in error:
  testRoadPassingOverDuplicatedNode(org.opentripplanner.graph_builder.module.osm.TestUnconnectedAreas): error loading OSM from path c:\Git%20Projects\opentripplanner\target\test-classes\org\opentripplanner\graph_builder\module\osm\coincident_pr.osm
  testCoincidentNodeUnconnectedParkAndRide(org.opentripplanner.graph_builder.module.osm.TestUnconnectedAreas): error loading OSM from path c:\Git%20Projects\opentripplanner\target\test-classes\org\opentripplanner\graph_builder\module\osm\hackett_pr.osm.gz
  testAreaPassingOverNode(org.opentripplanner.graph_builder.module.osm.TestUnconnectedAreas): error loading OSM from path c:\Git%20Projects\opentripplanner\target\test-classes\org\opentripplanner\graph_builder\module\osm\coincident_pr.osm
  testUnconnectedParkAndRide(org.opentripplanner.graph_builder.module.osm.TestUnconnectedAreas): error loading OSM from path c:\Git%20Projects\opentripplanner\target\test-classes\org\opentripplanner\graph_builder\module\osm\P+R.osm.gz
  testRoadPassingOverNode(org.opentripplanner.graph_builder.module.osm.TestUnconnectedAreas): error loading OSM from path c:\Git%20Projects\opentripplanner\target\test-classes\org\opentripplanner\graph_builder\module\osm\coincident_pr.osm

Tests run: 387, Failures: 1, Errors: 5, Skipped: 2

As you can see above there are also a few errors.

@abyrd

This comment has been minimized.

Member

abyrd commented Sep 13, 2016

The file src\test\resources\bike\share-bike.json is in the repo, but it looks like the file: URL has a query parameter on the end.

@seime

This comment has been minimized.

Contributor

seime commented Sep 13, 2016

I will make a PR for this very soon.

making data fly.

Arne Seime | Senior consultant & developer
greenbird Integration Technology AS
+47 99574896 | arne.seime@greenbird.com | www.greenbird.com

From: Andrew Byrd notifications@github.com
Reply-To: opentripplanner/OpenTripPlanner reply@reply.github.com
Date: Tuesday 13 September 2016 at 09:01
To: opentripplanner/OpenTripPlanner OpenTripPlanner@noreply.github.com
Subject: Re: [opentripplanner/OpenTripPlanner] Test failure when trying to build v1.0 (#2339)

The file src\test\resources\bike\share-bike.json is in the repo, but it looks like the file: URL has a query parameter on the end.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/2339#issuecomment-246592987, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABfh5ICc-mTUye7Ng9KfUKYMU_2iwLZiks5qpkozgaJpZM4J5O83.

@abyrd

This comment has been minimized.

Member

abyrd commented Sep 13, 2016

It looks like the real problem is that relative file URLs are not a good idea in Java, and can run into authorization problems. We should probably be using getClass().getResource("X");.

seime pushed a commit to entur/OpenTripPlanner that referenced this issue Sep 13, 2016

abyrd added a commit that referenced this issue Sep 13, 2016

csolem added a commit to entur/OpenTripPlanner that referenced this issue Sep 26, 2016

csolem added a commit to entur/OpenTripPlanner that referenced this issue Sep 26, 2016

barslett added a commit to barslett/OpenTripPlanner that referenced this issue Oct 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment