Testing

2017-07-17 Thread Klaus Berkling
Sorry, testing. Please ignore


"The trouble with normal is it always gets worse."
Bruce Cockburn

Klaus Berkling
www.berkling.us <http://berkling.us/> | @kiberkli | Photography 
<https://kib.smugmug.com/>



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Properties for unit testing

2015-08-30 Thread Hugi Thordarson
Hi Pascal,

ERXProperties picks up all regular java properties so you can put your -D 
prefixed properties in the “VM arguments” field in your launch configuration.

https://www.dropbox.com/s/et2et92zj5pbevn/Screenshot%202015-08-30%2010.38.48.png?dl=0

https://gist.github.com/hugith/7427ea246f6db46b7e94

Cheers,
- hugi



 On 30. ágú. 2015, at 01:06, Pascal Robert prob...@macti.ca wrote:
 
 Hi,
 
 I’m trying to write, for the first time, some unit tests for ERJavaMail. I 
 need to pass some properties in the tests, but the properties are only seen 
 if they are in the Properties file. If I pass as argument in the launch 
 configuration, the properties are not found.
 
 I have tried with both -er.javamail.imapHost outlook.office365.com or 
 -Der.javamail.imapHost=outlook.office365.com, same results.
 
 Anyway to use properties that ERXProperties can find in a unit test? 
 ERXExtensions.initApp is called.
 
 
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/hugi%40karlmenn.is
 
 This email sent to h...@karlmenn.is

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Properties for unit testing

2015-08-29 Thread Pascal Robert
Hi,

I’m trying to write, for the first time, some unit tests for ERJavaMail. I need 
to pass some properties in the tests, but the properties are only seen if they 
are in the Properties file. If I pass as argument in the launch configuration, 
the properties are not found.

I have tried with both -er.javamail.imapHost outlook.office365.com or 
-Der.javamail.imapHost=outlook.office365.com, same results.

Anyway to use properties that ERXProperties can find in a unit test? 
ERXExtensions.initApp is called.


 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Integration testing for Wonder

2015-04-29 Thread Fabian Peters
Hi all,

At WOWODC I spoke with some people about setting up integration tests for 
Wonder. Since I mostly use D2W, I'd suggest to take ERModernMoviesDemo as the 
starting point. This can run on H2 in-memory and thus exercise D2W, Ajax, 
standard WOComponents and EOF. An additional candidate may be the AjaxExample 
to have explicit tests for the Ajax components. The actual test app(s) would 
then live in the Tests directory, apart from the demos.

Now, there aren't as many functional testing frameworks as there are 
JS-frameworks, but still… Personally I've experience with Selenium 
IDE/WebDriver and Cucumber/Capybara/PhantomJS. If any of you have experience 
with these or other tools, please share!

To actually run the integration tests, we need to start the test application 
and have the test framework connect to it. And we'll want pretty pictures and 
possibly alerts when things break. Instead of using the community jenkins 
server, it may be easier to use services like https://travis-ci.org and/or 
https://saucelabs.com. Both are free to use for open source projects and 
offer integration with github, e.g. to automate testing of pull requests* 
before merging them.

Any thoughts?

Fabian

* Dave, rest assured we'll still be able to beer-review pull requests manually!
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Integration testing for Wonder

2015-04-29 Thread David Avendasora
 On Apr 29, 2015, at 12:55 PM, Fabian Peters lists.fab...@e-lumo.com wrote:
 
 Hi all,
 
 At WOWODC I spoke with some people about setting up integration tests for 
 Wonder. Since I mostly use D2W, I'd suggest to take ERModernMoviesDemo as the 
 starting point. This can run on H2 in-memory and thus exercise D2W, Ajax, 
 standard WOComponents and EOF. An additional candidate may be the AjaxExample 
 to have explicit tests for the Ajax components. The actual test app(s) would 
 then live in the Tests directory, apart from the demos.

There are a lot of non-D2W people out here - D2JC, JSON, Single-Page-App, even 
standard Web! But if you have a vision beginning with Direct-to-Web, then 
that’s a great place to start.

 Now, there aren't as many functional testing frameworks as there are 
 JS-frameworks, but still… Personally I've experience with Selenium 
 IDE/WebDriver and Cucumber/Capybara/PhantomJS. If any of you have experience 
 with these or other tools, please share!

I have done quite a bit with using JUnit to run Selenium tests completely 
outside the EOF (specifically: NOT WOUnit) using WebDriver. Doing it without 
EOF does limit some of the tests you can do or makes them harder to write, but 
if what you want to do is test workflows used by a human, then it works very 
well.

 To actually run the integration tests, we need to start the test application 
 and have the test framework connect to it. And we'll want pretty pictures and 
 possibly alerts when things break. Instead of using the community jenkins 
 server, it may be easier to use services like https://travis-ci.org and/or 
 https://saucelabs.com. Both are free to use for open source projects and 
 offer integration with github, e.g. to automate testing of pull requests* 
 before merging them.

Sounds great and is one less thing for Pascal to have to deal with!

 Any thoughts?

Thanks for volunteering? :-)

 Fabian
 
 * Dave, rest assured we'll still be able to beer-review pull requests 
 manually!

Nice! I do like how accepting we are as a community. There room enough for both 
manual and automated beer-review, and I’ll admit, I am Otto-curious.

I mean Auto! AUTO!

Dave

—
WebObjects - so easy that even Dave Avendasora can do it!™
—
David Avendasora
Senior Software Abuser
Nekesto, Inc.







 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-21 Thread Henrique Prange
Hi Paul,

The partial entities initialization could happen before some models are loaded. 
In this new version of WOUnit, the partial support is initialized after all 
models are completely loaded.

Could you give it a try? You can download the latest version here [1].

[1]http://maven.wocommunity.org/service/local/artifact/maven/redirect?r=snapshotsg=com.wounita=wounitv=1.2.3-SNAPSHOTe=jar

Cheers,

Henrique

On 21/02/2014, at 03:33, Paul Hoadley pa...@logicsquad.net wrote:

 On 21/02/2014, at 3:40 PM, Paul Hoadley pa...@logicsquad.net wrote:
 
 If what I'm trying to describe isn't clear, I'd be happy to put together a 
 minimal test project—let me know.
 
 I've sent you a test project off-list.  Let me know what you think is going 
 on.
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-21 Thread Paul Hoadley
Hi Henrique,

On 22/02/2014, at 1:14 PM, Henrique Prange hpra...@gmail.com wrote:

 The partial entities initialization could happen before some models are 
 loaded. In this new version of WOUnit, the partial support is initialized 
 after all models are completely loaded.
 
 Could you give it a try? You can download the latest version here [1].
 
 [1]http://maven.wocommunity.org/service/local/artifact/maven/redirect?r=snapshotsg=com.wounita=wounitv=1.2.3-SNAPSHOTe=jar

Fixed.  That works.  Thanks a _lot_ for persisting and getting to the bottom of 
it.


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-20 Thread Henrique Prange
Hi Paul,

I’ve pushed a few changes to the wounit-1.2.x branch (including the partials 
fix). The version 1.2.3-SNAPSHOT contains the latest fixes for WOUnit 1.2.2.

You can add the Maven dependency:

dependency
  groupIdcom.wounit/groupId
  artifactIdwounit/artifactId
  version1.2.3-SNAPSHOT/version
/dependency

Or download it directly from here [1].

Does it work for you? As soon as you validate this SNAPSHOT I’m going to cut 
the 1.2.3 release.

[1]http://maven.wocommunity.org/service/local/artifact/maven/redirect?r=snapshotsg=com.wounita=wounitv=1.2.3-SNAPSHOTe=jar

Cheers,

Henrique

PS.: Sorry for taking so long to fix this problem in the proper way.

On 19/02/2014, at 17:55, Paul Hoadley pa...@logicsquad.net wrote:

 On 20/02/2014, at 3:56 AM, Henrique Prange hpra...@gmail.com wrote:
 
 I have to push some changes to GitHub (including the partials solution). I’m 
 trying to find some time this week. I’ll let you know as soon as the changes 
 are in the WOUnit repository.
 
 Thanks Henrique.
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-20 Thread Paul Hoadley
Hi Henrique,

On 21/02/2014, at 1:35 PM, Henrique Prange hpra...@gmail.com wrote:

 Does it work for you? As soon as you validate this SNAPSHOT I’m going to cut 
 the 1.2.3 release.

Unfortunately, no change.  To give you a little more detail, I have a base 
class User in a framework, and an application-level partial entity HMUser.  
There's an entity Job with a to-one relationship 'creator' in the model to 
HMUser so that HMUser has the inverse 'jobs' relationship.  This all works fine 
within the running application.  In testing, calling job.setCreator(user) for 
some Job job and some User user fails when it gets to setting that inverse 
relationship:

com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException message 
'net.logicsquad.access.model.User 0x35c4795e valueForKey(): lookup of unknown 
key: 'jobs'.
This class does not have an instance variable of the name jobs or _jobs, nor a 
method of the name jobs, _jobs, getJobs, or _getJobs' object 
'net.logicsquad.access.model.User pk:null' key 'jobs'
at 
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.handleQueryWithUnboundKey(NSKeyValueCoding.java:1377)
at 
com.webobjects.eocontrol.EOCustomObject.handleQueryWithUnboundKey(EOCustomObject.java:1545)
at 
er.extensions.eof.ERXGenericRecord.handleQueryWithUnboundKey(ERXGenericRecord.java:1086)
at 
com.webobjects.foundation.NSKeyValueCoding$Utility.handleQueryWithUnboundKey(NSKeyValueCoding.java:494)
at 
com.webobjects.foundation.NSKeyValueCoding$_KeyBinding.valueInObject(NSKeyValueCoding.java:894)
at 
com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498)
at 
er.extensions.partials.ERXPartialGenericRecord.valueForKey(ERXPartialGenericRecord.java:92)
at 
er.extensions.eof.ERXGenericRecord$InverseRelationshipUpdater.takeStoredValueForKey(ERXGenericRecord.java:1490)
at 
er.extensions.eof.ERXGenericRecord.takeStoredValueForKey(ERXGenericRecord.java:1259)
at net.logicsquad.hydromaster.model.core._Job.setCreator(_Job.java:279)
at 
net.logicsquad.hydromaster.test.model.core.JobTest.jobMustHaveUniqueJobID(JobTest.java:68)

The stack trace is correct in that User doesn't have that key, but the 
properties of HMUser should have been merged so that it all just works, 
shouldn't they?

If what I'm trying to describe isn't clear, I'd be happy to put together a 
minimal test project—let me know.  Alternatively, if it looks like I'm misusing 
partials or WOUnit, let me know that as well!

 PS.: Sorry for taking so long to fix this problem in the proper way.

Thanks for working on it at all!


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-20 Thread Paul Hoadley
On 21/02/2014, at 3:40 PM, Paul Hoadley pa...@logicsquad.net wrote:

 If what I'm trying to describe isn't clear, I'd be happy to put together a 
 minimal test project—let me know.

I've sent you a test project off-list.  Let me know what you think is going on.


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-19 Thread Paul Hoadley
On 03/02/2014, at 2:30 PM, Paul Hoadley pa...@logicsquad.net wrote:

 [1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-3.jar
 
 I'm having some ongoing minor issues testing partial entities with WOUnit.  
 Before I jump in and describe the problem in depth, is that snapshot above 
 the latest still?  I'd like to try the latest if you've made any further 
 changes.  Let me know.

Come on Henrique, put me out of my misery!  :-)  Any WOUnit updates I can have 
a look at?  Would you be interested in a minimal test project that demonstrates 
the issues?


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-19 Thread Henrique Prange
Hi Paul,

I have to push some changes to GitHub (including the partials solution). I’m 
trying to find some time this week. I’ll let you know as soon as the changes 
are in the WOUnit repository.

Cheers,

Henrique

On 19/02/2014, at 05:40, Paul Hoadley pa...@logicsquad.net wrote:

 On 03/02/2014, at 2:30 PM, Paul Hoadley pa...@logicsquad.net wrote:
 
 [1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-3.jar
 
 I'm having some ongoing minor issues testing partial entities with WOUnit.  
 Before I jump in and describe the problem in depth, is that snapshot above 
 the latest still?  I'd like to try the latest if you've made any further 
 changes.  Let me know.
 
 Come on Henrique, put me out of my misery!  :-)  Any WOUnit updates I can 
 have a look at?  Would you be interested in a minimal test project that 
 demonstrates the issues?
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-19 Thread Paul Hoadley
On 20/02/2014, at 3:56 AM, Henrique Prange hpra...@gmail.com wrote:

 I have to push some changes to GitHub (including the partials solution). I’m 
 trying to find some time this week. I’ll let you know as soon as the changes 
 are in the WOUnit repository.

Thanks Henrique.


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2014-02-02 Thread Paul Hoadley
Hi Henrique.

On 22/08/2013, at 10:01 AM, Henrique Prange hpra...@gmail.com wrote:

 That is exactly the problem some WOUnit's users are reporting. The only way I 
 was able to reproduce this kind of issue in my own environment was by turning 
 the unit tests execution parallel. Anyway, this causes me problems even with 
 WOUnit 1.2. :(
 
 So, I added a lot of logs and compared the execution of tests on WOUnit 1.2 
 and the latest version of WOUnit. Clearly, the current version is reusing the 
 same model group between test executions. I've changed the way things are 
 initialized and the logs look almost identical now. There's a new snapshot 
 here [1] with the mentioned changes. Would you mind to try it?
 
 [1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-3.jar

I'm having some ongoing minor issues testing partial entities with WOUnit.  
Before I jump in and describe the problem in depth, is that snapshot above the 
latest still?  I'd like to try the latest if you've made any further changes.  
Let me know.


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2013-08-22 Thread Paul Hoadley
Hi Henrique,

On 22/08/2013, at 10:01 AM, Henrique Prange hpra...@gmail.com wrote:

 That is exactly the problem some WOUnit's users are reporting. The only way I 
 was able to reproduce this kind of issue in my own environment was by turning 
 the unit tests execution parallel. Anyway, this causes me problems even with 
 WOUnit 1.2. :(
 
 So, I added a lot of logs and compared the execution of tests on WOUnit 1.2 
 and the latest version of WOUnit. Clearly, the current version is reusing the 
 same model group between test executions. I've changed the way things are 
 initialized and the logs look almost identical now. There's a new snapshot 
 here [1] with the mentioned changes. Would you mind to try it?
 
 [1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-3.jar

Sadly, no it doesn't seem to fix the issue.  I'm getting an identical failure: 
same test, same stack trace.  I'll send you the output off-list to avoid 
clutter.


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2013-08-22 Thread Fabian Peters
Hi Henrique,

I get the same exception, but only once in a while (one in ten builds or so) 
and only when jenkins is running the tests via maven. When running the tests 
from eclipse, everything's fine. There does seem to be some sort of timing or 
concurrency problem.

Fabian

Am 22.08.2013 um 02:31 schrieb Henrique Prange:

 Hi Paul,
 
 That is exactly the problem some WOUnit's users are reporting. The only way I 
 was able to reproduce this kind of issue in my own environment was by turning 
 the unit tests execution parallel. Anyway, this causes me problems even with 
 WOUnit 1.2. :(
 
 So, I added a lot of logs and compared the execution of tests on WOUnit 1.2 
 and the latest version of WOUnit. Clearly, the current version is reusing the 
 same model group between test executions. I've changed the way things are 
 initialized and the logs look almost identical now. There's a new snapshot 
 here [1] with the mentioned changes. Would you mind to try it?
 
 [1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-3.jar
 
 Cheers,
 
 Henrique
 
 On 17/08/2013, at 08:29, Paul Hoadley pa...@logicsquad.net wrote:
 
 Hi Henrique,
 
 On 02/08/2013, at 9:08 AM, Henrique Prange hpra...@gmail.com wrote:
 
 Good to hear.
 
 I'm trying to solve another problem that seems related to the EOF 
 initialization. I'm going to release a new version of WOUnit during the 
 weekend (solving the other problem or not).
 
 Just out of interest, what was the other problem you were having with EOF 
 initialisation?  I've updated to that 1.3-SNAPSHOT build across a range of 
 projects, and while it fixes the issue with partial entities, _some_ tests 
 that were passing under 1.2 are now failing, and it seems to be during EO 
 initialisation, for example setting up @Dummy EOs.  Worse, everything is 
 fine in development, the tests are only failing once they hit the Jenkins 
 build server, which makes it awful to debug.
 
 Here's an example stack trace at the point of failure, for what it's worth.  
 I'm a bit stumped.  Can you see anything meaningful?
 
  [junit] Testcase: 
 testToString(net.logicsquad.lssurvey.model.SurveyInstanceTest):   Caused an 
 ERROR
  [junit] java.lang.reflect.InvocationTargetException
  [junit] com.webobjects.foundation.NSForwardException 
 [java.lang.reflect.InvocationTargetException] 
 null:java.lang.reflect.InvocationTargetException
  [junit] at 
 com.webobjects.foundation._NSUtilities._explainInstantiationException(_NSUtilities.java:626)
  [junit] at 
 com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:665)
  [junit] at 
 com.webobjects.eoaccess.EOEntityClassDescription.createInstanceWithEditingContext(EOEntityClassDescription.java:242)
  [junit] at 
 com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:216)
  [junit] at 
 com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:177)
  [junit] at 
 com.wounit.rules.MockEditingContext$DummyFacade.create(MockEditingContext.java:83)
  [junit] at 
 com.wounit.rules.AnnotationProcessor.createEOForType(AnnotationProcessor.java:49)
  [junit] at 
 com.wounit.rules.AnnotationProcessor.initializeObject(AnnotationProcessor.java:172)
  [junit] at 
 com.wounit.rules.AnnotationProcessor.process(AnnotationProcessor.java:205)
  [junit] at 
 com.wounit.rules.MockEditingContext.before(MockEditingContext.java:149)
  [junit] at 
 com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:160)
  [junit] Caused by: java.lang.reflect.InvocationTargetException
  [junit] at 
 java.lang.reflect.Constructor.newInstance(Constructor.java:532)
  [junit] at 
 com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:659)
  [junit] Caused by: java.lang.NullPointerException
  [junit] at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
  [junit] at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
  [junit] at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
  [junit] at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
  [junit] at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
  [junit] at 
 com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789)
  [junit] at 
 com.webobjects.eoaccess.EOEntity.classProperties(EOEntity.java:1098)
  [junit] at 
 com.webobjects.eoaccess.EOEntity._propertyDictionaryInitializer(EOEntity.java:3321)
  [junit] at 
 com.webobjects.eoaccess.EOEntity._newDictionaryForProperties(EOEntity.java:3667)
  [junit] at 
 com.webobjects.eoaccess.EOEntityClassDescription._newDictionaryForProperties(EOEntityClassDescription.java:88)
  [junit] at 
 com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:111)
  [junit] at 
 

Re: WOUnit testing with partial entities

2013-08-21 Thread Henrique Prange
Hi Paul,

That is exactly the problem some WOUnit's users are reporting. The only way I 
was able to reproduce this kind of issue in my own environment was by turning 
the unit tests execution parallel. Anyway, this causes me problems even with 
WOUnit 1.2. :(

So, I added a lot of logs and compared the execution of tests on WOUnit 1.2 and 
the latest version of WOUnit. Clearly, the current version is reusing the same 
model group between test executions. I've changed the way things are 
initialized and the logs look almost identical now. There's a new snapshot here 
[1] with the mentioned changes. Would you mind to try it?

[1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-3.jar

Cheers,

Henrique

On 17/08/2013, at 08:29, Paul Hoadley pa...@logicsquad.net wrote:

 Hi Henrique,
 
 On 02/08/2013, at 9:08 AM, Henrique Prange hpra...@gmail.com wrote:
 
 Good to hear.
 
 I'm trying to solve another problem that seems related to the EOF 
 initialization. I'm going to release a new version of WOUnit during the 
 weekend (solving the other problem or not).
 
 Just out of interest, what was the other problem you were having with EOF 
 initialisation?  I've updated to that 1.3-SNAPSHOT build across a range of 
 projects, and while it fixes the issue with partial entities, _some_ tests 
 that were passing under 1.2 are now failing, and it seems to be during EO 
 initialisation, for example setting up @Dummy EOs.  Worse, everything is fine 
 in development, the tests are only failing once they hit the Jenkins build 
 server, which makes it awful to debug.
 
 Here's an example stack trace at the point of failure, for what it's worth.  
 I'm a bit stumped.  Can you see anything meaningful?
 
   [junit] Testcase: 
 testToString(net.logicsquad.lssurvey.model.SurveyInstanceTest):   Caused an 
 ERROR
   [junit] java.lang.reflect.InvocationTargetException
   [junit] com.webobjects.foundation.NSForwardException 
 [java.lang.reflect.InvocationTargetException] 
 null:java.lang.reflect.InvocationTargetException
   [junit] at 
 com.webobjects.foundation._NSUtilities._explainInstantiationException(_NSUtilities.java:626)
   [junit] at 
 com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:665)
   [junit] at 
 com.webobjects.eoaccess.EOEntityClassDescription.createInstanceWithEditingContext(EOEntityClassDescription.java:242)
   [junit] at 
 com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:216)
   [junit] at 
 com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:177)
   [junit] at 
 com.wounit.rules.MockEditingContext$DummyFacade.create(MockEditingContext.java:83)
   [junit] at 
 com.wounit.rules.AnnotationProcessor.createEOForType(AnnotationProcessor.java:49)
   [junit] at 
 com.wounit.rules.AnnotationProcessor.initializeObject(AnnotationProcessor.java:172)
   [junit] at 
 com.wounit.rules.AnnotationProcessor.process(AnnotationProcessor.java:205)
   [junit] at 
 com.wounit.rules.MockEditingContext.before(MockEditingContext.java:149)
   [junit] at 
 com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:160)
   [junit] Caused by: java.lang.reflect.InvocationTargetException
   [junit] at 
 java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   [junit] at 
 com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:659)
   [junit] Caused by: java.lang.NullPointerException
   [junit] at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
   [junit] at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
   [junit] at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
   [junit] at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
   [junit] at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
   [junit] at 
 com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789)
   [junit] at 
 com.webobjects.eoaccess.EOEntity.classProperties(EOEntity.java:1098)
   [junit] at 
 com.webobjects.eoaccess.EOEntity._propertyDictionaryInitializer(EOEntity.java:3321)
   [junit] at 
 com.webobjects.eoaccess.EOEntity._newDictionaryForProperties(EOEntity.java:3667)
   [junit] at 
 com.webobjects.eoaccess.EOEntityClassDescription._newDictionaryForProperties(EOEntityClassDescription.java:88)
   [junit] at 
 com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:111)
   [junit] at 
 com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:100)
   [junit] at 
 com.webobjects.eocontrol.EOGenericRecord.init(EOGenericRecord.java:73)
   [junit] at 
 er.extensions.eof.ERXGenericRecord.init(ERXGenericRecord.java:102)
   [junit] at 
 net.logicsquad.webobjects.core.eof.LSGenericRecord.init(LSGenericRecord.java:54)
   

