Package br.eti.kinoshita.testlinkjavaapi.model

Examples of br.eti.kinoshita.testlinkjavaapi.model.CustomField


    @Test(dataProvider = "testCaseWithCustomField")
    public void testGetTestCaseCustomFieldDesignValueFull(Integer testCaseId,
      Integer versionNumber, Integer testProjectId, String customFieldName) {
  this.loadXMLRPCMockData("tl.getTestCaseCustomFieldDesignValue.xml");

  CustomField customField = null;
  try {
      customField = this.api.getTestCaseCustomFieldDesignValue(
        testCaseId, null, versionNumber, testProjectId,
        customFieldName, ResponseDetails.FULL);
  } catch (TestLinkAPIException e) {
      Assert.fail(e.getMessage(), e);
  }
  Assert.assertNotNull(customField);

  Assert.assertNotNull(customField.getValue());

  Assert.assertTrue(customField.getValue().length() > 0);
    }
View Full Code Here


    @Test(dataProvider = "testCaseWithCustomField")
    public void testGetTestCaseCustomFieldDesignValueSimple(Integer testCaseId,
      Integer versionNumber, Integer testProjectId, String customFieldName) {
  this.loadXMLRPCMockData("tl.getTestCaseCustomFieldDesignValue.xml");

  CustomField customField = null;
  try {
      customField = this.api.getTestCaseCustomFieldDesignValue(
        testCaseId, null, versionNumber, testProjectId,
        customFieldName, ResponseDetails.SIMPLE);
  } catch (TestLinkAPIException e) {
      Assert.fail(e.getMessage(), e);
  }
  Assert.assertNotNull(customField);

  Assert.assertNotNull(customField.getValue());

  Assert.assertTrue(customField.getValue().length() > 0);
    }
View Full Code Here

    @Test(dataProvider = "testCaseWithCustomField")
    public void testGetTestCaseCustomFieldDesignValueValue(Integer testCaseId,
      Integer versionNumber, Integer testProjectId, String customFieldName) {
  this.loadXMLRPCMockData("tl.getTestCaseCustomFieldDesignValue.xml");

  CustomField customField = null;
  try {
      customField = this.api.getTestCaseCustomFieldDesignValue(
        testCaseId, null, versionNumber, testProjectId,
        customFieldName, ResponseDetails.VALUE);
  } catch (TestLinkAPIException e) {
      Assert.fail(e.getMessage(), e);
  }
  Assert.assertNotNull(customField);

  Assert.assertNotNull(customField.getValue());

  Assert.assertTrue(customField.getValue().length() > 0);
    }
View Full Code Here

    /**
     * @param map
     * @return Custom Field.
     */
    public static final CustomField getCustomField(Map<String, Object> map) {
        CustomField customField = null;
        if (map != null && map.size() > 0) {
            // Sometimes we are working with CFs without ID
            customField = new CustomField();
            customField.setId(getInteger(map, TestLinkResponseParams.ID.toString()));
            customField.setDefaultValue(getString(map, TestLinkResponseParams.DEFAULT_VALUE.toString()));
            customField.setDisplayOrder(getInteger(map, TestLinkResponseParams.DISPLAY_ORDER.toString()));
            customField.setEnableOnDesign(getBoolean(map, TestLinkResponseParams.ENABLE_ON_DESIGN.toString()));
            customField.setEnableOnExecution(getBoolean(map, TestLinkResponseParams.ENABLE_ON_EXECUTION.toString()));
            customField.setEnableOnTestPlanDesign(getBoolean(map,
                    TestLinkResponseParams.ENABLE_ON_TEST_PLAN_DESIGN.toString()));
            customField.setLabel(getString(map, TestLinkResponseParams.LABEL.toString()));
            customField.setLengthMax(getInteger(map, TestLinkResponseParams.LENGTH_MAX.toString()));
            customField.setLengthMin(getInteger(map, TestLinkResponseParams.LENGTH_MIN.toString()));
            customField.setLocation(getInteger(map, TestLinkResponseParams.LOCATION.toString()));
            customField.setName(getString(map, TestLinkResponseParams.NAME.toString()));
            customField.setPossibleValues(getString(map, TestLinkResponseParams.POSSIBLE_VALUES.toString()));
            customField.setShowOnDesign(getBoolean(map, TestLinkResponseParams.SHOW_ON_DESIGN.toString()));
            customField.setShowOnExecution(getBoolean(map, TestLinkResponseParams.SHOW_ON_EXECUTION.toString()));
            customField.setShowOnTestPlanDesign(getBoolean(map,
                    TestLinkResponseParams.SHOW_ON_TEST_PLAN_DESIGN.toString()));
            customField.setType(getInteger(map, TestLinkResponseParams.TYPE.toString()));
            customField.setValidRegexp(getString(map, TestLinkResponseParams.VALID_REGEXP.toString()));
            customField.setValue(getString(map, TestLinkResponseParams.VALUE.toString()));

        }
        return customField;
    }
