Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » best approach for unit testing
best approach for unit testing [message #56458] Tue, 10 January 2006 14:01 Go to next message
Eclipse UserFriend
Originally posted by: morova.bol.com.br

Hello,

We are starting our development using osgi, what would you suggest as a
best approach for unit testing? I see three approaches:

- In normal java development we create parallel source trees in the same
project, one for code and one for tests.

- The eclipse project uses separate plugins for testing.

- I was thinking about using fragments, so I don't need to put junit
dependencies in the main bundle but could deploy the test code as I wish.

Comments anyone?

Gustavo
Re: best approach for unit testing [message #57793 is a reply to message #56458] Tue, 24 January 2006 04:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_nospam_mcaffer.ca.ibm.com

Separate bundles is hte way to go. You can do pretty much everything you
need using bundles. If you have to access some package private members then
you might need to implement a fragment to expose these in the context of the
tests. I would suggest that you avoid including anything to do with testing
in the main domain plugins themselves.

Jeff
"Gustavo Morozowski" <morova@bol.com.br> wrote in message
news:pan.2006.01.10.14.01.39.341432@bol.com.br...
> Hello,
>
> We are starting our development using osgi, what would you suggest as a
> best approach for unit testing? I see three approaches:
>
> - In normal java development we create parallel source trees in the same
> project, one for code and one for tests.
>
> - The eclipse project uses separate plugins for testing.
>
> - I was thinking about using fragments, so I don't need to put junit
> dependencies in the main bundle but could deploy the test code as I wish.
>
> Comments anyone?
>
> Gustavo
Re: best approach for unit testing [message #59249 is a reply to message #57793] Wed, 01 February 2006 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: morova.bol.com.br

I created a separate test bundle with dependencies on junit and tried to
run it as Junit plug-in test, but I'm having trouble getting the reference
to bundle context. My bundle test Activator class saves a BundleContext
reference on a static field so I can access it from the test case, but it
seems it's not being called before unit test execution.
Re: best approach for unit testing [message #60510 is a reply to message #59249] Thu, 09 February 2006 16:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_nospam_mcaffer.ca.ibm.com

you may have to set Eclipse-LazyStart: true or contrive to have your bundle
started by default. If you are launching as an Equinox framework you can do
this. Alternatively we are looking at putting in a switch to have
Update.configurator start all bundles as they are installed. That
capability is not in yet.

Jeff

"Gustavo Morozowski" <morova@bol.com.br> wrote in message
news:pan.2006.02.01.12.41.04.836824@bol.com.br...
> I created a separate test bundle with dependencies on junit and tried to
> run it as Junit plug-in test, but I'm having trouble getting the reference
> to bundle context. My bundle test Activator class saves a BundleContext
> reference on a static field so I can access it from the test case, but it
> seems it's not being called before unit test execution.
Re: best approach for unit testing [message #61156 is a reply to message #60510] Fri, 10 February 2006 17:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: morova.bol.com.br

I am trying right now with two approaches -

- Junit and JUnitRunner Knoplerfish bundles
(http://www.knopflerfish.org/repo/index.html) where I can register a unit
test to be run by the runner bundle, more details in
https://www.knopflerfish.org/svn/knopflerfish.org/trunk/osgi /bundles_opt/junit/readme.txt

- Markus Barchfeld article about plug-in test automation, available in
http://www.eclipse.org/articles/Article-PDE-Automation/autom ation.html

I will report my progress here.

Gustavo

On Thu, 09 Feb 2006 11:38:50 -0500, Jeff McAffer wrote:

> you may have to set Eclipse-LazyStart: true or contrive to have your bundle
> started by default. If you are launching as an Equinox framework you
> can do this. Alternatively we are looking at putting in a switch to
> have Update.configurator start all bundles as they are installed. That
> capability is not in yet.
>
> Jeff
>
> "Gustavo Morozowski" <morova@bol.com.br> wrote in message
> news:pan.2006.02.01.12.41.04.836824@bol.com.br...
>> I created a separate test bundle with dependencies on junit and tried
>> to run it as Junit plug-in test, but I'm having trouble getting the
>> reference to bundle context. My bundle test Activator class saves a
>> BundleContext reference on a static field so I can access it from the
>> test case, but it seems it's not being called before unit test
>> execution.
Solution found ? best approach for unit testing [message #100843 is a reply to message #61156] Thu, 01 November 2007 17:01 Go to previous message
Eclipse UserFriend
Originally posted by: Stefan-Isele.gmx.de

Did you find a solution ?
could you please give me a tip ?
Can I use the JUint PlugIn Test Runner to test OSGI-Bundle ?

Thanks

Stefan Isele

Gustavo Morozowski schrieb:
> I am trying right now with two approaches -
>
> - Junit and JUnitRunner Knoplerfish bundles
> (http://www.knopflerfish.org/repo/index.html) where I can register a unit
> test to be run by the runner bundle, more details in
> https://www.knopflerfish.org/svn/knopflerfish.org/trunk/osgi /bundles_opt/junit/readme.txt
>
> - Markus Barchfeld article about plug-in test automation, available in
> http://www.eclipse.org/articles/Article-PDE-Automation/autom ation.html
>
> I will report my progress here.
>
> Gustavo
>
> On Thu, 09 Feb 2006 11:38:50 -0500, Jeff McAffer wrote:
>
>> you may have to set Eclipse-LazyStart: true or contrive to have your bundle
>> started by default. If you are launching as an Equinox framework you
>> can do this. Alternatively we are looking at putting in a switch to
>> have Update.configurator start all bundles as they are installed. That
>> capability is not in yet.
>>
>> Jeff
>>
>> "Gustavo Morozowski" <morova@bol.com.br> wrote in message
>> news:pan.2006.02.01.12.41.04.836824@bol.com.br...
>>> I created a separate test bundle with dependencies on junit and tried
>>> to run it as Junit plug-in test, but I'm having trouble getting the
>>> reference to bundle context. My bundle test Activator class saves a
>>> BundleContext reference on a static field so I can access it from the
>>> test case, but it seems it's not being called before unit test
>>> execution.
>
Previous Topic:How can I move jetty based bundle to servletbridge based environment?
Next Topic:how to remote controll the Equinox server?
Goto Forum:
  


Current Time: Sat Apr 27 02:42:04 GMT 2024

Powered by FUDForum. Page generated in 0.03837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top