How to do a clean build in eclipse and run a junit test case at startup?

1.3k Views Asked by At

Is there any way we can clean all/rebuild the projects in eclipse and run a jUnit test case every time we open eclipse?

I am developing an eclipse application. The scenario is that i want to schedule UI tests to happen automatically twice everyday. But i do not have an executable build as such. But have the full code base with me and i want to run some scheduled JUnit test cases(based on WindowTester) on it.

Any other ideas that you have is also welcome. :) Thanks in advance.

Ant requires a executable build to perform the tests on it from what i have read. :(

Regards, Thomas

1

There are 1 best solutions below

0
On

Tough Jenkins is opensource, Going for jenkins will be a good choice if you have more number of projects to manage. Jenkins dose lot more than automated test case and builds.

But, If you have a small code base and need to peform some specific tasks like scheduled build and test cases, ant build will is much preferable.

In your case for running test cases,

  1. Create a ant build script to build the entire project (How to write Sample Build scprit)
  2. Create another ant script to read the jars and execute them using the tag (How to write Sample Test Build)
  3. Write a bat file to call the ant scripts and Schedule build twice a day in windows scheduler available in control panel.

SO, this will compile, build your project and test it in scheduled time. Just trigger a mail from the ant script if test fails.