I have one desktop rich client application (developed in SWT and Java) which is running on a windows machine. It has some Junit test cases inside it. Now I want to run those test cases using ANT so that I can generate a report to show in Jenkins. Is there any way to do it?
Asked
Active
Viewed 291 times
-1
-
possible duplicate of [How to setup Jenkins with Junit](http://stackoverflow.com/questions/12407560/how-to-setup-jenkins-with-junit) – mmmmmm Feb 25 '14 at 13:45
-
no this is not a duplicate question, as I wanted to know about "running the test cases from a running desktop application through jenkins". The link you suggested in only to tell the basic setup of Jenkins through ANT. – Ishan Rastogi Mar 03 '14 at 08:30
-
The report from Jenkins should really be produced by a runic Jenkins and not from another users= as you can't be certain what code was used to produce the report – mmmmmm Mar 03 '14 at 11:04
1 Answers
2
-
if the application is already running and I am calling this Junit task from Jenkins then how will that task be executed inside the running application? – Ishan Rastogi Feb 25 '14 at 15:04
-
If you really need your application to be running during your test, you can start it from jenkins too (unless your build server is running in headless mode). – Kojotak Feb 25 '14 at 15:15
-
Yeah, I am running that application through jenkins only. Jenkins just calls the exe file for that application. So if I will call the junit task after launching the application from same job will it run the test cases in the same jvm of application? May be I need to try it :) – Ishan Rastogi Feb 25 '14 at 15:28
-
No, this will not run on the same JVM, there will be two JVM instances. If you need the same JVM for tests and application, you should better start the application not from jenkins, but from the junit tests. What about using test suites? http://stackoverflow.com/questions/82949/before-and-after-suite-execution-hook-in-junit-4-x (start your application in `@BeforeClass` annotated method) – Kojotak Feb 25 '14 at 15:53
-
Anyway, these tests are not unit anymore. They are integration tests. Why do you need your application on the same JVM together with your tests? – Kojotak Feb 25 '14 at 15:54
-
-
My application has many plugins(eclipse RCP application) inside it including one test plugin, Now I need to perform some Integration tests only but they are written using Junit. So I want to run the test cases from inside the application i.e to use the instance of test objects created by application. I have one test suite which is being run using JUnitCore class but the issue is that it doesn't generate the test report. So either I have to generate the test report through some Junit apis only if they are available or use ANT to run the test cases. – Ishan Rastogi Feb 25 '14 at 16:07