• 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
WOInject and WOUnit co-operation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WOInject and WOUnit co-operation


  • Subject: WOInject and WOUnit co-operation
  • From: Paul Hoadley <email@hidden>
  • Date: Mon, 4 Dec 2017 15:39:48 +1030

Hello,

I have an EO class that has an object provided by an @Inject annotation, and it
wants to use that object in init(). This works just fine in the context of a
running InjectableApplication. No matter what I try, though, I can’t get the EO
created in the context of a WOUnit test. What I’ve done in another project is
to manually create an Injector in a @Before method, and then call
injector.injectMembers() on the EO. But the EO needs to exist, and to create it
I need the injected object—chicken and egg.

I’ve come up with a workaround (where init() asks for the object via an
accessor method which provides a “test version” of it if injection hasn’t
occurred), but it’s a bit of a hack. There must be a better way. Henrique, are
you around?


--
Paul Hoadley
https://logicsquad.net/
https://www.linkedin.com/company/logic-squad/


 _______________________________________________
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: WOInject and WOUnit co-operation
      • From: Henrique Prange <email@hidden>
  • Prev by Date: Re: GWT
  • Next by Date: Re: WOInject and WOUnit co-operation
  • Previous by thread: Re: Recent installation instructions?
  • Next by thread: Re: WOInject and WOUnit co-operation
  • Index(es):
    • Date
    • Thread