RE: WOUnit testing with partial entities

2013-08-19 Thread Martin B
I get the same stacktrace but in my case I get the error when starting up my 
application and sometimes at Runtime, which makes it even worst.  As Paul said 
below, it works well in development, but the problems appears randomly as soon 
as I deploy on linux (CentOS).  I have been look for a solution to this for 
weeks, any help would be appreciated.
Thanks!
Martin

 Subject: Re: WOUnit testing with partial entities
 From: pa...@logicsquad.net
 Date: Sat, 17 Aug 2013 20:59:57 +0930
 To: hpra...@gmail.com
 CC: webobjects-dev@lists.apple.com
 
 Hi Henrique,
 
 On 02/08/2013, at 9:08 AM, Henrique Prange hpra...@gmail.com wrote:
 
  Good to hear.
  
  I'm trying to solve another problem that seems related to the EOF 
  initialization. I'm going to release a new version of WOUnit during the 
  weekend (solving the other problem or not).
 
 Just out of interest, what was the other problem you were having with EOF 
 initialisation?  I've updated to that 1.3-SNAPSHOT build across a range of 
 projects, and while it fixes the issue with partial entities, _some_ tests 
 that were passing under 1.2 are now failing, and it seems to be during EO 
 initialisation, for example setting up @Dummy EOs.  Worse, everything is fine 
 in development, the tests are only failing once they hit the Jenkins build 
 server, which makes it awful to debug.
 
 Here's an example stack trace at the point of failure, for what it's worth.  
 I'm a bit stumped.  Can you see anything meaningful?
 
[junit] Testcase: 
 testToString(net.logicsquad.lssurvey.model.SurveyInstanceTest):  Caused an 
 ERROR
[junit] java.lang.reflect.InvocationTargetException
[junit] com.webobjects.foundation.NSForwardException 
 [java.lang.reflect.InvocationTargetException] 
 null:java.lang.reflect.InvocationTargetException
[junit]at 
 com.webobjects.foundation._NSUtilities._explainInstantiationException(_NSUtilities.java:626)
[junit]at 
 com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:665)
[junit]at 
 com.webobjects.eoaccess.EOEntityClassDescription.createInstanceWithEditingContext(EOEntityClassDescription.java:242)
[junit]at 
 com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:216)
[junit]at 
 com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:177)
[junit]at 
 com.wounit.rules.MockEditingContext$DummyFacade.create(MockEditingContext.java:83)
[junit]at 
 com.wounit.rules.AnnotationProcessor.createEOForType(AnnotationProcessor.java:49)
[junit]at 
 com.wounit.rules.AnnotationProcessor.initializeObject(AnnotationProcessor.java:172)
[junit]at 
 com.wounit.rules.AnnotationProcessor.process(AnnotationProcessor.java:205)
[junit]at 
 com.wounit.rules.MockEditingContext.before(MockEditingContext.java:149)
[junit]at 
 com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:160)
[junit] Caused by: java.lang.reflect.InvocationTargetException
[junit]at 
 java.lang.reflect.Constructor.newInstance(Constructor.java:532)
[junit]at 
 com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:659)
[junit] Caused by: java.lang.NullPointerException
[junit]at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
[junit]at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
[junit]at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
[junit]at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
[junit]at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
[junit]at 
 com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789)
[junit]at 
 com.webobjects.eoaccess.EOEntity.classProperties(EOEntity.java:1098)
[junit]at 
 com.webobjects.eoaccess.EOEntity._propertyDictionaryInitializer(EOEntity.java:3321)
[junit]at 
 com.webobjects.eoaccess.EOEntity._newDictionaryForProperties(EOEntity.java:3667)
[junit]at 
 com.webobjects.eoaccess.EOEntityClassDescription._newDictionaryForProperties(EOEntityClassDescription.java:88)
[junit]at 
 com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:111)
[junit]at 
 com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:100)
[junit]at 
 com.webobjects.eocontrol.EOGenericRecord.init(EOGenericRecord.java:73)
[junit]at 
 er.extensions.eof.ERXGenericRecord.init(ERXGenericRecord.java:102)
[junit]at 
 net.logicsquad.webobjects.core.eof.LSGenericRecord.init(LSGenericRecord.java:54)
[junit]at 
 net.logicsquad.lssurvey.model.survey._Survey.init(_Survey.java:15)
[junit]at 
 net.logicsquad.lssurvey.model.survey.Survey.init(Survey.java:491)
[junit] 
[junit] 
[junit] Test

Re: WOUnit testing with partial entities

2013-08-17 Thread Paul Hoadley
Hi Henrique,

On 02/08/2013, at 9:08 AM, Henrique Prange hpra...@gmail.com wrote:

 Good to hear.
 
 I'm trying to solve another problem that seems related to the EOF 
 initialization. I'm going to release a new version of WOUnit during the 
 weekend (solving the other problem or not).

Just out of interest, what was the other problem you were having with EOF 
initialisation?  I've updated to that 1.3-SNAPSHOT build across a range of 
projects, and while it fixes the issue with partial entities, _some_ tests that 
were passing under 1.2 are now failing, and it seems to be during EO 
initialisation, for example setting up @Dummy EOs.  Worse, everything is fine 
in development, the tests are only failing once they hit the Jenkins build 
server, which makes it awful to debug.

Here's an example stack trace at the point of failure, for what it's worth.  
I'm a bit stumped.  Can you see anything meaningful?

   [junit] Testcase: 
testToString(net.logicsquad.lssurvey.model.SurveyInstanceTest):Caused an 
ERROR
   [junit] java.lang.reflect.InvocationTargetException
   [junit] com.webobjects.foundation.NSForwardException 
[java.lang.reflect.InvocationTargetException] 
null:java.lang.reflect.InvocationTargetException
   [junit]  at 
com.webobjects.foundation._NSUtilities._explainInstantiationException(_NSUtilities.java:626)
   [junit]  at 
com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:665)
   [junit]  at 
com.webobjects.eoaccess.EOEntityClassDescription.createInstanceWithEditingContext(EOEntityClassDescription.java:242)
   [junit]  at 
com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:216)
   [junit]  at 
com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:177)
   [junit]  at 
com.wounit.rules.MockEditingContext$DummyFacade.create(MockEditingContext.java:83)
   [junit]  at 
com.wounit.rules.AnnotationProcessor.createEOForType(AnnotationProcessor.java:49)
   [junit]  at 
com.wounit.rules.AnnotationProcessor.initializeObject(AnnotationProcessor.java:172)
   [junit]  at 
com.wounit.rules.AnnotationProcessor.process(AnnotationProcessor.java:205)
   [junit]  at 
com.wounit.rules.MockEditingContext.before(MockEditingContext.java:149)
   [junit]  at 
com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:160)
   [junit] Caused by: java.lang.reflect.InvocationTargetException
   [junit]  at 
java.lang.reflect.Constructor.newInstance(Constructor.java:532)
   [junit]  at 
com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:659)
   [junit] Caused by: java.lang.NullPointerException
   [junit]  at 
com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
   [junit]  at 
com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
   [junit]  at 
com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
   [junit]  at 
com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
   [junit]  at 
com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
   [junit]  at 
com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789)
   [junit]  at 
com.webobjects.eoaccess.EOEntity.classProperties(EOEntity.java:1098)
   [junit]  at 
com.webobjects.eoaccess.EOEntity._propertyDictionaryInitializer(EOEntity.java:3321)
   [junit]  at 
com.webobjects.eoaccess.EOEntity._newDictionaryForProperties(EOEntity.java:3667)
   [junit]  at 
com.webobjects.eoaccess.EOEntityClassDescription._newDictionaryForProperties(EOEntityClassDescription.java:88)
   [junit]  at 
com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:111)
   [junit]  at 
com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:100)
   [junit]  at 
com.webobjects.eocontrol.EOGenericRecord.init(EOGenericRecord.java:73)
   [junit]  at 
er.extensions.eof.ERXGenericRecord.init(ERXGenericRecord.java:102)
   [junit]  at 
net.logicsquad.webobjects.core.eof.LSGenericRecord.init(LSGenericRecord.java:54)
   [junit]  at 
net.logicsquad.lssurvey.model.survey._Survey.init(_Survey.java:15)
   [junit]  at 
net.logicsquad.lssurvey.model.survey.Survey.init(Survey.java:491)
   [junit] 
   [junit] 
   [junit] Test net.logicsquad.lssurvey.model.SurveyInstanceTest FAILED


-- 
Paul Hoadley
http://logicsquad.net/




 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Testing er.jgroups.ERJGroupsSynchronizer

2013-08-01 Thread Gintautas Sulskus
Hello,

if I understand it right, in order to have a JGroups synchronisation I have
to set the following properties:

er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators=1
er.extensions.remoteSynchronizer.enabled=true
er.extensions.remoteSynchronizer=er.jgroups.ERJGroupsSynchronizer

The rest are optional.

Also, that calls for GossipRouter, thus I start it too. I see in the
GossipRouter log app server heartbeats. So something IS working.

How do I make sure that caches are truly synchronised? What would be the
easiest way to accomplish that?
Thanks!

Best Regards,
Gin
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2013-08-01 Thread Henrique Prange
Hi Paul,

Good to hear.

I'm trying to solve another problem that seems related to the EOF 
initialization. I'm going to release a new version of WOUnit during the weekend 
(solving the other problem or not).

Cheers,

Henrique

On 28/07/2013, at 04:07, Paul Hoadley pa...@logicsquad.net wrote:

 Hi Henrique,
 
 On 28/07/2013, at 11:58 AM, Henrique Prange hpra...@gmail.com wrote:
 
 Looks like WOUnit isn't doing the required initialization to make partial 
 entities work. I've improved the way EOF is initialized in WOUnit to mimic 
 the way Wonder initializes it. Could you try this version [1] of WOUnit. 
 Does it fix the problem with your tests?
 
 It certainly does.  Thanks a lot.  As usual, you deliver!  Do you have a 
 proper release in the pipeline, or should I use that snapshot for the time 
 being?
 
 Thanks again.
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 


 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2013-07-28 Thread Paul Hoadley
Hi Henrique,

On 28/07/2013, at 11:58 AM, Henrique Prange hpra...@gmail.com wrote:

 Looks like WOUnit isn't doing the required initialization to make partial 
 entities work. I've improved the way EOF is initialized in WOUnit to mimic 
 the way Wonder initializes it. Could you try this version [1] of WOUnit. Does 
 it fix the problem with your tests?

It certainly does.  Thanks a lot.  As usual, you deliver!  Do you have a proper 
release in the pipeline, or should I use that snapshot for the time being?

Thanks again.


-- 
Paul Hoadley
http://logicsquad.net/




 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: WOUnit testing with partial entities

2013-07-27 Thread Henrique Prange
Hi Paul,

Looks like WOUnit isn't doing the required initialization to make partial 
entities work. I've improved the way EOF is initialized in WOUnit to mimic the 
way Wonder initializes it. Could you try this version [1] of WOUnit. Does it 
fix the problem with your tests?

[1]https://dl.dropboxusercontent.com/u/9599580/wounit-1.3-SNAPSHOT-partials-fix.jar

Cheers,

Henrique

On 25/07/2013, at 21:51, Paul Hoadley pa...@logicsquad.net wrote:

 Hi Henrique,
 
 I want to write some WOUnit tests for a class that extends 
 ERXPartialGenericRecord—that is, a base entity in the partial entities 
 terminology.  I have a simple User class in a model called Ident:
 
 public class UserTest {
   @Rule
   public MockEditingContext ec = new MockEditingContext(Ident);
   
   @Test
   public void createUser() {
   User u = User.createUser(ec, password, username);
   confirm(u, canBeSaved());
   return;
   }
 }
 
 This test fails with the following (abridged) stack trace:
 
 java.lang.ClassCastException: 
 com.webobjects.eoaccess.EOEntityClassDescription cannot be cast to 
 er.extensions.eof.ERXEntityClassDescription
   at 
 er.extensions.partials.ERXPartialGenericRecord._partialsDictionary(ERXPartialGenericRecord.java:40)
   at 
 er.extensions.partials.ERXPartialGenericRecord._partials(ERXPartialGenericRecord.java:64)
   at 
 er.extensions.partials.ERXPartialGenericRecord.awakeFromInsertion(ERXPartialGenericRecord.java:179)
   at 
 com.webobjects.eocontrol.EOEditingContext.insertObjectWithGlobalID(EOEditingContext.java:2871)
   at er.extensions.eof.ERXEC.insertObjectWithGlobalID(ERXEC.java:976)
   at 
 com.webobjects.eocontrol.EOEditingContext.insertObject(EOEditingContext.java:2889)
   at er.extensions.eof.ERXEC.insertObject(ERXEC.java:987)
   at 
 com.webobjects.eoaccess.EOUtilities.createAndInsertInstance(EOUtilities.java:862)
   at net.logicsquad.access.model._User.createUser(_User.java:180)
   at net.logicsquad.access.tests.UserTest.createUser(UserTest.java:20)
 
 I know you haven't done any testing with partial entities yourself (I spoke 
 to Henrique off-list).  Eyeballing it, does this look like an issue with 
 WOUnit, or ERXPartialGenericRecord?  I can provide a minimal test project if 
 you need it.  Let me know.
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

WOUnit testing with partial entities

2013-07-25 Thread Paul Hoadley
Hi Henrique,

I want to write some WOUnit tests for a class that extends 
ERXPartialGenericRecord—that is, a base entity in the partial entities 
terminology.  I have a simple User class in a model called Ident:

public class UserTest {
@Rule
public MockEditingContext ec = new MockEditingContext(Ident);

@Test
public void createUser() {
User u = User.createUser(ec, password, username);
confirm(u, canBeSaved());
return;
}
}

This test fails with the following (abridged) stack trace:

java.lang.ClassCastException: com.webobjects.eoaccess.EOEntityClassDescription 
cannot be cast to er.extensions.eof.ERXEntityClassDescription
at 
er.extensions.partials.ERXPartialGenericRecord._partialsDictionary(ERXPartialGenericRecord.java:40)
at 
er.extensions.partials.ERXPartialGenericRecord._partials(ERXPartialGenericRecord.java:64)
at 
er.extensions.partials.ERXPartialGenericRecord.awakeFromInsertion(ERXPartialGenericRecord.java:179)
at 
com.webobjects.eocontrol.EOEditingContext.insertObjectWithGlobalID(EOEditingContext.java:2871)
at er.extensions.eof.ERXEC.insertObjectWithGlobalID(ERXEC.java:976)
at 
com.webobjects.eocontrol.EOEditingContext.insertObject(EOEditingContext.java:2889)
at er.extensions.eof.ERXEC.insertObject(ERXEC.java:987)
at 
com.webobjects.eoaccess.EOUtilities.createAndInsertInstance(EOUtilities.java:862)
at net.logicsquad.access.model._User.createUser(_User.java:180)
at net.logicsquad.access.tests.UserTest.createUser(UserTest.java:20)

I know you haven't done any testing with partial entities yourself (I spoke to 
Henrique off-list).  Eyeballing it, does this look like an issue with WOUnit, 
or ERXPartialGenericRecord?  I can provide a minimal test project if you need 
it.  Let me know.


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: ERRest Testing

2012-07-13 Thread Henrique Prange
Hi Kieran,

Thanks. I've used the soapUI to explore WebServices APIs in the past, but I had 
no idea they have this option for REST testing.

Cheers,

Henrique

On 12/07/2012, at 13:29, Kieran Kelleher wrote:

 I guess the URL would be useful :-)
 
 http://soapui.org/REST-Testing/rest-functional-testing.html
 
 On Jul 12, 2012, at 12:28 PM, Kieran Kelleher wrote:
 
 Came across this the other day when I was grabbing latest soapUI.app to 
 explore a SOAP webservice. It seems soapUI *might* be a solution for REST 
 service testing . I have not tried it, so YMMV.
 
 On Jul 3, 2012, at 11:14 PM, Paul Hoadley wrote:
 
 Hi Henrique,
 
 On 03/07/2012, at 1:20 PM, Henrique Prange wrote:
 
 Simple question: how are you testing ERRest APIs?
 
 In a project I was working on a few months ago, I was doing what amounts to 
 rudimentary functional testing using Apache HttpClient.  Using JUnit as the 
 test runner, I was simply constructing the appropriate requests and 
 checking the responses.  It was somewhat tedious, but it worked to the 
 extent that you could manually run a test quite against the app running in 
 Eclipse.  Time did not permit anything more sophisticated, such as working 
 out the best way to run the tests in a continuous integration setting, or 
 factoring the code appropriately to reduce the tedium of making new tests.  
 If I get time to revisit it, those two things would certainly be my goal, 
 as manually running the tests is better than nothing, but obviously nowhere 
 near as good as having it in the CI process.
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com
 
 This email sent to kelleh...@gmail.com
 
 

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: ERRest Testing

2012-07-12 Thread Kieran Kelleher
Came across this the other day when I was grabbing latest soapUI.app to explore 
a SOAP webservice. It seems soapUI *might* be a solution for REST service 
testing . I have not tried it, so YMMV.

On Jul 3, 2012, at 11:14 PM, Paul Hoadley wrote:

 Hi Henrique,
 
 On 03/07/2012, at 1:20 PM, Henrique Prange wrote:
 
 Simple question: how are you testing ERRest APIs?
 
 In a project I was working on a few months ago, I was doing what amounts to 
 rudimentary functional testing using Apache HttpClient.  Using JUnit as the 
 test runner, I was simply constructing the appropriate requests and checking 
 the responses.  It was somewhat tedious, but it worked to the extent that you 
 could manually run a test quite against the app running in Eclipse.  Time did 
 not permit anything more sophisticated, such as working out the best way to 
 run the tests in a continuous integration setting, or factoring the code 
 appropriately to reduce the tedium of making new tests.  If I get time to 
 revisit it, those two things would certainly be my goal, as manually running 
 the tests is better than nothing, but obviously nowhere near as good as 
 having it in the CI process.
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com
 
 This email sent to kelleh...@gmail.com

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: ERRest Testing

2012-07-12 Thread Kieran Kelleher
I guess the URL would be useful :-)

http://soapui.org/REST-Testing/rest-functional-testing.html

On Jul 12, 2012, at 12:28 PM, Kieran Kelleher wrote:

 Came across this the other day when I was grabbing latest soapUI.app to 
 explore a SOAP webservice. It seems soapUI *might* be a solution for REST 
 service testing . I have not tried it, so YMMV.
 
 On Jul 3, 2012, at 11:14 PM, Paul Hoadley wrote:
 
 Hi Henrique,
 
 On 03/07/2012, at 1:20 PM, Henrique Prange wrote:
 
 Simple question: how are you testing ERRest APIs?
 
 In a project I was working on a few months ago, I was doing what amounts to 
 rudimentary functional testing using Apache HttpClient.  Using JUnit as the 
 test runner, I was simply constructing the appropriate requests and checking 
 the responses.  It was somewhat tedious, but it worked to the extent that 
 you could manually run a test quite against the app running in Eclipse.  
 Time did not permit anything more sophisticated, such as working out the 
 best way to run the tests in a continuous integration setting, or factoring 
 the code appropriately to reduce the tedium of making new tests.  If I get 
 time to revisit it, those two things would certainly be my goal, as manually 
 running the tests is better than nothing, but obviously nowhere near as good 
 as having it in the CI process.
 
 
 -- 
 Paul Hoadley
 http://logicsquad.net/
 
 
 
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com
 
 This email sent to kelleh...@gmail.com
 

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


ERRest Testing

2012-07-03 Thread Henrique Prange
Hi everyone,

Simple question: how are you testing ERRest APIs?

Cheers,

Henrique
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: ERRest Testing

2012-07-03 Thread Paul Hoadley
Hi Henrique,

On 03/07/2012, at 1:20 PM, Henrique Prange wrote:

 Simple question: how are you testing ERRest APIs?

In a project I was working on a few months ago, I was doing what amounts to 
rudimentary functional testing using Apache HttpClient.  Using JUnit as the 
test runner, I was simply constructing the appropriate requests and checking 
the responses.  It was somewhat tedious, but it worked to the extent that you 
could manually run a test quite against the app running in Eclipse.  Time did 
not permit anything more sophisticated, such as working out the best way to run 
the tests in a continuous integration setting, or factoring the code 
appropriately to reduce the tedium of making new tests.  If I get time to 
revisit it, those two things would certainly be my goal, as manually running 
the tests is better than nothing, but obviously nowhere near as good as having 
it in the CI process.


-- 
Paul Hoadley
http://logicsquad.net/



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Stress Testing A WebObjects App

2012-03-26 Thread Kevin Hinkson
Hi all,
I have been playing with Apache Bench to determine at what number of concurrent 
sessions/request load my app starts to fail and to find and reduce any 
bottlenecks. The first thing I run into is the No instance available error. 
Does anyone have pointers for stress testing a webobjects app and determining 
what the bottlenecks are? Do the http adaptor settings play a big role in 
scaling up an app?

— K.R.H.

 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Stress Testing A WebObjects App

2012-03-26 Thread Chuck Hill
I did a short presentation on JMeter two years ago at WOWODC.  There is a 
video.  I think.


Chuck


On 2012-03-26, at 12:09 PM, Kevin Hinkson wrote:

 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and reduce 
 any bottlenecks. The first thing I run into is the No instance available 
 error. Does anyone have pointers for stress testing a webobjects app and 
 determining what the bottlenecks are? Do the http adaptor settings play a big 
 role in scaling up an app?
 
 — K.R.H.
 
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
 
 This email sent to ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects










smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Stress Testing A WebObjects App

2012-03-26 Thread Miguel Arroz
Hi,

  I've used JMeter in the past to perform scripted sequences of requests and 
test concurrency behaviour on apps with shared data accessed in heavy 
concurrency. Make sure you give it plenty of RAM if you are going to use a high 
number of threads and record response data.

  Regards,

Miguel Arroz

On 2012-03-26, at 12:09 PM, Kevin Hinkson wrote:

 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and reduce 
 any bottlenecks. The first thing I run into is the No instance available 
 error. Does anyone have pointers for stress testing a webobjects app and 
 determining what the bottlenecks are? Do the http adaptor settings play a big 
 role in scaling up an app?
 
 — K.R.H.
 
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/arroz%40guiamac.com
 
 This email sent to ar...@guiamac.com


 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Stress Testing A WebObjects App

