Re: Unit Tests switched to ant

From: Andrus (andru..bjectstyle.org)
Date: Sat Nov 09 2002 - 19:01:57 EST

  • Next message: Andrus: "Re: Tip: running Modeler from eclipse"

    Another addition to the build script that should speed up development. Now
    to avoid running all unit tests, when you are only concerned with a subset,
    a "filter" can be specified in the command line. For instance, to run just
    the tests in the "modeler" package, do this:

        ant test -Dcayenne.test.connection=test-mysql
    -Dtest.filter="**/modeler/**/*Tst.class

    Of course individual tests can be run from Eclipse (Run -> Run As.. ->
    JUnit Test), but I couldn't make it work for the database tests (extending
    CayenneTestCase as opposed to TestCase) and I don't know how to run a group
    of test cases from Eclipse.

    Andrus

    At 04:16 PM 11/9/2002 +1300, Craig Miskell wrote:
    >Very, very cool. I like the generated report too. Very snazzy and easy
    >to see what's happened (well, easier than scanning terminal output..80
    >chars/line trying to see errors).
    >
    >I ran it against mysql here at home, and it works fine except for one
    >possible glitch (don't think it's mysql related). Attached is the xml
    >output, but basically it seems to be complaining that about an inner class
    >not having a TestCase single arg constructor. Doesn't make a lot of sense
    >to me, and running the tests from the dist directory doesn't give this
    >failure. Might be junit, or something else odd that I can't figure out.
    >I'll leave it up to you.
    >
    >BTW, am I missing something, or is that wee message on the front page of
    >the report misleading:
    >"Note: failures are anticipated and checked for with assertions while
    >errors are unanticipated".
    >
    >This particular problem is classified as a "failure", but it certainly
    >wasn't checked for with an assertion that I can see. Or am I still
    >missing something about unit tests... (possible...still a neophyte on that
    >front).
    >
    >Craig
    >
    > On Fri, 8 Nov 2002, Andrus Adamchik
    >wrote:
    >
    > > No more login panel for unit tests (I need to update the docs). From now on
    > > tests should be runnable on CVS version as
    > >
    > > # ant test -Dcayenne.test.connection=name
    > >
    > > Where "name" is a symbolic name of a datasource configured in a property
    > > file at $HOME/.cayenne/connection.properties
    > >
    > > Sample content of this file might be (here "name" == "example1", multiple
    > > names are allowed):
    > >
    > > example1.cayenne.adapter = org.objectstyle.cayenne.dba.mysql.MySQLAdapter
    > > example1.jdbc.username = andrus
    > > example1.jdbc.password = andrus
    > > example1.jdbc.url = jdbc:someurl
    > > example1.jdbc.driver = com.xyz.MyDriverClass
    > >
    > >
    > > I finished with tests late last night, so there may still be some glitches.
    > > Please report any that you find to this list. I will try to fix them over
    > > the weekend.
    > >
    > > One thing that does not work, is running tests from a distribution
    > download,
    > > but CVS version should work.
    > >
    > > Andrus
    > >
    > >
    > >
    > >
    > >



    This archive was generated by hypermail 2.0.0 : Sat Nov 09 2002 - 19:01:35 EST