Package org.apache.jdo.tck.pc.mylib

Examples of org.apache.jdo.tck.pc.mylib.PCRect


            tx.begin();
            p1   = new PCPoint(1,1);
            p1print = p1.toString();
            p2   = new PCPoint(2,2);
            p3   = new PCPoint2(3,3);
            rect = new PCRect(100, p1, p2);
            pm.makePersistent(p1);
            pm.makePersistent(p2);
            pm.makePersistent(p3);
            pm.makePersistent(rect);
            if (debug) {
View Full Code Here


        }
        else {
            pm = getPM();
            pm.currentTransaction().begin();

            PCRect obj = getPersistentNewInstance();
            long beforeValue=obj.getId();
            pm.currentTransaction().commit(); // obj should transition to HOLLOW
            //The next call obj.getId() is a primary key access.
            //The method must not be called inside a transaction,
            //because a JDO implementation must allow primary key accesses
            //outside of transactions.
            long afterValue=obj.getId();
            if (beforeValue!=afterValue) {
                fail(ASSERTION_FAILED,
                     "Key field value incorrect after commit. Expected: " +
                     beforeValue + " Found: " + afterValue);
            }
View Full Code Here

        }
    }

    /** */
    private PCRect getPersistentNewInstance() {
        PCRect obj = new PCRect(0, new PCPoint(1,5), new PCPoint(7,3));
        pm.makePersistent(obj); // obj should transition to persistent-new
        int curr = currentState(obj);
        if( curr != PERSISTENT_NEW ){
            fail(ASSERTION_FAILED,
                 "StateTransitions: Unable to create persistent-new instance " +
View Full Code Here

            tx.begin();
            tx2.begin();
           
            PCPoint p11 = new PCPoint(110, 120);
            PCPoint p12 = new PCPoint(120, 140);
            PCRect rect1 = new PCRect (0, p11, p12);
            pm.makePersistent (rect1);
           
            PCPoint p21 = new PCPoint(210, 220);
            PCPoint p22 = new PCPoint(220, 240);
            PCRect rect2 = new PCRect (0, p21, p22);
            pm2.makePersistent (rect2);
           
            tx.commit();
            tx2.commit();
       
View Full Code Here

        PersistenceManagerFactory pmf2 = JDOHelper.getPersistenceManagerFactory(pmfProperties);
        PersistenceManager pm2 = pmf2.getPersistenceManager();
        Transaction tx2 = pm2.currentTransaction();
        PCPoint p21 = null;
        PCPoint p22 = null;
        PCRect rect2 = null;

        pm = getPM();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            tx2.begin();
           
            PCPoint p11 = new PCPoint(110, 120);
            PCPoint p12 = new PCPoint(120, 140);
            PCRect rect1 = new PCRect (0, p11, p12);
            pm.makePersistent (rect1);
           
            p21 = new PCPoint(210, 220);
            p22 = new PCPoint(220, 240);
            rect2 = new PCRect (0, p21, p22);
            pm2.makePersistent (rect2);
           
            tx.commit();
            tx2.commit();
       
View Full Code Here

        PersistenceManagerFactory pmf2 = JDOHelper.getPersistenceManagerFactory(pmfProperties);
        PersistenceManager pm2 = pmf2.getPersistenceManager();
        Transaction tx2 = pm2.currentTransaction();
        PCPoint p21 = null;
        PCPoint p22 = null;
        PCRect rect2 = null;

        pm = getPM();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            tx2.begin();
           
            PCPoint p11 = new PCPoint(110, 120);
            PCPoint p12 = new PCPoint(120, 140);
            PCRect rect1 = new PCRect (0, p11, p12);
            pm.makePersistent (rect1);
           
            p21 = new PCPoint(210, 220);
            p22 = new PCPoint(220, 240);
            rect2 = new PCRect (0, p21, p22);
            pm2.makePersistent (rect2);
           
            tx.commit();
            tx2.commit();
       
View Full Code Here

   
    /** */
    public void testRefresh() {
        setBothGroup();
        pm.currentTransaction().begin();
        PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false);
        pm.refresh(instance);
        checkBothLoaded(ASSERTION_FAILED, instance);
        pm.currentTransaction().commit();
        failOnError();
    }
View Full Code Here

   
    /** */
    public void testRefreshAllCollection() {
        setBothGroup();
        pm.currentTransaction().begin();
        PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false);
        Collection instances = new HashSet();
        instances.add(instance);
        pm.refreshAll(instances);
        checkBothLoaded(ASSERTION_FAILED, instance);
        pm.currentTransaction().commit();
View Full Code Here

   
    /** */
    public void testRefreshAllArray() {
        setBothGroup();
        pm.currentTransaction().begin();
        PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false);
        Object[] instances = new Object[]{instance};
        pm.refreshAll(instances);
        checkBothLoaded(ASSERTION_FAILED, instance);
        pm.currentTransaction().commit();
        failOnError();
View Full Code Here

    /** */
    public void testRetrieve() {
        setBothGroup();
        pm.currentTransaction().begin();
        PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false);
        pm.retrieve(instance, true);
        checkBothLoaded(ASSERTION_FAILED, instance);
        pm.currentTransaction().commit();
        failOnError();
    }
View Full Code Here

TOP

Related Classes of org.apache.jdo.tck.pc.mylib.PCRect

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.