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

endToEndTest does not compile on Windows #106

Open
SeventhOfNine opened this issue Jan 7, 2018 · 3 comments
Open

endToEndTest does not compile on Windows #106

SeventhOfNine opened this issue Jan 7, 2018 · 3 comments

Comments

@SeventhOfNine
Copy link

There are 100 errors reported, here are some of them:

gameon\map\map-app\src\endToEnd\java\org\gameontext\map\TestRoomCreate.java:3: error: package org.junit does not exist
import static org.junit.Assert.assertTrue;
gameon\map\map-app\src\endToEnd\java\org\gameontext\map\TestRoomCreate.java:9: error: package javax.ws.rs.client does not exist
import javax.ws.rs.client.Client;
gameon\map\map-app\src\endToEnd\java\org\gameontext\map\TestRoomSwap.java:37: error: package org.apache.http does not exist
import org.apache.http.HttpResponse;
gameon\map\map-app\src\endToEnd\java\org\gameontext\map\TestRoomCreate.java:17: error: package org.gameontext.map.model does not exist
import org.gameontext.map.model.ConnectionDetails;

@SeventhOfNine
Copy link
Author

SeventhOfNine commented Jan 7, 2018

If you change the gradle build file as shown below, the code will compile OK.

But then the tests appear not to run (only TestRoomCreate is enabled, the other one is @ignore'd) because it's expecting a server to be running.
...
// setup for end-2-end tests, needs to be in this order
sourceSets {
endToEndTest {
java.srcDir file('/src/endToEnd/java')
resources.srcDir file('/src/endToEnd/resources')
}
}

dependencies {
endToEndTestCompile sourceSets.main.output
endToEndTestCompile sourceSets.test.output

endToEndTestCompile configurations.compile
endToEndTestCompile configurations.testCompile

endToEndTestRuntime configurations.runtime
endToEndTestRuntime configurations.testRuntime
}

task endToEndTest(type: Test) {
testClassesDir = sourceSets.endToEndTest.output.classesDir
classpath = sourceSets.endToEndTest.runtimeClasspath
}
// end setup for end-2-end tests
...

Inspired by this article: https://www.michael-bull.com/blog/2016/06/04/separating-integration-and-unit-tests-with-gradle

@SeventhOfNine
Copy link
Author

SeventhOfNine commented Jan 7, 2018

Error from TestRoomCreate:
javax.ws.rs.ProcessingException: java.net.ConnectException: ConnectException invoking http://127.0.0.1:9099/map/v1/sites: Connection refused: connect
at org.apache.cxf.jaxrs.client.AbstractClient.checkClientException(AbstractClient.java:569)
at org.apache.cxf.jaxrs.client.AbstractClient.preProcessResult(AbstractClient.java:551)
at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1142)
at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1092)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:894)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:865)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:428)
at org.apache.cxf.jaxrs.client.WebClient$SyncInvokerImpl.method(WebClient.java:1636)
at org.apache.cxf.jaxrs.client.WebClient$SyncInvokerImpl.method(WebClient.java:1631)
at org.apache.cxf.jaxrs.client.WebClient$SyncInvokerImpl.post(WebClient.java:1571)
at org.apache.cxf.jaxrs.client.spec.InvocationBuilderImpl.post(InvocationBuilderImpl.java:145)
at org.gameontext.map.TestRoomCreate.createRoom(TestRoomCreate.java:76)
at org.gameontext.map.TestRoomCreate.testcreateRooms(TestRoomCreate.java:56)

@BarDweller
Copy link
Member

I'm not sure this is running on Linux either.. tho it doesn't fail to compile, gradle always seems to think the dir is 'UP-TO-DATE' even when run with --rerun-tasks etc.
testRoomCreate seems to be active in the source, but definitely would require a running server, and I can't see where one is ever supposed to be started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants