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

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


    }

    @Test
    public void recreateObject_homogeneousCollectionPreserved() throws Exception {
        recreatedAdapter = mementoForEpc1.recreateObject();
        final ParentEntity recreatedObject = (ParentEntity)recreatedAdapter.getObject();
        final List<SimpleEntity> homogenousCollection = recreatedObject.getHomogeneousCollection();
        assertNotNull(homogenousCollection);
       
        assertThat(homogenousCollection.size(), is(2));
        assertThat(homogenousCollection.get(0).getName(), is("Fred"));
        assertThat(homogenousCollection.get(1).getName(), is("Harry"));
View Full Code Here


    }

    @Test
    public void recreateObject_heterogeneousCollectionPreserved() throws Exception {
        recreatedAdapter = mementoForEpc1.recreateObject();
        final ParentEntity recreatedObject = (ParentEntity)recreatedAdapter.getObject();
        final List<BaseEntity> hetrogenousCollection = recreatedObject.getHeterogeneousCollection();
        assertNotNull(hetrogenousCollection);
       
        assertThat(hetrogenousCollection.size(), is(2));
        final SimpleEntity firstObj = (SimpleEntity)hetrogenousCollection.get(0);
        assertThat(firstObj.getName(), is("Fred"));
View Full Code Here

       
        final SimpleEntity epv = iswf.fixtures.smpl1;
        epv.setName("Fred Smith");
        epv.setDate(new Date(110, 2, 8, 13, 32));
       
        final ParentEntity epc = iswf.fixtures.prnt1;
        epc.getHomogeneousCollection().add(iswf.fixtures.smpl1);
        epc.getHomogeneousCollection().add(iswf.fixtures.smpl2);
        service.save(epc);

        final Set<Object> savedObjects = service.allSavedObjects();
        Assert.assertEquals(3, savedObjects.size());
    }
View Full Code Here

        createEntity("parent 4");
        createEntity("parent 5");
    }

    private ParentEntity createEntity(final String name) {
        final ParentEntity parent = parentEntityRepository.newEntity(name);
        parent.newChild("child 1");
        parent.newChild("child 2");
        return parent;
    }
View Full Code Here

        final ObjectAdapter readObject = objectReader.load(reader2, versionCreator, dataEncrypter);
        assertEquals(oid5, readObject.getOid());
        assertEquals(ResolveState.RESOLVED, readObject.getResolveState());

        final ParentEntity pojo = (ParentEntity) readObject.getObject();
        final List<SimpleEntity> collection2 = pojo.getHomogeneousCollection();
        assertEquals(2, collection2.size());

        assertThat(collection2.get(0), CoreMatchers.instanceOf(SimpleEntity.class));
        assertThat(collection2.get(1), CoreMatchers.instanceOf(SimpleEntity.class));
View Full Code Here

    }

    @Test
    public void recreateObject_heterogeneousCollectionPreserved() throws Exception {
        recreatedAdapter = mementoForEpc1.recreateObject();
        final ParentEntity recreatedObject = (ParentEntity)recreatedAdapter.getObject();
        final List<BaseEntity> hetrogenousCollection = recreatedObject.getHeterogeneousCollection();
        assertNotNull(hetrogenousCollection);
       
        assertThat(hetrogenousCollection.size(), is(2));
        final SimpleEntity firstObj = (SimpleEntity)hetrogenousCollection.get(0);
        assertThat(firstObj.getName(), is("Fred"));
View Full Code Here

    }

    @Test
    public void recreateObject_homogeneousCollectionPreserved() throws Exception {
        recreatedAdapter = mementoForEpc1.recreateObject();
        final ParentEntity recreatedObject = (ParentEntity)recreatedAdapter.getObject();
        final List<SimpleEntity> homogenousCollection = recreatedObject.getHomogeneousCollection();
        assertNotNull(homogenousCollection);
       
        assertThat(homogenousCollection.size(), is(2));
        assertThat(homogenousCollection.get(0).getName(), is("Fred"));
        assertThat(homogenousCollection.get(1).getName(), is("Harry"));
View Full Code Here

TOP

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

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.