Package org.apache.isis.core.tck.dom.refs

Examples of org.apache.isis.core.tck.dom.refs.UnidirJoinParentEntity


        iswf.commitTran();

        iswf.bounceSystem();
       
        iswf.beginTran();
        UnidirJoinParentEntity retrievedEntity = repo.list().get(0);
        retrievedEntity.newChild("Child 1 of Parent 1");
        retrievedEntity.newChild("Child 2 of Parent 1");
        retrievedEntity.newChild("Child 3 of Parent 1");
        iswf.commitTran();

        iswf.bounceSystem();
       
        iswf.beginTran();
        retrievedEntity = repo.list().get(0);
        Set<UnidirJoinChildEntity> children = retrievedEntity.getChildren();
        assertThat(children.size(), is(3));
        iswf.commitTran();
    }
View Full Code Here


    @Ignore("Not currently working, is an update")
    @Test
    public void updateBidirectional() throws Exception {
        iswf.beginTran();
        UnidirJoinParentEntity parent1 = repo.newEntity();
        parent1.setName("Parent 1");
        UnidirJoinParentEntity parent2 = repo.newEntity();
        parent2.setName("Parent 2");

        parent1.newChild("Child 1 of Parent 1");
        parent1.newChild("Child 2 of Parent 1");
        parent1.newChild("Child 3 of Parent 1");
        iswf.commitTran();

        iswf.bounceSystem();
       
        iswf.beginTran();
        parent1 = repo.list().get(0);
        parent2 = repo.list().get(0);
        Set<UnidirJoinChildEntity> children = parent1.getChildren();
        assertThat(children.size(), is(3));
        UnidirJoinChildEntity child1 = parent1.getChildren().iterator().next();
        parent1.removeChild(child1);
        parent2.addChild(child1);
        iswf.commitTran();

        iswf.bounceSystem();
       
        iswf.beginTran();
        parent1 = repo.list().get(0);
        parent2 = repo.list().get(0);
        children = parent1.getChildren();
        assertThat(children.size(), is(2));
       
        children = parent2.getChildren();
        assertThat(children.size(), is(1));
        iswf.commitTran();
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.tck.dom.refs.UnidirJoinParentEntity

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.