Package org.apache.cayenne

Examples of org.apache.cayenne.MockDataObject


    public void testRegisteredObjectsCount() throws Exception {
        DataContext context = createDataContext();
        assertEquals(0, context.getObjectStore().registeredObjectsCount());

        DataObject o1 = new MockDataObject();
        o1.setObjectId(new ObjectId("T", "key1", "v1"));
        context.getObjectStore().registerNode(o1.getObjectId(), o1);
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // test object with same id
        DataObject o2 = new MockDataObject();
        o2.setObjectId(new ObjectId("T", "key1", "v1"));
        context.getObjectStore().registerNode(o2.getObjectId(), o2);
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // test new object
        DataObject o3 = new MockDataObject();
        o3.setObjectId(new ObjectId("T", "key3", "v3"));
        context.getObjectStore().registerNode(o3.getObjectId(), o3);
        assertEquals(2, context.getObjectStore().registeredObjectsCount());
    }
View Full Code Here


    public void testRegisteredObjectsCount() throws Exception {
        DataContext context = createDataContext();
        assertEquals(0, context.getObjectStore().registeredObjectsCount());

        DataObject o1 = new MockDataObject();
        o1.setObjectId(new ObjectId("T", "key1", "v1"));
        context.getObjectStore().registerNode(o1.getObjectId(), o1);
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // test object with same id
        DataObject o2 = new MockDataObject();
        o2.setObjectId(new ObjectId("T", "key1", "v1"));
        context.getObjectStore().registerNode(o2.getObjectId(), o2);
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // test new object
        DataObject o3 = new MockDataObject();
        o3.setObjectId(new ObjectId("T", "key3", "v3"));
        context.getObjectStore().registerNode(o3.getObjectId(), o3);
        assertEquals(2, context.getObjectStore().registeredObjectsCount());
    }
View Full Code Here

    public void testRegisteredObjectsCount() throws Exception {

        assertEquals(0, context.getObjectStore().registeredObjectsCount());

        DataObject o1 = new MockDataObject();
        o1.setObjectId(new ObjectId("T", "key1", "v1"));
        context.getObjectStore().registerNode(o1.getObjectId(), o1);
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // test object with same id
        DataObject o2 = new MockDataObject();
        o2.setObjectId(new ObjectId("T", "key1", "v1"));
        context.getObjectStore().registerNode(o2.getObjectId(), o2);
        assertEquals(1, context.getObjectStore().registeredObjectsCount());

        // test new object
        DataObject o3 = new MockDataObject();
        o3.setObjectId(new ObjectId("T", "key3", "v3"));
        context.getObjectStore().registerNode(o3.getObjectId(), o3);
        assertEquals(2, context.getObjectStore().registeredObjectsCount());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.MockDataObject

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.