Search in sources :

Example 1 with ByteTestEntity

use of org.whole.lang.testentities.model.ByteTestEntity in project whole by wholeplatform.

the class FactoriesTest method testDataFactoryMethodsWithPromotions.

@Test
public void testDataFactoryMethodsWithPromotions() {
    TestEntitiesEntityFactory ef = TestEntitiesEntityFactory.instance;
    ByteTestEntity be1 = ef.createByteTestEntity((byte) 23);
    Assert.assertEquals((byte) 23, be1.wByteValue());
    ByteTestEntity be2 = ef.create(TestEntitiesEntityDescriptorEnum.ByteTestEntity, (byte) 23);
    Assert.assertEquals((byte) 23, be2.wByteValue());
    CharTestEntity ce1 = ef.createCharTestEntity('c');
    Assert.assertEquals('c', ce1.wCharValue());
    CharTestEntity ce2 = ef.create(TestEntitiesEntityDescriptorEnum.CharTestEntity, 'c');
    Assert.assertEquals('c', ce2.wCharValue());
    CharTestEntity ce3 = ef.create(TestEntitiesEntityDescriptorEnum.CharTestEntity, (char) 65);
    Assert.assertEquals(65, ce3.wCharValue());
    ShortTestEntity se1 = ef.createShortTestEntity((short) 12345);
    Assert.assertEquals((short) 12345, se1.wShortValue());
    ShortTestEntity se2 = ef.create(TestEntitiesEntityDescriptorEnum.ShortTestEntity, (short) 12345);
    Assert.assertEquals((short) 12345, se2.wShortValue());
}
Also used : ByteTestEntity(org.whole.lang.testentities.model.ByteTestEntity) CharTestEntity(org.whole.lang.testentities.model.CharTestEntity) TestEntitiesEntityFactory(org.whole.lang.testentities.factories.TestEntitiesEntityFactory) ShortTestEntity(org.whole.lang.testentities.model.ShortTestEntity) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 TestEntitiesEntityFactory (org.whole.lang.testentities.factories.TestEntitiesEntityFactory)1 ByteTestEntity (org.whole.lang.testentities.model.ByteTestEntity)1 CharTestEntity (org.whole.lang.testentities.model.CharTestEntity)1 ShortTestEntity (org.whole.lang.testentities.model.ShortTestEntity)1