2012-03-26 Thread Pascal Robert
For stress testing: 
http://www.wocommunity.org/podcasts/wowodc/2010/WOWODC2010JMeter.mov

 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and reduce 
 any bottlenecks. The first thing I run into is the No instance available 
 error. Does anyone have pointers for stress testing a webobjects app and 
 determining what the bottlenecks are? Do the http adaptor settings play a big 
 role in scaling up an app?
 
 — K.R.H.
 
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
 
 This email sent to prob...@macti.ca


 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Stress Testing A WebObjects App

2012-03-26 Thread Chuck Hill

On 2012-03-26, at 12:09 PM, Kevin Hinkson wrote:

 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and reduce 
 any bottlenecks.

Be aware that this is not easy and that setting up the tests and getting them 
to run in a realistic simulation of actual load is not trivial.


 The first thing I run into is the No instance available error.

That may just mean it overwhelmed your app.


 Does anyone have pointers for stress testing a webobjects app and determining 
 what the bottlenecks are? Do the http adaptor settings play a big role in 
 scaling up an app?

No, your code and database tuning play a much larger role.


Chuck

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects










smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Stress Testing A WebObjects App

2012-03-26 Thread Kevin Hinkson
Hi Chuck,

On 26 Mar 2012, at 15:36, Chuck Hill wrote:

 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and 
 reduce any bottlenecks.
 
 Be aware that this is not easy and that setting up the tests and getting them 
 to run in a realistic simulation of actual load is not trivial.

Thanks. I had started to think this was the case, so I figured I would ask 
about other people's experiences. 

Regarding overloading the app, I figured that was the case so I toned down the 
request to find the point up to which it does not fail. It seems to me that I 
may be better off doing basic testing and implementing really good monitoring 
to catch problems as soon as they occur in the wild.


— K.R.H.


 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Stress Testing A WebObjects App

2012-03-26 Thread Kevin Hinkson

On 26 Mar 2012, at 15:31, Pascal Robert wrote:

 For stress testing: 
 http://www.wocommunity.org/podcasts/wowodc/2010/WOWODC2010JMeter.mov

Thanks Pascal.

— K.R.H.


 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Stress Testing A WebObjects App

2012-03-26 Thread Pascal Robert

Le 2012-03-26 à 15:57, Kevin Hinkson a écrit :

 Hi Chuck,
 
 On 26 Mar 2012, at 15:36, Chuck Hill wrote:
 
 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and 
 reduce any bottlenecks.
 
 Be aware that this is not easy and that setting up the tests and getting 
 them to run in a realistic simulation of actual load is not trivial.
 
 Thanks. I had started to think this was the case, so I figured I would ask 
 about other people's experiences. 
 
 Regarding overloading the app, I figured that was the case so I toned down 
 the request to find the point up to which it does not fail. It seems to me 
 that I may be better off doing basic testing and implementing really good 
 monitoring to catch problems as soon as they occur in the wild.

I have to say it again, Nagios is your friend!

http://wocommunity.org/podcasts/MonitoringYourWOApps.mov

(instead of there's an app for that, we should say there's a podcast for 
that :-))
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Stress Testing A WebObjects App

2012-03-26 Thread Ramsey Gurley

On Mar 26, 2012, at 12:57 PM, Kevin Hinkson wrote:

 Hi Chuck,
 
 On 26 Mar 2012, at 15:36, Chuck Hill wrote:
 
 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and 
 reduce any bottlenecks.
 
 Be aware that this is not easy and that setting up the tests and getting 
 them to run in a realistic simulation of actual load is not trivial.
 
 Thanks. I had started to think this was the case, so I figured I would ask 
 about other people's experiences. 
 
 Regarding overloading the app, I figured that was the case so I toned down 
 the request to find the point up to which it does not fail. It seems to me 
 that I may be better off doing basic testing and implementing really good 
 monitoring to catch problems as soon as they occur in the wild.
 
 
 — K.R.H.

Just thought I would add... If you don't already have tickets, you may want to 
attend WOWODC this year :-)

http://www.youtube.com/watch?v=wDnwUHaQ9rQ

I won't be giving JMeter the in depth coverage Chuck did, but if your app uses 
component actions, you'll probably want to know about persistent session 
storage.

Ramsey



 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Stress Testing A WebObjects App

2012-03-26 Thread Kevin Hinkson

On 26 Mar 2012, at 16:41, Ramsey Gurley wrote:

 I won't be giving JMeter the in depth coverage Chuck did, but if your app 
 uses component actions, you'll probably want to know about persistent session 
 storage.

Persistent session storage... sounds like magic to me.


— K.R.H.


 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Stress Testing A WebObjects App

2012-03-26 Thread Chuck Hill
On 2012-03-26, at 12:57 PM, Kevin Hinkson wrote:
 Hi Chuck,
 On 26 Mar 2012, at 15:36, Chuck Hill wrote:
 
 Hi all,
 I have been playing with Apache Bench to determine at what number of 
 concurrent sessions/request load my app starts to fail and to find and 
 reduce any bottlenecks.
 
 Be aware that this is not easy and that setting up the tests and getting 
 them to run in a realistic simulation of actual load is not trivial.
 
 Thanks. I had started to think this was the case, so I figured I would ask 
 about other people's experiences. 
 
 Regarding overloading the app, I figured that was the case so I toned down 
 the request to find the point up to which it does not fail. It seems to me 
 that I may be better off doing basic testing and implementing really good 
 monitoring to catch problems as soon as they occur in the wild.


It really depends on what your goals are.  If you are just trying to find bugs 
and bottlenecks, there are easier ways to go about it.  You will probably find 
that video useful.


Chuck

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects










smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Please ignore - testing to see if the list is alive

2012-03-08 Thread Kieran Kelleher
Please ignore - testing to see if the list is alive
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Testing

2012-02-23 Thread Chuck Hill
Its on.


On 2012-02-21, at 8:07 PM, Kieran Kelleher wrote:

 Testing
 ___
 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:
 https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
 
 This email sent to ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects










smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Validation Exceptions, Localization Unit Testing

2011-12-18 Thread Henrique Prange
Hi Kevin,

I'm not an expert on ERXValidation, but you're correct. The ERXLocalizer class 
has not been initialized properly. Unfortunately, WOUnit doesn't load the 
Properties file before the test execution as well as it doesn't provide means 
for the ERXLocalizer to initialize properly. As a workaround, you can manually 
load the Properties file and initialize the ERXLocalizer in a static method 
annotated with @BeforeClass.

I've created two issues [1] [2] and will take a closer look at this requirement.

[1]https://github.com/hprange/wounit/issues/24
[2]https://github.com/hprange/wounit/issues/25

Cheers,

Henrique

On 15/12/2011, at 17:15, Kevin Hinkson wrote:

 Hi everyone,
 
 I have a model framework that I am currently testing using WOUnit. For the 
 Account EO I have a unit test to ensure that the email attribute is valid 
 before saving. That worked fine until I started changing the code to be 
 localizable.
 
 I have a ValidationTemplate.strings in the framework under Resources - 
 English.lproj - ValidationTemplate.strings
 
 Values in the template
 {
 EmailFormatException = A valid b@@displayNameForProperty@@/b is 
 required.;
 Account.email.EmailFormatException = b@@displayNameForProperty@@/b 
 must be a valid email address.;
 }
 
 Properties set:
 
 # Localization
 er.extensions.ERXLocalizer.defaultLanguage=English
 er.extensions.ERXLocalizer.fileNamesToWatch=(Localizable.strings,ValidationTemplate.strings)
 er.extensions.ERXLocalizer.availableLanguages=(English)
 er.extensions.ERXLocalizer.frameworkSearchPath=(app,ERDirectToWeb,ERExtensions)
 er.extensions.ERXLocalizer.useLocalizedFormatters=true
 
 
 Validation code:
 
   public String validateEmail(String newEmail) {
   ERXValidationFactory factory = 
 ERXValidationFactory.defaultFactory();
   
   if (!Account.isValidEmail(newEmail)) {
   ERXValidationException exception = 
 factory.createCustomException(this, Account.EMAIL_KEY, newEmail, 
 EmailFormatException);
   throw exception;
   }
   
   return newEmail;
   }
 
 When I run the unit test for the Account EO I get a stack trace in the logs:
 
 - Undefined Validation Template entity Account property 
 EmailFormatException type CustomMethodException target language English
 java.lang.Throwable
   at 
 er.extensions.validation.ERXValidationFactory.templateForEntityPropertyType(ERXValidationFactory.java:554)
   at 
 er.extensions.validation.ERXValidationFactory.templateForException(ERXValidationFactory.java:448)
   at 
 er.extensions.validation.ERXValidationFactory.messageForException(ERXValidationFactory.java:394)
   at 
 er.extensions.validation.ERXValidationException.getMessage(ERXValidationException.java:133)
   at 
 com.wounit.matchers.CanBeSavedMatcher.describeTo(CanBeSavedMatcher.java:53)
   at 
 org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:21)
   at com.wounit.matchers.EOAssert.confirmImplementation(EOAssert.java:253)
   at com.wounit.matchers.EOAssert.confirm(EOAssert.java:216)
   at 
 com.coralstone.envoy.modeltests.AccountTest.cannotSaveInvalidEmail(AccountTest.java:61)
   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 
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at 
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at 
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at 
 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
   at 
 com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:141)
   at 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
   at 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
   at 
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
   at 
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467

Re: Validation Exceptions, Localization Unit Testing

2011-12-18 Thread Farrukh Ijaz
Try reordering your application classpath and I guess moving Extensions 
Framework above will solve the problem. It happened to me a couple of times and 
I discovered it's related to loading the classes in specific order.

Farrukh 

Henrique Prange hpra...@gmail.com wrote:

Hi Kevin,

I'm not an expert on ERXValidation, but you're correct. The ERXLocalizer class 
has not been initialized properly. Unfortunately, WOUnit doesn't load the 
Properties file before the test execution as well as it doesn't provide means 
for the ERXLocalizer to initialize properly. As a workaround, you can manually 
load the Properties file and initialize the ERXLocalizer in a static method 
annotated with @BeforeClass.

I've created two issues [1] [2] and will take a closer look at this 
requirement.

[1]https://github.com/hprange/wounit/issues/24
[2]https://github.com/hprange/wounit/issues/25

Cheers,

Henrique

On 15/12/2011, at 17:15, Kevin Hinkson wrote:

 Hi everyone,
 
 I have a model framework that I am currently testing using WOUnit. For the 
 Account EO I have a unit test to ensure that the email attribute is valid 
 before saving. That worked fine until I started changing the code to be 
 localizable.
 
 I have a ValidationTemplate.strings in the framework under Resources - 
 English.lproj - ValidationTemplate.strings
 
 Values in the template
 {
 EmailFormatException = A valid b@@displayNameForProperty@@/b is 
 required.;
 Account.email.EmailFormatException = 
 b@@displayNameForProperty@@/b must be a valid email address.;
 }
 
 Properties set:
 
 # Localization
 er.extensions.ERXLocalizer.defaultLanguage=English
 er.extensions.ERXLocalizer.fileNamesToWatch=(Localizable.strings,ValidationTemplate.strings)
 er.extensions.ERXLocalizer.availableLanguages=(English)
 er.extensions.ERXLocalizer.frameworkSearchPath=(app,ERDirectToWeb,ERExtensions)
 er.extensions.ERXLocalizer.useLocalizedFormatters=true
 
 
 Validation code:
 
  public String validateEmail(String newEmail) {
  ERXValidationFactory factory = 
 ERXValidationFactory.defaultFactory();
  
  if (!Account.isValidEmail(newEmail)) {
  ERXValidationException exception = 
 factory.createCustomException(this, Account.EMAIL_KEY, newEmail, 
 EmailFormatException);
  throw exception;
  }
  
  return newEmail;
  }
 
 When I run the unit test for the Account EO I get a stack trace in the logs:
 
 - Undefined Validation Template entity Account property 
 EmailFormatException type CustomMethodException target language English
 java.lang.Throwable
  at 
 er.extensions.validation.ERXValidationFactory.templateForEntityPropertyType(ERXValidationFactory.java:554)
  at 
 er.extensions.validation.ERXValidationFactory.templateForException(ERXValidationFactory.java:448)
  at 
 er.extensions.validation.ERXValidationFactory.messageForException(ERXValidationFactory.java:394)
  at 
 er.extensions.validation.ERXValidationException.getMessage(ERXValidationException.java:133)
  at 
 com.wounit.matchers.CanBeSavedMatcher.describeTo(CanBeSavedMatcher.java:53)
  at 
 org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:21)
  at com.wounit.matchers.EOAssert.confirmImplementation(EOAssert.java:253)
  at com.wounit.matchers.EOAssert.confirm(EOAssert.java:216)
  at 
 com.coralstone.envoy.modeltests.AccountTest.cannotSaveInvalidEmail(AccountTest.java:61)
  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 
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
  at 
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
  at 
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
  at 
 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
  at 
 com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:141)
  at 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
  at 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
  at 
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run

Re: Validation Exceptions, Localization Unit Testing

2011-12-18 Thread Kevin Hinkson

On 18 Dec 2011, at 21:41, Henrique Prange wrote:

 Hi Kevin,
 
 I'm not an expert on ERXValidation, but you're correct. The ERXLocalizer 
 class has not been initialized properly. Unfortunately, WOUnit doesn't load 
 the Properties file before the test execution as well as it doesn't provide 
 means for the ERXLocalizer to initialize properly. As a workaround, you can 
 manually load the Properties file and initialize the ERXLocalizer in a static 
 method annotated with @BeforeClass.

I poked around to see what ERXExtensions was doing to load the properties and 
setup ValidationTemplates and came up with:

@Before
public void setup() {
//ERXProperties.populateSystemProperties();
ERXLocalizer.initialize();
ERXValidationFactory.defaultFactory().configureFactory();
}

Then I realized that WOUnit actually loads ERExtensions which should already be 
doing this (and is according to ERXLocalization.isLocalizationInitialized). So 
there is some other piece that is not fully setup.

 
 I've created two issues [1] [2] and will take a closer look at this 
 requirement.

Thanks Henrique. The exception is not actually an exception. I can still do:
confirm(account, cannotBeSavedBecause(InvalidEmailException));

It looks like ERXValidationFactory does the following in it's 
templateForEntityPropertyType method because it was unable to find a template. 

template = UNDEFINED_VALIDATION_TEMPLATE +  entity \ + entityName + \ 
property \ + property + \ type \ + type + \ target language \ + 
targetLanguage + \;
log.error(template, new Throwable());

This then led me as far as the valueForKeyPath method in ERXLocalizer returning 
null for the template.

So I can match on the validation template key name but not the value. Come to 
think of it, this may actually make more sense when unit testing, otherwise I'd 
be having to look for different string values depending on the language setup. 
I'll call it a night here and take another look at this sometime during the 
week. Or not at all, since it may actually make more sense the way it is.

 
 [1]https://github.com/hprange/wounit/issues/24
 [2]https://github.com/hprange/wounit/issues/25
 
 Cheers,
 
 Henrique
 
 On 15/12/2011, at 17:15, Kevin Hinkson wrote:
 
 Hi everyone,
 
 I have a model framework that I am currently testing using WOUnit. For the 
 Account EO I have a unit test to ensure that the email attribute is valid 
 before saving. That worked fine until I started changing the code to be 
 localizable.
 
 I have a ValidationTemplate.strings in the framework under Resources - 
 English.lproj - ValidationTemplate.strings
 
 Values in the template
 {
 EmailFormatException = A valid b@@displayNameForProperty@@/b is 
 required.;
 Account.email.EmailFormatException = 
 b@@displayNameForProperty@@/b must be a valid email address.;
 }
 
 Properties set:
 
 # Localization
 er.extensions.ERXLocalizer.defaultLanguage=English
 er.extensions.ERXLocalizer.fileNamesToWatch=(Localizable.strings,ValidationTemplate.strings)
 er.extensions.ERXLocalizer.availableLanguages=(English)
 er.extensions.ERXLocalizer.frameworkSearchPath=(app,ERDirectToWeb,ERExtensions)
 er.extensions.ERXLocalizer.useLocalizedFormatters=true
 
 
 Validation code:
 
  public String validateEmail(String newEmail) {
  ERXValidationFactory factory = 
 ERXValidationFactory.defaultFactory();
  
  if (!Account.isValidEmail(newEmail)) {
  ERXValidationException exception = 
 factory.createCustomException(this, Account.EMAIL_KEY, newEmail, 
 EmailFormatException);
  throw exception;
  }
  
  return newEmail;
  }
 
 When I run the unit test for the Account EO I get a stack trace in the logs:
 
 - Undefined Validation Template entity Account property 
 EmailFormatException type CustomMethodException target language English
 java.lang.Throwable
  at 
 er.extensions.validation.ERXValidationFactory.templateForEntityPropertyType(ERXValidationFactory.java:554)
  at 
 er.extensions.validation.ERXValidationFactory.templateForException(ERXValidationFactory.java:448)
  at 
 er.extensions.validation.ERXValidationFactory.messageForException(ERXValidationFactory.java:394)
  at 
 er.extensions.validation.ERXValidationException.getMessage(ERXValidationException.java:133)
  at 
 com.wounit.matchers.CanBeSavedMatcher.describeTo(CanBeSavedMatcher.java:53)
  at 
 org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:21)
  at com.wounit.matchers.EOAssert.confirmImplementation(EOAssert.java:253)
  at com.wounit.matchers.EOAssert.confirm(EOAssert.java:216)
  at 
 com.coralstone.envoy.modeltests.AccountTest.cannotSaveInvalidEmail(AccountTest.java:61)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39

Validation Exceptions, Localization Unit Testing

2011-12-15 Thread Kevin Hinkson
Hi everyone,

I have a model framework that I am currently testing using WOUnit. For the 
Account EO I have a unit test to ensure that the email attribute is valid 
before saving. That worked fine until I started changing the code to be 
localizable.

I have a ValidationTemplate.strings in the framework under Resources - 
English.lproj - ValidationTemplate.strings

Values in the template
{
EmailFormatException = A valid b@@displayNameForProperty@@/b is 
required.;
Account.email.EmailFormatException = b@@displayNameForProperty@@/b 
must be a valid email address.;
}

Properties set:

# Localization
er.extensions.ERXLocalizer.defaultLanguage=English
er.extensions.ERXLocalizer.fileNamesToWatch=(Localizable.strings,ValidationTemplate.strings)
er.extensions.ERXLocalizer.availableLanguages=(English)
er.extensions.ERXLocalizer.frameworkSearchPath=(app,ERDirectToWeb,ERExtensions)
er.extensions.ERXLocalizer.useLocalizedFormatters=true


Validation code:

public String validateEmail(String newEmail) {
ERXValidationFactory factory = 
ERXValidationFactory.defaultFactory();

if (!Account.isValidEmail(newEmail)) {
ERXValidationException exception = 
factory.createCustomException(this, Account.EMAIL_KEY, newEmail, 
EmailFormatException);
throw exception;
}

return newEmail;
}

When I run the unit test for the Account EO I get a stack trace in the logs:

- Undefined Validation Template entity Account property 
EmailFormatException type CustomMethodException target language English
java.lang.Throwable
at 
er.extensions.validation.ERXValidationFactory.templateForEntityPropertyType(ERXValidationFactory.java:554)
at 
er.extensions.validation.ERXValidationFactory.templateForException(ERXValidationFactory.java:448)
at 
er.extensions.validation.ERXValidationFactory.messageForException(ERXValidationFactory.java:394)
at 
er.extensions.validation.ERXValidationException.getMessage(ERXValidationException.java:133)
at 
com.wounit.matchers.CanBeSavedMatcher.describeTo(CanBeSavedMatcher.java:53)
at 
org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:21)
at com.wounit.matchers.EOAssert.confirmImplementation(EOAssert.java:253)
at com.wounit.matchers.EOAssert.confirm(EOAssert.java:216)
at 
com.coralstone.envoy.modeltests.AccountTest.cannotSaveInvalidEmail(AccountTest.java:61)
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 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at 
com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:141)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


It looks to me as if maybe the validation template cannot be found but I'm not 
certain what would cause that. Possibly there is something I need to load 
before running the test? Does anyone know what that might be?

— Kevin Hinkson.

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help

Re: Bundle loading during unit testing outside Eclipse

2011-09-26 Thread Paul Hoadley
Hi Marius,

On 23/09/2011, at 5:29 PM, Marius Soutier wrote:

 Paul, are you depending on the bundle when building from Hudson? For me this 
 property only mattes inside of Eclipse because I'm working bundle-less (which 
 is much more compatible with other plug-ins).

I run the unit tests inside the built bundle, yes.  I use WOPath to pick up all 
the frameworks from outside the bundle, though.  It works just fine _except_ in 
this single case where TemporaryEditingContext is being initialised.

As it turns out, the problem was related to Henrique's fix for using WOUnit in 
Eclipse with bundleless builds.  Henrique can expand on the problem and its 
solution, but the one line summary for this thread is that it looks like it's 
now fixed in WOUnit.


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-23 Thread Marius Soutier
)
 [junit]at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
 [junit]at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
 [junit]at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 
 ___
 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/hprange%40gmail.com
 
 This email sent to hpra...@gmail.com
 ___
 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/m.soutier%40starhealthcare.info
 
 This email sent to m.sout...@starhealthcare.info

 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Marius Soutier
I face the same problem when I run my WOUnit tests locally from Ant:

[junit] Cannot load model named 'SFFoundationEOModel'
[junit] java.lang.IllegalArgumentException: Cannot load model named 
'SFFoundationEOModel'
[junit] at 
com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
[junit] at 
com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
[junit] at 
com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
[junit] at 
com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
[junit] at 
net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)

On the other hand, my own test case stuff has a similar problem now:

[junit] - Standard Output ---
[junit] Sep 22 11:52:27 N/A[N/A] WARN  er.extensions.migration.ERXMigrator  
- er.migration.modelNames is not set, defaulting to modelGroup.models() order 
instead.
[junit] Sep 22 11:52:28 N/A[N/A] ERROR 
er.extensions.eof.ERXEntityClassDescription  - Entity SFIncident not found in 
the default model group!
[junit] -  ---
[junit] Testcase: 
testTimeContextIsAppended(net.starhealthcare.sffoundation.model.SFIncidentTest):
  Caused an ERROR
[junit] Could not find EOClassDescription for entity name 'SFIncident' !
[junit] java.lang.IllegalArgumentException: Could not find 
EOClassDescription for entity name 'SFIncident' !




