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

Examples of org.apache.isis.core.tck.dom.scalars.PrimitiveValuedEntity


    @Test
    public void transient_then_persistent() throws Exception {
       
        iswf.beginTran();
        PrimitiveValuedEntity entity = repo.newEntity();
        ObjectAdapter adapter = iswf.adapterFor(entity);
       
        assertThat(adapter.isTransient(), is(true));
        assertThat(adapter.getResolveState(), is(ResolveState.TRANSIENT));
        assertThat(adapter.getOid().isTransient(), is(true));
       
        entity.setId(1);
        iswf.commitTran();
       
        iswf.bounceSystem();
       
        iswf.beginTran();
View Full Code Here


    @Test
    public void updated_and_retrieved() throws Exception {

        // given persisted
        iswf.beginTran();
        PrimitiveValuedEntity entity = repo.newEntity();
        ObjectAdapter adapter = iswf.adapterFor(entity);
       
        entity.setId(1);
        entity.setCharProperty('X');
       
        iswf.commitTran();
       
        // when update
        iswf.bounceSystem();

        iswf.beginTran();
        entity = repo.list().get(0);
        entity.setCharProperty('Y');
        iswf.commitTran();

        // then adapter's state is resolved
        iswf.bounceSystem();
       
        iswf.beginTran();
        entity = repo.list().get(0);
        assertThat(entity.getCharProperty(), is('Y'));
       
        adapter = iswf.adapterFor(entity);
        assertThat(adapter.getResolveState(), is(ResolveState.RESOLVED));
       
        iswf.commitTran();
View Full Code Here

    @Test
    public void persist_dontBounce_listAll() throws Exception {
       
        iswf.beginTran();
        PrimitiveValuedEntity entity = repo.newEntity();
        entity.setId(1);
        entity = repo.newEntity();
        entity.setId(2);
        iswf.commitTran();

        // don't bounce
        iswf.beginTran();
        List<PrimitiveValuedEntity> list = repo.list();
View Full Code Here

    @Test
    public void persist_then_update() throws Exception {
       
        iswf.beginTran();
        PrimitiveValuedEntity entity = repo.newEntity();
        entity.setId(1);
       
        entity.setBooleanProperty(false);
        entity.setByteProperty((byte)456);
        entity.setDoubleProperty(123456789876.0);
        entity.setFloatProperty(654321.0f);
        entity.setIntProperty(765);
        entity.setLongProperty(7654321012345L);
        entity.setShortProperty((short)543);
        entity.setCharProperty('A');
       
        iswf.commitTran();

        iswf.bounceSystem();
       
        iswf.beginTran();
        entity = repo.list().get(0);

        assertThat(entity.getBooleanProperty(), is(false));
        assertThat(entity.getByteProperty(), is((byte)456));
        assertThat(entity.getDoubleProperty(), is(123456789876.0));
        assertThat(entity.getFloatProperty(), is(654321.0f));
        assertThat(entity.getIntProperty(), is(765));
        assertThat(entity.getLongProperty(), is(7654321012345L));
        assertThat(entity.getShortProperty(), is((short)543));
        assertThat(entity.getCharProperty(), is('A'));

       
        entity.setBooleanProperty(true);
        entity.setByteProperty((byte)123);
        entity.setDoubleProperty(9876543210987.0);
        entity.setFloatProperty(123456.0f);
        entity.setIntProperty(456);
        entity.setLongProperty(12345678901L);
        entity.setShortProperty((short)4567);
        entity.setCharProperty('X');

        iswf.commitTran();

        iswf.bounceSystem();
       
        iswf.beginTran();
        entity = repo.list().get(0);

        assertThat(entity.getBooleanProperty(), is(true));
        assertThat(entity.getByteProperty(), is((byte)123));
        assertThat(entity.getDoubleProperty(), is(9876543210987.0));
        assertThat(entity.getFloatProperty(), is(123456.0f));
        assertThat(entity.getIntProperty(), is(456));
        assertThat(entity.getLongProperty(), is(12345678901L));
        assertThat(entity.getShortProperty(), is((short)4567));
        assertThat(entity.getCharProperty(), is('X'));
       
        iswf.commitTran();
    }
View Full Code Here

    }

    @Ignore
    @Test
    public void canCreateScalarEntityItem() throws Exception {
        final PrimitiveValuedEntity newItem = primitivesEntityRepository.newEntity();
        assertThat(newItem, is(not(nullValue())));
        assertThat(getDomainObjectContainer().isPersistent(newItem), is(true));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.tck.dom.scalars.PrimitiveValuedEntity

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.