Package org.apache.jdo.tck.pc.company

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


        company.addDepartment(emg);

        // Insure these guys
        DentalInsurance scottDentalIns = new DentalInsurance(
            5001L, "Aetna", scott, new BigDecimal("12000"));
        MedicalInsurance scottMedicalIns = new MedicalInsurance(
            5002L, "Aetna", scott, "PPO");
        DentalInsurance edDentalIns = new DentalInsurance(
            5003L, "BlueCross", ed, new BigDecimal("10000"));
        MedicalInsurance edMedicalIns = new MedicalInsurance(
            5004L, "BlueCross", ed, "EPO");
        scott.setDentalInsurance(scottDentalIns);
        scott.setMedicalInsurance(scottMedicalIns);
        ed.setDentalInsurance(edDentalIns);
        ed.setMedicalInsurance(edMedicalIns);
View Full Code Here


     * 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

    public void testSetToNewFromMappedBySide() {
        testMethod = "testSetToNewFromMappedBySide";
        if (isTestToBePerformed) {
           
            // Set relationship
            MedicalInsurance medInsNew = new MedicalInsurance(99L,
                "Ameriblast", "B");
            pm.makePersistent(medInsNew);
            emp1.setMedicalInsurance(medInsNew);
            Object medInsNewOid = pm.getObjectId((Object)medInsNew);
            pm.flush();
           
            // Postcondition
            deferredAssertTrue(medInsNew.getEmployee() == emp1,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "other side of relationship not set on flush.");
           
            pm.currentTransaction().commit();
            cleanupPM();
            getPM();
           
            pm.currentTransaction().begin();
            emp1 = (Employee)pm.getObjectById(emp1Oid);
            medInsNew = (MedicalInsurance)pm.getObjectById(medInsNewOid);
            medIns1 = (MedicalInsurance)pm.getObjectById(medIns1Oid);
            deferredAssertTrue(medInsNew.getEmployee() == emp1,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "other side of relationship not set in new pm");
            pm.currentTransaction().commit();
           
View Full Code Here

    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

        company.addDepartment(emg);

        // Insure these guys
        DentalInsurance scottDentalIns = new DentalInsurance(
            5001L, "Aetna", scott, new BigDecimal("12000"));
        MedicalInsurance scottMedicalIns = new MedicalInsurance(
            5002L, "Aetna", scott, "PPO");
        DentalInsurance edDentalIns = new DentalInsurance(
            5003L, "BlueCross", ed, new BigDecimal("10000"));
        MedicalInsurance edMedicalIns = new MedicalInsurance(
            5004L, "BlueCross", ed, "EPO");
        scott.setDentalInsurance(scottDentalIns);
        scott.setMedicalInsurance(scottMedicalIns);
        ed.setDentalInsurance(edDentalIns);
        ed.setMedicalInsurance(edMedicalIns);
View Full Code Here

TOP

Related Classes of org.apache.jdo.tck.pc.company.MedicalInsurance

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.