On 21.09.2011, at 19:28, Chuck Hill wrote:

 
 On 2011-09-20, at 10:08 PM, Paul Hoadley wrote:
 
 On 21/09/2011, at 2:26 PM, Chuck Hill wrote:
 
 If you 
 cd WT2.woa
 ./WT2
 does the app run and find any of the bundles?
 
 Yep, runs and finds them all.
 
 Wow.  The only thing that I can think of right now is that it _is_ 
 something to do with WOTest.  I just can't imagine what.  Is ERJars on your 
 classpath?
 
 Yes, ERJars is on the classpath.
 
 I'd love to blame WOUnit.  (Hi Henrique!)  I might have to put some more 
 time into developing a minimal test case that I can ship to Henrique.
 
 
 I'd like to take a look at it too.
 
 
 -- 
 Chuck Hill Senior Consultant / VP Development
 
 Practical WebObjects - for developers who want to increase their overall 
 knowledge of WebObjects or who are trying to solve specific problems.
 http://www.global-village.net/products/practical_webobjects
 
 
 
 
 
 
 
 ___
 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/m.soutier%40starhealthcare.info
 
 This email sent to m.sout...@starhealthcare.info

 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Paul Hoadley
Hi Marius,

On 22/09/2011, at 7:27 PM, Marius Soutier wrote:

 I face the same problem when I run my WOUnit tests locally from Ant:
 
 [junit] Cannot load model named 'SFFoundationEOModel'
 [junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
 [junit]   at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
 [junit]   at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
 [junit]   at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
 [junit]   at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
 [junit]   at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)

I don't think that is quite the same problem—I'm not having an issue with 
finding any models.  Is your model in a different framework?  Is that framework 
on the testing classpath?


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Marius Soutier
That error message wasn't exact enough, it was a problem with ERXLocalizer 
being initialized too early (in statics), and now I'm down to this:

   [junit] Testcase: net.starhealthcare.sffoundation.model.SFTaskTest:  Caused 
an ERROR
[junit] Unable to get the name of the class to instantiate for the adaptor 
framework JavaJDBCAdaptor. The possible causes for this error are: the adaptor 
framework is not installed on your system, the adaptor framework is not linked 
into your application, or the info dictionary for this adaptor is corrupted.
[junit] java.lang.IllegalStateException: Unable to get the name of the 
class to instantiate for the adaptor framework JavaJDBCAdaptor. The possible 
causes for this error are: the adaptor framework is not installed on your 
system, the adaptor framework is not linked into your application, or the info 
dictionary for this adaptor is corrupted.
[junit] at 
com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed(EOAdaptor.java:264)
[junit] at 
com.webobjects.eoaccess.EOAdaptor.adaptorWithName(EOAdaptor.java:287)
[junit] at 
com.webobjects.eoaccess.EOAdaptor.adaptorWithModel(EOAdaptor.java:312)
[junit] at 
com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:624)
[junit] at 
com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
[junit] at 
com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
[junit] at 
com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
[junit] at 
com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
[junit] at 
er.extensions.eof.ERXModelGroup.modifyModelsFromProperties(ERXModelGroup.java:1150)
[junit] at 
er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:278)
[junit] at 
er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:147)
[junit] at 
com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
[junit] at 
com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
[junit] at 
com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
[junit] at 
com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
[junit] at 
er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169)
[junit] at 
net.starhealthcare.sffoundation.test.SFModelTestCase.initWO(SFModelTestCase.java:74)
[junit] at 
net.starhealthcare.sffoundation.test.SFModelTestCase.initTestCase(SFModelTestCase.java:52)
[junit] at 
org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[junit] at 
org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[junit] at 
org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)


