Using AspectJ for cross-db unit testing.

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Oct 27 2003 - 00:55:13 EST

  • Next message: Andriy Shapochka: "Re: Using AspectJ for cross-db unit testing."

    Some time back we had an offline conversation with Giulio Cesare about
    AspectJ and AOP (actually it was "online", but off the list :-)) .
    Though I had no immediate plans to use it in Cayenne, I kept the
    possibility in the back of my mind. And just tonight I think I stumbled
    on a problem that may benefit from AspectJ.

    Our unit tests are being run on the variety of databases (and ideally -
    variety of JDBC driver versions, etc.). There are quiet a few test
    cases that are not supported by a given database (or maybe not yet
    supported by Cayenne on a given DB, all the same...). Right now we are
    using two complimentary solutions -
    org.objectstyle.cayenne.unittest.DatabaseSetupDelegate, and a bunch of
    if/else statements all over the test suite. Aside from the fact that
    this is ugly, such approach hides potential issues behind the
    meaningless "[java] BUILD SUCCESSFUL" message. We can not tell right
    away what features are not supported by a DB XYZ, which features are
    under construction, and which features already work, but are simply not
    being tested.

    Looks like AspectJ may help to build an outside control mechanism over
    the test matrix. Each target DB may have its own set of aspects
    compiled into the test suite. We can cleanly disable certain test
    cases, and generate a report at the end, mentioning which tests were
    excluded.

    This requires some more thought (and learning on my part - I am pretty
    much clueless at AOP, and never used it before). Anyone has any good
    advise about AOP use in general and this case in particular?

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Oct 27 2003 - 00:55:18 EST