Package br.eti.kinoshita.testlinkjavaapi.model

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


    /**
     * @param map
     * @return Attachment.
     */
    public static final Attachment getAttachment(Map<String, Object> map) {
        Attachment attachment = null;
        if (map != null && map.size() > 0) {
            Object o = map.get(TestLinkResponseParams.ID.toString());
            if (o != null) {
                Integer id = Integer.parseInt(o.toString());

                if (id > 0) {
                    attachment = new Attachment();
                    attachment.setId(id);

                    attachment.setFileName(getString(map, TestLinkResponseParams.NAME.toString()));
                    attachment.setFileType(getString(map, TestLinkResponseParams.FILE_TYPE.toString()));
                    attachment.setTitle(getString(map, TestLinkResponseParams.TITLE.toString()));
                    // TBD: put the date too...
                    attachment.setContent(getString(map, TestLinkResponseParams.CONTENT.toString()));
                    // TBD: description not beign returned
                    // attachment.setDescription( getString(map,
                    // TestLinkResponseParams.description.toString() ) );
                    // TBD: returning name instead of file_name
                    // TBD: file size not beign returned
View Full Code Here


     * @param content
     * @return
     */
    protected Attachment uploadTestCaseAttachment(Integer testCaseId, String title, String description,
            String fileName, String fileType, String content) throws TestLinkAPIException {
        Attachment attachment = null;

        Integer id = 0;

        attachment = new Attachment(id, testCaseId, TestLinkTables.NODES_HIERARCHY.toString(), title, description,
                fileName, null, fileType, content);

        try {
            Map<String, Object> executionData = Util.getTestCaseAttachmentMap(attachment);
            Object response = this.executeXmlRpcCall(TestLinkMethods.UPLOAD_TEST_CASE_ATTACHMENT.toString(),
                    executionData);
            Map<String, Object> responseMap = Util.castToMap(response);
            id = Util.getInteger(responseMap, TestLinkResponseParams.ID.toString());
            attachment.setId(id);
        } catch (XmlRpcException xmlrpcex) {
            throw new TestLinkAPIException("Error uploading attachment for test case: " + xmlrpcex.getMessage(),
                    xmlrpcex);
        }

View Full Code Here

        return attachments;
    }

    protected Attachment uploadExecutionAttachment(Integer executionId, String title, String description,
            String fileName, String fileType, String content) throws TestLinkAPIException {
        Attachment attachment = null;

        Integer id = 0;

        attachment = new Attachment(id, executionId, TestLinkTables.EXECUTIONS.toString(), title, description,
                fileName, null, fileType, content);

        try {
            Map<String, Object> executionData = Util.getExecutionAttachmentMap(attachment);

            Object response = this.executeXmlRpcCall(TestLinkMethods.UPLOAD_EXECUTION_ATTACHMENT.toString(),
                    executionData);
            Map<String, Object> responseMap = Util.castToMap(response);
            id = Util.getInteger(responseMap, TestLinkResponseParams.ID.toString());
            attachment.setId(id);
        } catch (XmlRpcException xmlrpcex) {
            throw new TestLinkAPIException("Error uploading attachment for execution: " + xmlrpcex.getMessage(),
                    xmlrpcex);
        }
View Full Code Here

   * @param map
   * @return Attachment.
   */
  public static final Attachment getAttachment( Map<String, Object> map )
  {
    Attachment attachment = null;
    if ( map != null && map.size() > 0 )
    {
      Object o = map.get( TestLinkResponseParams.id.toString());
      if ( o != null )
      {
        Integer id = Integer.parseInt( o.toString() );
       
        if ( id > 0 )
        {
          attachment = new Attachment();
          attachment.setId( id );
         
          attachment.setFileName( getString(map, TestLinkResponseParams.name.toString()) );
          attachment.setFileType( getString(map, TestLinkResponseParams.fileType.toString()) );
          attachment.setTitle( getString(map, TestLinkResponseParams.title.toString()) );
          // TBD: put the date too...
          attachment.setContent( getString(map, TestLinkResponseParams.content.toString()) );
          // TBD: description not beign returned
          // attachment.setDescription( getString(map, TestLinkResponseParams.description.toString() ) );
          // TBD: returning name instead of file_name
          // TBD: file size not beign returned
         
View Full Code Here

   * @param map
   * @return
   */
  public static final Attachment getAttachment( Map<String, Object> map )
  {
    Attachment attachment = null;
    if ( map != null && map.size() > 0 )
    {
      Object o = map.get( TestLinkResponseParams.id.toString());
      if ( o != null )
      {
        Integer id = Integer.parseInt( o.toString() );
       
        if ( id > 0 )
        {
          attachment = new Attachment();
          attachment.setId( id );
         
          attachment.setFileName( getString(map, TestLinkResponseParams.name.toString()) );
          attachment.setFileType( getString(map, TestLinkResponseParams.fileType.toString()) );
          attachment.setTitle( getString(map, TestLinkResponseParams.title.toString()) );
          // TBD: put the date too...
          attachment.setContent( getString(map, TestLinkResponseParams.content.toString()) );
          // TBD: description not beign returned
          // attachment.setDescription( getString(map, TestLinkResponseParams.description.toString() ) );
          // TBD: returning name instead of file_name
          // TBD: file size not beign returned
         
View Full Code Here

    String fileType,
    String content
  )
  throws TestLinkAPIException
  {
    Attachment attachment = null;
   
    Integer id = 0;
   
    attachment = new Attachment(
      id,
      testCaseId,
      TestLinkTables.nodesHierarchy.toString(),
      title,
      description,
      fileName,
      null,
      fileType,
      content
    );
   
    try
    {
      Map<String, Object> executionData = Util.getTestCaseAttachmentMap(attachment);
      Object response = this.executeXmlRpcCall(
          TestLinkMethods.uploadTestCaseAttachment.toString(), executionData);
      Map<String, Object> responseMap = (Map<String, Object>)response;
      id = Util.getInteger(responseMap, TestLinkResponseParams.id.toString());
      attachment.setId(id);
    }
    catch ( XmlRpcException xmlrpcex )
    {
      throw new TestLinkAPIException(
          "Error uploading attachment for test case: " + xmlrpcex.getMessage(), xmlrpcex);
View Full Code Here

    String fileType,
    String content
  )
  throws TestLinkAPIException
  {
    Attachment attachment = null;
   
    Integer id = 0;
   
    attachment = new Attachment(
      id,
      fkId,
      fkTable,
      title,
      description,
      fileName,
      null,
      fileType,
      content
    );
   
    try
    {
      Map<String, Object> executionData = Util.getAttachmentMap(attachment);
      Object response = this.executeXmlRpcCall(
          TestLinkMethods.uploadAttachment.toString(), executionData);
      Map<String, Object> responseMap = (Map<String, Object>)response;
      id = Util.getInteger(responseMap, TestLinkResponseParams.id.toString());
      attachment.setId(id);
    }
    catch ( XmlRpcException xmlrpcex )
    {
      throw new TestLinkAPIException(
          "Error uploading attachment: " + xmlrpcex.getMessage(), xmlrpcex);
View Full Code Here

    String fileType,
    String content
  )
  throws TestLinkAPIException
  {
    Attachment attachment = null;
   
    Integer id = 0;
   
    attachment = new Attachment(
      id,
      testProjectId,
      TestLinkTables.nodesHierarchy.toString(),
      title,
      description,
      fileName,
      null,
      fileType,
      content
    );
   
    try
    {
      Map<String, Object> executionData = Util.getTestProjectAttachmentMap(attachment);
      Object response = this.executeXmlRpcCall(
          TestLinkMethods.uploadTestProjectAttachment.toString(), executionData);
      Map<String, Object> responseMap = (Map<String, Object>)response;
      id = Util.getInteger(responseMap, TestLinkResponseParams.id.toString());
      attachment.setId(id);
    }
    catch ( XmlRpcException xmlrpcex )
    {
      throw new TestLinkAPIException(
          "Error uploading attachment for test project: " + xmlrpcex.getMessage(), xmlrpcex);
View Full Code Here

    String fileName,
    String fileType,
    String content )
  throws TestLinkAPIException
  {
    Attachment attachment = null;
   
    Integer id = 0;
   
    attachment = new Attachment(
      id,
      testSuiteId,
      TestLinkTables.nodesHierarchy.toString(),
      title,
      description,
      fileName,
      null,
      fileType,
      content
    );
   
    try
    {
      Map<String, Object> executionData = Util.getTestSuiteAttachmentMap(attachment);
      Object response = this.executeXmlRpcCall(
          TestLinkMethods.uploadTestSuiteAttachment.toString(), executionData);
      Map<String, Object> responseMap = (Map<String, Object>)response;
      id = Util.getInteger(responseMap, TestLinkResponseParams.id.toString());
      attachment.setId(id);
    }
    catch ( XmlRpcException xmlrpcex )
    {
      throw new TestLinkAPIException(
          "Error uploading attachment for test suite: " + xmlrpcex.getMessage(), xmlrpcex);
View Full Code Here

   * @param map
   * @return Attachment.
   */
  public static final Attachment getAttachment( Map<String, Object> map )
  {
    Attachment attachment = null;
    if ( map != null && map.size() > 0 )
    {
      Object o = map.get( TestLinkResponseParams.id.toString());
      if ( o != null )
      {
        Integer id = Integer.parseInt( o.toString() );
       
        if ( id > 0 )
        {
          attachment = new Attachment();
          attachment.setId( id );
         
          attachment.setFileName( getString(map, TestLinkResponseParams.name.toString()) );
          attachment.setFileType( getString(map, TestLinkResponseParams.fileType.toString()) );
          attachment.setTitle( getString(map, TestLinkResponseParams.title.toString()) );
          // TBD: put the date too...
          attachment.setContent( getString(map, TestLinkResponseParams.content.toString()) );
          // TBD: description not beign returned
          // attachment.setDescription( getString(map, TestLinkResponseParams.description.toString() ) );
          // TBD: returning name instead of file_name
          // TBD: file size not beign returned
         
View Full Code Here

TOP

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

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.