On 22.09.2011, at 12:38, Paul Hoadley wrote:

 Hi Marius,
 
 On 22/09/2011, at 7:27 PM, Marius Soutier wrote:
 
 I face the same problem when I run my WOUnit tests locally from Ant:
 
 [junit] Cannot load model named 'SFFoundationEOModel'
 [junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
 [junit]  at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
 [junit]  at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
 [junit]  at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
 [junit]  at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
 [junit]  at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 

 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Henrique Prange
That error only happens when you run the tests with Ant, correct?

Sent from my iPhone

On 22/09/2011, at 07:51, Marius Soutier m.sout...@starhealthcare.info wrote:

 That error message wasn't exact enough, it was a problem with ERXLocalizer 
 being initialized too early (in statics), and now I'm down to this:
 
[junit] Testcase: net.starhealthcare.sffoundation.model.SFTaskTest:
 Caused an ERROR
 [junit] Unable to get the name of the class to instantiate for the 
 adaptor framework JavaJDBCAdaptor. The possible causes for this error are: 
 the adaptor framework is not installed on your system, the adaptor framework 
 is not linked into your application, or the info dictionary for this adaptor 
 is corrupted.
 [junit] java.lang.IllegalStateException: Unable to get the name of the 
 class to instantiate for the adaptor framework JavaJDBCAdaptor. The possible 
 causes for this error are: the adaptor framework is not installed on your 
 system, the adaptor framework is not linked into your application, or the 
 info dictionary for this adaptor is corrupted.
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed(EOAdaptor.java:264)
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithName(EOAdaptor.java:287)
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithModel(EOAdaptor.java:312)
 [junit]   at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:624)
 [junit]   at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
 [junit]   at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
 [junit]   at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
 [junit]   at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
 [junit]   at 
 er.extensions.eof.ERXModelGroup.modifyModelsFromProperties(ERXModelGroup.java:1150)
 [junit]   at 
 er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:278)
 [junit]   at 
 er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:147)
 [junit]   at 
 com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
 [junit]   at 
 com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
 [junit]   at 
 com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
 [junit]   at 
 er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169)
 [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initWO(SFModelTestCase.java:74)
 [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initTestCase(SFModelTestCase.java:52)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
 
 
 On 22.09.2011, at 12:38, Paul Hoadley wrote:
 
 Hi Marius,
 
 On 22/09/2011, at 7:27 PM, Marius Soutier wrote:
 
 I face the same problem when I run my WOUnit tests locally from Ant:
 
 [junit] Cannot load model named 'SFFoundationEOModel'
 [junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
 [junit] at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
 [junit] at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 
 ___
 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/hprange%40gmail.com
 
 This email sent to hpra...@gmail.com
 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Marius Soutier
As a matter of fact, my WOUnit-based tests work now!

On 22.09.2011, at 15:08, Henrique Prange wrote:

 That error only happens when you run the tests with Ant, correct?
 
 Sent from my iPhone
 
 On 22/09/2011, at 07:51, Marius Soutier m.sout...@starhealthcare.info wrote:
 
 That error message wasn't exact enough, it was a problem with ERXLocalizer 
 being initialized too early (in statics), and now I'm down to this:
 
[junit] Testcase: net.starhealthcare.sffoundation.model.SFTaskTest:   
 Caused an ERROR
 [junit] Unable to get the name of the class to instantiate for the 
 adaptor framework JavaJDBCAdaptor. The possible causes for this error are: 
 the adaptor framework is not installed on your system, the adaptor framework 
 is not linked into your application, or the info dictionary for this adaptor 
 is corrupted.
 [junit] java.lang.IllegalStateException: Unable to get the name of the 
 class to instantiate for the adaptor framework JavaJDBCAdaptor. The possible 
 causes for this error are: the adaptor framework is not installed on your 
 system, the adaptor framework is not linked into your application, or the 
 info dictionary for this adaptor is corrupted.
 [junit]  at 
 com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed(EOAdaptor.java:264)
 [junit]  at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithName(EOAdaptor.java:287)
 [junit]  at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithModel(EOAdaptor.java:312)
 [junit]  at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:624)
 [junit]  at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
 [junit]  at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
 [junit]  at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
 [junit]  at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
 [junit]  at 
 er.extensions.eof.ERXModelGroup.modifyModelsFromProperties(ERXModelGroup.java:1150)
 [junit]  at 
 er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:278)
 [junit]  at 
 er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:147)
 [junit]  at 
 com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
 [junit]  at 
 com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
 [junit]  at 
 com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
 [junit]  at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
 [junit]  at 
 er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169)
 [junit]  at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initWO(SFModelTestCase.java:74)
 [junit]  at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initTestCase(SFModelTestCase.java:52)
 [junit]  at 
 org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
 [junit]  at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
 [junit]  at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
 
 
 On 22.09.2011, at 12:38, Paul Hoadley wrote:
 
 Hi Marius,
 
 On 22/09/2011, at 7:27 PM, Marius Soutier wrote:
 
 I face the same problem when I run my WOUnit tests locally from Ant:
 
 [junit] Cannot load model named 'SFFoundationEOModel'
 [junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
 [junit]at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
 [junit]at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
 [junit]at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
 [junit]at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
 [junit]at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 
 ___
 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/hprange%40gmail.com
 
 This email sent to hpra...@gmail.com
 ___
 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/m.soutier%40starhealthcare.info

Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Chuck Hill
That sounds more like a classpath problem.  Are you putting the jar in the 
built .framework on the classpath, or something else?


On 2011-09-22, at 3:51 AM, Marius Soutier wrote:

 That error message wasn't exact enough, it was a problem with ERXLocalizer 
 being initialized too early (in statics), and now I'm down to this:
 
[junit] Testcase: net.starhealthcare.sffoundation.model.SFTaskTest:
 Caused an ERROR
 [junit] Unable to get the name of the class to instantiate for the 
 adaptor framework JavaJDBCAdaptor. The possible causes for this error are: 
 the adaptor framework is not installed on your system, the adaptor framework 
 is not linked into your application, or the info dictionary for this adaptor 
 is corrupted.
 [junit] java.lang.IllegalStateException: Unable to get the name of the 
 class to instantiate for the adaptor framework JavaJDBCAdaptor. The possible 
 causes for this error are: the adaptor framework is not installed on your 
 system, the adaptor framework is not linked into your application, or the 
 info dictionary for this adaptor is corrupted.
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed(EOAdaptor.java:264)
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithName(EOAdaptor.java:287)
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithModel(EOAdaptor.java:312)
 [junit]   at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:624)
 [junit]   at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
 [junit]   at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
 [junit]   at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
 [junit]   at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
 [junit]   at 
 er.extensions.eof.ERXModelGroup.modifyModelsFromProperties(ERXModelGroup.java:1150)
 [junit]   at 
 er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:278)
 [junit]   at 
 er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:147)
 [junit]   at 
 com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
 [junit]   at 
 com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
 [junit]   at 
 com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
 [junit]   at 
 er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169)
 [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initWO(SFModelTestCase.java:74)
 [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initTestCase(SFModelTestCase.java:52)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
 
 
 On 22.09.2011, at 12:38, Paul Hoadley wrote:
 
 Hi Marius,
 
 On 22/09/2011, at 7:27 PM, Marius Soutier wrote:
 
 I face the same problem when I run my WOUnit tests locally from Ant:
 
 [junit] Cannot load model named 'SFFoundationEOModel'
 [junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
 [junit] at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
 [junit] at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 
 ___
 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/chill%40global-village.net
 
 This email sent to ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 ___
Do not post admin requests

Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Marius Soutier
I had forgotten to fork the jUnit process, so that's resolved now. Apparently 
the classpath does not get passed through to jUnit unless you fork the process. 
Makes things a bit slower :(

But I still have this random strange error where the EO cannot be instantiated 
because EOF is not ready. I will migrate everything to WOUnit, it works much 
better.


- Marius


On 22.09.2011, at 19:55, Chuck Hill wrote:

 That sounds more like a classpath problem.  Are you putting the jar in the 
 built .framework on the classpath, or something else?
 
 
 On 2011-09-22, at 3:51 AM, Marius Soutier wrote:
 
 That error message wasn't exact enough, it was a problem with ERXLocalizer 
 being initialized too early (in statics), and now I'm down to this:
 
   [junit] Testcase: net.starhealthcare.sffoundation.model.SFTaskTest:
 Caused an ERROR
[junit] Unable to get the name of the class to instantiate for the 
 adaptor framework JavaJDBCAdaptor. The possible causes for this error are: 
 the adaptor framework is not installed on your system, the adaptor framework 
 is not linked into your application, or the info dictionary for this adaptor 
 is corrupted.
[junit] java.lang.IllegalStateException: Unable to get the name of the 
 class to instantiate for the adaptor framework JavaJDBCAdaptor. The possible 
 causes for this error are: the adaptor framework is not installed on your 
 system, the adaptor framework is not linked into your application, or the 
 info dictionary for this adaptor is corrupted.
[junit]   at 
 com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed(EOAdaptor.java:264)
[junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithName(EOAdaptor.java:287)
[junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithModel(EOAdaptor.java:312)
[junit]   at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:624)
[junit]   at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
[junit]   at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
[junit]   at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
[junit]   at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
[junit]   at 
 er.extensions.eof.ERXModelGroup.modifyModelsFromProperties(ERXModelGroup.java:1150)
[junit]   at 
 er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:278)
[junit]   at 
 er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:147)
[junit]   at 
 com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
[junit]   at 
 com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
[junit]   at 
 com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
[junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
[junit]   at 
 er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169)
[junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initWO(SFModelTestCase.java:74)
[junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initTestCase(SFModelTestCase.java:52)
[junit]   at 
 org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
 
 
 On 22.09.2011, at 12:38, Paul Hoadley wrote:
 
 Hi Marius,
 
 On 22/09/2011, at 7:27 PM, Marius Soutier wrote:
 
 I face the same problem when I run my WOUnit tests locally from Ant:
 
[junit] Cannot load model named 'SFFoundationEOModel'
[junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
[junit] at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
[junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
[junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
[junit] at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
[junit] at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 
 ___
 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/chill%40global-village.net
 
 This email sent

Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Chuck Hill

On 2011-09-22, at 12:50 PM, Marius Soutier wrote:

 I had forgotten to fork the jUnit process, so that's resolved now. Apparently 
 the classpath does not get passed through to jUnit unless you fork the 
 process. Makes things a bit slower :(
 
 But I still have this random strange error where the EO cannot be 
 instantiated because EOF is not ready. I will migrate everything to WOUnit, 
 it works much better.

You can try doing this before running any tests:
NSBundle.mainBundle();
NSBundle.allBundles();
EOModelGroup.defaultGroup();




 On 22.09.2011, at 19:55, Chuck Hill wrote:
 
 That sounds more like a classpath problem.  Are you putting the jar in the 
 built .framework on the classpath, or something else?
 
 
 On 2011-09-22, at 3:51 AM, Marius Soutier wrote:
 
 That error message wasn't exact enough, it was a problem with ERXLocalizer 
 being initialized too early (in statics), and now I'm down to this:
 
  [junit] Testcase: net.starhealthcare.sffoundation.model.SFTaskTest:
 Caused an ERROR
   [junit] Unable to get the name of the class to instantiate for the 
 adaptor framework JavaJDBCAdaptor. The possible causes for this error are: 
 the adaptor framework is not installed on your system, the adaptor 
 framework is not linked into your application, or the info dictionary for 
 this adaptor is corrupted.
   [junit] java.lang.IllegalStateException: Unable to get the name of the 
 class to instantiate for the adaptor framework JavaJDBCAdaptor. The 
 possible causes for this error are: the adaptor framework is not installed 
 on your system, the adaptor framework is not linked into your application, 
 or the info dictionary for this adaptor is corrupted.
   [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed(EOAdaptor.java:264)
   [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithName(EOAdaptor.java:287)
   [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithModel(EOAdaptor.java:312)
   [junit]   at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:624)
   [junit]   at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
   [junit]   at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
   [junit]   at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
   [junit]   at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
   [junit]   at 
 er.extensions.eof.ERXModelGroup.modifyModelsFromProperties(ERXModelGroup.java:1150)
   [junit]   at 
 er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:278)
   [junit]   at 
 er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:147)
   [junit]   at 
 com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
   [junit]   at 
 com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
   [junit]   at 
 com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
   [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
   [junit]   at 
 er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169)
   [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initWO(SFModelTestCase.java:74)
   [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initTestCase(SFModelTestCase.java:52)
   [junit]   at 
 org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
   [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
   [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
 
 
 On 22.09.2011, at 12:38, Paul Hoadley wrote:
 
 Hi Marius,
 
 On 22/09/2011, at 7:27 PM, Marius Soutier wrote:
 
 I face the same problem when I run my WOUnit tests locally from Ant:
 
   [junit] Cannot load model named 'SFFoundationEOModel'
   [junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
   [junit] at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
   [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
   [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
   [junit] at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
   [junit] at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com

Re: Bundle loading during unit testing outside Eclipse

2011-09-22 Thread Henrique Prange
Hi all,

After some investigation on a sample project provided by Paul, I was able to 
find a problem in the WOUnit code.

In order to solve the issue #13, I have enabled the NSBundleProjectEnabled 
property by default. Besides the effort to test this change inside Eclipse and 
in the console using Maven and Ant, I was unable to detect this collateral 
damage.

I'll debug the NSBundle initialization code as soon as I'm at home in order to 
provide a fix that doesn't bring the issue #13 back.

Thank you very much for your patience.

Cheers,

Henrique 

Sent from my iPhone

On 22/09/2011, at 07:51, Marius Soutier m.sout...@starhealthcare.info wrote:

 That error message wasn't exact enough, it was a problem with ERXLocalizer 
 being initialized too early (in statics), and now I'm down to this:
 
[junit] Testcase: net.starhealthcare.sffoundation.model.SFTaskTest:
 Caused an ERROR
 [junit] Unable to get the name of the class to instantiate for the 
 adaptor framework JavaJDBCAdaptor. The possible causes for this error are: 
 the adaptor framework is not installed on your system, the adaptor framework 
 is not linked into your application, or the info dictionary for this adaptor 
 is corrupted.
 [junit] java.lang.IllegalStateException: Unable to get the name of the 
 class to instantiate for the adaptor framework JavaJDBCAdaptor. The possible 
 causes for this error are: the adaptor framework is not installed on your 
 system, the adaptor framework is not linked into your application, or the 
 info dictionary for this adaptor is corrupted.
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.classForAdaptorNamed(EOAdaptor.java:264)
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithName(EOAdaptor.java:287)
 [junit]   at 
 com.webobjects.eoaccess.EOAdaptor.adaptorWithModel(EOAdaptor.java:312)
 [junit]   at 
 com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:624)
 [junit]   at 
 com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
 [junit]   at 
 com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
 [junit]   at 
 com.webobjects.eoaccess.EOAttribute.init(EOAttribute.java:998)
 [junit]   at 
 com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
 [junit]   at 
 er.extensions.eof.ERXModelGroup.modifyModelsFromProperties(ERXModelGroup.java:1150)
 [junit]   at 
 er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:278)
 [junit]   at 
 er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:147)
 [junit]   at 
 com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
 [junit]   at 
 com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
 [junit]   at 
 com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
 [junit]   at 
 er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169)
 [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initWO(SFModelTestCase.java:74)
 [junit]   at 
 net.starhealthcare.sffoundation.test.SFModelTestCase.initTestCase(SFModelTestCase.java:52)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
 [junit]   at 
 org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
 
 
 On 22.09.2011, at 12:38, Paul Hoadley wrote:
 
 Hi Marius,
 
 On 22/09/2011, at 7:27 PM, Marius Soutier wrote:
 
 I face the same problem when I run my WOUnit tests locally from Ant:
 
 [junit] Cannot load model named 'SFFoundationEOModel'
 [junit] java.lang.IllegalArgumentException: Cannot load model named 
 'SFFoundationEOModel'
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.loadModel(AbstractEditingContextRule.java:178)
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:86)
 [junit] at 
 com.wounit.rules.AbstractEditingContextRule.init(AbstractEditingContextRule.java:98)
 [junit] at 
 com.wounit.rules.TemporaryEditingContext.init(TemporaryEditingContext.java:78)
 [junit] at 
 net.starhealthcare.sffoundation.model.SFGoalTest.init(SFGoalTest.java:15)
 
 I don't think that is quite the same problem—I'm not having an issue with 
 finding any models.  Is your model in a different framework?  Is that 
 framework on the testing classpath?
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 
 ___
 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

Re: Bundle loading during unit testing outside Eclipse

2011-09-21 Thread Chuck Hill

On 2011-09-20, at 10:08 PM, Paul Hoadley wrote:

 On 21/09/2011, at 2:26 PM, Chuck Hill wrote:
 
 If you 
 cd WT2.woa
 ./WT2
 does the app run and find any of the bundles?
 
 Yep, runs and finds them all.
 
 Wow.  The only thing that I can think of right now is that it _is_ something 
 to do with WOTest.  I just can't imagine what.  Is ERJars on your classpath?
 
 Yes, ERJars is on the classpath.
 
 I'd love to blame WOUnit.  (Hi Henrique!)  I might have to put some more time 
 into developing a minimal test case that I can ship to Henrique.


I'd like to take a look at it too.


-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Paul Hoadley
On 20/09/2011, at 7:33 AM, Chuck Hill wrote:

 That is, it can't find JavaMemoryAdaptor.framework when it needs it.  I'm 
 having this problem when running unit tests in both application and 
 framework bundles of my own.  JavaMemoryAdaptor.framework is on the 
 .classpath (confirmed by running 'ant -v'),
 
 The jar file in Resources/Java is on the classpath?  That is what gets used 
 to locate the bundle.
 
 Yes.  This is in Ant's classpath as it's running the test case:
 
 /Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar
 
 And that file is really there and you have permissions?  :-)

Yep.

 I doubt this is a WOUnit problem.  For Hudson, are you wanting to use the 
 source project as the bundle (project bundles enabled) or the built .woa or 
 .framework directory as the bundle?  If you can tell me how you have things 
 setup, I should be able to help you figure out what needs to be done.
 
 I'm using the .woa directory as the bundle.
 
 The .woa directory inside the source project (dist/Foo.woa)?  Or built 
 someplace else?

The former.  The source project gets checked out into a Hudson workspace, and 
it builds in dist/WT2.woa.  (Yes, the WO project name differs from the Hudson 
project name by one character, which is why the paths I've quoted just have 
WT in them.  In retrospect this is not ideal, but I don't _think_ it's 
causing any problems.)

 I call junit like this:
 
  junit haltonfailure=false
 fork=true
 dir=${dest.dir}/${project.name}.woa
 printsummary=true
 failureproperty=test.failed
  classpath refid=testing.classpath /
  classpath
  pathelement location=bin /
 
 What is that for?  Those are the compiled classes in the app?

Exactly.  Does that not need to be there?

  pathelement location=${junit.jar} /
  pathelement location=${wounit.jar} /
  pathelement location=${bin.tests} /
  !-- WTModel models --
  pathelement 
 location=Root/Library/Frameworks/WTModel.framework /
  /classpath
  formatter type=brief usefile=false /
  formatter type=xml /
  batchtest todir=${junit.results}
  fileset dir=${bin.tests}
  include name=**/*Test.class /
  /fileset
  /batchtest
  /junit
 
 There's a bit of additional stuff in the 'junit' target (test results and so 
 on), but I doubt it's relevant.  'testing.classpath' is defined like this:
 
  typedef name=wopath classname=org.objectstyle.woproject.ant.WOPath 
 /
  wopath id=testing.classpath
  frameworks root=User eclipse=true /
  frameworks root=Local eclipse=true /
  frameworks root=System eclipse=true /
  /wopath
 
 It sounds like that this your problem.  I think this is only going to work if 
 you are running this in the project source dir where the .classpath file is.  
 Is that the case?

Yes…  well, I think so.  Define running this.  :-)  That's where Hudson and I 
are launching 'ant … junit' from, but in the junit task I have the 
dir=${dest.dir}/${project.name}.woa attribute.

 Try adding
 pathconvert property=junit.testing.classpath refid=testing.classpath/
 echo testing.classpath is  ${testing.classpath} /
 
 And see if the result is what you expect.

Did you mean ${junit.testing.classpath}?  Yes, it's exactly what I would 
expect: all of the frameworks, including 
JavaMemoryAdapter.framework/Resources/Java/JavaMemoryAdaptor.jar.  They're also 
all on the classpath for the JVM that's launching the JUnit tests, so that all 
seems to be working.  The only place they're _not_ is wherever they need to be 
to get NSBundle to load them.  I remain stumped.


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Paul Hoadley
Hi Ray,

On 20/09/2011, at 2:58 PM, Ray Kiddy wrote:

 Whenever I have had this sort of problem, I usually end up switching the 
 junit target to a java target. The re-write one has to do for that, the 
 re-jiggering of the parameters, usually points me to the problem. It is kind 
 of labor-intensive, but it works. Once it works as a java, I have seen the 
 error and it will work as a junit. Also, spending some more time looking at 
 the verbose output from ant helps. It just takes longer than it seems is 
 justified. It is extremely verbose. But, you know, the problem is always in 
 there somewhere and if you read the warnings, it is usually describing the 
 problem, even if the warnings seem to be coming from out of left field.

Thanks for the advice.  I think I'm approaching the point where I'm going to 
have to invest the time.


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Chuck Hill

On 2011-09-20, at 1:57 AM, Paul Hoadley wrote:

 On 20/09/2011, at 7:33 AM, Chuck Hill wrote:
 
 That is, it can't find JavaMemoryAdaptor.framework when it needs it.  I'm 
 having this problem when running unit tests in both application and 
 framework bundles of my own.  JavaMemoryAdaptor.framework is on the 
 .classpath (confirmed by running 'ant -v'),
 
 The jar file in Resources/Java is on the classpath?  That is what gets 
 used to locate the bundle.
 
 Yes.  This is in Ant's classpath as it's running the test case:
 
 /Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar
 
 And that file is really there and you have permissions?  :-)
 
 Yep.
 
 I doubt this is a WOUnit problem.  For Hudson, are you wanting to use the 
 source project as the bundle (project bundles enabled) or the built .woa 
 or .framework directory as the bundle?  If you can tell me how you have 
 things setup, I should be able to help you figure out what needs to be 
 done.
 
 I'm using the .woa directory as the bundle.
 
 The .woa directory inside the source project (dist/Foo.woa)?  Or built 
 someplace else?
 
 The former.  The source project gets checked out into a Hudson workspace, and 
 it builds in dist/WT2.woa.  (Yes, the WO project name differs from the Hudson 
 project name by one character, which is why the paths I've quoted just have 
 WT in them.  In retrospect this is not ideal, but I don't _think_ it's 
 causing any problems.)

So the project is at /whatever/WT/ and built into /whatever/WT/dist/WT2.woa?  
That might cause confusion.  Are the frameworks embedded in that bundle?  I am 
trying to work out how NSBundle is not seeing these.  There are some Funky 
Things (tm) in Eclipse to detect bundles that don't happen when run from the 
comment line.


 I call junit like this:
 
 junit haltonfailure=false
fork=true
dir=${dest.dir}/${project.name}.woa
printsummary=true
failureproperty=test.failed
 classpath refid=testing.classpath /
 classpath
 pathelement location=bin /
 
 What is that for?  Those are the compiled classes in the app?
 
 Exactly.  Does that not need to be there?

I think this might make main bundle identification hard.  Though that does not 
seem to be the issue.  I'd use
pathelement 
location=${dest.dir}/${project.name}.woa/Contents/Resources/Java/${project.name}.jar
 /

(or is that ${project.name.lowercase}.jar ?)


 pathelement location=${junit.jar} /
 pathelement location=${wounit.jar} /
 pathelement location=${bin.tests} /

Those should be OK if those are not built into the project jar.


 !-- WTModel models --
 pathelement 
 location=Root/Library/Frameworks/WTModel.framework /
 /classpath
 formatter type=brief usefile=false /
 formatter type=xml /
 batchtest todir=${junit.results}
 fileset dir=${bin.tests}
 include name=**/*Test.class /
 /fileset
 /batchtest
 /junit
 
 There's a bit of additional stuff in the 'junit' target (test results and 
 so on), but I doubt it's relevant.  'testing.classpath' is defined like 
 this:
 
 typedef name=wopath classname=org.objectstyle.woproject.ant.WOPath 
 /
 wopath id=testing.classpath
 frameworks root=User eclipse=true /
 frameworks root=Local eclipse=true /
 frameworks root=System eclipse=true /
 /wopath
 
 It sounds like that this your problem.  I think this is only going to work 
 if you are running this in the project source dir where the .classpath file 
 is.  Is that the case?
 
 Yes…  well, I think so.  Define running this.  :-)  That's where Hudson and 
 I are launching 'ant … junit' from, but in the junit task I have the 
 dir=${dest.dir}/${project.name}.woa attribute.

That should get evaluated in the context of the project then and be OK.


 
 Try adding
 pathconvert property=junit.testing.classpath refid=testing.classpath/
 echo testing.classpath is  ${testing.classpath} /
 
 And see if the result is what you expect.
 
 Did you mean ${junit.testing.classpath}?

er, yes.  That one.


 Yes, it's exactly what I would expect: all of the frameworks, including 
 JavaMemoryAdapter.framework/Resources/Java/JavaMemoryAdaptor.jar.

Relative or absolute paths?


  They're also all on the classpath for the JVM that's launching the JUnit 
 tests, so that all seems to be working.  

Well, you are forking the JVM for junit.


 The only place they're _not_ is wherever they need to be to get 

Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Paul Hoadley
On 21/09/2011, at 7:51 AM, Chuck Hill wrote:

 I'm using the .woa directory as the bundle.
 
 The .woa directory inside the source project (dist/Foo.woa)?  Or built 
 someplace else?
 
 The former.  The source project gets checked out into a Hudson workspace, 
 and it builds in dist/WT2.woa.  (Yes, the WO project name differs from the 
 Hudson project name by one character, which is why the paths I've quoted 
 just have WT in them.  In retrospect this is not ideal, but I don't 
 _think_ it's causing any problems.)
 
 So the project is at /whatever/WT/ and built into /whatever/WT/dist/WT2.woa?  
 That might cause confusion.

Yeah, it's just the difference between the Hudson project name and the Ant/WO 
project name.  I can try making them the same if I don't get anywhere.

 Are the frameworks embedded in that bundle?

Yes.

 I am trying to work out how NSBundle is not seeing these.  There are some 
 Funky Things (tm) in Eclipse to detect bundles that don't happen when run 
 from the comment line.

Yeah.  I wish I knew what they were.

 I call junit like this:
 
junit haltonfailure=false
   fork=true
   dir=${dest.dir}/${project.name}.woa
   printsummary=true
   failureproperty=test.failed
classpath refid=testing.classpath /
classpath
pathelement location=bin /
 
 What is that for?  Those are the compiled classes in the app?
 
 Exactly.  Does that not need to be there?
 
 I think this might make main bundle identification hard.  Though that does 
 not seem to be the issue.



  I'd use
   pathelement 
 location=${dest.dir}/${project.name}.woa/Contents/Resources/Java/${project.name}.jar
  /
 
 (or is that ${project.name.lowercase}.jar ?)

That also works, though didn't help finding the Local bundles.

 Try adding
 pathconvert property=junit.testing.classpath refid=testing.classpath/
 echo testing.classpath is  ${testing.classpath} /
 
 And see if the result is what you expect.
 
 Did you mean ${junit.testing.classpath}?
 
 er, yes.  That one.
 
 
 Yes, it's exactly what I would expect: all of the frameworks, including 
 JavaMemoryAdapter.framework/Resources/Java/JavaMemoryAdaptor.jar.
 
 Relative or absolute paths?

Sorry, absolute.

 They're also all on the classpath for the JVM that's launching the JUnit 
 tests, so that all seems to be working.  
 
 Well, you are forking the JVM for junit.
 
 The only place they're _not_ is wherever they need to be to get NSBundle to 
 load them.  I remain stumped.
 
 Try getting the classloader in one of your tests and print out the classpath 
 that it really is using.

It's as expected, including:

/Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Chuck Hill

On 2011-09-20, at 3:57 PM, Paul Hoadley wrote:

 On 21/09/2011, at 7:51 AM, Chuck Hill wrote:
 
 I'm using the .woa directory as the bundle.
 
 The .woa directory inside the source project (dist/Foo.woa)?  Or built 
 someplace else?
 
 The former.  The source project gets checked out into a Hudson workspace, 
 and it builds in dist/WT2.woa.  (Yes, the WO project name differs from the 
 Hudson project name by one character, which is why the paths I've quoted 
 just have WT in them.  In retrospect this is not ideal, but I don't 
 _think_ it's causing any problems.)
 
 So the project is at /whatever/WT/ and built into /whatever/WT/dist/WT2.woa? 
  That might cause confusion.
 
 Yeah, it's just the difference between the Hudson project name and the Ant/WO 
 project name.  I can try making them the same if I don't get anywhere.

I don't think that is the problem, but it could be.


 Are the frameworks embedded in that bundle?
 
 Yes.

You could try loading them from there instead.  Just grab all the paths to jar 
files under Contents/Frameworks.


 I am trying to work out how NSBundle is not seeing these.  There are some 
 Funky Things (tm) in Eclipse to detect bundles that don't happen when run 
 from the comment line.
 
 Yeah.  I wish I knew what they were.

Nothing that will help you in Ant.


 I call junit like this:
 
   junit haltonfailure=false
  fork=true
  dir=${dest.dir}/${project.name}.woa
  printsummary=true
  failureproperty=test.failed
   classpath refid=testing.classpath /
   classpath
   pathelement location=bin /
 
 What is that for?  Those are the compiled classes in the app?
 
 Exactly.  Does that not need to be there?
 
 I think this might make main bundle identification hard.  Though that does 
 not seem to be the issue.
 
 I'd use
  pathelement 
 location=${dest.dir}/${project.name}.woa/Contents/Resources/Java/${project.name}.jar
  /
 
 (or is that ${project.name.lowercase}.jar ?)
 
 That also works, though didn't help finding the Local bundles.
 
 Try adding
 pathconvert property=junit.testing.classpath refid=testing.classpath/
 echo testing.classpath is  ${testing.classpath} /
 
 And see if the result is what you expect.
 
 Did you mean ${junit.testing.classpath}?
 
 er, yes.  That one.
 
 
 Yes, it's exactly what I would expect: all of the frameworks, including 
 JavaMemoryAdapter.framework/Resources/Java/JavaMemoryAdaptor.jar.
 
 Relative or absolute paths?
 
 Sorry, absolute.
 
 They're also all on the classpath for the JVM that's launching the JUnit 
 tests, so that all seems to be working.  
 
 Well, you are forking the JVM for junit.
 
 The only place they're _not_ is wherever they need to be to get NSBundle to 
 load them.  I remain stumped.
 
 Try getting the classloader in one of your tests and print out the classpath 
 that it really is using.
 
 It's as expected, including:
 
 /Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar

What if you change this code:

private void fixJavaMemoryDictionary() {
NSBundle bundle = NSBundle.bundleForName(JavaMemoryAdaptor);

bundle._infoDictionary().takeValueForKey(ERMemoryAdaptor.class.getName(), 
EOAdaptorClassName);
}

to this:
private void fixJavaMemoryDictionary() {
NSBundle bundle = NSBundle.bundleForClass(ERMemoryAdaptor.class);

bundle._infoDictionary().takeValueForKey(ERMemoryAdaptor.class.getName(), 
EOAdaptorClassName);
}


e.g. can it find it by class?


-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Paul Hoadley
Hi Chuck,

On 21/09/2011, at 8:44 AM, Chuck Hill wrote:

 Are the frameworks embedded in that bundle?
 
 Yes.
 
 You could try loading them from there instead.  Just grab all the paths to 
 jar files under Contents/Frameworks.

I'll try that shortly.

 Try getting the classloader in one of your tests and print out the 
 classpath that it really is using.
 
 It's as expected, including:
 
 /Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar
 
 What if you change this code:
 
 private void fixJavaMemoryDictionary() {
   NSBundle bundle = NSBundle.bundleForName(JavaMemoryAdaptor);
   
 bundle._infoDictionary().takeValueForKey(ERMemoryAdaptor.class.getName(), 
 EOAdaptorClassName);
 }
 
 to this:
 private void fixJavaMemoryDictionary() {
   NSBundle bundle = NSBundle.bundleForClass(ERMemoryAdaptor.class);
   
 bundle._infoDictionary().takeValueForKey(ERMemoryAdaptor.class.getName(), 
 EOAdaptorClassName);
 }
 
 
 e.g. can it find it by class?

I can't easily change the WOUnit code in the test environment I've got set up 
here (that method above is from WOUnit), but I am executing that code in a test 
method, and it's coming back null.


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Paul Hoadley
On 21/09/2011, at 9:53 AM, Paul Hoadley wrote:

 Are the frameworks embedded in that bundle?
 
 Yes.
 
 You could try loading them from there instead.  Just grab all the paths to 
 jar files under Contents/Frameworks.
 
 I'll try that shortly.

I added:

fileset dir=${dest.dir}/${project.name}.woa/Contents/Frameworks 


  include name=**/*.jar /   


/fileset

as a child of a classpath element in the junit task.  It certainly picked 
up all the expected JARs (including JavaMemoryAdaptor) and threw them on the 
classpath, but I'm still not seeing the bundles loaded by NSBundle.  
NSBundle.frameworkBundles().count() still returns 9 on the command line, and 29 
in Eclipse.

One thing I'm _not_ doing is any of the app initialisation-type things here:

http://wiki.objectstyle.org/confluence/display/WO/Testing-JUnit+and+TestNG

Nor am I extending ERXTestCase.  I'm just following Henrique's samples here:

http://hprange.github.com/wounit/usage.html

(Henrique—I assume neither of those things above are necessary, right?)


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Chuck Hill
Hi Paul,

On 2011-09-20, at 6:55 PM, Paul Hoadley wrote:

 On 21/09/2011, at 9:53 AM, Paul Hoadley wrote:
 
 Are the frameworks embedded in that bundle?
 
 Yes.
 
 You could try loading them from there instead.  Just grab all the paths to 
 jar files under Contents/Frameworks.
 
 I'll try that shortly.
 
 I added:
 
 fileset dir=${dest.dir}/${project.name}.woa/Contents/Frameworks   
   
 
  include name=**/*.jar /  
   

 /fileset
 
 as a child of a classpath element in the junit task.  It certainly picked 
 up all the expected JARs (including JavaMemoryAdaptor) and threw them on the 
 classpath, but I'm still not seeing the bundles loaded by NSBundle.  
 NSBundle.frameworkBundles().count() still returns 9 on the command line, and 
 29 in Eclipse.

This just gets stranger and stranger.


 One thing I'm _not_ doing is any of the app initialisation-type things here:
 
 http://wiki.objectstyle.org/confluence/display/WO/Testing-JUnit+and+TestNG
 
 Nor am I extending ERXTestCase.  I'm just following Henrique's samples here:
 
 http://hprange.github.com/wounit/usage.html
 
 (Henrique—I assume neither of those things above are necessary, right?)


That you are getting some bundles suggests that it is not.  Usually calling 
NSBundle.mainBundle() and NSBundle.allBundles() triggers the bundle loading.  
frameworkBundles() should trigger these but you might want to call them 
yourself just for laughs.  I am not seeing how they could be on the classpath 
and not detected as bundles.  Your build is not stripping anything out of the 
built .framework bundles, it is?

If you 
cd WT2.woa
./WT2
does the app run and find any of the bundles?

Chuck

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Paul Hoadley
On 21/09/2011, at 12:47 PM, Chuck Hill wrote:

 Are the frameworks embedded in that bundle?
 
 Yes.
 
 You could try loading them from there instead.  Just grab all the paths to 
 jar files under Contents/Frameworks.
 
 I'll try that shortly.
 
 I added:
 
 fileset dir=${dest.dir}/${project.name}.woa/Contents/Frameworks  
  
   
 include name=**/*.jar /  
  
 
 /fileset
 
 as a child of a classpath element in the junit task.  It certainly 
 picked up all the expected JARs (including JavaMemoryAdaptor) and threw them 
 on the classpath, but I'm still not seeing the bundles loaded by NSBundle.  
 NSBundle.frameworkBundles().count() still returns 9 on the command line, and 
 29 in Eclipse.
 
 This just gets stranger and stranger.

I'm banking on that translating to I find your problem fascinating and plan to 
stick around until it's solved.

 One thing I'm _not_ doing is any of the app initialisation-type things 
 here:
 
 http://wiki.objectstyle.org/confluence/display/WO/Testing-JUnit+and+TestNG
 
 Nor am I extending ERXTestCase.  I'm just following Henrique's samples here:
 
 http://hprange.github.com/wounit/usage.html
 
 (Henrique—I assume neither of those things above are necessary, right?)
 
 That you are getting some bundles suggests that it is not.  Usually calling 
 NSBundle.mainBundle() and NSBundle.allBundles() triggers the bundle loading.  
 frameworkBundles() should trigger these but you might want to call them 
 yourself just for laughs.

No laughs.  Didn't help.

 I am not seeing how they could be on the classpath and not detected as 
 bundles.  Your build is not stripping anything out of the built .framework 
 bundles, it is?

No, just copying them.

 If you 
 cd WT2.woa
 ./WT2
 does the app run and find any of the bundles?

Yep, runs and finds them all.


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Chuck Hill
On 2011-09-20, at 9:50 PM, Paul Hoadley wrote:
 On 21/09/2011, at 12:47 PM, Chuck Hill wrote:
 
 Are the frameworks embedded in that bundle?
 
 Yes.
 
 You could try loading them from there instead.  Just grab all the paths 
 to jar files under Contents/Frameworks.
 
 I'll try that shortly.
 
 I added:
 
 fileset dir=${dest.dir}/${project.name}.woa/Contents/Frameworks 
 
 
 include name=**/*.jar / 
 
   
 /fileset
 
 as a child of a classpath element in the junit task.  It certainly 
 picked up all the expected JARs (including JavaMemoryAdaptor) and threw 
 them on the classpath, but I'm still not seeing the bundles loaded by 
 NSBundle.  NSBundle.frameworkBundles().count() still returns 9 on the 
 command line, and 29 in Eclipse.
 
 This just gets stranger and stranger.
 
 I'm banking on that translating to I find your problem fascinating and plan 
 to stick around until it's solved.

I was leaning more to running way and regretting I ever mentioned it.  :-P


 One thing I'm _not_ doing is any of the app initialisation-type things 
 here:
 
 http://wiki.objectstyle.org/confluence/display/WO/Testing-JUnit+and+TestNG
 
 Nor am I extending ERXTestCase.  I'm just following Henrique's samples here:
 
 http://hprange.github.com/wounit/usage.html
 
 (Henrique—I assume neither of those things above are necessary, right?)
 
 That you are getting some bundles suggests that it is not.  Usually calling 
 NSBundle.mainBundle() and NSBundle.allBundles() triggers the bundle loading. 
  frameworkBundles() should trigger these but you might want to call them 
 yourself just for laughs.
 
 No laughs.  Didn't help.
 
 I am not seeing how they could be on the classpath and not detected as 
 bundles.  Your build is not stripping anything out of the built .framework 
 bundles, it is?
 
 No, just copying them.
 
 If you 
 cd WT2.woa
 ./WT2
 does the app run and find any of the bundles?
 
 Yep, runs and finds them all.


Wow.  The only thing that I can think of right now is that it _is_ something to 
do with WOTest.  I just can't imagine what.  Is ERJars on your classpath?



Chuck

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-20 Thread Paul Hoadley
On 21/09/2011, at 2:26 PM, Chuck Hill wrote:

 If you 
 cd WT2.woa
 ./WT2
 does the app run and find any of the bundles?
 
 Yep, runs and finds them all.
 
 Wow.  The only thing that I can think of right now is that it _is_ something 
 to do with WOTest.  I just can't imagine what.  Is ERJars on your classpath?

Yes, ERJars is on the classpath.

I'd love to blame WOUnit.  (Hi Henrique!)  I might have to put some more time 
into developing a minimal test case that I can ship to Henrique.


-- 
Paul.

http://logicsquad.net/


 ___
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


Bundle loading during unit testing outside Eclipse

2011-09-19 Thread Paul Hoadley
Hello,

I seem to bother the list with a variation on this problem every few months.  
I'm doing some unit testing during a Hudson build process using Henrique's 
WOUnit.  I think what I've got is a bundle finding/loading problem that's 
masquerading as a problem with WOUnit's TemporaryEditingContext (that uses the 
JavaMemoryAdaptor.framework).  At the highest level, the problem is this: I can 
get a TemporaryEditingContext to work just fine running unit tests in Eclipse, 
but outside Eclipse this method in TemporaryEditingContext throws an NPE:

private void fixJavaMemoryDictionary() {
NSBundle bundle = NSBundle.bundleForName(JavaMemoryAdaptor);

bundle._infoDictionary().takeValueForKey(ERMemoryAdaptor.class.getName(), 
EOAdaptorClassName);
}

That is, it can't find JavaMemoryAdaptor.framework when it needs it.  I'm 
having this problem when running unit tests in both application and framework 
bundles of my own.  JavaMemoryAdaptor.framework is on the .classpath (confirmed 
by running 'ant -v'), and it's present in Root/Library/Frameworks of the Hudson 
workspace.  Root/wolips.properties points wo.local.frameworks to that 
directory.  I use WOPath to construct the testing classpath (for User, Local, 
System anyway).  And yet when I add something like this to a test method:

NSArray bundles = NSBundle.frameworkBundles();
System.out.println(bundles.count());
System.out.println(bundles);

Inside Eclipse I get 29 bundles, including JavaMemoryAdaptor.framework, and 
outside Eclipse I get 9 bundles, just the core WO System bundles.  Surely this 
is the source of the problem?

I've been bothering Henrique about this for a while, but I'm just not convinced 
it's WOUnit's problem.  I think it's my Hudson build environment.  I know I'm 
not giving a lot to go on here, but can anyone suggest where I even _start_ 
looking to clarify this further?


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-19 Thread Chuck Hill
Hi Paul,


On 2011-09-18, at 11:05 PM, Paul Hoadley wrote:

 Hello,
 
 I seem to bother the list with a variation on this problem every few months.  
 I'm doing some unit testing during a Hudson build process using Henrique's 
 WOUnit.  I think what I've got is a bundle finding/loading problem that's 
 masquerading as a problem with WOUnit's TemporaryEditingContext (that uses 
 the JavaMemoryAdaptor.framework).  At the highest level, the problem is this: 
 I can get a TemporaryEditingContext to work just fine running unit tests in 
 Eclipse, but outside Eclipse this method in TemporaryEditingContext throws an 
 NPE:
 
 private void fixJavaMemoryDictionary() {
   NSBundle bundle = NSBundle.bundleForName(JavaMemoryAdaptor);
   
 bundle._infoDictionary().takeValueForKey(ERMemoryAdaptor.class.getName(), 
 EOAdaptorClassName);
 }
 
 That is, it can't find JavaMemoryAdaptor.framework when it needs it.  I'm 
 having this problem when running unit tests in both application and framework 
 bundles of my own.  JavaMemoryAdaptor.framework is on the .classpath 
 (confirmed by running 'ant -v'),

The jar file in Resources/Java is on the classpath?  That is what gets used to 
locate the bundle.


 and it's present in Root/Library/Frameworks of the Hudson workspace.  
 Root/wolips.properties points wo.local.frameworks to that directory.  I use 
 WOPath to construct the testing classpath (for User, Local, System anyway).  
 And yet when I add something like this to a test method:
 
   NSArray bundles = NSBundle.frameworkBundles();
   System.out.println(bundles.count());
   System.out.println(bundles);
 
 Inside Eclipse I get 29 bundles, including JavaMemoryAdaptor.framework, and 
 outside Eclipse I get 9 bundles, just the core WO System bundles.  Surely 
 this is the source of the problem?

Yes.  Do you have project bundles enabled in Eclipse?


 I've been bothering Henrique about this for a while, but I'm just not 
 convinced it's WOUnit's problem.  I think it's my Hudson build environment.  
 I know I'm not giving a lot to go on here, but can anyone suggest where I 
 even _start_ looking to clarify this further?


I doubt this is a WOUnit problem.  For Hudson, are you wanting to use the 
source project as the bundle (project bundles enabled) or the built .woa or 
.framework directory as the bundle?  If you can tell me how you have things 
setup, I should be able to help you figure out what needs to be done.


Chuck

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 ___
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


Re: Bundle loading during unit testing outside Eclipse

2011-09-19 Thread Paul Hoadley
Hi Chuck,

On 20/09/2011, at 2:49 AM, Chuck Hill wrote:

 That is, it can't find JavaMemoryAdaptor.framework when it needs it.  I'm 
 having this problem when running unit tests in both application and 
 framework bundles of my own.  JavaMemoryAdaptor.framework is on the 
 .classpath (confirmed by running 'ant -v'),
 
 The jar file in Resources/Java is on the classpath?  That is what gets used 
 to locate the bundle.

Yes.  This is in Ant's classpath as it's running the test case:

/Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar

 and it's present in Root/Library/Frameworks of the Hudson workspace.  
 Root/wolips.properties points wo.local.frameworks to that directory.  I use 
 WOPath to construct the testing classpath (for User, Local, System anyway).  
 And yet when I add something like this to a test method:
 
  NSArray bundles = NSBundle.frameworkBundles();
  System.out.println(bundles.count());
  System.out.println(bundles);
 
 Inside Eclipse I get 29 bundles, including JavaMemoryAdaptor.framework, and 
 outside Eclipse I get 9 bundles, just the core WO System bundles.  Surely 
 this is the source of the problem?
 
 Yes.  Do you have project bundles enabled in Eclipse?

Yes, I have Generate bundles checked in Eclipse.  Just in case there's some 
confusion here, though, I am _not_ using Ant to run the tests within Eclipse.  
When I say it works in Eclipse, I mean I selected the test class, then Run As  
JUnit Test.

 I've been bothering Henrique about this for a while, but I'm just not 
 convinced it's WOUnit's problem.  I think it's my Hudson build environment.  
 I know I'm not giving a lot to go on here, but can anyone suggest where I 
 even _start_ looking to clarify this further?
 
 I doubt this is a WOUnit problem.  For Hudson, are you wanting to use the 
 source project as the bundle (project bundles enabled) or the built .woa or 
 .framework directory as the bundle?  If you can tell me how you have things 
 setup, I should be able to help you figure out what needs to be done.

I'm using the .woa directory as the bundle.  I call junit like this:

junit haltonfailure=false
   fork=true
   dir=${dest.dir}/${project.name}.woa
   printsummary=true
   failureproperty=test.failed
classpath refid=testing.classpath /
classpath
pathelement location=bin /
pathelement location=${junit.jar} /
pathelement location=${wounit.jar} /
pathelement location=${bin.tests} /
!-- WTModel models --
pathelement 
location=Root/Library/Frameworks/WTModel.framework /
/classpath
formatter type=brief usefile=false /
formatter type=xml /
batchtest todir=${junit.results}
fileset dir=${bin.tests}
include name=**/*Test.class /
/fileset
/batchtest
/junit

There's a bit of additional stuff in the 'junit' target (test results and so 
on), but I doubt it's relevant.  'testing.classpath' is defined like this:

typedef name=wopath classname=org.objectstyle.woproject.ant.WOPath 
/
wopath id=testing.classpath
frameworks root=User eclipse=true /
frameworks root=Local eclipse=true /
frameworks root=System eclipse=true /
/wopath

'junit.jar' and 'wounit.jar' are supplied on the command line, and the JARs 
exist and are being found.  'bin.tests' has been defined.

I am using the popular setupWorkspace.sh script to setup the workspace.  I've 
made a few modifications to that script, but the workspace structure itself 
remains unchanged.  That is, it creates a Root directory, which contains 
Library, Network, System, User directories, all containing the frameworks you 
would expect.  JavaMemoryAdaptor.framework (and the rest of Wonder) is in 
/Users/paulh/tmp/WT/workspace/Root/Library/Frameworks at test runtime.  
wolips.properties (passed in on the command line) is also in Root and looks 
like this:

wo.system.root=/Users/paulh/tmp/WT/workspace/Root/System
wo.user.frameworks=/Users/paulh/tmp/WT/workspace/Root/User/Library/Frameworks
wo.system.frameworks=/Users/paulh/tmp/WT/workspace/Root/System/Library/Frameworks
wo.bootstrapjar=/System/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar
wo.network.frameworks=/Users/paulh/tmp/WT/workspace/Root/Network/Library/Frameworks
wo.api.root=/Developer/ADC%20Reference%20Library/documentation/WebObjects/Reference/API/
wo.network.root

Re: Bundle loading during unit testing outside Eclipse

2011-09-19 Thread Chuck Hill
Hi Paul,


On 2011-09-19, at 2:48 PM, Paul Hoadley wrote:

 Hi Chuck,
 
 On 20/09/2011, at 2:49 AM, Chuck Hill wrote:
 
 That is, it can't find JavaMemoryAdaptor.framework when it needs it.  I'm 
 having this problem when running unit tests in both application and 
 framework bundles of my own.  JavaMemoryAdaptor.framework is on the 
 .classpath (confirmed by running 'ant -v'),
 
 The jar file in Resources/Java is on the classpath?  That is what gets used 
 to locate the bundle.
 
 Yes.  This is in Ant's classpath as it's running the test case:
 
 /Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar

And that file is really there and you have permissions?  :-)


 and it's present in Root/Library/Frameworks of the Hudson workspace.  
 Root/wolips.properties points wo.local.frameworks to that directory.  I use 
 WOPath to construct the testing classpath (for User, Local, System anyway). 
  And yet when I add something like this to a test method:
 
 NSArray bundles = NSBundle.frameworkBundles();
 System.out.println(bundles.count());
 System.out.println(bundles);
 
 Inside Eclipse I get 29 bundles, including JavaMemoryAdaptor.framework, and 
 outside Eclipse I get 9 bundles, just the core WO System bundles.  Surely 
 this is the source of the problem?
 
 Yes.  Do you have project bundles enabled in Eclipse?
 
 Yes, I have Generate bundles checked in Eclipse.  Just in case there's some 
 confusion here, though, I am _not_ using Ant to run the tests within Eclipse. 
  When I say it works in Eclipse, I mean I selected the test class, then Run 
 As  JUnit Test.

That then runs in an eclipse constructed classpath.



 I've been bothering Henrique about this for a while, but I'm just not 
 convinced it's WOUnit's problem.  I think it's my Hudson build environment. 
  I know I'm not giving a lot to go on here, but can anyone suggest where I 
 even _start_ looking to clarify this further?
 
 I doubt this is a WOUnit problem.  For Hudson, are you wanting to use the 
 source project as the bundle (project bundles enabled) or the built .woa or 
 .framework directory as the bundle?  If you can tell me how you have things 
 setup, I should be able to help you figure out what needs to be done.
 
 I'm using the .woa directory as the bundle.

The .woa directory inside the source project (dist/Foo.woa)?  Or built 
someplace else?


  I call junit like this:
 
   junit haltonfailure=false
  fork=true
  dir=${dest.dir}/${project.name}.woa
  printsummary=true
  failureproperty=test.failed
   classpath refid=testing.classpath /
   classpath
   pathelement location=bin /

What is that for?  Those are the compiled classes in the app?


   pathelement location=${junit.jar} /
   pathelement location=${wounit.jar} /
   pathelement location=${bin.tests} /
   !-- WTModel models --
   pathelement 
 location=Root/Library/Frameworks/WTModel.framework /
   /classpath
   formatter type=brief usefile=false /
   formatter type=xml /
   batchtest todir=${junit.results}
   fileset dir=${bin.tests}
   include name=**/*Test.class /
   /fileset
   /batchtest
   /junit
 
 There's a bit of additional stuff in the 'junit' target (test results and so 
 on), but I doubt it's relevant.  'testing.classpath' is defined like this:
 
   typedef name=wopath classname=org.objectstyle.woproject.ant.WOPath 
 /
   wopath id=testing.classpath
   frameworks root=User eclipse=true /
   frameworks root=Local eclipse=true /
   frameworks root=System eclipse=true /
   /wopath

It sounds like that this your problem.  I think this is only going to work if 
you are running this in the project source dir where the .classpath file is.  
Is that the case?

Try adding
pathconvert property=junit.testing.classpath refid=testing.classpath/
echo testing.classpath is  ${testing.classpath} /

And see if the result is what you expect.


 'junit.jar' and 'wounit.jar' are supplied on the command line, and the JARs 
 exist and are being found.  'bin.tests' has been defined.
 
 I am using the popular setupWorkspace.sh script to setup the workspace.  I've 
 made a few modifications to that script, but the workspace structure itself 
 remains unchanged.  That is, it creates a Root directory, which contains 
 Library, Network, System, User directories, all containing the frameworks you 
 would expect.  JavaMemoryAdaptor.framework

Re: Bundle loading during unit testing outside Eclipse

2011-09-19 Thread Ray Kiddy

On Sep 19, 2011, at 2:48 PM, Paul Hoadley wrote:

 Hi Chuck,
 
 On 20/09/2011, at 2:49 AM, Chuck Hill wrote:
 
 That is, it can't find JavaMemoryAdaptor.framework when it needs it.  I'm 
 having this problem when running unit tests in both application and 
 framework bundles of my own.  JavaMemoryAdaptor.framework is on the 
 .classpath (confirmed by running 'ant -v'),
 
 The jar file in Resources/Java is on the classpath?  That is what gets used 
 to locate the bundle.
 
 Yes.  This is in Ant's classpath as it's running the test case:
 
 /Users/paulh/tmp/WT/workspace/Root/Library/Frameworks/JavaMemoryAdaptor.framework/Resources/Java/JavaMemoryAdaptor.jar
 snip

Paul -

Whenever I have had this sort of problem, I usually end up switching the 
junit target to a java target. The re-write one has to do for that, the 
re-jiggering of the parameters, usually points me to the problem. It is kind of 
labor-intensive, but it works. Once it works as a java, I have seen the error 
and it will work as a junit. Also, spending some more time looking at the 
verbose output from ant helps. It just takes longer than it seems is justified. 
It is extremely verbose. But, you know, the problem is always in there 
somewhere and if you read the warnings, it is usually describing the problem, 
even if the warnings seem to be coming from out of left field.

Also, typos in path names lead to hours of fun. The Resource directory is one 
of my faves. And mixed-case terms when unexpectedly on a case-sensitive file 
system There are lots of things to choose from.

good luck - 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/archive%40mail-archive.com

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


DB2 Plugin Testing

2011-04-18 Thread Jeffrey Simpson
So I am taking my ancient DB2 plugin and updating into a more modern plugin.  
My hope is to contribute this to Wonder.  Is there a standard test suite  I 
should run the plugin against?

I am planing to test against both DB2 for Linux and DB2 for iSeries.



Jeffrey Simpson
Senior Software Engineer
Telephone: 240.235.2144
Fax: 240.235.2174
simp...@yfu.org

Youth For Understanding (YFU) prepares young people for their responsibilities 
and opportunities in a changing, interdependent world.
 ___
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


Re: DB2 Plugin Testing

2011-04-18 Thread Chuck Hill
I don't know of a suite, but it is a good idea.

Chuck

On Apr 18, 2011, at 1:27 PM, Jeffrey Simpson wrote:

 So I am taking my ancient DB2 plugin and updating into a more modern plugin.  
 My hope is to contribute this to Wonder.  Is there a standard test suite  I 
 should run the plugin against?
 
 I am planing to test against both DB2 for Linux and DB2 for iSeries.
 
 
 
 Jeffrey Simpson
 Senior Software Engineer
 Telephone: 240.235.2144
 Fax: 240.235.2174
 simp...@yfu.org
 
 Youth For Understanding (YFU) prepares young people for their 
 responsibilities and opportunities in a changing, interdependent world.
 ___
 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/chill%40global-village.net
 
 This email sent to ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









smime.p7s
Description: S/MIME cryptographic signature
 ___
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


Re: DB2 Plugin Testing

2011-04-18 Thread Pascal Robert
It would be great to have unit tests for EOF, so that we can try all plugins 
and check if they are all working.

 I don't know of a suite, but it is a good idea.
 
 Chuck
 
 On Apr 18, 2011, at 1:27 PM, Jeffrey Simpson wrote:
 
 So I am taking my ancient DB2 plugin and updating into a more modern plugin. 
  My hope is to contribute this to Wonder.  Is there a standard test suite  I 
 should run the plugin against?
 
 I am planing to test against both DB2 for Linux and DB2 for iSeries.
 
 
 
 Jeffrey Simpson
 Senior Software Engineer
 Telephone: 240.235.2144
 Fax: 240.235.2174
 simp...@yfu.org
 
 Youth For Understanding (YFU) prepares young people for their 
 responsibilities and opportunities in a changing, interdependent world.
 ___
 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/chill%40global-village.net
 
 This email sent to ch...@global-village.net
 
 -- 
 Chuck Hill Senior Consultant / VP Development
 
 Practical WebObjects - for developers who want to increase their overall 
 knowledge of WebObjects or who are trying to solve specific problems.
 http://www.global-village.net/products/practical_webobjects
 
 
 
 
 
 
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca

 ___
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


Re: DB2 Plugin Testing

2011-04-18 Thread Chuck Hill
For the plugin, you really need to test SQL generation, DDL generation, model 
reverse engineering, PK generation, that kind of stuff.  You don't need to test 
all of  EOF, so it is a bit constrained.  But the results you are testing for 
are definitely plugin specific.

Chuck


On Apr 18, 2011, at 3:39 PM, Pascal Robert wrote:

 It would be great to have unit tests for EOF, so that we can try all plugins 
 and check if they are all working.
 
 I don't know of a suite, but it is a good idea.
 
 Chuck
 
 On Apr 18, 2011, at 1:27 PM, Jeffrey Simpson wrote:
 
 So I am taking my ancient DB2 plugin and updating into a more modern 
 plugin.  My hope is to contribute this to Wonder.  Is there a standard test 
 suite  I should run the plugin against?
 
 I am planing to test against both DB2 for Linux and DB2 for iSeries.
 
 
 
 Jeffrey Simpson
 Senior Software Engineer
 Telephone: 240.235.2144
 Fax: 240.235.2174
 simp...@yfu.org
 
 Youth For Understanding (YFU) prepares young people for their 
 responsibilities and opportunities in a changing, interdependent world.
 ___
 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/chill%40global-village.net
 
 This email sent to ch...@global-village.net
 
 -- 
 Chuck Hill Senior Consultant / VP Development
 
 Practical WebObjects - for developers who want to increase their overall 
 knowledge of WebObjects or who are trying to solve specific problems.
 http://www.global-village.net/products/practical_webobjects
 
 
 
 
 
 
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca
 

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









smime.p7s
Description: S/MIME cryptographic signature
 ___
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


Re: Dr. Miguel 'Optimistic Locking' Arroz [was Re: WebObjects stress Testing tool?]

2011-02-28 Thread Jon Nolan

Hi Kieran,

I have a multi-threaded app and I'm starting to run into deadlock issues on EC 
locking/unlocking (OSC really).  After a weekend of digging and researching I 
think your solution is the answer.

Question #1:  Is this the final, dust-settled version?

Question #2:  Do you always use a new EOObjectStore in your threads?  It seems 
your implementation depends upon it.  If so, what's your philosophy on how many 
you create and how long they live?  I have tens of thousands of threads running 
per instance per day (only a few at a time) and something tells me creating a 
new OS for each is a bad idea.

Thanks,
Jon


On 12/3/09 1:31 PM, Kieran Kelleher wrote:

OK, this is the final concurrent utility code to provide manual locking ec's in 
a app with safeLocking on. And just for fun and Ricardo's enjoyment of 
anonymous classes ;-), the factory is an anonymous static class and its _create 
method returns anonymous ERXEC's with the two methods over-riden as per Anjo's 
suggestion.

/**
*AnonymousERXECfactorythatcreatesmanuallockingec'sinanappwheresafeLockingisonbydefault
*/
private static ERXEC.Factory manualLockingEditingContextFactory = new 
ERXEC.DefaultFactory() {

@Override
protected EOEditingContext _createEditingContext(EOObjectStore parent) {
return new ERXEC(parent == null ? EOEditingContext.defaultParentObjectStore() : 
parent) {
@Override
public boolean useAutoLock() {return false;}

@Override
public boolean coalesceAutoLocks() {return false;}
};
}
};

/**
*@returnaregularERXECwithnoauto-lockingfeatures
*/
public static EOEditingContext newManualLockingEditingContext() {
returnmanualLockingEditingContextFactory._newEditingContext();
}


/**
*Idonotwantautolockinginnon-requestthreads
*
*@paramparent
*@returnanERXECwithsafeLockingpropertiesturnedOFF.
*/
public static EOEditingContext newManualLockingEditingContext(EOObjectStore 
parent) {
returnmanualLockingEditingContextFactory._newEditingContext(parent);
}


On Dec 3, 2009, at 2:54 PM, Mike Schrag wrote:


i think we're talking two different things ... if you have an empty superclass 
constructor and you don't declare any constructors, then yes, there is an 
implicit constructor created in your subclass that calls super (as well, if you 
DO declare a constructor and there is an empty super constructor, implicitly a 
super() is added to the top of your constructor). in this case, because the 
anonymous subclass is declared as new ERXEC(os), it's actually calling the 
ERXEC(ObjectStore) constructor (which I PRESUME java secretly added into your 
subclass with a super(os) call -- this is a little different than a normal 
class). However, Kieran's specifically talking about the 
ERXEC.newEditingContext() factory method, which you're bypassing here by 
explicitly subclassing ERXEC and instantiating the class directly.

ms

On Dec 3, 2009, at 2:45 PM, Ricardo J. Parada wrote:


Don't subclasses have an implicit super() to invoke the super class constructor?


On Dec 3, 2009, at 2:38 PM, Kieran Kelleher wrote:


True, but then I would be bypassing the EC factory, which just seems dirty, but 
yes, this very good suggestion is an elegant way to do it for sure.

On Dec 3, 2009, at 2:16 PM, Anjo Krank wrote:


PS. And even the above is not perfect protection against an autolock if a 
thread gets cpu execution delay between construction statement and the 
ec.setCoalesceAutoLocks(false) statement. After setting safelocking props to 
false, I should really check if the ec was autolocked and unlock it before 
returning  or even have an ERXEC constructor that takes a safeLocking 
boolean param, but that would be two more undesired constructors ... so 
probably making isLockedInThread public (or accessible using reflection) should 
do the trick.


In that case, you'd be better with

return new ERXEC(os) {
 public boolean useAutoLock() {return false;}

 public boolean coalesceAutoLocks() {return false;}
};

Cheers, Anjo


___






  ___
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/lists%40lochgarman.com

This email sent to li...@lochgarman.com


___
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


Re: Dr. Miguel 'Optimistic Locking' Arroz [was Re: WebObjects stress Testing tool?]

2011-02-28 Thread Kieran Kelleher
Hi Jon,

On Feb 28, 2011, at 10:28 AM, Jon Nolan wrote:

 Hi Kieran,
 
 I have a multi-threaded app and I'm starting to run into deadlock issues on 
 EC locking/unlocking (OSC really).  After a weekend of digging and 
 researching I think your solution is the answer.
 
 Question #1:  Is this the final, dust-settled version?

Yes, I always use the manual locking anonymous subclass in the background. I 
think dust will be settled when I can have a cleaner version of this 
functionality in Wonder without distastefully dirtying the ERXEC factory.


 
 Question #2:  Do you always use a new EOObjectStore in your threads?

No. In have a pool of OSC's dedicated to background threads. Usually 4 to 12 in 
the pool, depending on the application's needs and functionality.


WKTaskObjectStoreCoordinatorPool.java
Description: Binary data


WKObjectStoreCoordinator is just a simple subclass that allows me to give the 
OSC a name for debugging/logging purposes, so you don't have to use that in the 
pool. Just use the regular Wonder ERXOSC.


WKObjectStoreCoordinator.java
Description: Binary data


Since using this approach I have not experienced any EC deadlocks in 
production. Need to decide how to implement this cleanly in Wonder some day.

Regards, Kieran


 It seems your implementation depends upon it.  If so, what's your philosophy 
 on how many you create and how long they live?  I have tens of thousands of 
 threads running per instance per day (only a few at a time) and something 
 tells me creating a new OS for each is a bad idea.
 
 Thanks,
 Jon
 
 
 On 12/3/09 1:31 PM, Kieran Kelleher wrote:
 OK, this is the final concurrent utility code to provide manual locking ec's 
 in a app with safeLocking on. And just for fun and Ricardo's enjoyment of 
 anonymous classes ;-), the factory is an anonymous static class and its 
 _create method returns anonymous ERXEC's with the two methods over-riden as 
 per Anjo's suggestion.
 
 /**
 *AnonymousERXECfactorythatcreatesmanuallockingec'sinanappwheresafeLockingisonbydefault
 */
 private static ERXEC.Factory manualLockingEditingContextFactory = new 
 ERXEC.DefaultFactory() {
 
 @Override
 protected EOEditingContext _createEditingContext(EOObjectStore parent) {
 return new ERXEC(parent == null ? 
 EOEditingContext.defaultParentObjectStore() : parent) {
 @Override
 public boolean useAutoLock() {return false;}
 
 @Override
 public boolean coalesceAutoLocks() {return false;}
 };
 }
 };
 
 /**
 *@returnaregularERXECwithnoauto-lockingfeatures
 */
 public static EOEditingContext newManualLockingEditingContext() {
 returnmanualLockingEditingContextFactory._newEditingContext();
 }
 
 
 /**
 *Idonotwantautolockinginnon-requestthreads
 *
 *@paramparent
 *@returnanERXECwithsafeLockingpropertiesturnedOFF.
 */
 public static EOEditingContext newManualLockingEditingContext(EOObjectStore 
 parent) {
 returnmanualLockingEditingContextFactory._newEditingContext(parent);
 }
 
 
 On Dec 3, 2009, at 2:54 PM, Mike Schrag wrote:
 
 i think we're talking two different things ... if you have an empty 
 superclass constructor and you don't declare any constructors, then yes, 
 there is an implicit constructor created in your subclass that calls super 
 (as well, if you DO declare a constructor and there is an empty super 
 constructor, implicitly a super() is added to the top of your constructor). 
 in this case, because the anonymous subclass is declared as new ERXEC(os), 
 it's actually calling the ERXEC(ObjectStore) constructor (which I PRESUME 
 java secretly added into your subclass with a super(os) call -- this is a 
 little different than a normal class). However, Kieran's specifically 
 talking about the ERXEC.newEditingContext() factory method, which you're 
 bypassing here by explicitly subclassing ERXEC and instantiating the class 
 directly.
 
 ms
 
 On Dec 3, 2009, at 2:45 PM, Ricardo J. Parada wrote:
 
 Don't subclasses have an implicit super() to invoke the super class 
 constructor?
 
 
 On Dec 3, 2009, at 2:38 PM, Kieran Kelleher wrote:
 
 True, but then I would be bypassing the EC factory, which just seems 
 dirty, but yes, this very good suggestion is an elegant way to do it for 
 sure.
 
 On Dec 3, 2009, at 2:16 PM, Anjo Krank wrote:
 
 PS. And even the above is not perfect protection against an autolock if 
 a thread gets cpu execution delay between construction statement and 
 the ec.setCoalesceAutoLocks(false) statement. After setting safelocking 
 props to false, I should really check if the ec was autolocked and 
 unlock it before returning  or even have an ERXEC constructor that 
 takes a safeLocking boolean param, but that would be two more undesired 
 constructors ... so probably making isLockedInThread public (or 
 accessible using reflection) should do the trick.
 
 In that case, you'd be better with
 
 return new ERXEC(os) {
 public boolean useAutoLock() {return false;}
 
 public boolean coalesceAutoLocks() {return false;}
 };
 
 Cheers, Anjo
 
 
 

Re: Dr. Miguel 'Optimistic Locking' Arroz [was Re: WebObjects stress Testing tool?]

2011-02-28 Thread Jon Nolan

Thanks Kieran.  I've implemented your solution and will roll it through to prod 
within a couple of days.  I have deadlocks on at least a daily basis so if 
those disappear it will be another validation of your work... not to mention 
once again earning my gratitude.

Slán,
Jon

On 2/28/11 8:50 AM, Kieran Kelleher wrote:

Hi Jon,

On Feb 28, 2011, at 10:28 AM, Jon Nolan wrote:


Hi Kieran,

I have a multi-threaded app and I'm starting to run into deadlock issues on EC 
locking/unlocking (OSC really).  After a weekend of digging and researching I 
think your solution is the answer.

Question #1:  Is this the final, dust-settled version?


Yes, I always use the manual locking anonymous subclass in the background. I 
think dust will be settled when I can have a cleaner version of this functionality in 
Wonder without distastefully dirtying the ERXEC factory.




Question #2:  Do you always use a new EOObjectStore in your threads?


No. In have a pool of OSC's dedicated to background threads. Usually 4 to 12 in 
the pool, depending on the application's needs and functionality.




WKObjectStoreCoordinator is just a simple subclass that allows me to give the 
OSC a name for debugging/logging purposes, so you don't have to use that in the 
pool. Just use the regular Wonder ERXOSC.




Since using this approach I have not experienced any EC deadlocks in 
production. Need to decide how to implement this cleanly in Wonder some day.

Regards, Kieran



It seems your implementation depends upon it.  If so, what's your philosophy on 
how many you create and how long they live?  I have tens of thousands of 
threads running per instance per day (only a few at a time) and something tells 
me creating a new OS for each is a bad idea.

Thanks,
Jon


On 12/3/09 1:31 PM, Kieran Kelleher wrote:

OK, this is the final concurrent utility code to provide manual locking ec's in 
a app with safeLocking on. And just for fun and Ricardo's enjoyment of 
anonymous classes ;-), the factory is an anonymous static class and its _create 
method returns anonymous ERXEC's with the two methods over-riden as per Anjo's 
suggestion.

/**
*AnonymousERXECfactorythatcreatesmanuallockingec'sinanappwheresafeLockingisonbydefault
*/
private static ERXEC.Factory manualLockingEditingContextFactory = new 
ERXEC.DefaultFactory() {

@Override
protected EOEditingContext _createEditingContext(EOObjectStore parent) {
return new ERXEC(parent == null ? EOEditingContext.defaultParentObjectStore() : 
parent) {
@Override
public boolean useAutoLock() {return false;}

@Override
public boolean coalesceAutoLocks() {return false;}
};
}
};

/**
*@returnaregularERXECwithnoauto-lockingfeatures
*/
public static EOEditingContext newManualLockingEditingContext() {
returnmanualLockingEditingContextFactory._newEditingContext();
}


/**
*Idonotwantautolockinginnon-requestthreads
*
*@paramparent
*@returnanERXECwithsafeLockingpropertiesturnedOFF.
*/
public static EOEditingContext newManualLockingEditingContext(EOObjectStore 
parent) {
returnmanualLockingEditingContextFactory._newEditingContext(parent);
}


On Dec 3, 2009, at 2:54 PM, Mike Schrag wrote:


i think we're talking two different things ... if you have an empty superclass 
constructor and you don't declare any constructors, then yes, there is an 
implicit constructor created in your subclass that calls super (as well, if you 
DO declare a constructor and there is an empty super constructor, implicitly a 
super() is added to the top of your constructor). in this case, because the 
anonymous subclass is declared as new ERXEC(os), it's actually calling the 
ERXEC(ObjectStore) constructor (which I PRESUME java secretly added into your 
subclass with a super(os) call -- this is a little different than a normal 
class). However, Kieran's specifically talking about the 
ERXEC.newEditingContext() factory method, which you're bypassing here by 
explicitly subclassing ERXEC and instantiating the class directly.

ms

On Dec 3, 2009, at 2:45 PM, Ricardo J. Parada wrote:


Don't subclasses have an implicit super() to invoke the super class constructor?


On Dec 3, 2009, at 2:38 PM, Kieran Kelleher wrote:


True, but then I would be bypassing the EC factory, which just seems dirty, but 
yes, this very good suggestion is an elegant way to do it for sure.

On Dec 3, 2009, at 2:16 PM, Anjo Krank wrote:


PS. And even the above is not perfect protection against an autolock if a 
thread gets cpu execution delay between construction statement and the 
ec.setCoalesceAutoLocks(false) statement. After setting safelocking props to 
false, I should really check if the ec was autolocked and unlock it before 
returning  or even have an ERXEC constructor that takes a safeLocking 
boolean param, but that would be two more undesired constructors ... so 
probably making isLockedInThread public (or accessible using reflection) should 
do the trick.


In that case, you'd be better with

return new ERXEC(os) {
public boolean useAutoLock() 

Re: Running through Apache, and testing in VMWare/Windows

2010-12-08 Thread Kieran Kelleher
I test Windows on Parallels. One way is to install Bonjour for Windows on 
your Windows VM and then use http://andrewsmac.local/ (or whatever your bonjour 
name is). Another way is to just use the Mac's IP address in the URL.

On Dec 7, 2010, at 4:52 PM, Andrew R. Kinnie wrote:

 Hi all,
 
 I have set up my dev box to run through apache rather than direct connect, 
 but discovered a problem that seems likely to be related.  When I test on 
 Windows running in VMWare Fusion on my machine, it can't connect.  I assume 
 it's because apache is serving it as localhost, and the VM presumably has 
 it's own ip, so it can't see the mac's 127.0.0.1
 
 I assume someone does this, as it seems like a fairly common configuration 
 and requirement.  Can someone point me to what I need to do to configure this?
 
 Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week or 
 two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion running an XP 
 Virtual Machine.
 
 Any ideas?  Thanks in advance.
 
 Andrew 
 ___
 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/kelleherk%40gmail.com
 
 This email sent to kelleh...@gmail.com

 ___
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


Re: Running through Apache, and testing in VMWare/Windows

2010-12-08 Thread Simon
hold on a second - on the bottom of that web page there is an oracle
badge. let me guess: it's free to download and free to install, but drains a
$1000 per second from your bank account when you're not looking ? :-)

simon

On 8 December 2010 00:25, Chuck Hill ch...@global-village.net wrote:

 Mostly unrelated, but I ran across this the other day:

 http://www.virtualbox.org/

 Free(ish) and there is an OS X version.


 Chuck


 On Dec 7, 2010, at 4:22 PM, David Avendasora wrote:

  What is the networking setup of your VMWare virtual machine? Maybe a
 screen capture?
 
  Dave
 
  On Dec 7, 2010, at 5:30 PM, Andrew R. Kinnie wrote:
 
  That didn't work either, though that makes much less sense to me.
 
 
  On Dec 7, 2010, at 5:01 PM, David LeBer wrote:
 
 
  On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:
 
  Hi all,
 
  I have set up my dev box to run through apache rather than direct
 connect, but discovered a problem that seems likely to be related.  When I
 test on Windows running in VMWare Fusion on my machine, it can't connect.  I
 assume it's because apache is serving it as localhost, and the VM presumably
 has it's own ip, so it can't see the mac's 127.0.0.1
 
  I assume someone does this, as it seems like a fairly common
 configuration and requirement.  Can someone point me to what I need to do to
 configure this?
 
  Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a
 week or two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion
 running an XP Virtual Machine.
 
  Any ideas?  Thanks in advance.
 
  Can you use the current IP of the Mac?
 
  ;david
 
  --
  David LeBer
  Codeferous Software
  'co-def-er-ous' adj. Literally 'code-bearing'
  site:   http://codeferous.com
  blog:   http://davidleber.net
  profile:http://www.linkedin.com/in/davidleber
  twitter:http://twitter.com/rebeld
  --
  Toronto Area Cocoa / WebObjects developers group:
  http://tacow.org
 
 
 
 
 
  ___
  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/webobjects%40avendasora.com
 
  This email sent to webobje...@avendasora.com
 
 
 
  ___
  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/chill%40global-village.net
 
  This email sent to ch...@global-village.net

 --
 Chuck Hill Senior Consultant / VP Development

 Practical WebObjects - for developers who want to increase their overall
 knowledge of WebObjects or who are trying to solve specific problems.
 http://www.global-village.net/products/practical_webobjects








  ___
 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/simon%40potwells.co.uk

 This email sent to si...@potwells.co.uk

 ___
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

Re: Running through Apache, and testing in VMWare/Windows

2010-12-08 Thread Pascal Robert
Yep, I think if you use a NAT network setup you can't connect from Windows to 
OS X by IP. I always setup my VMs to use a bridge (don't know the exact term in 
English, my copy of Fusion is running in French).

 What is the networking setup of your VMWare virtual machine? Maybe a screen 
 capture?
 
 Dave
 
 On Dec 7, 2010, at 5:30 PM, Andrew R. Kinnie wrote:
 
 That didn't work either, though that makes much less sense to me.
 
 
 On Dec 7, 2010, at 5:01 PM, David LeBer wrote:
 
 
 On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:
 
 Hi all,
 
 I have set up my dev box to run through apache rather than direct connect, 
 but discovered a problem that seems likely to be related.  When I test on 
 Windows running in VMWare Fusion on my machine, it can't connect.  I 
 assume it's because apache is serving it as localhost, and the VM 
 presumably has it's own ip, so it can't see the mac's 127.0.0.1
 
 I assume someone does this, as it seems like a fairly common configuration 
 and requirement.  Can someone point me to what I need to do to configure 
 this?
 
 Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week 
 or two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion running 
 an XP Virtual Machine.
 
 Any ideas?  Thanks in advance.
 
 Can you use the current IP of the Mac?
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site:   http://codeferous.com
 blog:   http://davidleber.net
 profile:http://www.linkedin.com/in/davidleber
 twitter:http://twitter.com/rebeld
 --
 Toronto Area Cocoa / WebObjects developers group:
 http://tacow.org
 
 
 
 
 
 ___
 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/webobjects%40avendasora.com
 
 This email sent to webobje...@avendasora.com
 
 
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca

 ___
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


Re: Running through Apache, and testing in VMWare/Windows

2010-12-08 Thread Pascal Robert
They also have a paid version. But personally, I trust more VMWare. 
Virtualization is their core business and so far Fusion have been rock solid 
for me (using it since mid 2008).

 hold on a second - on the bottom of that web page there is an oracle badge. 
 let me guess: it's free to download and free to install, but drains a $1000 
 per second from your bank account when you're not looking ? :-)
 
 simon
 
 On 8 December 2010 00:25, Chuck Hill ch...@global-village.net wrote:
 Mostly unrelated, but I ran across this the other day:
 
 http://www.virtualbox.org/
 
 Free(ish) and there is an OS X version.
 
 
 Chuck
 
 
 On Dec 7, 2010, at 4:22 PM, David Avendasora wrote:
 
  What is the networking setup of your VMWare virtual machine? Maybe a screen 
  capture?
 
  Dave
 
  On Dec 7, 2010, at 5:30 PM, Andrew R. Kinnie wrote:
 
  That didn't work either, though that makes much less sense to me.
 
 
  On Dec 7, 2010, at 5:01 PM, David LeBer wrote:
 
 
  On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:
 
  Hi all,
 
  I have set up my dev box to run through apache rather than direct 
  connect, but discovered a problem that seems likely to be related.  When 
  I test on Windows running in VMWare Fusion on my machine, it can't 
  connect.  I assume it's because apache is serving it as localhost, and 
  the VM presumably has it's own ip, so it can't see the mac's 127.0.0.1
 
  I assume someone does this, as it seems like a fairly common 
  configuration and requirement.  Can someone point me to what I need to 
  do to configure this?
 
  Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week 
  or two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion 
  running an XP Virtual Machine.
 
  Any ideas?  Thanks in advance.
 
  Can you use the current IP of the Mac?
 
  ;david
 
  --
  David LeBer
  Codeferous Software
  'co-def-er-ous' adj. Literally 'code-bearing'
  site:   http://codeferous.com
  blog:   http://davidleber.net
  profile:http://www.linkedin.com/in/davidleber
  twitter:http://twitter.com/rebeld
  --
  Toronto Area Cocoa / WebObjects developers group:
  http://tacow.org
 
 
 
 
 
  ___
  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/webobjects%40avendasora.com
 
  This email sent to webobje...@avendasora.com
 
 
 
  ___
  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/chill%40global-village.net
 
  This email sent to ch...@global-village.net
 
 --
 Chuck Hill Senior Consultant / VP Development
 
 Practical WebObjects - for developers who want to increase their overall 
 knowledge of WebObjects or who are trying to solve specific problems.
 http://www.global-village.net/products/practical_webobjects
 
 
 
 
 
 
 
 
  ___
 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/simon%40potwells.co.uk
 
 This email sent to si...@potwells.co.uk
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca

 ___
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

Re: Running through Apache, and testing in VMWare/Windows

2010-12-08 Thread Andrew R. Kinnie
Yeah, I just changed that (It is called Bridge vs. NAT which is the default).  
It now can see apache, but can't see the wo app.

(i.e. the ip address gives me an It Works! page, but the full url including 
:port/cgi-bin/WebObjects/MyApp.woa gets me Internet Explorer cannot connect 
to this web page)

If I remove the port I get Web Page cannot be found




On Dec 8, 2010, at 8:43 AM, Pascal Robert wrote:

 Yep, I think if you use a NAT network setup you can't connect from Windows to 
 OS X by IP. I always setup my VMs to use a bridge (don't know the exact term 
 in English, my copy of Fusion is running in French).
 
 What is the networking setup of your VMWare virtual machine? Maybe a screen 
 capture?
 
 Dave
 
 On Dec 7, 2010, at 5:30 PM, Andrew R. Kinnie wrote:
 
 That didn't work either, though that makes much less sense to me.
 
 
 On Dec 7, 2010, at 5:01 PM, David LeBer wrote:
 
 
 On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:
 
 Hi all,
 
 I have set up my dev box to run through apache rather than direct 
 connect, but discovered a problem that seems likely to be related.  When 
 I test on Windows running in VMWare Fusion on my machine, it can't 
 connect.  I assume it's because apache is serving it as localhost, and 
 the VM presumably has it's own ip, so it can't see the mac's 127.0.0.1
 
 I assume someone does this, as it seems like a fairly common 
 configuration and requirement.  Can someone point me to what I need to do 
 to configure this?
 
 Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week 
 or two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion 
 running an XP Virtual Machine.
 
 Any ideas?  Thanks in advance.
 
 Can you use the current IP of the Mac?
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site:  http://codeferous.com
 blog:  http://davidleber.net
 profile:   http://www.linkedin.com/in/davidleber
 twitter:   http://twitter.com/rebeld
 --
 Toronto Area Cocoa / WebObjects developers group:
 http://tacow.org
 
 
 
 
 
 ___
 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/webobjects%40avendasora.com
 
 This email sent to webobje...@avendasora.com
 
 
 
 ___
 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/probert%40macti.ca
 
 This email sent to prob...@macti.ca
 

 ___
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


Running through Apache, and testing in VMWare/Windows

2010-12-07 Thread Andrew R. Kinnie
Hi all,

I have set up my dev box to run through apache rather than direct connect, but 
discovered a problem that seems likely to be related.  When I test on Windows 
running in VMWare Fusion on my machine, it can't connect.  I assume it's 
because apache is serving it as localhost, and the VM presumably has it's own 
ip, so it can't see the mac's 127.0.0.1

I assume someone does this, as it seems like a fairly common configuration and 
requirement.  Can someone point me to what I need to do to configure this?

Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week or two 
ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion running an XP 
Virtual Machine.

Any ideas?  Thanks in advance.

Andrew 
 ___
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


Re: Running through Apache, and testing in VMWare/Windows

2010-12-07 Thread David LeBer

On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:

 Hi all,
 
 I have set up my dev box to run through apache rather than direct connect, 
 but discovered a problem that seems likely to be related.  When I test on 
 Windows running in VMWare Fusion on my machine, it can't connect.  I assume 
 it's because apache is serving it as localhost, and the VM presumably has 
 it's own ip, so it can't see the mac's 127.0.0.1
 
 I assume someone does this, as it seems like a fairly common configuration 
 and requirement.  Can someone point me to what I need to do to configure this?
 
 Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week or 
 two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion running an XP 
 Virtual Machine.
 
 Any ideas?  Thanks in advance.

Can you use the current IP of the Mac?

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




 ___
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


Re: Running through Apache, and testing in VMWare/Windows

2010-12-07 Thread Andrew R. Kinnie
That didn't work either, though that makes much less sense to me.


On Dec 7, 2010, at 5:01 PM, David LeBer wrote:

 
 On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:
 
 Hi all,
 
 I have set up my dev box to run through apache rather than direct connect, 
 but discovered a problem that seems likely to be related.  When I test on 
 Windows running in VMWare Fusion on my machine, it can't connect.  I assume 
 it's because apache is serving it as localhost, and the VM presumably has 
 it's own ip, so it can't see the mac's 127.0.0.1
 
 I assume someone does this, as it seems like a fairly common configuration 
 and requirement.  Can someone point me to what I need to do to configure 
 this?
 
 Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week or 
 two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion running an 
 XP Virtual Machine.
 
 Any ideas?  Thanks in advance.
 
 Can you use the current IP of the Mac?
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site: http://codeferous.com
 blog: http://davidleber.net
 profile:  http://www.linkedin.com/in/davidleber
 twitter:  http://twitter.com/rebeld
 --
 Toronto Area Cocoa / WebObjects developers group:
 http://tacow.org
 
 
 
 

 ___
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


Re: Running through Apache, and testing in VMWare/Windows

2010-12-07 Thread David Avendasora
What is the networking setup of your VMWare virtual machine? Maybe a screen 
capture?

Dave

On Dec 7, 2010, at 5:30 PM, Andrew R. Kinnie wrote:

 That didn't work either, though that makes much less sense to me.
 
 
 On Dec 7, 2010, at 5:01 PM, David LeBer wrote:
 
 
 On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:
 
 Hi all,
 
 I have set up my dev box to run through apache rather than direct connect, 
 but discovered a problem that seems likely to be related.  When I test on 
 Windows running in VMWare Fusion on my machine, it can't connect.  I assume 
 it's because apache is serving it as localhost, and the VM presumably has 
 it's own ip, so it can't see the mac's 127.0.0.1
 
 I assume someone does this, as it seems like a fairly common configuration 
 and requirement.  Can someone point me to what I need to do to configure 
 this?
 
 Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week or 
 two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion running an 
 XP Virtual Machine.
 
 Any ideas?  Thanks in advance.
 
 Can you use the current IP of the Mac?
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site:http://codeferous.com
 blog:http://davidleber.net
 profile: http://www.linkedin.com/in/davidleber
 twitter: http://twitter.com/rebeld
 --
 Toronto Area Cocoa / WebObjects developers group:
 http://tacow.org
 
 
 
 
 
 ___
 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/webobjects%40avendasora.com
 
 This email sent to webobje...@avendasora.com
 
 

 ___
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


Re: Running through Apache, and testing in VMWare/Windows

2010-12-07 Thread Chuck Hill
Mostly unrelated, but I ran across this the other day:

http://www.virtualbox.org/

Free(ish) and there is an OS X version.


Chuck


On Dec 7, 2010, at 4:22 PM, David Avendasora wrote:

 What is the networking setup of your VMWare virtual machine? Maybe a screen 
 capture?
 
 Dave
 
 On Dec 7, 2010, at 5:30 PM, Andrew R. Kinnie wrote:
 
 That didn't work either, though that makes much less sense to me.
 
 
 On Dec 7, 2010, at 5:01 PM, David LeBer wrote:
 
 
 On 2010-12-07, at 4:52 PM, Andrew R. Kinnie wrote:
 
 Hi all,
 
 I have set up my dev box to run through apache rather than direct connect, 
 but discovered a problem that seems likely to be related.  When I test on 
 Windows running in VMWare Fusion on my machine, it can't connect.  I 
 assume it's because apache is serving it as localhost, and the VM 
 presumably has it's own ip, so it can't see the mac's 127.0.0.1
 
 I assume someone does this, as it seems like a fairly common configuration 
 and requirement.  Can someone point me to what I need to do to configure 
 this?
 
 Eclipse 3.6, WO 5.4.3, Wonder as of last week, WOLips as of . . . a week 
 or two ago, Mac OS X 10.6.5 and the latest update to VMWare Fusion running 
 an XP Virtual Machine.
 
 Any ideas?  Thanks in advance.
 
 Can you use the current IP of the Mac?
 
 ;david
 
 --
 David LeBer
 Codeferous Software
 'co-def-er-ous' adj. Literally 'code-bearing'
 site:   http://codeferous.com
 blog:   http://davidleber.net
 profile:http://www.linkedin.com/in/davidleber
 twitter:http://twitter.com/rebeld
 --
 Toronto Area Cocoa / WebObjects developers group:
 http://tacow.org
 
 
 
 
 
 ___
 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/webobjects%40avendasora.com
 
 This email sent to webobje...@avendasora.com
 
 
 
 ___
 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/chill%40global-village.net
 
 This email sent to ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









smime.p7s
Description: S/MIME cryptographic signature
 ___
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

Re: JUnit testing outside Eclipse

2010-08-09 Thread Paul Hoadley
On 07/08/2010, at 12:02 PM, Paul Hoadley wrote:

 On 07/08/2010, at 1:18 AM, Chuck Hill wrote:
 
 Yes?  Are you using the WO-fu of wopath?
 
 I am now!  Thanks Chuck.

Now I'm testing a framework that contains some EOs.  Again, this is using Ant + 
JUnit, and outside of Eclipse.  Inside Eclipse, I don't seem to have to do much 
at all in the way of setting things up to get the model loaded.  In fact, it 
seems to happen somewhat magically, and I just provide a dummy connection 
dictionary for the model in a @BeforeClass method, and point it at an (empty) 
in-memory H2 database.

From the command line (and in Hudson) I get this:

[junit] Attempt to insert null into an 
com.webobjects.foundation.NSMutableArray.
[junit] java.lang.IllegalArgumentException: Attempt to insert null into an 
com.webobjects.foundation.NSMutableArray.
[junit] at 
com.webobjects.foundation.NSMutableArray.addObject(NSMutableArray.java:165)
[junit] at 
com.webobjects.eoaccess.EOModelGroup.modelGroupForLoadedBundles(EOModelGroup.java:700)
[junit] at 
com.webobjects.eoaccess.EOModelGroup.globalModelGroup(EOModelGroup.java:306)
[junit] at 
com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:333)
[junit] at 
net.logicsquad.webobjects.core.LSEOModelUtils.setUpDatabaseConnectionForModel(Unknown
 Source)
[junit] at net.logicsquad.pbf.tests.model.ModelTest.setUp(Unknown 
Source)
[junit] at 
net.logicsquad.pbf.tests.model.bookings.BookingsModelTest.setUp(Unknown Source)

Some Googling lead me to believe that this is a symptom of the main bundle not 
being loaded, and, indeed, NSBundle.mainBundle() returns null.  Is it obvious 
what I'm doing wrong here?  I'm using the same Ant targets (appended below) as 
I am for a different framework projects (i.e., neither of them are 
applications), the only difference here is that I am trying to load an EOModel.

---
!-- JUnit testing --
property name=src.tests value=Tests /
property name=bin.tests value=bin-tests /
property name=junit.results value=junit-results /
property name=junit.report value=junit-report /

target name=clean.tests
delete dir=${bin.tests} /
delete dir=${junit.results} /
delete dir=${junit.report} /
/target

typedef name=wopath classname=org.objectstyle.woproject.ant.WOPath 
/
wopath id=testing.classpath
frameworks root=User eclipse=true /
frameworks root=Local eclipse=true /
frameworks root=System eclipse=true /
/wopath

target name=compile.tests
mkdir dir=${bin.tests} /
javac srcdir=${src.tests} destdir=${bin.tests}
classpath refid=testing.classpath /
classpath
pathelement location=bin /
/classpath
/javac
/target

target name=junit depends=compile.tests
mkdir dir=junit-results /
junit haltonfailure=false
   printsummary=true
   failureproperty=test.failed
classpath refid=testing.classpath /
classpath
pathelement location=bin /
pathelement location=${junit.jar} /
pathelement location=${bin.tests} /
/classpath
formatter type=brief usefile=false /
formatter type=xml /
batchtest todir=${junit.results}
fileset dir=${bin.tests} 
includes=**/ClinicalDetailsTest.class /
/batchtest
/junit
mkdir dir=${junit.report} /
junitreport todir=${junit.report}
fileset dir=${junit.results}
include name=TEST-*.xml/
/fileset
report format=frames todir=${junit.report}/
/junitreport
fail if=test.failed/
/target
---


-- 
Paul.

http://logicsquad.net/


 ___
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

Re: JUnit testing outside Eclipse

2010-08-09 Thread Chuck Hill
See below.


On Aug 9, 2010, at 4:22 PM, Paul Hoadley wrote:

 On 07/08/2010, at 12:02 PM, Paul Hoadley wrote:
 
 On 07/08/2010, at 1:18 AM, Chuck Hill wrote:
 
 Yes?  Are you using the WO-fu of wopath?
 
 I am now!  Thanks Chuck.
 
 Now I'm testing a framework that contains some EOs.  Again, this is using Ant 
 + JUnit, and outside of Eclipse.  Inside Eclipse, I don't seem to have to do 
 much at all in the way of setting things up to get the model loaded.  In 
 fact, it seems to happen somewhat magically, and I just provide a dummy 
 connection dictionary for the model in a @BeforeClass method, and point it at 
 an (empty) in-memory H2 database.
 
 From the command line (and in Hudson) I get this:
 
 [junit] Attempt to insert null into an 
 com.webobjects.foundation.NSMutableArray.
 [junit] java.lang.IllegalArgumentException: Attempt to insert null into 
 an com.webobjects.foundation.NSMutableArray.
 [junit]   at 
 com.webobjects.foundation.NSMutableArray.addObject(NSMutableArray.java:165)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.modelGroupForLoadedBundles(EOModelGroup.java:700)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.globalModelGroup(EOModelGroup.java:306)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:333)
 [junit]   at 
 net.logicsquad.webobjects.core.LSEOModelUtils.setUpDatabaseConnectionForModel(Unknown
  Source)
 [junit]   at net.logicsquad.pbf.tests.model.ModelTest.setUp(Unknown 
 Source)
 [junit]   at 
 net.logicsquad.pbf.tests.model.bookings.BookingsModelTest.setUp(Unknown 
 Source)
 
 
 Some Googling lead me to believe that this is a symptom of the main bundle 
 not being loaded, and, indeed, NSBundle.mainBundle() returns null.  Is it 
 obvious what I'm doing wrong here?  I'm using the same Ant targets (appended 
 below) as I am for a different framework projects (i.e., neither of them are 
 applications), the only difference here is that I am trying to load an 
 EOModel.
 
 ---
   !-- JUnit testing --
   property name=src.tests value=Tests /
   property name=bin.tests value=bin-tests /
   property name=junit.results value=junit-results /
   property name=junit.report value=junit-report /
 
   target name=clean.tests
   delete dir=${bin.tests} /
   delete dir=${junit.results} /
   delete dir=${junit.report} /
   /target
   
   typedef name=wopath classname=org.objectstyle.woproject.ant.WOPath 
 /
   wopath id=testing.classpath
   frameworks root=User eclipse=true /
   frameworks root=Local eclipse=true /
   frameworks root=System eclipse=true /
   /wopath
 
   target name=compile.tests
   mkdir dir=${bin.tests} /
   javac srcdir=${src.tests} destdir=${bin.tests}
   classpath refid=testing.classpath /
   classpath
   pathelement location=bin /
   /classpath
   /javac
   /target
   
   target name=junit depends=compile.tests
   mkdir dir=junit-results /
   junit haltonfailure=false
  printsummary=true
  failureproperty=test.failed

You need to add dir to the junit task.  e.g.

junit dir=${project.working.directory} ...

Where the directory depends on the project type:

!-- Initialize properties that depend on build type (build or install) 
with values unique to applications  --
target name=set_application_build_properties depends=load.properties 
if=is.wo.app 
property name=build.product.dir 
value=${dest.dir}${file.separator}${build.app.name}.woa/
property name=installed.product.dir 
value=${install.dir}${file.separator}${build.app.name}.woa/
property name=project.working.directory 
value=${build.product.dir}/
property name=project.java.dir 
value=${build.product.dir}${file.separator}Contents${file.separator}Resources${file.separator}Java/

/target


!-- Initialize properties  that depend on build type (build or install) 
with values unique to frameworks  --
target name=set_framework_build_properties depends=load.properties 
if=is.wo.framework 
property name=build.product.dir 
value=${dest.dir}${file.separator}${project.name}.framework/
property name=installed.product.dir 
value=${install.dir}${file.separator}${project.name}.framework/
!-- Use the installed location as that will be populated for regular 
and install builds --
property name=project.working.directory 
value=${install.dir}${file.separator}${project.name}.framework${file.separator}Resources${file.separator}Java/
property name=project.java.dir 
value=${project.working.directory}/
/target


Chuck


   classpath refid=testing.classpath /
   classpath

Re: JUnit testing outside Eclipse

2010-08-09 Thread Paul Hoadley
Hi Chuck,

On 10/08/2010, at 9:06 AM, Chuck Hill wrote:

 You need to add dir to the junit task.  e.g.
 
junit dir=${project.working.directory} ...
 
 Where the directory depends on the project type:
 
!-- Initialize properties that depend on build type (build or install) 
 with values unique to applications  --
target name=set_application_build_properties depends=load.properties 
 if=is.wo.app 
property name=build.product.dir 
 value=${dest.dir}${file.separator}${build.app.name}.woa/
property name=installed.product.dir 
 value=${install.dir}${file.separator}${build.app.name}.woa/
property name=project.working.directory 
 value=${build.product.dir}/
property name=project.java.dir 
 value=${build.product.dir}${file.separator}Contents${file.separator}Resources${file.separator}Java/

/target
 
 
!-- Initialize properties  that depend on build type (build or install) 
 with values unique to frameworks  --
target name=set_framework_build_properties depends=load.properties 
 if=is.wo.framework 
property name=build.product.dir 
 value=${dest.dir}${file.separator}${project.name}.framework/
property name=installed.product.dir 
 value=${install.dir}${file.separator}${project.name}.framework/
   !-- Use the installed location as that will be populated for regular 
 and install builds --
property name=project.working.directory 
 value=${install.dir}${file.separator}${project.name}.framework${file.separator}Resources${file.separator}Java/
property name=project.java.dir 
 value=${project.working.directory}/   
/target

I've hard-coded it in there for now:

junit haltonfailure=false 
dir=dist/PBFModels.framework/Resources/Java

but it makes no difference.  I'm still getting this:

[junit] Testcase: 
net.logicsquad.pbf.tests.model.bookings.ClinicalDetailsTest:  Caused an 
ERROR
[junit] Attempt to insert null into an 
com.webobjects.foundation.NSMutableArray.
[junit] java.lang.IllegalArgumentException: Attempt to insert null into an 
com.webobjects.foundation.NSMutableArray.
[junit] at 
com.webobjects.foundation.NSMutableArray.addObject(NSMutableArray.java:165)
[junit] at 
com.webobjects.eoaccess.EOModelGroup.modelGroupForLoadedBundles(EOModelGroup.java:700)
[junit] at 
com.webobjects.eoaccess.EOModelGroup.globalModelGroup(EOModelGroup.java:306)
[junit] at 
com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:333)
[junit] at 
net.logicsquad.webobjects.core.LSEOModelUtils.setUpDatabaseConnectionForModel(Unknown
 Source)
[junit] at net.logicsquad.pbf.tests.model.ModelTest.setUp(Unknown 
Source)
[junit] at 
net.logicsquad.pbf.tests.model.bookings.BookingsModelTest.setUp(Unknown Source)


-- 
Paul.

http://logicsquad.net/


 ___
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

Re: JUnit testing outside Eclipse

2010-08-09 Thread Chuck Hill
I don't think that relative paths work.

On Aug 9, 2010, at 5:42 PM, Paul Hoadley wrote:

 Hi Chuck,
 
 On 10/08/2010, at 9:06 AM, Chuck Hill wrote:
 
 You need to add dir to the junit task.  e.g.
 
junit dir=${project.working.directory} ...
 
 Where the directory depends on the project type:
 
!-- Initialize properties that depend on build type (build or install) 
 with values unique to applications  --
target name=set_application_build_properties depends=load.properties 
 if=is.wo.app 
property name=build.product.dir 
 value=${dest.dir}${file.separator}${build.app.name}.woa/
property name=installed.product.dir 
 value=${install.dir}${file.separator}${build.app.name}.woa/
property name=project.working.directory 
 value=${build.product.dir}/
property name=project.java.dir 
 value=${build.product.dir}${file.separator}Contents${file.separator}Resources${file.separator}Java/
   
/target
 
 
!-- Initialize properties  that depend on build type (build or install) 
 with values unique to frameworks  --
target name=set_framework_build_properties depends=load.properties 
 if=is.wo.framework 
property name=build.product.dir 
 value=${dest.dir}${file.separator}${project.name}.framework/
property name=installed.product.dir 
 value=${install.dir}${file.separator}${project.name}.framework/
  !-- Use the installed location as that will be populated for regular 
 and install builds --
property name=project.working.directory 
 value=${install.dir}${file.separator}${project.name}.framework${file.separator}Resources${file.separator}Java/
property name=project.java.dir 
 value=${project.working.directory}/  
/target
 
 I've hard-coded it in there for now:
 
   junit haltonfailure=false 
 dir=dist/PBFModels.framework/Resources/Java
 
 but it makes no difference.  I'm still getting this:
 
 [junit] Testcase: 
 net.logicsquad.pbf.tests.model.bookings.ClinicalDetailsTest:Caused an 
 ERROR
 [junit] Attempt to insert null into an 
 com.webobjects.foundation.NSMutableArray.
 [junit] java.lang.IllegalArgumentException: Attempt to insert null into 
 an com.webobjects.foundation.NSMutableArray.
 [junit]   at 
 com.webobjects.foundation.NSMutableArray.addObject(NSMutableArray.java:165)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.modelGroupForLoadedBundles(EOModelGroup.java:700)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.globalModelGroup(EOModelGroup.java:306)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:333)
 [junit]   at 
 net.logicsquad.webobjects.core.LSEOModelUtils.setUpDatabaseConnectionForModel(Unknown
  Source)
 [junit]   at net.logicsquad.pbf.tests.model.ModelTest.setUp(Unknown 
 Source)
 [junit]   at 
 net.logicsquad.pbf.tests.model.bookings.BookingsModelTest.setUp(Unknown 
 Source)
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









