Search in sources :

Example 6 with OctaneClient

use of com.hp.octane.integrations.OctaneClient in project octane-ci-java-sdk by MicroFocus.

the class MfUftConverter method isAddGlobalParameters.

private boolean isAddGlobalParameters(Map<String, String> globalParameters) {
    boolean addGlobalParameters = false;
    if (globalParameters != null) {
        // check job level params
        addGlobalParameters = globalParameters.containsKey(SdkConstants.JobParameters.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM) && "true".equalsIgnoreCase(globalParameters.getOrDefault(SdkConstants.JobParameters.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM, "false"));
        // check global param
        if (!addGlobalParameters && globalParameters.containsKey(SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME)) {
            try {
                OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(globalParameters.get(SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME));
                addGlobalParameters = ConfigurationParameterFactory.addGlobalParametersToTests(octaneClient.getConfigurationService().getConfiguration());
            } catch (Exception e) {
                logger.info("Failed to get octane client by id " + globalParameters.get(SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME));
            }
        }
    }
    return addGlobalParameters;
}
Also used : OctaneClient(com.hp.octane.integrations.OctaneClient) TransformerException(javax.xml.transform.TransformerException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException)

Aggregations

OctaneClient (com.hp.octane.integrations.OctaneClient)6 OctaneConfiguration (com.hp.octane.integrations.OctaneConfiguration)5 OctaneSDK (com.hp.octane.integrations.OctaneSDK)4 OctaneConfigurationIntern (com.hp.octane.integrations.OctaneConfigurationIntern)3 OctaneSPEndpointSimulator (com.hp.octane.integrations.testhelpers.OctaneSPEndpointSimulator)3 Test (org.junit.Test)3 LinkedHashMap (java.util.LinkedHashMap)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 DTOFactory (com.hp.octane.integrations.dto.DTOFactory)1 CIEventCause (com.hp.octane.integrations.dto.causes.CIEventCause)1 CIEventCauseType (com.hp.octane.integrations.dto.causes.CIEventCauseType)1 OctaneRequest (com.hp.octane.integrations.dto.connectivity.OctaneRequest)1 OctaneResponse (com.hp.octane.integrations.dto.connectivity.OctaneResponse)1 CoverageReportType (com.hp.octane.integrations.dto.coverage.CoverageReportType)1 CIEvent (com.hp.octane.integrations.dto.events.CIEvent)1 CIEventType (com.hp.octane.integrations.dto.events.CIEventType)1 CIEventsList (com.hp.octane.integrations.dto.events.CIEventsList)1 SCMData (com.hp.octane.integrations.dto.scm.SCMData)1 SCMRepository (com.hp.octane.integrations.dto.scm.SCMRepository)1