Search in sources :

Example 1 with QualifierTestBean

use of com.canoo.dolphin.integration.qualifier.QualifierTestBean in project dolphin-platform by canoo.

the class QualifierControllerTest method testQualifier2.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if QualifierTestSubBean is sync when updating QualifierTestSubBeanTwo")
public void testQualifier2(String containerType, String endpoint) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<QualifierTestBean> controller = createController(context, QUALIFIER_CONTROLLER_NAME);
        // given:
        final QualifierTestSubBean qualifierTestSubBeanOne = controller.getModel().getQualifierTestSubBeanOneValue();
        final QualifierTestSubBean qualifierTestSubBeanTwo = controller.getModel().getQualifierTestSubBeanTwoValue();
        // when:
        setSubBeanValue(qualifierTestSubBeanTwo, 44, true, "Test2");
        invoke(controller, DUMMY_ACTION, containerType);
        // then:
        assertSubBeanValue(qualifierTestSubBeanOne, 44, true, "Test2");
        assertSubBeanValue(qualifierTestSubBeanTwo, 44, true, "Test2");
        // Destroy and Disconnect Controller
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : QualifierTestSubBean(com.canoo.dolphin.integration.qualifier.QualifierTestSubBean) ClientContext(com.canoo.platform.remoting.client.ClientContext) QualifierTestBean(com.canoo.dolphin.integration.qualifier.QualifierTestBean) Test(org.testng.annotations.Test)

Example 2 with QualifierTestBean

use of com.canoo.dolphin.integration.qualifier.QualifierTestBean in project dolphin-platform by canoo.

the class QualifierControllerTest method testQualifierUnbind.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test Qualifier Unbind")
public void testQualifierUnbind(String containerType, String endpoint) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<QualifierTestBean> controller = createController(context, QUALIFIER_CONTROLLER_NAME);
        // given:
        final QualifierTestSubBean qualifierTestSubBeanOne = controller.getModel().getQualifierTestSubBeanOneValue();
        final QualifierTestSubBean qualifierTestSubBeanTwo = controller.getModel().getQualifierTestSubBeanTwoValue();
        // when:
        setSubBeanValue(qualifierTestSubBeanOne, 42, true, "Test1");
        invoke(controller, UNBIND_ACTION, containerType);
        setSubBeanValue(qualifierTestSubBeanOne, 44, false, "Test2");
        // then:
        assertSubBeanValue(qualifierTestSubBeanOne, 44, false, "Test2");
        assertSubBeanValue(qualifierTestSubBeanTwo, 42, true, "Test1");
        // Destroy and Disconnect Controller
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : QualifierTestSubBean(com.canoo.dolphin.integration.qualifier.QualifierTestSubBean) ClientContext(com.canoo.platform.remoting.client.ClientContext) QualifierTestBean(com.canoo.dolphin.integration.qualifier.QualifierTestBean) Test(org.testng.annotations.Test)

Example 3 with QualifierTestBean

use of com.canoo.dolphin.integration.qualifier.QualifierTestBean in project dolphin-platform by canoo.

the class QualifierControllerTest method testQualifier1.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if QualifierTestSubBeanTwo is sync when updating QualifierTestSubBean")
public void testQualifier1(String containerType, String endpoint) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<QualifierTestBean> controller = createController(context, QUALIFIER_CONTROLLER_NAME);
        // given:
        final QualifierTestSubBean qualifierTestSubBeanOne = controller.getModel().getQualifierTestSubBeanOneValue();
        final QualifierTestSubBean qualifierTestSubBeanTwo = controller.getModel().getQualifierTestSubBeanTwoValue();
        // when:
        setSubBeanValue(qualifierTestSubBeanOne, 42, true, "Test1");
        invoke(controller, DUMMY_ACTION, containerType);
        // then:
        assertSubBeanValue(qualifierTestSubBeanOne, 42, true, "Test1");
        assertSubBeanValue(qualifierTestSubBeanTwo, 42, true, "Test1");
        // Destroy and Disconnect Controller
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : QualifierTestSubBean(com.canoo.dolphin.integration.qualifier.QualifierTestSubBean) ClientContext(com.canoo.platform.remoting.client.ClientContext) QualifierTestBean(com.canoo.dolphin.integration.qualifier.QualifierTestBean) Test(org.testng.annotations.Test)

Example 4 with QualifierTestBean

use of com.canoo.dolphin.integration.qualifier.QualifierTestBean in project dolphin-platform by canoo.

the class QualifierControllerTest method testQualifierNotBound.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test Qualifier Not Bound")
public void testQualifierNotBound(String containerType, String endpoint) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<QualifierTestBean> controller = createController(context, QUALIFIER_CONTROLLER_NAME);
        // given:
        final QualifierTestSubBean qualifierTestSubBeanOne = controller.getModel().getQualifierTestSubBeanOneValue();
        final QualifierTestSubBean qualifierTestSubBeanTwo = controller.getModel().getQualifierTestSubBeanTwoValue();
        // when:
        invoke(controller, UNBIND_ACTION, containerType);
        setSubBeanValue(qualifierTestSubBeanOne, 42, true, "Test1");
        invoke(controller, DUMMY_ACTION, containerType);
        // then:
        assertSubBeanValue(qualifierTestSubBeanOne, 42, true, "Test1");
        assertSubBeanValue(qualifierTestSubBeanTwo, null, null, null);
        // Destroy and Disconnect Controller
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : QualifierTestSubBean(com.canoo.dolphin.integration.qualifier.QualifierTestSubBean) ClientContext(com.canoo.platform.remoting.client.ClientContext) QualifierTestBean(com.canoo.dolphin.integration.qualifier.QualifierTestBean) Test(org.testng.annotations.Test)

Example 5 with QualifierTestBean

use of com.canoo.dolphin.integration.qualifier.QualifierTestBean in project dolphin-platform by canoo.

the class QualifierControllerTest method testQualifierRebind.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test Qualifier Rebind")
public void testQualifierRebind(String containerType, String endpoint) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<QualifierTestBean> controller = createController(context, QUALIFIER_CONTROLLER_NAME);
        // given:
        final QualifierTestSubBean qualifierTestSubBeanOne = controller.getModel().getQualifierTestSubBeanOneValue();
        final QualifierTestSubBean qualifierTestSubBeanTwo = controller.getModel().getQualifierTestSubBeanTwoValue();
        // when:
        invoke(controller, UNBIND_ACTION, containerType);
        setSubBeanValue(qualifierTestSubBeanTwo, 42, true, "Test1");
        invoke(controller, BIND_ACTION, containerType);
        // then:
        assertSubBeanValue(qualifierTestSubBeanOne, null, null, null);
        assertSubBeanValue(qualifierTestSubBeanTwo, 42, true, "Test1");
        // Destroy and Disconnect Controller
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : QualifierTestSubBean(com.canoo.dolphin.integration.qualifier.QualifierTestSubBean) ClientContext(com.canoo.platform.remoting.client.ClientContext) QualifierTestBean(com.canoo.dolphin.integration.qualifier.QualifierTestBean) Test(org.testng.annotations.Test)

Aggregations

QualifierTestBean (com.canoo.dolphin.integration.qualifier.QualifierTestBean)6 QualifierTestSubBean (com.canoo.dolphin.integration.qualifier.QualifierTestSubBean)6 ClientContext (com.canoo.platform.remoting.client.ClientContext)6 Test (org.testng.annotations.Test)6