| Andy Jefferson (JIRA) 2007-12-04, 7:11 pm |
|
[ https://issues.apache.org/jira/brow...action_12548382 ]
Andy Jefferson commented on JDO-559:
------------------------------------
NewInstance checks for missing <property> for a method. e.g AAddress has getAString() but not mapped in MetaData.
NewInstanceBadMapping checks for the same thing but using JDO+ORM files.
> NewInstanceBadMapping has to be invoked from a separate conf file which specifies the alternate mapping, which is missing metadata to map zipcode.
But it isn't missing anything IMHO. The <property> mapping is in the JDO file. Why should users have to specify it in both JDO *and* ORM? That's not how it works for fields. An alternate to using a different schema is just to have AAddress_bad1, AAddress_
bad2 for example.
> Currently the spec does assume that for pm.newInstance() to work, properties in interfaces and abstract classes need to be explicitly defined in metadata.
Yes, but as I already said, all of the persistent interfaces tests already present in the TCK *don't* make that assumption. PIAddress has no properties mapped, yet has methods for example, there are others. So going by the spec JPOX should throw a JDOUser
Exception for that (which it would do if i enable that check hence all persistent interface tests would fail).
Spec section 18 says
<spec>If any field or property declarations are missing from the metadata, then field or property metadata is defaulted for the missing declarations.</spec>
but what is it defaulted to is the crux
> JPOX fails to throw JDOUserException on some illegal arguments to pm.newInstance()
> ----------------------------------------------------------------------------------
>
> Key: JDO-559
> URL: https://issues.apache.org/jira/browse/JDO-559
> Project: JDO
> Issue Type: Bug
> Components: tck2
> Reporter: Michelle Caisse
> Assignee: Andy Jefferson
> Fix For: JDO 2 maintenance release 1
>
>
> For tests NewInstance (in pm.conf) and NewInstanceBadMapping (in newInstanceBadMapping.conf), a number of test failures:
> 1) testNewInstanceInterfaceBad(org.apache.jdo.tck.api.persistencemanager.NewInstance)junit.framework.AssertionFailedError: Expected JDOUserException but no exception thrown. Interface contains method not declared as persistent property.
> at org.apache.jdo.tck.api.persistencemanager.NewInstance.testNewInstanceInterfaceBad(NewInstance.java:99)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:254)
> at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
> at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
> at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
> 2) testNewInstanceAbstractClassBad(org.apache.jdo.tck.api.persistencemanager.NewInstance)junit.framework.AssertionFailedError: Expected JDOUserException but no exception thrown. Abstract class contains abstract method not declared as persistent propert
y.
> at org.apache.jdo.tck.api.persistencemanager.NewInstance. testNewInstanceAbstractClassBad(NewInsta
nce.java:115)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:254)
> at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
> at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
> at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
> RUN NewInstanceBadMapping.testNewInstanceInterface FAILURE
> RUN NewInstanceBadMapping.testNewInstanceAbstractClass FAILURE
> RUN NewInstanceBadMapping.testNewInstanceClass FAILURE
> Description: All pm tests with standard mapping, no testdata.
> Time: 003
> There were 3 failures:
> 1) testNewInstanceInterface(org.apache.jdo.tck.api.persistencemanager.NewInstanceBadMapping)junit.framework.AssertionFailedError: Expected JDOUserException but no exception thrown. Persistent property is not mapped.
> at org.apache.jdo.tck.api.persistencemanager.NewInstanceBadMapping. testNewInstanceInterface(NewInstanceBadM
apping.java:66)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:254)
> at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
> at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
> at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
> 2) testNewInstanceAbstractClass(org.apache.jdo.tck.api.persistencemanager.NewInstanceBadMapping)junit.framework.AssertionFailedError: Expected JDOUserException but no exception thrown. Persistent property is not mapped.
> at org.apache.jdo.tck.api.persistencemanager.NewInstanceBadMapping. testNewInstanceAbstractClass(NewInstance
BadMapping.java:81)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:254)
> at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
> at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
> at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
> 3) testNewInstanceClass(org.apache.jdo.tck.api.persistencemanager.NewInstanceBadMapping)junit.framework.AssertionFailedError: Expected JDOUserException but no exception thrown. Persistent property is not mapped.
> at org.apache.jdo.tck.api.persistencemanager.NewInstanceBadMapping. testNewInstanceClass(NewInstanceBadMappi
ng.java:96)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:254)
> at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
> at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
> at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
|