Search in sources :

Example 1 with Container

use of com.qasymphony.ci.plugin.model.qtest.Container in project jenkin-qtest-plugin by QASymphony.

the class Configuration method createJunitSubmitRequest.

public JunitSubmitterRequest createJunitSubmitRequest() {
    Long containerID = this.releaseId;
    String containerType = "release";
    Container container = null;
    if (submitToContainer) {
        container = this.getContainerInfo();
        if (null == container) {
            return null;
        }
        containerID = container.getId();
        containerType = container.getType();
    }
    JunitSubmitterRequest request = new JunitSubmitterRequest();
    request.setqTestURL(this.url).setApiKey(this.appSecretKey).setConfigurationID(this.id).setSubmitToExistingContainer(this.submitToContainer).setContainerID(containerID).setContainerType(containerType).setCreateNewTestRunsEveryBuildDate(null != container ? container.getCreateNewTestSuiteEveryBuild() : null).setEnvironmentID(this.environmentId).setEnvironmentParentID(this.environmentParentId).setJenkinsProjectName(this.jenkinsProjectName).setModuleID(this.moduleId).setJenkinsServerURL(this.jenkinsServerUrl).setProjectID(this.projectId);
    return request;
}
Also used : Container(com.qasymphony.ci.plugin.model.qtest.Container) JunitSubmitterRequest(com.qasymphony.ci.plugin.submitter.JunitSubmitterRequest)

Example 2 with Container

use of com.qasymphony.ci.plugin.model.qtest.Container in project jenkin-qtest-plugin by QASymphony.

the class Configuration method getContainerInfo.

private Container getContainerInfo() {
    long nodeId = -1;
    String nodeType = "";
    boolean createTestSuiteEveryBuildDate = false;
    try {
        JSONObject json = JSONObject.fromObject(this.containerSetting);
        JSONObject selectedContainer = json.getJSONObject("selectedContainer");
        if (selectedContainer.has("dailyCreateTestSuite")) {
            createTestSuiteEveryBuildDate = selectedContainer.getBoolean("dailyCreateTestSuite");
        }
        JSONArray containerPath = JSONArray.fromObject(json.getString("containerPath"));
        if (0 < containerPath.size()) {
            JSONObject jsonContainer = containerPath.getJSONObject(containerPath.size() - 1);
            if (null != jsonContainer) {
                nodeType = jsonContainer.getString("nodeType");
                nodeId = jsonContainer.getLong("nodeId");
            }
        }
    } catch (Exception ex) {
        ex.printStackTrace();
        return null;
    }
    Container container = new Container();
    container.setId(nodeId);
    container.setType(nodeType);
    container.setCreateNewTestSuiteEveryBuild(createTestSuiteEveryBuildDate);
    return container;
}
Also used : Container(com.qasymphony.ci.plugin.model.qtest.Container) JSONObject(net.sf.json.JSONObject) JSONArray(net.sf.json.JSONArray)

Example 3 with Container

use of com.qasymphony.ci.plugin.model.qtest.Container in project jenkin-qtest-plugin by QASymphony.

the class PipelineConfiguration method getContainerInfo.

private Container getContainerInfo() {
    Container container = new Container();
    container.setId(this.containerID);
    container.setType(this.containerType.toLowerCase());
    container.setCreateNewTestSuiteEveryBuild(this.createNewTestRunsEveryBuildDate);
    return container;
}
Also used : Container(com.qasymphony.ci.plugin.model.qtest.Container)

Aggregations

Container (com.qasymphony.ci.plugin.model.qtest.Container)3 JunitSubmitterRequest (com.qasymphony.ci.plugin.submitter.JunitSubmitterRequest)1 JSONArray (net.sf.json.JSONArray)1 JSONObject (net.sf.json.JSONObject)1