Package org.apache.jdo.tck.pc.singlefieldidentity

Examples of org.apache.jdo.tck.pc.singlefieldidentity.Person


    /** */
    public void testConcreteSuperclassExact() {
        if (!runsWithApplicationIdentity()) return;
        Transaction tx = null;
        Person instance = null;
        try {
            pm = getPM();
            pm.currentTransaction().begin();
            // create the oid
            Object superclassOid = new LongIdentity(Person.class, id);
            instance = (Person)pm.getObjectById(superclassOid, false);
            if (instance.getClass() != Person.class) {
                appendMessage(ASSERTION_FAILED + "getObjectById exact for "
                        + "concrete superclass should return "
                        + "Person.class but returned wrong type "
                        + instance.getClass().getName());
            }
        } catch (Exception ex) {
            appendMessage(ASSERTION_FAILED + "getObjectById exact for " +
                    "concrete superclass must succeed before accessing database.");
        }
        try {
            instance.toString(); // accesses non-key fields
            appendMessage(ASSERTION_FAILED + "getObjectById exact for "
                    + "concrete superclass must fail when accessing database.");
        } catch (JDOException ex) {
            // good catch
        }
View Full Code Here

TOP

Related Classes of org.apache.jdo.tck.pc.singlefieldidentity.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.