Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

JUnit across multiple projects?

Options
  • 09-04-2009 12:01pm
    #1
    Closed Accounts Posts: 2,349 ✭✭✭


    Trying to automate JUnit tests across a number of different project. There's files in each of the projects that run all the tests e.g. Project1TestSuite.

    I can call it from the other project by importing its source and test JAR files, and calling it like this : Project1TestSuite.suite().run(result);

    However I need to import all the dependencies from that project or it won't work. This is a problem as if new dependencies are added the test would probably break. Anyone know how I can do it without having to import the project dependencies?


    I was going to the while thing with an ant build script and ant-junit but having a weird problem, it doesn't seem to run all the tests most of the time, and also I can't really format the output with ant.


Comments

  • Registered Users Posts: 19 churrusco2


    Invoking project unit tests from another project looks like a bad practice to me tbh.

    I would suggest you to check Maven and create a proper build/testing structure. But as you mentioned Ant I imagine that will not be an option. Check Ivy, it is a nice project build framework based in Ant.


  • Closed Accounts Posts: 2,349 ✭✭✭nobodythere


    churrusco2 wrote: »
    Invoking project unit tests from another project looks like a bad practice to me tbh.

    I would suggest you to check Maven and create a proper build/testing structure. But as you mentioned Ant I imagine that will not be an option. Check Ivy, it is a nice project build framework based in Ant.

    It's to automated tests across about 100+ projects, so that they can be run overnight. All of the tests have been written in JUnit already I just have to make them all run.

    Anyways turns out there's no way around the dependencies thing without interfering in the development process so plan abandoned....


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    grasshopa wrote: »
    It's to automated tests across about 100+ projects, so that they can be run overnight. All of the tests have been written in JUnit already I just have to make them all run.

    CruiseControl.

    Automate the builds and tests for each project individually, but all running under a single "umbrella".

    Build-and-test-on-commit...
    Nightly build-and-test...
    Plugins for code-coverage and all sorts of metrics...


  • Registered Users Posts: 1,821 ✭✭✭Skud


    Hudson would do it also. Seems similar to CruiseControl and is a CI server


Advertisement