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

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


       
        iswf.beginTran();
        UnidirReferencedEntity referencedEntity1 = referencedRepo.list().get(0);
        UnidirReferencedEntity referencedEntity2 = referencedRepo.list().get(1);
       
        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
        referencingEntity1.setName("Referencing 1");
        referencingEntity1.setReferenced(referencedEntity1);
       
        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
        referencingEntity2.setName("Referencing 2");
        referencingEntity2.setReferenced(referencedEntity1);

        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
        referencingEntity3.setName("Referencing 3");
        referencingEntity3.setReferenced(referencedEntity2);

        iswf.commitTran();
       
        iswf.bounceSystem();
       
        iswf.beginTran();
        List<UnidirReferencingEntity> list = referencingRepo.list();
        referencingEntity1 = list.get(0);
        referencingEntity2 = list.get(1);
        referencingEntity3 = list.get(2);
       
        assertThat(referencingEntity1.getReferenced(), is(not(nullValue())));
        assertThat(referencingEntity2.getReferenced(), is(not(nullValue())));
        assertThat(referencingEntity3.getReferenced(), is(not(nullValue())));
       
        assertThat(referencingEntity1.getReferenced(), is(referencingEntity1.getReferenced()));
        assertThat(referencingEntity1.getReferenced(), is(not(referencingEntity3.getReferenced())));
        iswf.commitTran();
    }
View Full Code Here


        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
        referencedEntity1.setName("Referenced 1");
        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
        referencedEntity2.setName("Referenced 2");

        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
        referencingEntity1.setName("Referencing 1");
        referencingEntity1.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
        referencingEntity2.setName("Referencing 2");
        referencingEntity2.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
        referencingEntity3.setName("Referencing 3");
        referencingEntity3.setReferenced(referencedEntity2);
        iswf.commitTran();
       
        iswf.bounceSystem();
       
        iswf.beginTran();
        List<UnidirReferencingEntity> list = referencingRepo.list();
        referencingEntity1 = list.get(0);
        referencingEntity2 = list.get(1);
        referencingEntity3 = list.get(2);
       
        assertThat(referencingEntity1.getReferenced(), is(not(nullValue())));
        assertThat(referencingEntity2.getReferenced(), is(not(nullValue())));
        assertThat(referencingEntity3.getReferenced(), is(not(nullValue())));
       
        assertThat(referencingEntity1.getReferenced(), is(referencingEntity1.getReferenced()));
        assertThat(referencingEntity1.getReferenced(), is(not(referencingEntity3.getReferenced())));
        iswf.commitTran();
    }
View Full Code Here

        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
        referencedEntity1.setName("Referenced 1");
        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
        referencedEntity2.setName("Referenced 2");

        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
        referencingEntity1.setName("Referencing 1");
        referencingEntity1.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
        referencingEntity2.setName("Referencing 2");
        referencingEntity2.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
        referencingEntity3.setName("Referencing 3");
        referencingEntity3.setReferenced(referencedEntity2);
       
        iswf.commitTran();
       
        // when ...
        iswf.bounceSystem();
View Full Code Here

        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
        referencedEntity1.setName("Referenced 1");
        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
        referencedEntity2.setName("Referenced 2");

        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
        referencingEntity1.setName("Referencing 1");
        referencingEntity1.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
        referencingEntity2.setName("Referencing 2");
        referencingEntity2.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
        referencingEntity3.setName("Referencing 3");
        referencingEntity3.setReferenced(referencedEntity2);

        iswf.commitTran();

        TypedOid referencingOid2 = (TypedOid) iswf.adapterFor(referencingEntity2).getOid();
View Full Code Here

        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
        referencedEntity1.setName("Referenced 1");
        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
        referencedEntity2.setName("Referenced 2");

        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
        referencingEntity1.setName("Referencing 1");
        referencingEntity1.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
        referencingEntity2.setName("Referencing 2");
        referencingEntity2.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
        referencingEntity3.setName("Referencing 3");
        referencingEntity3.setReferenced(referencedEntity2);

        iswf.commitTran();

        TypedOid referencingOid2 = (TypedOid) iswf.adapterFor(referencingEntity2).getOid();
View Full Code Here

        iswf.bounceSystem();
       
        iswf.beginTran();
        UnidirReferencedEntity referencedEntity1 = referencedRepo.list().get(0);
       
        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
        referencingEntity1.setName("Referencing 1");
        referencingEntity1.setReferenced(referencedEntity1);
       
        iswf.commitTran();
       
        iswf.bounceSystem();
       
        iswf.beginTran();
        List<UnidirReferencingEntity> list = referencingRepo.list();
        referencingEntity1 = list.get(0);
       
        assertThat(referencingEntity1.referenced, is(nullValue())); // lazy loading
        UnidirReferencedEntity referenced = referencingEntity1.getReferenced();
        ObjectAdapter referencedAdapter = iswf.adapterFor(referenced);
        assertThat(referencedAdapter.getResolveState(), is(ResolveState.RESOLVED));
        assertThat(referenced, is(not(nullValue())));
       
        iswf.commitTran();
View Full Code Here

TOP

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

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.