View Full Code Here

     * @throws TestLinkAPIException
     */
    protected CustomField getTestCaseCustomFieldDesignValue(Integer testCaseId, Integer testCaseExternalId,
            Integer versionNumber, Integer testProjectId, String customFieldName, ResponseDetails details)
            throws TestLinkAPIException {
        CustomField customField = null;

        try {
            Map<String, Object> executionData = new HashMap<String, Object>();
            executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
            executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
            executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
            executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
            executionData.put(TestLinkParams.CUSTOM_FIELD_NAME.toString(), customFieldName);
            executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(details));

            Object response = this.executeXmlRpcCall(
                    TestLinkMethods.GET_TEST_CASE_CUSTOM_FIELD_DESIGN_VALUE.toString(), executionData);

            if (response instanceof String) {
                customField = new CustomField();
                customField.setValue(response.toString());
            } else if (response instanceof Map<?, ?>) {
                Map<String, Object> responseMap = Util.castToMap(response);
                customField = Util.getCustomField(responseMap);
            }

View Full Code Here

     * @throws TestLinkAPIException
     */
    protected CustomField getTestCaseCustomFieldTestPlanDesignValue(Integer testCaseId, Integer testCaseExternalId,
            Integer versionNumber, Integer testProjectId, String customFieldName, ResponseDetails details)
            throws TestLinkAPIException {
        CustomField customField = null;

        try {
            Map<String, Object> executionData = new HashMap<String, Object>();
            executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
            executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
            executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
            executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
            executionData.put(TestLinkParams.CUSTOM_FIELD_NAME.toString(), customFieldName);
            executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(details));

            Object response = this.executeXmlRpcCall(
                    TestLinkMethods.GET_TEST_CASE_CUSTOM_FIELD_TEST_PLAN_DESIGN_VALUE.toString(), executionData);

            if (response instanceof String) {
                customField = new CustomField();
                customField.setValue(response.toString());
            } else if (response instanceof Map<?, ?>) {
                Map<String, Object> responseMap = Util.castToMap(response);
                customField = Util.getCustomField(responseMap);
            }

View Full Code Here

     * @throws TestLinkAPIException
     */
    protected CustomField getTestCaseCustomFieldExecutionValue(Integer testCaseId, Integer testCaseExternalId,
            Integer versionNumber, Integer executionId, Integer testProjectId, String customFieldName,
            ResponseDetails details) throws TestLinkAPIException {
        CustomField customField = null;

        try {
            Map<String, Object> executionData = new HashMap<String, Object>();
            executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
            executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(), testCaseExternalId);
            executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
            executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(), testProjectId);
            executionData.put(TestLinkParams.CUSTOM_FIELD_NAME.toString(), customFieldName);
            executionData.put(TestLinkParams.DETAILS.toString(), Util.getStringValueOrNull(details));
            executionData.put(TestLinkParams.EXECUTION_ID.toString(), executionId);

            Object response = this.executeXmlRpcCall(
                    TestLinkMethods.GET_TEST_CASE_CUSTOM_FIELD_EXECUTION_VALUE.toString(), executionData);

            if (response instanceof String) {
                customField = new CustomField();
                customField.setValue(response.toString());
            } else if (response instanceof Map<?, ?>) {
                Map<String, Object> responseMap = Util.castToMap(response);
                customField = Util.getCustomField(responseMap);
            }

View Full Code Here

    /**
     * @param map
     * @return Custom Field.
     */
    public static final CustomField getCustomField(Map<String, Object> map) {
  CustomField customField = null;
  if (map != null && map.size() > 0) {
      // Sometimes we are working with CFs without ID
      customField = new CustomField();
      customField.setId(getInteger(map,
        TestLinkResponseParams.ID.toString()));
      customField.setDefaultValue(getString(map,
        TestLinkResponseParams.DEFAULT_VALUE.toString()));
      customField.setDisplayOrder(getInteger(map,
        TestLinkResponseParams.DISPLAY_ORDER.toString()));
      customField.setEnableOnDesign(getBoolean(map,
        TestLinkResponseParams.ENABLE_ON_DESIGN.toString()));
      customField.setEnableOnExecution(getBoolean(map,
        TestLinkResponseParams.ENABLE_ON_EXECUTION.toString()));
      customField.setEnableOnTestPlanDesign(getBoolean(map,
        TestLinkResponseParams.ENABLE_ON_TEST_PLAN_DESIGN
          .toString()));
      customField.setLabel(getString(map,
        TestLinkResponseParams.LABEL.toString()));
      customField.setLengthMax(getInteger(map,
        TestLinkResponseParams.LENGTH_MAX.toString()));
      customField.setLengthMin(getInteger(map,
        TestLinkResponseParams.LENGTH_MIN.toString()));
      customField.setLocation(getInteger(map,
        TestLinkResponseParams.LOCATION.toString()));
      customField.setName(getString(map,
        TestLinkResponseParams.NAME.toString()));
      customField.setPossibleValues(getString(map,
        TestLinkResponseParams.POSSIBLE_VALUES.toString()));
      customField.setShowOnDesign(getBoolean(map,
        TestLinkResponseParams.SHOW_ON_DESIGN.toString()));
      customField.setShowOnExecution(getBoolean(map,
        TestLinkResponseParams.SHOW_ON_EXECUTION.toString()));
      customField
        .setShowOnTestPlanDesign(getBoolean(map,
          TestLinkResponseParams.SHOW_ON_TEST_PLAN_DESIGN
            .toString()));
      customField.setType(getInteger(map,
        TestLinkResponseParams.TYPE.toString()));
      customField.setValidRegexp(getString(map,
        TestLinkResponseParams.VALID_REGEXP.toString()));
      customField.setValue(getString(map,
        TestLinkResponseParams.VALUE.toString()));

  }
  return customField;
    }
View Full Code Here

     */
    protected CustomField getTestCaseCustomFieldDesignValue(Integer testCaseId,
      Integer testCaseExternalId, Integer versionNumber,
      Integer testProjectId, String customFieldName,
      ResponseDetails details) throws TestLinkAPIException {
  CustomField customField = null;

  try {
      Map<String, Object> executionData = new HashMap<String, Object>();
      executionData.put(TestLinkParams.TEST_CASE_ID.toString(), testCaseId);
      executionData.put(TestLinkParams.TEST_CASE_EXTERNAL_ID.toString(),
        testCaseExternalId);
      executionData.put(TestLinkParams.VERSION.toString(), versionNumber);
      executionData.put(TestLinkParams.TEST_PROJECT_ID.toString(),
        testProjectId);
      executionData.put(TestLinkParams.CUSTOM_FIELD_NAME.toString(),
        customFieldName);
      executionData.put(TestLinkParams.DETAILS.toString(),
        Util.getStringValueOrNull(details));

      Object response = this.executeXmlRpcCall(
        TestLinkMethods.GET_TEST_CASE_CUSTOM_FIELD_DESIGN_VALUE
          .toString(), executionData);

      if (response instanceof String) {
    customField = new CustomField();
    customField.setValue(response.toString());
      } else if (response instanceof Map<?, ?>) {
    Map<String, Object> responseMap = Util.castToMap(response);
    customField = Util.getCustomField(responseMap);
      }

View Full Code Here

   * @param map
   * @return
   */
  public static final CustomField getCustomField( Map<String, Object> map )
  {
    CustomField customField = null;
    if ( map != null && map.size() > 0 )
    {
      // Sometimes we are working with CFs without ID
      customField = new CustomField();
      customField.setId( getInteger( map, TestLinkResponseParams.id.toString()) );
      customField.setDefaultValue( getString(map, TestLinkResponseParams.defaultValue.toString()) );
      customField.setDisplayOrder( getInteger(map, TestLinkResponseParams.displayOrder.toString()) );
      customField.setEnableOnDesign( getBoolean(map, TestLinkResponseParams.enableOnDesign.toString()) );
      customField.setEnableOnExecution( getBoolean(map, TestLinkResponseParams.enableOnExecution.toString()) );
      customField.setEnableOnTestPlanDesign( getBoolean(map, TestLinkResponseParams.enableOnTestPlanDesign.toString()) );
      customField.setLabel( getString(map, TestLinkResponseParams.label.toString()) );
      customField.setLengthMax( getInteger(map, TestLinkResponseParams.lengthMax.toString()) );
      customField.setLengthMin( getInteger(map, TestLinkResponseParams.lengthMin.toString()) );
      customField.setLocation( getInteger(map, TestLinkResponseParams.location.toString()) );
      customField.setName( getString(map, TestLinkResponseParams.name.toString()) );
      customField.setPossibleValues( getString(map, TestLinkResponseParams.possibleValues.toString()) );
      customField.setShowOnDesign( getBoolean(map, TestLinkResponseParams.showOnDesign.toString()) );
      customField.setShowOnExecution( getBoolean(map, TestLinkResponseParams.showOnExecution.toString()) );
      customField.setShowOnTestPlanDesign( getBoolean(map, TestLinkResponseParams.showOnTestPlanDesign.toString()) );
      customField.setType( getInteger(map, TestLinkResponseParams.type.toString()) );
      customField.setValidRegexp( getString(map, TestLinkResponseParams.validRegexp.toString()) );
      customField.setValue( getString(map, TestLinkResponseParams.value.toString() ));
 
    }
    return customField;
  }
View Full Code Here

TOP

Related Classes of br.eti.kinoshita.testlinkjavaapi.model.CustomField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.