Search in sources :

Example 11 with ClientContext

use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.

the class ActionControllerTest method performActionForFloat.

private void performActionForFloat(final String containerType, final String endpoint, final String action, final float result, final Param... params) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<ActionTestBean> controller = createController(context, ACTION_CONTROLLER_NAME);
        invoke(controller, action, containerType, params);
        Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), result);
        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) ActionTestBean(com.canoo.dolphin.integration.action.ActionTestBean)

Example 12 with ClientContext

use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.

the class ConnectionTest method testConnection.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if the client API can create a connection to the server")
public void testConnection(String containerType, String endpoint) {
    try {
        ClientContext context = connect(endpoint);
        Assert.assertNotNull(context);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create connection for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) Test(org.testng.annotations.Test)

Example 13 with ClientContext

use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.

the class ControllerWithoutModelTest method testCreateController.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if all bean types of Dolphin Platform can be injected in a controller")
public void testCreateController(String containerType, String endpoint) {
    try {
        ClientContext context = connect(endpoint);
        ControllerProxy controller = createController(context, CONTROLLER_WITHOUT_MODEL_NAME);
        Assert.assertNull(controller.getModel());
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Error in test for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) ControllerProxy(com.canoo.platform.remoting.client.ControllerProxy) Test(org.testng.annotations.Test)

Example 14 with ClientContext

use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.

the class EnterpriseControllerTest 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<EnterpriseTestBean> controller = createController(context, ENTERPRISE_CONTROLLER_NAME);
        Assert.assertNotNull(controller);
        Assert.assertNotNull(controller.getModel());
        Assert.assertEquals(controller.getModel().getClass(), EnterpriseTestBean.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) EnterpriseTestBean(com.canoo.dolphin.integration.enterprise.EnterpriseTestBean) Test(org.testng.annotations.Test)

Example 15 with ClientContext

use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.

the class ActionControllerTest method performActionForBigInteger.

private void performActionForBigInteger(final String containerType, final String endpoint, final String action, final BigInteger result, final Param... params) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<ActionTestBean> controller = createController(context, ACTION_CONTROLLER_NAME);
        invoke(controller, action, containerType, params);
        Assert.assertEquals(controller.getModel().getBigIntegerValue(), result);
        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) ActionTestBean(com.canoo.dolphin.integration.action.ActionTestBean)

Aggregations

ClientContext (com.canoo.platform.remoting.client.ClientContext)53 Test (org.testng.annotations.Test)37 ActionTestBean (com.canoo.dolphin.integration.action.ActionTestBean)22 PropertyTestBean (com.canoo.dolphin.integration.property.PropertyTestBean)8 ParentTestBean (com.canoo.dolphin.integration.parentchild.ParentTestBean)6 QualifierTestBean (com.canoo.dolphin.integration.qualifier.QualifierTestBean)6 QualifierTestSubBean (com.canoo.dolphin.integration.qualifier.QualifierTestSubBean)6 Param (com.canoo.platform.remoting.client.Param)5 ClientContextFactory (com.canoo.platform.remoting.client.ClientContextFactory)4 EnterpriseTestBean (com.canoo.dolphin.integration.enterprise.EnterpriseTestBean)3 URI (java.net.URI)3 ClientConfiguration (com.canoo.platform.client.ClientConfiguration)2 Scene (javafx.scene.Scene)2 BeanTestBean (com.canoo.dolphin.integration.bean.BeanTestBean)1 ChildTestBean (com.canoo.dolphin.integration.parentchild.ChildTestBean)1 ClientModelStore (com.canoo.dp.impl.client.legacy.ClientModelStore)1 AbstractClientConnector (com.canoo.dp.impl.client.legacy.communication.AbstractClientConnector)1 StrictClientSessionResponseHandler (com.canoo.dp.impl.platform.client.session.StrictClientSessionResponseHandler)1 Assert (com.canoo.dp.impl.platform.core.Assert)1 OptimizedJsonCodec (com.canoo.dp.impl.remoting.codec.OptimizedJsonCodec)1