Default application won't start tests with launcher

Topics related to the LSPS SDK and custom development of applications.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Default application won't start tests with launcher

Thu Apr 27, 2017 3:04 am

We have retreated to doing exactly what is described in the testing section of the LSPS 3.2 SDK document. The link is here:

https://docs.whitestein.com/lsps/3_2/cu ... sting.html

I created a new instance of the LSPS application. I launched the launcher with the run configuration generated with the default app and it launched successfully. We created a run configuration for the NonUI tests which I will attach but it is very straightforward. It just runs the myNonUI test in the test directory. The test ran flawlessly: it started the Launcher, the launcher deployed all of the needed wars and jars and Junit showed success.

After this success I ran mvn eclipse:eclipse and mvn clean install as described in the document. (Running mvn clean install is inevitable as we needed the required jars to install in our local repository. ) After performing these operations I re-ran the test using the launcher and it failed. The failure is that Junit cannot connect to the server. I believe this is occurring because the TomEE server is not running when LSPSRemote calls getService. I am not sure what mvn clean install does but I can reproduce the problem using the steps described above. Refreshing the project (f5) doesn't help. Rebuilding the project (eclipse clean) doesn't help either.

The test.properties file has not been modified.

If I start the Wildfly embedded server the test runs through to completion so there is nothing wrong with the test. The document cited above seems to indicate that users are expected to run model tests with embedded Wildfly and the flag used to run model tests during builds with the embedded server running (-Dlsps.tester) implies that as well.

We would like to use the launcher so we can run model tests as part of our build without any legerdemain. For now we can workaround this by using the embedded Wildfly server but we need a solution.

Note that there is NOTHING from the LTS automation project in the default application at this point. It is exactly as shipped by Whitestein.

I will post the relevant section of the test report in a followup

scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Re: Default application won't start tests with launcher

Thu Apr 27, 2017 3:04 am

Relevant section of the log file

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.18 sec <<< FAILURE! - in gov.va.ch33.automation.SampleNonUITests
myTestNoUI(gov.va.ch33.automation.SampleNonUITests) Time elapsed: 2.166 sec <<< ERROR!
java.lang.RuntimeException: Failed to connect to http://localhost:8080/lsps-ws: com.whitestein.lsps.ws.DisconnectedException: Connection error
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
at sun.net.www.http.HttpClient.New(HttpClient.java:308)
at sun.net.www.http.HttpClient.New(HttpClient.java:326)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933)
at com.whitestein.lsps.ws.ClientCommunication.validateConnection(ClientCommunication.java:151)
at com.whitestein.lsps.ws.ClientCommunication.validate(ClientCommunication.java:136)
at com.whitestein.lsps.test.LspsRemote.validateConnection(LspsRemote.java:105)
at com.whitestein.lsps.test.LspsRemote.getService(LspsRemote.java:68)
at com.whitestein.lsps.test.LspsRemote.getModelManagementService(LspsRemote.java:237)
at com.whitestein.lsps.test.LspsRemote.unloadAllModules(LspsRemote.java:211)
at gov.va.ch33.automation.SampleNonUITests.prepare(SampleNonUITests.java:25)

scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Re: Default application won't start tests with launcher

Thu Apr 27, 2017 3:21 am

I should add that the error gets fixed sometimes by a rebuild from within PDS but at this point I haven't figured out what I'm doing that fixes the problem.

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Default application won't start tests with launcher

Thu May 11, 2017 3:57 pm

Hi Scott,

for generated app you can use LSPSLauncher (Tomee) or standalone server where you deploy your app manually.
Embedded server (wildfly) uses default app, not your generated app so in this case it shouldn't be used.
To run integration tests, server must be running.
It start test with maven rename your test to end with Test (instead of Tests) or IT i.e. gov.va.ch33.automation.SampleNonUITest or gov.va.ch33.automation.SampleNonUIIT.

Regards,
Roman

Return to SDK

Who is online

Users browsing this forum: No registered users and 0 guests