Search in sources :

Example 1 with AddVolumeDbInfo

use of com.cubrid.cubridmanager.core.cubrid.dbspace.model.AddVolumeDbInfo in project cubrid-manager by CUBRID.

the class AddVolumeDialog method okPressed.

/**
	 * When press ok button,call it
	 */
public void okPressed() {
    if (!verify()) {
        return;
    }
    String sPathText = pathText.getText().trim();
    String sizeNeedMb = volumeSizetext.getText().trim();
    purpose = purposeCombo.getText().trim();
    String msg = Messages.bind(Messages.msgConfirmAdd, sizeNeedMb, purpose);
    if (!CommonUITool.openConfirmBox(null, msg)) {
        return;
    }
    addVolumeDbInfo = new AddVolumeDbInfo();
    addVolumeDbInfo.setPath(sPathText);
    addVolumeDbInfo.setNumberofpage(String.valueOf(calcVolumePageNum()));
    addVolumeDbInfo.setSize_need_mb(sizeNeedMb + "(MB)");
    addVolumeDbInfo.setPurpose(purpose);
    addVolumeDbInfo.setVolname("");
    addVolumeDbInfo.setDbname(selection.getDatabase().getName());
    performTask(addVolumeDbInfo);
}
Also used : AddVolumeDbInfo(com.cubrid.cubridmanager.core.cubrid.dbspace.model.AddVolumeDbInfo)

Example 2 with AddVolumeDbInfo

use of com.cubrid.cubridmanager.core.cubrid.dbspace.model.AddVolumeDbInfo in project cubrid-manager by CUBRID.

the class AddVolumeDbTaskTest method testExecute.

public void testExecute() {
    String dbName = testDbName;
    GetAddVolumeStatusInfo getAddVolumeStatusInfo = new GetAddVolumeStatusInfo();
    final CommonQueryTask<GetAddVolumeStatusInfo> statusTask = new CommonQueryTask<GetAddVolumeStatusInfo>(serverInfo, CommonSendMsg.getCommonDatabaseSendMsg(), getAddVolumeStatusInfo);
    statusTask.setDbName(dbName);
    statusTask.execute();
    getAddVolumeStatusInfo = statusTask.getResultModel();
    assertNotNull(getAddVolumeStatusInfo);
    String volpath = getAddVolumeStatusInfo.getVolpath();
    assertNotNull(volpath);
    AddVolumeDbInfo addVolumeDbInfo = new AddVolumeDbInfo();
    addVolumeDbInfo.setDbname(dbName);
    addVolumeDbInfo.setPurpose("generic");
    addVolumeDbInfo.setPath(volpath);
    addVolumeDbInfo.setSize_need_mb("40");
    addVolumeDbInfo.setNumberofpage("10000");
    AddVolumeDbTask addTask = new AddVolumeDbTask(serverInfo);
    addTask.setDbname(dbName);
    addTask.setVolname(addVolumeDbInfo.getVolname());
    addTask.setPurpose(addVolumeDbInfo.getPurpose());
    addTask.setPath(addVolumeDbInfo.getPath());
    addTask.setNumberofpages(addVolumeDbInfo.getNumberofpage());
    addTask.setSizeNeedMb(addVolumeDbInfo.getSize_need_mb());
    //addTask.execute();
    assertNull(addTask.getErrorMsg());
}
Also used : AddVolumeDbInfo(com.cubrid.cubridmanager.core.cubrid.dbspace.model.AddVolumeDbInfo) CommonQueryTask(com.cubrid.cubridmanager.core.common.task.CommonQueryTask) GetAddVolumeStatusInfo(com.cubrid.cubridmanager.core.cubrid.dbspace.model.GetAddVolumeStatusInfo)

Aggregations

AddVolumeDbInfo (com.cubrid.cubridmanager.core.cubrid.dbspace.model.AddVolumeDbInfo)2 CommonQueryTask (com.cubrid.cubridmanager.core.common.task.CommonQueryTask)1 GetAddVolumeStatusInfo (com.cubrid.cubridmanager.core.cubrid.dbspace.model.GetAddVolumeStatusInfo)1