smime.p7s
Description: S/MIME cryptographic signature
 ___
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

Re: JUnit testing outside Eclipse

2010-08-09 Thread Q

This is how I currently do it:

wounit printsummary=yes haltonfailure=yes showoutput=yes 
dir=${dest.dir}/${project.name}.${appextension}
classpath refid=test.classpath /
formatter type=xml /
batchtest fork=yes todir=${reports.tests}
fileset dir=${src.tests}
include name=**/*Tests.java /
exclude name=**/*TestSuite.java /
exclude name=**/AllTests.java /
/fileset
/batchtest
sysproperty key=user.name value=testing /
/wounit

On 10/08/2010, at 10:42 AM, Paul Hoadley wrote:

 Hi Chuck,
 
 On 10/08/2010, at 9:06 AM, Chuck Hill wrote:
 
 You need to add dir to the junit task.  e.g.
 
junit dir=${project.working.directory} ...
 
 Where the directory depends on the project type:
 
!-- Initialize properties that depend on build type (build or install) 
 with values unique to applications  --
target name=set_application_build_properties depends=load.properties 
 if=is.wo.app 
property name=build.product.dir 
 value=${dest.dir}${file.separator}${build.app.name}.woa/
property name=installed.product.dir 
 value=${install.dir}${file.separator}${build.app.name}.woa/
