db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-453) Create a test for illegal arguments for PersistenceManager.newInstance
Date Sun, 02 Dec 2007 03:34:43 GMT

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

Craig Russell commented on JDO-453:
-----------------------------------

Just one comment. This code in AAddress_bad seems to be superfluous:
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public Address_bad(String street, String city, String state, String zipcode) {
+        this.street = street;
+        this.city = city;
+        this.state = state;
+        this.zipcode = zipcode;
+    }
+
+    // pm.newInstance(this) throws JDOUserException with non-public constructor
+    private Address_bad() {}
+
I think all you need is 

+    // pm.newInstance(this) throws JDOUserException with non-public no-args constructor
+    private Address_bad() {}
+



> Create a test for illegal arguments for PersistenceManager.newInstance
> ----------------------------------------------------------------------
>
>                 Key: JDO-453
>                 URL: https://issues.apache.org/jira/browse/JDO-453
>             Project: JDO
>          Issue Type: Test
>          Components: tck2, tck2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Craig Russell
>            Assignee: Michelle Caisse
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: JDO-453.patch
>
>
> New test cases are needed for illegal arguments of newInstance. 
> One strategy is to define classes in a new package along with metadata, but no mapping
(since these are error classes). A new test should try to instantiate the classes using the
newInstance method and verify that JDOUserException is thrown.
> Classes to test include:
> Abstract class with abstract method not declared as a property (missing metadata for
the method)
> Interface with method not declared as a property (missing metadata for the method)
> Concrete class with missing public no-args constructor

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