BugInfo:javabean对象,用于映射bugfree中的bug:
package com.yunos.qa; public class BugInfo { private int product_id; // Integer 必须 产品id 1 private int productmodule_id; // Integer 模块id 1 private String product_name = ""; private String module_name = ""; private String title; //String 必须 Bug标题 1 private int severity = 4; //Integer 必须 严重程度 1,2,3,4 private int priority = 2; //Integer 优先级 1,2,3,4 private String repeat_step = ""; // String 重现步骤 private String assign_to_name = ""; //String 必须 指派给 系统管理员 private String BugType = ""; // String 必须 缺陷类型 //private String created_by = ""; //private String bug_status = ""; private String action_note = ""; //String 注释 private String mail_to = ""; //String 抄送给, 以','分割 系统管理员,admin@bugfree.org private int related_case = 0; //Integer 相关Case //attachment_file[] public BugInfo(int product_id, String title, int severity, String assign_to_name, String BugType) { this.product_id = product_id; if (title.length() > 102) { this.title = title.substring(0, 100); } else { this.title = title; } this.severity = severity; this.assign_to_name = assign_to_name; this.BugType = BugType; } public int getProduct_id() { return product_id; } public void setProduct_id(int product_id) { this.product_id = product_id; } public int getProductmodule_id() { return productmodule_id; } public void setProductmodule_id(int productmodule_id) { this.productmodule_id = productmodule_id; } public String getProduct_name() { return product_name; } public void setProduct_name(String product_name) { this.product_name = product_name; } public String getModule_name() { return module_name; } public void setModule_name(String module_name) { this.module_name = module_name; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getSeverity() { return severity; } public void setSeverity(int severity) { this.severity = severity; } public int getPriority() { return priority; } public void setPriority(int priority) { this.priority = priority; } public String getRepeat_step() { return repeat_step; } public void setRepeat_step(String repeat_step) { this.repeat_step = repeat_step; } public String getAssign_to_name() { return assign_to_name; } public void setAssign_to_name(String assign_to_name) { this.assign_to_name = assign_to_name; } public String getBugType() { return BugType; } public void setBugType(String bugType) { BugType = bugType; } public String getAction_note() { return action_note; } public void setAction_note(String action_note) { this.action_note = action_note; } public String getMail_to() { return mail_to; } public void setMail_to(String mail_to) { this.mail_to = mail_to; } public int getRelated_case() { return related_case; } public void setRelated_case(int related_case) { this.related_case = related_case; } } |
其他:
bugfree在addbug时,对bug的title的内容是有校验的。我在用程序addbug时,遇到过一次addbug失败,报错信息如下:
{"status":"failed","code":7,"info":{"custom_field":"custom field [quot;_prio] is not valid field name"}}
title里边有一些特殊字符,会导致这个问题