• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
JUnit Test Initialization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JUnit Test Initialization


  • Subject: JUnit Test Initialization
  • From: Joe Kramer <email@hidden>
  • Date: Tue, 1 Feb 2011 13:44:47 -0800

Hi Everyone,

I'm writing my first JUnit test for a WebObjects Application and I've hit a roadblock.  I need access to some of the data in the database.  When I just try to run the test I get an error: "java.lang.IllegalArgumentException: An object store for the entity "Account" could not be found. Verify that the entity is defined in an EOModel, and that the model is installed properly. To see what models are loaded, you can try printing the return value of EOModelGroup.defaultGroup() in your application."

Seems I need to initialize my application, so I tried this advice on the wiki: http://wiki.objectstyle.org/confluence/display/WO/Testing-JUnit+and+TestNG to initialize the app, but then I get a NPE:

java.lang.NullPointerException
    at er.extensions.foundation.ERXConfigurationManager.commandLineArgumentProperties(ERXConfigurationManager.java:170)
    at er.extensions.foundation.ERXConfigurationManager.applyConfiguration(ERXConfigurationManager.java:300)
    at er.extensions.foundation.ERXConfigurationManager.loadConfiguration(ERXConfigurationManager.java:289)
    at er.extensions.ERXExtensions.finishInitialization(ERXExtensions.java:261)
    at er.extensions.ERXFrameworkPrincipal$Observer.willFinishInitialization(ERXFrameworkPrincipal.java:97)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
    at com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588)
    at com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
    at er.extensions.appserver.ERXApplication.<init>(ERXApplication.java:1035)
    at com.example.Application.<init>(Application.java:21)
    at com.example.tests.YourOrdersTest.initWO(YourOrdersTest.java:51)
    <snip>

and the console message: "It seems that your application class com.example.Application did not call er.extensions.appserver.ERXApplication.main(argv[], applicationClass) method. Please modify your Application.java as the followings so that er.extensions.foundation.ERXConfigurationManager can provide its rapid turnaround feature completely. "

Any help setting up this test would be greatly appreciated.

Thanks,

Joe


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: JUnit Test Initialization
      • From: John Huss <email@hidden>
  • Prev by Date: Re: JasperReport LocalDate question
  • Next by Date: Re: JUnit Test Initialization
  • Previous by thread: Re: AjaxTabbedPanel - Implementation changes
  • Next by thread: Re: JUnit Test Initialization
  • Index(es):
    • Date
    • Thread