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

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


       
        // then
        assertEquals(oid, adapter.getOid());
        assertEquals(ResolveState.GHOST, adapter.getResolveState());

        final SimpleEntity epv = (SimpleEntity)adapter.getObject();
        assertEquals("Fred", epv.getName());
        assertNotNull(adapter.getVersion());
    }
View Full Code Here


    }

    @Test
    public void recreateObject_valuePreserved() throws Exception {
        recreatedAdapter = mementoForEpv1.recreateObject();
        final SimpleEntity recreatedObject = (SimpleEntity)recreatedAdapter.getObject();
        assertEquals("Fred", recreatedObject.getName());
    }
View Full Code Here

    @Test
    public void recreateObject_referencePreserved() throws Exception {
        recreatedAdapter = mementoForEpr1.recreateObject();
        final ReferencingEntity recreatedObject = (ReferencingEntity)recreatedAdapter.getObject();
        final SimpleEntity reference1 = recreatedObject.getReference();
        assertNotNull(reference1);
       
        assertThat("Fred", equalTo(reference1.getName()));
    }
View Full Code Here

        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"));
       
        final ReferencingEntity secondObj = (ReferencingEntity)hetrogenousCollection.get(1);
        final SimpleEntity reference1 = secondObj.getReference();
        assertThat(reference1.getName(), is("Fred"));
       
        assertSame(firstObj, reference1);
    }
View Full Code Here

        final Set<Object> objects = persistor.loadData(reader);

        assertEquals(1, objects.size());
        final Object object = objects.toArray()[0];
        assertThat(object instanceof SimpleEntity, is(true));
        final SimpleEntity epv = (SimpleEntity) object;
        assertEquals("Fred Smith", epv.getName());
       
        assertEquals(dateFormat.parse("08-Mar-2010 01:00 GMT"), epv.getDate());
    }
View Full Code Here


    @Test
    public void saveObjectAddedToList() throws Exception {
       
        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);
View Full Code Here

       
        // then find none
        assertFalse(hasInstances);
       
        // given now persisted
        final SimpleEntity epv2 = iswf.fixtures.smpl2;
        epv2.setName("foo");
        epv2.setDate(new Date());
        epv2.setNullable(1234567890L);
        epv2.setSize(123);
       
        iswf.persist(epv2);

        iswf.bounceSystem();
       
View Full Code Here

        iswf.bounceSystem();
       
        // when change
        adapter = iswf.reload(oid);
       
        SimpleEntity epv = (SimpleEntity) adapter.getObject();
        epv.setName("changed");

        iswf.bounceSystem();

        // then found
        List<ObjectAdapter> retrievedInstance = getStore().loadInstancesAndAdapt(new PersistenceQueryFindByTitle(epvSpecification, adapter.titleString()));
View Full Code Here

        // when destroy
        iswf.beginTran();
        adapter = iswf.reload(oid);
       
        SimpleEntity epv = (SimpleEntity) adapter.getObject();
        iswf.destroy(epv);
        iswf.commitTran();

        iswf.bounceSystem();
View Full Code Here

       
        // then
        assertEquals(oid, adapter.getOid());
        assertEquals(ResolveState.GHOST, adapter.getResolveState());

        final SimpleEntity epv = (SimpleEntity)adapter.getObject();
        assertEquals("Fred", epv.getName());
        assertNotNull(adapter.getVersion());
    }
View Full Code Here

TOP

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

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.