Search in sources :

Example 51 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class RequestableStep method exportVariableDefinition.

public void exportVariableDefinition() throws EngineException {
    for (StepVariable stepVariable : getVariables()) {
        String variableName = stepVariable.getName();
        if (sequence.getVariable(variableName) == null) {
            if (!StringUtils.isNormalized(variableName))
                throw new EngineException("Variable name is not normalized : \"" + variableName + "\".");
            RequestableVariable requestableVariable = stepVariable.isMultiValued() ? new RequestableMultiValuedVariable() : new RequestableVariable();
            requestableVariable.setName(variableName);
            requestableVariable.setComment(stepVariable.getComment());
            requestableVariable.setDescription(stepVariable.getDescription());
            requestableVariable.setComment(stepVariable.getComment());
            requestableVariable.setRequired(stepVariable.isRequired());
            requestableVariable.setValueOrNull(stepVariable.getValueOrNull());
            requestableVariable.setVisibility(stepVariable.getVisibility());
            sequence.addVariable(requestableVariable);
            requestableVariable.bNew = true;
            requestableVariable.hasChanged = true;
            sequence.hasChanged = true;
        }
    }
}
Also used : EngineException(com.twinsoft.convertigo.engine.EngineException) RequestableMultiValuedVariable(com.twinsoft.convertigo.beans.variables.RequestableMultiValuedVariable) RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable) StepVariable(com.twinsoft.convertigo.beans.variables.StepVariable)

Example 52 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class Sequence method clone.

@Override
public Sequence clone() throws CloneNotSupportedException {
    Sequence clonedObject = (Sequence) super.clone();
    clonedObject.variables = new HashMap<String, Object>();
    clonedObject.cloneNumber = ++cloneNumber;
    clonedObject.vVariables = new ArrayList<RequestableVariable>();
    clonedObject.vTestCases = new ArrayList<TestCase>();
    clonedObject.vAllVariables = null;
    clonedObject.nbAsyncThreadRunning = 0;
    clonedObject.xpathApi = null;
    clonedObject.stepHttpState = null;
    clonedObject.transactionSessionId = null;
    clonedObject.copies = null;
    clonedObject.loadedSteps = new HashMap<Long, Step>(10);
    clonedObject.executedSteps = null;
    clonedObject.childrenSteps = null;
    clonedObject.workerElementMap = null;
    clonedObject.vSteps = new ArrayList<Step>();
    clonedObject.vAllSteps = null;
    clonedObject.currentStep = null;
    clonedObject.currentChildStep = 0;
    clonedObject.stepContextNames = new ArrayList<String>();
    clonedObject.arborting = false;
    clonedObject.skipSteps = false;
    clonedObject.sequenceListeners = new EventListenerList();
    clonedObject.stepListeners = new EventListenerList();
    return clonedObject;
}
Also used : RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable) XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) BranchStep(com.twinsoft.convertigo.beans.steps.BranchStep) XMLCopyStep(com.twinsoft.convertigo.beans.steps.XMLCopyStep) EventListenerList(javax.swing.event.EventListenerList)

Example 53 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class AbstractCouchDbTransaction method getJsonBody.

public JSONObject getJsonBody(JSONObject jsonDocument) throws JSONException, EngineException {
    // add document members from variables
    for (RequestableVariable variable : getAllVariables()) {
        String variableName = variable.getName();
        if (!variableName.startsWith("__") && !variableName.startsWith(CouchParam.prefix)) {
            Object value = toJson(getParameterValue(variableName));
            addJson(jsonDocument, variableName, value, getParameterDataTypeClass(variableName));
        }
    }
    return jsonDocument;
}
Also used : RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable) NativeObject(org.mozilla.javascript.NativeObject) NativeJavaObject(org.mozilla.javascript.NativeJavaObject) JSONObject(org.codehaus.jettison.json.JSONObject)

Example 54 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class SapJcoLogonTransaction method addCredentialsVariables.

public void addCredentialsVariables() throws EngineException {
    if (getVariable(jco_user) == null) {
        RequestableVariable varUser = new RequestableVariable();
        varUser.bNew = true;
        varUser.setName(jco_user);
        addVariable(varUser);
        hasChanged = true;
    }
    if (getVariable(jco_pwd) == null) {
        RequestableVariable varPwd = new RequestableVariable();
        varPwd.bNew = true;
        varPwd.setName(jco_pwd);
        addVariable(varPwd);
        hasChanged = true;
    }
    if (getVariable(jco_client) == null) {
        RequestableVariable varClient = new RequestableVariable();
        varClient.bNew = true;
        varClient.setName(jco_client);
        addVariable(varClient);
        hasChanged = true;
    }
}
Also used : RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable)

Aggregations

RequestableVariable (com.twinsoft.convertigo.beans.variables.RequestableVariable)54 EngineException (com.twinsoft.convertigo.engine.EngineException)23 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)13 Sequence (com.twinsoft.convertigo.beans.core.Sequence)11 Element (org.w3c.dom.Element)9 DatabaseObjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject)8 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)8 RequestableMultiValuedVariable (com.twinsoft.convertigo.beans.variables.RequestableMultiValuedVariable)7 StepVariable (com.twinsoft.convertigo.beans.variables.StepVariable)7 TestCaseVariable (com.twinsoft.convertigo.beans.variables.TestCaseVariable)7 Shell (org.eclipse.swt.widgets.Shell)6 TransactionWithVariables (com.twinsoft.convertigo.beans.core.TransactionWithVariables)5 Variable (com.twinsoft.convertigo.beans.core.Variable)5 RequestableHttpVariable (com.twinsoft.convertigo.beans.variables.RequestableHttpVariable)5 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)5 Cursor (org.eclipse.swt.graphics.Cursor)5 Display (org.eclipse.swt.widgets.Display)5 RequestableObject (com.twinsoft.convertigo.beans.core.RequestableObject)4 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)4 XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)3