use of com.canoo.dolphin.integration.qualifier.QualifierTestSubBean 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);
}
}
use of com.canoo.dolphin.integration.qualifier.QualifierTestSubBean 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);
}
}
use of com.canoo.dolphin.integration.qualifier.QualifierTestSubBean in project dolphin-platform by canoo.
the class QualifierControllerTest method testQualifierChangeAfterRebind.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test Qualifier Change After Rebind")
public void testQualifierChangeAfterRebind(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, BIND_ACTION, containerType);
setSubBeanValue(qualifierTestSubBeanTwo, 44, false, "Test2");
// then:
assertSubBeanValue(qualifierTestSubBeanOne, 44, false, "Test2");
assertSubBeanValue(qualifierTestSubBeanTwo, 44, false, "Test2");
// Destroy and Disconnect Controller
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
Aggregations