Examples of TestClassB


Examples of org.apache.ojb.odmg.shared.TestClassB

    }

    private void clearTestData() throws LockingException
    {
        TestClassA a = generateTestData();
        TestClassB b2 = generateAnotherB();
        Transaction tx = _kit.getTransaction(_conn);
        tx.begin();
        Identity oid = _conn.getIdentity(a);
        Identity oidb = _conn.getIdentity(a.getB());
        Identity oidb2 = _conn.getIdentity(b2);
        TestClassA a1 = (TestClassA) _conn.getObjectByIdentity(oid);
        if (a1 != null)
        {
            _conn.deletePersistent(a1);
        }
        TestClassB b1 = (TestClassB) _conn.getObjectByIdentity(oidb);
        if (b1 != null)
        {
            _conn.deletePersistent(b1);
        }
        b2 = (TestClassB) _conn.getObjectByIdentity(oidb2);
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

        TestClassA tca = new TestClassA();
        tca.setOid("someoid");
        tca.setValue1("abc");
        tca.setValue2("123");
        tca.setValue3(5);
        TestClassB tcb = new TestClassB();
        tcb.setOid("boid");
        tcb.setValue1("hi there");
        tca.setB(tcb);
        return tca;
    }
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

        return tca;
    }

    private TestClassB generateAnotherB()
    {
        TestClassB tcb = new TestClassB();
        tcb.setOid("boid2");
        tcb.setValue1("value2");
        return tcb;
    }
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

  }

  public void testMetadataCopy() throws LockingException
  {
    TestClassA tca = generateTestData();
    TestClassB tcb = tca.getB();
    internalTest(m_mdcs, tca, tcb);
  }
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

  }

  public void testSerializedCopy() throws LockingException
  {
    TestClassA tca = generateTestData();
    TestClassB tcb = tca.getB();
    internalTest(m_scs, tca, tcb);
  }
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

  }

  public void testReflectiveCopy() throws LockingException
  {
    TestClassA tca = generateTestData();
    TestClassB tcb = tca.getB();
    internalTest(m_rcs, tca, tcb);
  }
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

  {
    long start = System.currentTimeMillis();
    for (int i = 0; i < ITERATIONS; i++)
    {
      TestClassA tca = generateTestData();
      TestClassB tcb = tca.getB();
      TestClassA copy = (TestClassA) m_scs.copy(tca, m_pb);
    }
    long stop = System.currentTimeMillis();
    System.out.println("testSerializedCopy took: " + (stop - start));
    start = System.currentTimeMillis();
    for (int i = 0; i < ITERATIONS; i++)
    {
      TestClassA tca = generateTestData();
      TestClassB tcb = tca.getB();
      TestClassA copy = (TestClassA) m_mdcs.copy(tca, m_pb);
    }
    stop = System.currentTimeMillis();
    System.out.println("testMetadataCopy took: " + (stop - start));
    start = System.currentTimeMillis();
    for (int i = 0; i < ITERATIONS; i++)
    {
      TestClassA tca = generateTestData();
      TestClassB tcb = tca.getB();
      TestClassA copy = (TestClassA) m_rcs.copy(tca, m_pb);
    }
    stop = System.currentTimeMillis();
    System.out.println("testReflectiveCopy took: " + (stop - start));
  }
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

        tca.setOid("someoid");
        tca.setValue1("abc");
        tca.setValue2("123");
        tca.setValue3(5);
        _conn.makePersistent(tca);
        TestClassB tcb = new TestClassB();
        tcb.setOid("boid");
        tcb.setValue1("hi there");
        _conn.makePersistent(tcb);
        tca.setB(tcb);
      }
      tx.commit();
      m_tca = tca;
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

        deleteData(TestClassB.class);

    TestClassA a1 = new TestClassA();
    TestClassA a2 = new TestClassA();

    TestClassB b1 = new TestClassB();
    TestClassB b2 = new TestClassB();
    a1.setB(b1);
    a2.setB(b2);

    Transaction tx = odmg.newTransaction();
    tx.begin();
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassB

        TestClassA a = generateTestData();
        Transaction tx = _kit.getTransaction(_conn);
        tx.begin();
        _conn.makePersistent(a.getB());
        _conn.makePersistent(a);
    TestClassB b = a.getB();
        tx.commit();
        /**
        * clear to start test
        */
        _conn.invalidateAll();
        tx = _kit.getTransaction(_conn);
        tx.begin();
        /**
     * load B
     */
    Identity oidb = _conn.getIdentity(b);
        TestClassB b1 = (TestClassB) _conn.getObjectByIdentity(oidb);
        assertTrue(b1 != null);
    /**
     * load A
      */
    Identity oida = _conn.getIdentity(a);
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.