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

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


        createEntity();
        createEntity();
    }

    private PrimitiveValuedEntity createEntity() {
        final PrimitiveValuedEntity pve = primitiveValuesEntityRepository.newEntity();
        pve.setBooleanProperty(true);
        pve.setByteProperty((byte)123);
        pve.setShortProperty((short)32123);
        pve.setCharProperty('a');
        pve.setIntProperty(987654321);
        pve.setLongProperty(2345678901234567890L);
        pve.setFloatProperty(12345678901234567890.1234567890F);
        pve.setDoubleProperty(12345678901234567890.1234567890);
        return pve;
    }
View Full Code Here


    private void testPercentage() {
        assertEquals(Data.percentage, sqlDataClass.getPercentage());
    }

    private void testStandardValueTypesMaxima() {
        final PrimitiveValuedEntity pveMax = sqlDataClass.getPrimitiveValuedEntityMax();

        assertEquals(Data.shortMaxValue, pveMax.getShortProperty());
        assertEquals(Data.intMaxValue, pveMax.getIntProperty());
        assertEquals(Data.longMaxValue, pveMax.getLongProperty());
        assertEquals(Data.doubleMaxValue, pveMax.getDoubleProperty(), 0.00001f); // fails
        // in
        assertEquals(Data.floatMaxValue, pveMax.getFloatProperty(), 0.00001f);
    }
View Full Code Here

        // in
        assertEquals(Data.floatMaxValue, pveMax.getFloatProperty(), 0.00001f);
    }

    private void testStandardValueTypesMinima() {
        final PrimitiveValuedEntity pveMin = sqlDataClass.getPrimitiveValuedEntityMin();

        assertEquals(Data.shortMinValue, pveMin.getShortProperty());
        assertEquals(Data.intMinValue, pveMin.getIntProperty());
        assertEquals(Data.longMinValue, pveMin.getLongProperty());
        assertEquals(Data.doubleMinValue, pveMin.getDoubleProperty(), 0.00001f); // fails
        // in
        // MySQL
        // =
        // infinity
        assertEquals(Data.floatMinValue, pveMin.getFloatProperty(), 0.00001f);
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {

        iswf.beginTran();

        PrimitiveValuedEntity entity = repo.newEntity();
        entity.setId(1);
        entity.setIntProperty(111);

        entity = repo.newEntity();
        entity.setId(2);
        entity.setIntProperty(222);

        entity = repo.newEntity();
        entity.setId(3);
        entity.setIntProperty(333);

        entity = repo.newEntity();
        entity.setId(4);
        entity.setIntProperty(111);

        iswf.commitTran();
    }
View Full Code Here

        .build();

    @Test
    public void whenNoInstances() {
        iswf.beginTran();
        final PrimitiveValuedEntity entity = repo.findById(1);
        assertThat(entity, is(nullValue()));
        iswf.commitTran();
    }
View Full Code Here

        iswf.beginTran();
        repo.newEntity().setId(1);
        iswf.commitTran();
       
        iswf.beginTran();
        final PrimitiveValuedEntity entity = repo.findById(1);
        assertThat(entity, is(not(nullValue())));
        assertThat(entity.getId(), is(1));
        iswf.commitTran();
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {

        iswf.beginTran();

        PrimitiveValuedEntity entity = repo.newEntity();
        entity.setId(1);
        entity.setIntProperty(111);

        entity = repo.newEntity();
        entity.setId(2);
        entity.setIntProperty(222);

        entity = repo.newEntity();
        entity.setId(3);
        entity.setIntProperty(333);

        entity = repo.newEntity();
        entity.setId(4);
        entity.setIntProperty(111);

        iswf.commitTran();

    }
View Full Code Here

    }
   
    @Test
    public void whenOne() throws Exception {
       
        PrimitiveValuedEntity entity;
       
        iswf.beginTran();

        entity = repo.findByNamedQueryFirstOnly("prmv_findByIntProperty", ImmutableMap.of("i", (Object)222));
        assertThat(entity, is(not(nullValue())));
        assertThat(entity.getId(), is(2));

        iswf.commitTran();
    }
View Full Code Here

    }

    @Test
    public void whenTwo() throws Exception {
       
        PrimitiveValuedEntity entity;
       
        iswf.beginTran();

        entity = repo.findByNamedQueryFirstOnly("prmv_findByIntProperty", ImmutableMap.of("i", (Object)111));
        assertThat(entity, is(not(nullValue())));
        assertThat(entity.getId(), is(1));

        iswf.commitTran();
    }
View Full Code Here

    }

    @Test
    public void whenNone() throws Exception {
       
        PrimitiveValuedEntity entity;
       
        iswf.beginTran();

        entity = repo.findByNamedQueryFirstOnly("prmv_findByIntProperty", ImmutableMap.of("i", (Object)999));
        assertThat(entity, is(nullValue()));
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.