use of com.haulmont.cuba.gui.components.OptionsGroup in project cuba by cuba-platform.
the class OptionsGroupDsTest method testUnsubscribeDsListener.
@Test
public void testUnsubscribeDsListener() {
OptionsGroup optionsGroup = (OptionsGroup) factory.createComponent(OptionsGroup.NAME);
Datasource<Role> roleDs = getTestRoleDatasource();
optionsGroup.setDatasource(roleDs, "type");
optionsGroup.setValue(RoleType.STANDARD);
optionsGroup.setDatasource(null, null);
Datasource.ItemPropertyChangeListener<Role> listener = e -> {
throw new RuntimeException("");
};
roleDs.addItemPropertyChangeListener(listener);
optionsGroup.setValue(RoleType.DENYING);
assertEquals(RoleType.STANDARD, roleDs.getItem().getType());
}
use of com.haulmont.cuba.gui.components.OptionsGroup in project cuba by cuba-platform.
the class OptionsGroupDsTest method testSetValue.
@Test
public void testSetValue() {
OptionsGroup optionsGroup = (OptionsGroup) factory.createComponent(OptionsGroup.NAME);
Datasource<Role> roleDs = getTestRoleDatasource();
optionsGroup.setDatasource(roleDs, "type");
optionsGroup.setValue(RoleType.DENYING);
assertNotNull(optionsGroup.getValue());
}
Aggregations