Search in sources :

Example 1 with PropertyTestBean

use of com.canoo.dolphin.integration.property.PropertyTestBean in project dolphin-platform by canoo.

the class PropertyControllerTest method testNoChangeForSameValue.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if all unsubscribe for changes is working")
public void testNoChangeForSameValue(String containerType, String endpoint) {
    try {
        ClientContext context = connect(endpoint);
        ControllerProxy<PropertyTestBean> controller = createController(context, PROPERTY_CONTROLLER_NAME);
        invoke(controller, SET_TO_DEFAULTS_ACTION, containerType);
        invoke(controller, ADD_CHANGE_LISTENER, containerType);
        controller.getModel().setBigDecimalValue(BIG_DECIMAL_VALUE);
        controller.getModel().setBigIntegerValue(BIG_INTEGER_VALUE);
        controller.getModel().setBooleanValue(BOOLEAN_VALUE);
        controller.getModel().setByteValue(BYTE_VALUE);
        controller.getModel().setCalendarValue(CALENDAR_VALUE);
        controller.getModel().setDateValue(DATE_VALUE);
        controller.getModel().setDoubleValue(DOUBLE_VALUE);
        controller.getModel().setEnumValue(ENUM_VALUE);
        controller.getModel().setFloatValue(FLOAT_VALUE);
        controller.getModel().setIntegerValue(INTEGER_VALUE);
        controller.getModel().setLongValue(LONG_VALUE);
        controller.getModel().setShortValue(SHORT_VALUE);
        controller.getModel().setStringValue(STRING_VALUE);
        controller.getModel().setUuidValue(UUID_VALUE);
        invoke(controller, PING, containerType);
        Assert.assertFalse(controller.getModel().getBigDecimalValueChanged());
        Assert.assertFalse(controller.getModel().getBigIntegerValueChanged());
        Assert.assertFalse(controller.getModel().getBooleanValueChanged());
        Assert.assertFalse(controller.getModel().getByteValueChanged());
        Assert.assertFalse(controller.getModel().getCalenderValueChanged());
        Assert.assertFalse(controller.getModel().getDateValueChanged());
        Assert.assertFalse(controller.getModel().getDoubleValueChanged());
        Assert.assertFalse(controller.getModel().getEnumValueChanged());
        Assert.assertFalse(controller.getModel().getFloatValueChanged());
        Assert.assertFalse(controller.getModel().getIntegerValueChanged());
        Assert.assertFalse(controller.getModel().getLongValueChanged());
        Assert.assertFalse(controller.getModel().getShortValueChanged());
        Assert.assertFalse(controller.getModel().getStringValueChanged());
        Assert.assertFalse(controller.getModel().getUuidValueChanged());
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) PropertyTestBean(com.canoo.dolphin.integration.property.PropertyTestBean) Test(org.testng.annotations.Test)

Example 2 with PropertyTestBean

use of com.canoo.dolphin.integration.property.PropertyTestBean in project dolphin-platform by canoo.

the class PropertyControllerTest method testPropertyNullValueCreating.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if all property have an null value by default")
public void testPropertyNullValueCreating(String containerType, String endpoint) {
    try {
        ClientContext context = connect(endpoint);
        ControllerProxy<PropertyTestBean> controller = createController(context, PROPERTY_CONTROLLER_NAME);
        Assert.assertNull(controller.getModel().getUuidValue());
        Assert.assertNull(controller.getModel().getStringValue());
        Assert.assertNull(controller.getModel().getShortValue());
        Assert.assertNull(controller.getModel().getLongValue());
        Assert.assertNull(controller.getModel().getIntegerValue());
        Assert.assertNull(controller.getModel().getBigDecimalValue());
        Assert.assertNull(controller.getModel().getBigIntegerValue());
        Assert.assertNull(controller.getModel().getBooleanValue());
        Assert.assertNull(controller.getModel().getByteValue());
        Assert.assertNull(controller.getModel().getCalendarValue());
        Assert.assertNull(controller.getModel().getDateValue());
        Assert.assertNull(controller.getModel().getDoubleValue());
        Assert.assertNull(controller.getModel().getEnumValue());
        Assert.assertNull(controller.getModel().getFloatValue());
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) PropertyTestBean(com.canoo.dolphin.integration.property.PropertyTestBean) Test(org.testng.annotations.Test)

Example 3 with PropertyTestBean

use of com.canoo.dolphin.integration.property.PropertyTestBean in project dolphin-platform by canoo.

the class PropertyControllerTest method testCreateController.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if controller and model can be created")
public void testCreateController(String containerType, String endpoint) {
    try {
        ClientContext context = connect(endpoint);
        ControllerProxy<PropertyTestBean> controller = createController(context, PROPERTY_CONTROLLER_NAME);
        Assert.assertNotNull(controller);
        Assert.assertNotNull(controller.getModel());
        Assert.assertEquals(controller.getModel().getClass(), PropertyTestBean.class);
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) PropertyTestBean(com.canoo.dolphin.integration.property.PropertyTestBean) Test(org.testng.annotations.Test)

Example 4 with PropertyTestBean

use of com.canoo.dolphin.integration.property.PropertyTestBean in project dolphin-platform by canoo.

the class PropertyControllerTest method testPropertyValueSet.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if all property values are snychronized")
public void testPropertyValueSet(String containerType, String endpoint) {
    try {
        ClientContext context = connect(endpoint);
        ControllerProxy<PropertyTestBean> controller = createController(context, PROPERTY_CONTROLLER_NAME);
        invoke(controller, SET_TO_DEFAULTS_ACTION, containerType);
        Assert.assertEquals(controller.getModel().getBigDecimalValue(), BIG_DECIMAL_VALUE);
        Assert.assertEquals(controller.getModel().getBigIntegerValue(), BIG_INTEGER_VALUE);
        Assert.assertEquals(controller.getModel().getBooleanValue(), BOOLEAN_VALUE);
        Assert.assertEquals(controller.getModel().getByteValue(), BYTE_VALUE);
        Assert.assertEquals(controller.getModel().getCalendarValue().getTimeInMillis(), CALENDAR_VALUE.getTimeInMillis());
        Assert.assertEquals(controller.getModel().getDateValue(), DATE_VALUE);
        Assert.assertEquals(controller.getModel().getDoubleValue(), DOUBLE_VALUE);
        Assert.assertEquals(controller.getModel().getEnumValue(), ENUM_VALUE);
        Assert.assertEquals(controller.getModel().getFloatValue(), FLOAT_VALUE);
        Assert.assertEquals(controller.getModel().getIntegerValue(), INTEGER_VALUE);
        Assert.assertEquals(controller.getModel().getLongValue(), LONG_VALUE);
        Assert.assertEquals(controller.getModel().getShortValue(), SHORT_VALUE);
        Assert.assertEquals(controller.getModel().getStringValue(), STRING_VALUE);
        Assert.assertEquals(controller.getModel().getUuidValue(), UUID_VALUE);
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) PropertyTestBean(com.canoo.dolphin.integration.property.PropertyTestBean) Test(org.testng.annotations.Test)

Example 5 with PropertyTestBean

use of com.canoo.dolphin.integration.property.PropertyTestBean in project dolphin-platform by canoo.

the class PropertyControllerTest method testPropertyCreating.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if all property instances are created by default")
public void testPropertyCreating(String containerType, String endpoint) {
    try {
        ClientContext context = connect(endpoint);
        ControllerProxy<PropertyTestBean> controller = createController(context, PROPERTY_CONTROLLER_NAME);
        Assert.assertNotNull(controller.getModel().uuidValueProperty());
        Assert.assertNotNull(controller.getModel().stringValueProperty());
        Assert.assertNotNull(controller.getModel().shortValueProperty());
        Assert.assertNotNull(controller.getModel().longValueProperty());
        Assert.assertNotNull(controller.getModel().integerValueProperty());
        Assert.assertNotNull(controller.getModel().bigDecimalValueProperty());
        Assert.assertNotNull(controller.getModel().bigIntegerValueProperty());
        Assert.assertNotNull(controller.getModel().booleanValueProperty());
        Assert.assertNotNull(controller.getModel().byteValueProperty());
        Assert.assertNotNull(controller.getModel().calendarValueProperty());
        Assert.assertNotNull(controller.getModel().dateValueProperty());
        Assert.assertNotNull(controller.getModel().doubleValueProperty());
        Assert.assertNotNull(controller.getModel().enumValueProperty());
        Assert.assertNotNull(controller.getModel().floatValueProperty());
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) PropertyTestBean(com.canoo.dolphin.integration.property.PropertyTestBean) Test(org.testng.annotations.Test)

Aggregations

PropertyTestBean (com.canoo.dolphin.integration.property.PropertyTestBean)8 ClientContext (com.canoo.platform.remoting.client.ClientContext)8 Test (org.testng.annotations.Test)8