Re: Running one junit test method from package explorer

From: Kaj Hejer (kaj.heje..sit.uio.no)
Date: Wed Mar 02 2005 - 16:06:21 EST

  • Next message: wolip..atos.de: "Re: Running one junit test method from package explorer"

    Hi!

    This is solved! :)

    By adding

             if (EOModelGroup.defaultGroup().modelNamed(modelName) == null) {
                 EOModelGroup.defaultGroup().addModelWithPathURL(
                         new File(modelName + ".eomodeld").toURL());
             }

    to the setup-method we can run our unittests from package explorer as
    described.

    -Kaj :)

    On 2. mar 2005, at 19.33, Ulrich Köster wrote:

    > Moin Kaj,
    >
    > please add a request to jira. Could take a while.
    >
    > Ulrich
    >
    > Am 22.02.2005 um 10:27 schrieb Kaj Hejer:
    >
    >> Hi!
    >>
    >> I'm doing some other javadevelopment in eclipse too (spring and so on
    >> :) and then I can run just one junit test method from package
    >> explorer by finding the testclass in package explorer and open it so
    >> I see all the methods it contains. Then I just right-click the
    >> testmethod I want to run and run->kunit test.
    >>
    >> When I try this for a testclass in a WO project (which is using some
    >> database stuff) in eclipse I get the following:
    >>
    >>
    >> com.webobjects.eoaccess.EOObjectNotAvailableException:
    >> databaseContextForModelNamed: cannot find model named skjema
    >> associated with this EOEditingContext
    >> at
    >> com.webobjects.eoaccess.EOUtilities.databaseContextForModelNamed(EOUti
    >> lities.java:769)
    >> at Session.isProdDatabase(Session.java:348)
    >> at NettskjemaTestCase.setUp(NettskjemaTestCase.java:62)
    >> at com.codefab.wounittest.WOUTTestCase.runBare(Unknown Source)
    >> at junit.framework.TestResult$1.protect(TestResult.java:106)
    >> at junit.framework.TestResult.runProtected(TestResult.java:124)
    >> at junit.framework.TestResult.run(TestResult.java:109)
    >> at junit.framework.TestCase.run(TestCase.java:118)
    >> at
    >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
    >> TestRunner.java:421)
    >> at
    >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
    >> unner.java:305)
    >> at
    >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
    >> Runner.java:186)
    >>
    >> It seems that if I first run the testclass the "normal way" by
    >> defining a runsetup for it and then from the junit-view right-click
    >> some of the tests and select run, the test runs just fine.
    >>
    >>
    >> Should I add a feature request to wolips for the posibility to run a
    >> single junit test method in WO projects from package explorer or is
    >> this something that would be alot of work to implement?
    >>
    >>
    >> -Kaj :)
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Wed Mar 02 2005 - 16:06:41 EST