Re: ant test fails

From: Gili (cowwo..bs.darktech.org)
Date: Mon Aug 29 2005 - 11:00:00 EDT

  • Next message: Andrus Adamchik: "Re: ant test fails"

            <sigh> I give up. The XML file explicitly complains
    "java.lang.NoClassDefFoundError:
    org.objectstyle.cayenne.unit.CayenneTestCase" so I really don't see how
    this could be a problem with my drivers. I dumped the mysql driver into
    the /otherlib directory and added

            <include name="mysql-connector-java-3.1.8-bin.jar"/>

    to build-tests.xml

            Is there a way to force Ant to fail on nonexistant paths or files? I've
    tried just about anything. I can't figure out what else could be wrong.

    Gili

    Mike Kienenberger wrote:
    > If you use "ant test", it will default to a in-memory HSQLDB database
    > for testing.
    > So it's still probably an issue with your mysql driver not being found.
    >
    > On 8/29/05, Gili <cowwo..bs.darktech.org> wrote:
    >
    >> The test failure has something to do with cayenne.test.connection
    >>
    >> If I run "ant test" all tests pass just fine. If, however, I run "ant
    >>test -Dcayenne.test.connection=example1" with example1 defined as:
    >>
    >>example1.cayenne.adapter = org.objectstyle.cayenne.dba.mysql.MySQLAdapter
    >>example1.jdbc.username = cayenne
    >>example1.jdbc.password = cayenne
    >>example1.jdbc.url = jdbc:mysql://localhost/cayenne
    >>example1.jdbc.driver = com.mysql.jdbc.Driver
    >>
    >> then it fails.
    >>
    >>Gili
    >>
    >>Gili wrote:
    >>
    >>> Actually you're right, we reference a variable with id "classpath"
    >>>which contains the path you mentioned. Still, the class is not resolving
    >>>at runtime even though I can go into the directory and I see it there...
    >>>How odd.
    >>>
    >>>Gili
    >>>
    >>>Gili wrote:
    >>>
    >>>
    >>>> Yes but this classpath entry is included at compile-time, not
    >>>>runtime. Don't you need to add it to the "test" target?
    >>>>
    >>>>Gili
    >>>>
    >>>>Andrus Adamchik wrote:
    >>>>
    >>>>
    >>>>>On Aug 29, 2005, at 8:48 AM, Gili wrote:
    >>>>>
    >>>>>
    >>>>>> I never depend on the environment variable CLASSPATH on my end
    >>>>>>so maybe that's where the problem is coming from. Shouldn't this be
    >>>>>>part of the ant file?
    >>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>>Ant script uses CLASSPATH as an easy extension point allowing to
    >>>>>include drivers, otherwise the script is self-contained. Tests are
    >>>>>included directly from the build folder, not the jar:
    >>>>>
    >>>>>...
    >>>>><pathelement path="build/tests/classes"/>
    >>>>>...
    >>>>>
    >>>>>
    >>>>>Andrus
    >>>>>
    >>>>>
    >>>>
    >>--
    >>http://www.desktopbeautifier.com/
    >>
    >
    >

    -- 
    http://www.desktopbeautifier.com/
    



    This archive was generated by hypermail 2.0.0 : Mon Aug 29 2005 - 11:00:01 EDT