Re: WOUnit testing with partial entities
Hi Henrique, On 22/02/2014, at 1:14 PM, Henrique Prange 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=snapshots&g=com.wounit&a=wounit&v=1.2.3-SNAPSHOT&e=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
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=snapshots&g=com.wounit&a=wounit&v=1.2.3-SNAPSHOT&e=jar Cheers, Henrique On 21/02/2014, at 03:33, Paul Hoadley wrote: > On 21/02/2014, at 3:40 PM, Paul Hoadley 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
On 21/02/2014, at 3:40 PM, Paul Hoadley 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
Hi Henrique, On 21/02/2014, at 1:35 PM, Henrique Prange 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: 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 '' 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
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: com.wounit wounit 1.2.3-SNAPSHOT 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=snapshots&g=com.wounit&a=wounit&v=1.2.3-SNAPSHOT&e=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 wrote: > On 20/02/2014, at 3:56 AM, Henrique Prange 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
On 20/02/2014, at 3:56 AM, Henrique Prange 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
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 wrote: > On 03/02/2014, at 2:30 PM, Paul Hoadley 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
On 03/02/2014, at 2:30 PM, Paul Hoadley 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
Hi Henrique. On 22/08/2013, at 10:01 AM, Henrique Prange 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
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 wrote: > >> Hi Henrique, >> >> On 02/08/2013, at 9:08 AM, Henrique Prange 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.(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.eoco
Re: WOUnit testing with partial entities
Hi Henrique, On 22/08/2013, at 10:01 AM, Henrique Prange 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
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 wrote: > Hi Henrique, > > On 02/08/2013, at 9:08 AM, Henrique Prange 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.(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.(EOGenericRecord.java:73) > [junit] at > er.extensions.eof.ERXGenericRecord.(ERXGenericRecord.java:102) > [junit] at > net.logicsquad.webobjects.core.eof.LSGener
RE: WOUnit testing with partial entities
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 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.(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.(EOGenericRecord.java:73) >[junit]at > er.extensions.
Re: WOUnit testing with partial entities
Hi Henrique, On 02/08/2013, at 9:08 AM, Henrique Prange 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.(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.(EOGenericRecord.java:73) [junit] at er.extensions.eof.ERXGenericRecord.(ERXGenericRecord.java:102) [junit] at net.logicsquad.webobjects.core.eof.LSGenericRecord.(LSGenericRecord.java:54) [junit] at net.logicsquad.lssurvey.model.survey._Survey.(_Survey.java:15) [junit] at net.logicsquad.lssurvey.model.survey.Survey.(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
Re: WOUnit testing with partial entities
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 wrote: > Hi Henrique, > > On 28/07/2013, at 11:58 AM, Henrique Prange 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
Hi Henrique, On 28/07/2013, at 11:58 AM, Henrique Prange 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
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 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
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