property name=project.working.directory 
 value=${build.product.dir}/
property name=project.java.dir 
 value=${build.product.dir}${file.separator}Contents${file.separator}Resources${file.separator}Java/
   
/target
 
 
!-- Initialize properties  that depend on build type (build or install) 
 with values unique to frameworks  --
target name=set_framework_build_properties depends=load.properties 
 if=is.wo.framework 
property name=build.product.dir 
 value=${dest.dir}${file.separator}${project.name}.framework/
property name=installed.product.dir 
 value=${install.dir}${file.separator}${project.name}.framework/
  !-- Use the installed location as that will be populated for regular 
 and install builds --
property name=project.working.directory 
 value=${install.dir}${file.separator}${project.name}.framework${file.separator}Resources${file.separator}Java/
property name=project.java.dir 
 value=${project.working.directory}/  
/target
 
 I've hard-coded it in there for now:
 
   junit haltonfailure=false 
 dir=dist/PBFModels.framework/Resources/Java
 
 but it makes no difference.  I'm still getting this:
 
 [junit] Testcase: 
 net.logicsquad.pbf.tests.model.bookings.ClinicalDetailsTest:Caused an 
 ERROR
 [junit] Attempt to insert null into an 
 com.webobjects.foundation.NSMutableArray.
 [junit] java.lang.IllegalArgumentException: Attempt to insert null into 
 an com.webobjects.foundation.NSMutableArray.
 [junit]   at 
 com.webobjects.foundation.NSMutableArray.addObject(NSMutableArray.java:165)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.modelGroupForLoadedBundles(EOModelGroup.java:700)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.globalModelGroup(EOModelGroup.java:306)
 [junit]   at 
 com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:333)
 [junit]   at 
 net.logicsquad.webobjects.core.LSEOModelUtils.setUpDatabaseConnectionForModel(Unknown
  Source)
 [junit]   at net.logicsquad.pbf.tests.model.ModelTest.setUp(Unknown 
 Source)
 [junit]   at 
 net.logicsquad.pbf.tests.model.bookings.BookingsModelTest.setUp(Unknown 
 Source)
 
 
 -- 
 Paul.
 
 http://logicsquad.net/
 
 
 ___
 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/qdolan%40gmail.com
 
 This email sent to qdo...@gmail.com



