use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method getGlusterGeoRepSessionConfig.
private GlusterGeoRepSessionConfiguration getGlusterGeoRepSessionConfig() {
GlusterGeoRepSessionConfiguration sessionConfig = new GlusterGeoRepSessionConfiguration();
sessionConfig.setId(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
sessionConfig.setKey(GEOREP_CONFIG_CRAWL);
sessionConfig.setDescription("Geo-replication session crawl");
sessionConfig.setValue("changelog");
return sessionConfig;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method testGetGlusterGeoRepSessionUnSetConfig.
@Test
public void testGetGlusterGeoRepSessionUnSetConfig() {
GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig();
dao.saveConfig(sessionConfig);
List<GlusterGeoRepSessionConfiguration> unsetSessionConfig = dao.getGlusterGeoRepSessionUnSetConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
assertEquals("use_meta_volume", unsetSessionConfig.get(0).getKey());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method testSaveConfig.
@Test
public void testSaveConfig() {
GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig();
dao.saveConfig(sessionConfig);
List<GlusterGeoRepSessionConfiguration> fetchedSessionConfigList = dao.getGeoRepSessionConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
assertEquals(sessionConfig, fetchedSessionConfigList.get(0));
GlusterGeoRepSessionConfiguration fetchedSessionConfig = dao.getGeoRepSessionConfigByKey(FixturesTool.GLUSTER_GEOREP_SESSION_ID, GEOREP_CONFIG_CRAWL);
assertEquals(sessionConfig, fetchedSessionConfig);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method testUpdateConfig.
@Test
public void testUpdateConfig() {
GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig();
dao.saveConfig(sessionConfig);
sessionConfig.setValue("NEW_VAL");
dao.updateConfig(sessionConfig);
List<GlusterGeoRepSessionConfiguration> fetchedSessionConfig = dao.getGeoRepSessionConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
assertEquals("NEW_VAL", fetchedSessionConfig.get(0).getValue());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.
the class GlusterVolumeGeoReplicationSessionConfigPopupView method initConfigTable.
private void initConfigTable() {
geoReplicationConfigTable = new EntityModelCellTable<>(false, true);
geoReplicationConfigTable.setSelectionModel(new NoSelectionModel());
geoReplicationConfigTable.addColumn(new AbstractEntityModelTextColumn<Pair<Boolean, GlusterGeoRepSessionConfiguration>>() {
@Override
protected String getText(Pair<Boolean, GlusterGeoRepSessionConfiguration> entity) {
return entity.getSecond().getKey();
}
}, constants.optionKeyVolumeParameter(), // $NON-NLS-1$
"150px");
geoReplicationConfigTable.addColumn(new AbstractScrollableTextColumn<EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>>() {
@Override
public String getValue(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
return object.getEntity().getSecond().getDescription() == null ? constants.notAvailableLabel() : object.getEntity().getSecond().getDescription();
}
}, constants.descriptionVolumeParameter(), // $NON-NLS-1$
"300px");
geoReplicationConfigTable.addColumn(new GlusterConfigAwareColumn(), constants.optionValueVolumeParameter(), // $NON-NLS-1$
"200px");
geoReplicationConfigTable.addColumn(new AbstractCheckboxColumn<EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>>(true, (index, object, value) -> object.getEntity().setFirst(value)) {
@Override
protected boolean canEdit(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
return true;
}
@Override
public Boolean getValue(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
return object.getEntity().getFirst();
}
}, constants.resetGeoRepSessionConfig());
}
Aggregations