Examples of IMedicalInsurance


Examples of org.apache.jdo.tck.pc.company.IMedicalInsurance

     * do not refer to each other.
     */
    public void testA2BbutNotB2AMappedBy() {
        testMethod = "testA2BbutNotB2AMappedBy";
        if (isTestToBePerformed) {
            IMedicalInsurance medInsNew = new MedicalInsurance(99,
                "The American Company", "B");
            pm.makePersistent(medInsNew);
            medIns2.setEmployee(emp1);
            emp1.setMedicalInsurance(medInsNew);
            doFlush(testMethod);
View Full Code Here

Examples of org.apache.jdo.tck.pc.company.IMedicalInsurance

    public void testSetToNewFromMappedBySide() {
        testMethod = "testSetToNewFromMappedBySide";
        if (isTestToBePerformed) {
           
            // Set relationship
            IMedicalInsurance medInsNew = new MedicalInsurance(99L,
                "Ameriblast", "B");
            pm.makePersistent(medInsNew);
            emp1.setMedicalInsurance(medInsNew);
            Object medInsNewOid = pm.getObjectId((Object)medInsNew);
            pm.flush();
           
            assertFalse(testMethod + ": Test aborted, precondition is false; " +
                "expected medInsNewOid to be non-null", medInsNewOid == null);
           
            // Postcondition
            deferredAssertTrue(medInsNew.getEmployee() == emp1,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "other side of relationship not set on flush.");
            deferredAssertTrue(medIns1.getEmployee() == null,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "previous relationship (medIns1) not nulled on flush.");
           
            pm.currentTransaction().commit();
            cleanupPM();
            getPM();
           
            pm.currentTransaction().begin();
            emp1 = (IEmployee)pm.getObjectById(emp1Oid);
            medInsNew = (IMedicalInsurance)pm.getObjectById(medInsNewOid);
            medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid);
            deferredAssertTrue(medInsNew.getEmployee() == emp1,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "other side of relationship not set in new pm");
            deferredAssertTrue(medIns1.getEmployee() == null,
                ASSERTION_FAILED + testMethod,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.