Re: JUnit and WOA Launching

2012-01-16 Thread Andrew Lindesay

Hi Ray;

Thanks for your reply.

I would like to test the application from outside, but in addition, I 
want to be able to test various algorithms which have been encapsulated 
in 'helpers' within the application; hence the need to launch the 
application within the same virtual machine as the tests are running from.


cheers.

On 16/01/12 6:59 PM, Ray Kiddy wrote:


On Jan 12, 2012, at 1:38 PM, Andrew Lindesay wrote:


Hello;

A colleague and I are trying something at the moment; trying to launch a WOA 
from a thread within a JUnit test running out of Eclipse.

We had some problems with the runtime not finding the main bundle (of course) and added 
the .woa in the ${workspacehome}/build directory. The problem is that now 
seems to be not finding components' classes which are clearly in;

${workspacehome}/build/XYZ.woa/Contents/Resources/Java/...

We're launching the WOA with;

XYZApplication.main(args);

Has anybody tried this before? :)

Regards;

--
Andrew Lindesay


Wow. And I thought I had tried some weird things. This is ... interesting. But 
weird.

I suspect that the problem in this chain is junit. How junit sets up its 
classpath can be a bother. But then I do not run junit tests from eclipse. I 
run them from ant. Or I invoke the tests directly in my woa.

It may seem strange but I suspect you would have more luck with starting with a 
java command-line invocation that launches you WOA. I assume your tests are 
trying to launch that so that they can be clients of the app, yes? So, can your 
tests access the WOA when it is launched on the command-line?

You can, within java, construct an exec call which invokes java. You can, 
within java, construct an exec call which invokes java which launched your WOA. 
You will have more control of the setup of the wo app if you launch it that 
way. Then, can you have your junit test run the code that launches your woa?

This could work, no? Now you are making me wonder if I can do this from ant for 
Project Wonder testing

cheers - ray

  ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/apl%40lindesay.co.nz

This email sent to a...@lindesay.co.nz




--
Andrew Lindesay
www.silvereye.co.nz
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


JUnit and WOA Launching

2012-01-12 Thread Andrew Lindesay

Hello;

A colleague and I are trying something at the moment; trying to launch a 
WOA from a thread within a JUnit test running out of Eclipse.


We had some problems with the runtime not finding the main bundle (of 
course) and added the .woa in the ${workspacehome}/build directory. 
The problem is that now seems to be not finding components' classes 
which are clearly in;


${workspacehome}/build/XYZ.woa/Contents/Resources/Java/...

We're launching the WOA with;

XYZApplication.main(args);

Has anybody tried this before? :)

Regards;

--
Andrew Lindesay
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com