db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michelle Caisse (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-559) JPOX fails to throw JDOUserException on some illegal arguments to pm.newInstance()
Date Tue, 04 Dec 2007 17:51:43 GMT

    [ https://issues.apache.org/jira/browse/JDO-559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548320
] 

Michelle Caisse commented on JDO-559:
-------------------------------------

Hi Andy,

Negative tests in NewInstance.java test for the following:


A12.6.6-1 [The parameter must be one of the following:
- an abstract class that is declared in the metadata as persistence-capable, in which all
abstract methods are declared as persistent properties, or
- an interface that is declared in the metadata as persistence-capable, in which all methods
are declared as persistent properties, or
- a concrete class that is declared in the metadata as persistence-capable. In this case,
the concrete class must declare a public no-args constructor.

If the parameter does not satisfy the above requirements, JDOUserException is thrown.]

Tests in NewInstanceBadMapping test this assertion:

A12.6.6-2 [In order for the newInstance method to be used, the parameter interface must be
completely mapped. ... Otherwise, JDOUserException is thrown by the newInstance method.]

So, one tests the declaration as persistence-capable, the other tests the mapping. NewInstanceBadMapping
has to be invoked from a separate conf file which specifies the alternate mapping, which is
missing metadata to map zipcode.

Currently the spec does assume that for pm.newInstance() to work, properties in interfaces
and abstract classes need to be explicitly defined in metadata. Perhaps Craig can comment
on your last point.



> 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 property.
> 	at org.apache.jdo.tck.api.persistencemanager.NewInstance.testNewInstanceAbstractClassBad(NewInstance.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(NewInstanceBadMapping.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(NewInstanceBadMapping.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(NewInstanceBadMapping.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.


Mime
View raw message