Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.MockObjRelationship


public class FlattenedArcKeyTest extends TestCase {

    public void testAttributes() {
        ObjectId src = new ObjectId("X");
        ObjectId target = new ObjectId("Y");
        MockObjRelationship r1 = new MockObjRelationship("r1");
        r1.setReverseRelationship(new MockObjRelationship("r2"));

        FlattenedArcKey update = new FlattenedArcKey(src, target, r1);

        assertSame(src, update.sourceId);
        assertSame(target, update.destinationId);
        assertSame(r1, update.relationship);
        assertSame(r1.getReverseRelationship(), update.reverseRelationship);
        assertTrue(update.isBidirectional());
    }
View Full Code Here


    }

    public void testEquals() {
        ObjectId src = new ObjectId("X");
        ObjectId target = new ObjectId("Y");
        MockObjRelationship r1 = new MockObjRelationship("r1");
        r1.setReverseRelationship(new MockObjRelationship("r2"));

        FlattenedArcKey update = new FlattenedArcKey(src, target, r1);
        FlattenedArcKey update1 = new FlattenedArcKey(target, src, r1
                .getReverseRelationship());

        FlattenedArcKey update2 = new FlattenedArcKey(
                target,
                src,
                new MockObjRelationship("r3"));

        assertTrue(update.equals(update1));
        assertFalse(update.equals(update2));
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.MockObjRelationship

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.