-- 
Seeya...Q

Quinton Dolan - qdo...@gmail.com
Gold Coast, QLD, Australia (GMT+10)




 ___
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

Re: JUnit testing outside Eclipse

2010-08-09 Thread Paul Hoadley
On 10/08/2010, at 10:28 AM, Chuck Hill wrote:

 I don't think that relative paths work.

Actually, the problem was that I was ignoring this:

[junit] dir attribute ignored if running in the same VM

Adding fork=true fixed it.  The relative, hard-coded path was fine.


-- 
Paul.

http://logicsquad.net/


 ___
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


Re: JUnit testing outside Eclipse

2010-08-09 Thread Paul Hoadley
On 10/08/2010, at 10:40 AM, Q wrote:

 This is how I currently do it:
 
   wounit printsummary=yes haltonfailure=yes showoutput=yes 
 dir=${dest.dir}/${project.name}.${appextension}
   classpath refid=test.classpath /
   formatter type=xml /
   batchtest fork=yes todir=${reports.tests}
   fileset dir=${src.tests}
   include name=**/*Tests.java /
   exclude name=**/*TestSuite.java /
   exclude name=**/AllTests.java /
   /fileset
   /batchtest
   sysproperty key=user.name value=testing /
   /wounit
 

Thanks Q.  What does the 'wounit' task add to 'junit'?


-- 
Paul.

http://logicsquad.net/


 ___
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

Re: JUnit testing outside Eclipse

2010-08-09 Thread Q

On 10/08/2010, at 11:37 AM, Paul Hoadley wrote:

 On 10/08/2010, at 10:40 AM, Q wrote:
 
 This is how I currently do it:
 
  wounit printsummary=yes haltonfailure=yes showoutput=yes 
 dir=${dest.dir}/${project.name}.${appextension}
  classpath refid=test.classpath /
  formatter type=xml /
  batchtest fork=yes todir=${reports.tests}
  fileset dir=${src.tests}
  include name=**/*Tests.java /
  exclude name=**/*TestSuite.java /
  exclude name=**/AllTests.java /
  /fileset
  /batchtest
  sysproperty key=user.name value=testing /
  /wounit
 
 
 Thanks Q.  What does the 'wounit' task add to 'junit'?

I think I was originally using it to help with building the classpath from a 
framework list, I don't think it adds much else. I probably don't need to use 
it anymore.

-- 
Seeya...Q

Quinton Dolan - qdo...@gmail.com
Gold Coast, QLD, Australia (GMT+10)




 ___
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 testing outside Eclipse

2010-08-06 Thread Paul Hoadley
Hello,

Having recently set up a Hudson build server, I am now trying to get some JUnit 
tests running as part of the build, and hence outside of Eclipse.  I have a 
test suite for a framework which I've previously run manually in Eclipse just 
fine, but it's evident that Eclipse is providing quite a bit of help with the 
classpath.  I'm about half way through manually tracking down all the locations 
of classes on which the test suite depends (javafoundation.jar, 
javaeoacess.jar, javaeocontrol.jar, log4j-1.2.14.jar...), and have almost got 
the tests running outside Eclipse.  Is this the only way to do it?  Or am I 
missing an easier way?


-- 
Paul.

http://logicsquad.net/


 ___
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


  1   2   3   >