Re: Xcode and WOUnitTest 2
Re: Xcode and WOUnitTest 2
- Subject: Re: Xcode and WOUnitTest 2
- From: Eugene Khablov <email@hidden>
- Date: Thu, 07 Dec 2006 16:06:35 +0300
- Thread-topic: Xcode and WOUnitTest 2
Title: Re: Xcode and WOUnitTest 2
Hi list!
Using wounittest2 I've stuck with testing methods containing calls of
EOEnterpriseObjectClazz.objectWithPrimaryKeyValue(ec, pk);
or
EOUtilities.objectWithPrimaryKeyValue(ec, entity, pk);
These methods create qualifiers against primary key attribute which is not selected as a class property in model. So array of registered in mockEditingContext enterprise objects cannot be filtered in memory by EOFetcher using objectsWithFetchSpecification because of exception in EOQualifier.filteredArrayWithQualifier().
What is a right way of testing methods with these calls with wounittest?
Is it a way to implement support of filtering by primary key or filtering by other non-class property attributes?
Here is an exception’s stack:
java.lang.RuntimeException: com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: <dm.threesixtypro.FileRubric 0x6715f8> valueForKey(): lookup of unknown key: 'rowid'.
This class does not have an instance variable of the name rowid or _rowid, nor a method of the name rowid, _rowid, getRowid, or _getRowid
at dm.threesixtypro.ContentItem$ContentItemClazz.objectsForQueryDictionary(ContentItem.java:37)
at dm.threesixtypro.tests.FileTest.testObjectsForQueryDictionary(FileTest.java:31)
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:585)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: <dm.threesixtypro.FileRubric 0x6715f8> valueForKey(): lookup of unknown key: 'rowid'.
This class does not have an instance variable of the name rowid or _rowid, nor a method of the name rowid, _rowid, getRowid, or _getRowid
at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.handleQueryWithUnboundKey(NSKeyValueCoding.java:1316)
at com.webobjects.eocontrol.EOCustomObject.handleQueryWithUnboundKey(EOCustomObject.java:1623)
at com.webobjects.foundation.NSKeyValueCoding$Utility.handleQueryWithUnboundKey(NSKeyValueCoding.java:544)
at com.webobjects.foundation.NSKeyValueCoding$_KeyBinding.valueInObject(NSKeyValueCoding.java:920)
at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1559)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:498)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at com.webobjects.eocontrol.EOCustomObject.valueForKeyPath(EOCustomObject.java:1675)
at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)
at com.webobjects.eocontrol.EOKeyValueQualifier.evaluateWithObject(EOKeyValueQualifier.java:131)
at com.webobjects.eocontrol.EOQualifier.filteredArrayWithQualifier(EOQualifier.java:635)
at org.pekeler.eof.EOFetcher$EditingContextStore.rawObjectsWithFetchSpecification(EOFetcher.java:186)
at org.pekeler.eof.EOFetcher$EditingContextStore.objectsWithFetchSpecification(EOFetcher.java:151)
at org.pekeler.eof.EOFetcher.objectsWithFetchSpecification(EOFetcher.java:218)
at org.wounittest.MockEditingContext.objectsWithFetchSpecification(MockEditingContext.java:120)
at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4500)
at com.webobjects.eoaccess.EOUtilities.objectWithPrimaryKey(EOUtilities.java:433)
at com.webobjects.eoaccess.EOUtilities.objectWithPrimaryKeyValue(EOUtilities.java:405)
at dm.threesixtypro.ContentItem$ContentItemClazz.qualifierForQueryDictionary(ContentItem.java:44)
at dm.threesixtypro.ContentItem$ContentItemClazz.objectsForQueryDictionary(ContentItem.java:35)
... 21 more
Thanks in advance!
---
Eugene Khablov
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden