Including Mockrunner for unit testing in cayenne dev's otherlibs?

From: Mike Kienenberger (mkienen..laska.net)
Date: Tue Mar 16 2004 - 12:42:02 EST

  • Next message: Mike Kienenberger: "OutOfMemoryError while running test suite on Oracle 9i"

    I'm writing some unit tests for UpdateBatchQueryBuilder and possibly some
    other classes to insure that my optimistic locking patch doesn't affect
    non-optimistic-locking behavior.

    One of the things I've noticed is that there's no MockPreparedStatement or
    equivalent available for doing tests.

    I thought about writing my own, but then I realized I'd probably be
    reinventing the wheel.

    A web search turned up MockRunner which appears to have a compatible
    license.

    ==========
     * Mockrunner License, Version 1.1
     * based on Apache Software License, version 1.1.
    ==========

    The JDBC mock object collection also appears to be quite comprehensive.

    The downside is that it requires more jar dependencies for development.
    However, most of these are already being included in the CVS Head.
    These are the ones that are missing:

    ----------------
    xml-apis.jar
    xercesImpl.jar
    commons-digester.jar
    nekohtml.jar
    mockejb.jar (possibly useful in-and-of itself since I see that otherlib
    includes ejb-2.0.jar)

    Possibly:
    jboss-j2ee.jar
    ----------------

    However, a quick scan of the dependencies of the jdbc classes doesn't appear
    to require any supporting libraries outside of a call to commons-lang, as
    long as the JDBCTestCaseAdapter class is avoided.

    Thoughts?

    -Mike

    Dependency clipping from readme follows.
    ===============================================================
    Mockrunner uses the following libraries and software components.
    You have to download them. Please add the specified jars to the classpath.

    Xerces XML Parser 2.0.0 (or higher):
    http://xml.apache.org/xerces2-j/index.html
    xml-apis.jar
    xercesImpl.jar

    The following libraries are included in the Mockrunner release.
    Just add them to the classpath. Please note that you have to
    add struts.jar even if you only use the test modules that are
    not Struts related (e.g ServletTestModule or JDBCTestModule).

    Struts 1.1 (or higher):
    http://jakarta.apache.org/struts
    struts.jar

    JUnit 3.8.1:
    http://www.junit.org
    junit.jar

    J2EE 1.3:
    Tomcat 4.1.29:
    http://jakarta.apache.org/tomcat
    servlet.jar
    JBoss 3.2.2:
    http://www.jboss.org
    jboss-j2ee.jar

    Commons (from Struts 1.1 release):
    http://jakarta.apache.org/commons
    commons-logging.jar
    commons-collections.jar
    commons-beanutils.jar
    commons-lang.jar
    commons-digester.jar

    MockEJB 0.5:
    http://mockejb.sourceforge.net
    mockejb.jar

    JDOM Beta 9 (or higher):
    http://www.jdom.org
    jdom.jar

    NekoHTML Parser 0.8.3:
    http://www.apache.org/~andyc/neko/doc/html/index.html
    nekohtml.jar
    ===============================================================



    This archive was generated by hypermail 2.0.0 : Tue Mar 16 2004 - 12:41:29 EST