diff options
13 files changed, 363 insertions, 272 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/configuration.json b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/configuration.json index 8bdddf57b..5172a23a4 100644 --- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/configuration.json +++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/configuration.json @@ -1 +1 @@ -{"repositoryId":"http://dummy.url","fields":{"alias":{"id":38,"type":0,"is_custom":false,"name":"alias","display_name":"Alias","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"assigned_to":{"id":16,"type":0,"is_custom":false,"name":"assigned_to","display_name":"AssignedTo","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"assigned_to_realname":{"id":19,"type":0,"is_custom":false,"name":"assigned_to_realname","display_name":"AssignedToName","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attach_data.thedata":{"id":53,"type":0,"is_custom":false,"name":"attach_data.thedata","display_name":"Attachment data","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.description":{"id":25,"type":0,"is_custom":false,"name":"attachments.description","display_name":"Attachment description","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.filename":{"id":26,"type":0,"is_custom":false,"name":"attachments.filename","display_name":"Attachment filename","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.isobsolete":{"id":29,"type":0,"is_custom":false,"name":"attachments.isobsolete","display_name":"Attachment is obsolete","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.ispatch":{"id":28,"type":0,"is_custom":false,"name":"attachments.ispatch","display_name":"Attachment is patch","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.isprivate":{"id":30,"type":0,"is_custom":false,"name":"attachments.isprivate","display_name":"Attachment is private","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.mimetype":{"id":27,"type":0,"is_custom":false,"name":"attachments.mimetype","display_name":"Attachment mime type","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.submitter":{"id":31,"type":0,"is_custom":false,"name":"attachments.submitter","display_name":"Attachment creator","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"blocked":{"id":24,"type":0,"is_custom":false,"name":"blocked","display_name":"Blocks","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_file_loc":{"id":7,"type":0,"is_custom":false,"name":"bug_file_loc","display_name":"URL","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_group":{"id":42,"type":0,"is_custom":false,"name":"bug_group","display_name":"Group","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_id":{"id":1,"type":0,"is_custom":false,"name":"bug_id","display_name":"Bug #","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_severity":{"id":13,"type":2,"is_custom":false,"name":"bug_severity","display_name":"Severity","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"blocker","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"critical","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"major","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"normal","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"minor","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false},{"name":"trivial","sort_key":600,"visibility_values":[],"is_active":false,"is_open":false},{"name":"enhancement","sort_key":700,"visibility_values":[],"is_active":false,"is_open":false}]},"bug_status":{"id":9,"type":2,"is_custom":false,"name":"bug_status","display_name":"Status","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"sort_key":0,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"CONFIRMED","comment_required":false},{"name":"IN_PROGRESS","comment_required":false}]},{"name":"UNCONFIRMED","sort_key":100,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"CONFIRMED","comment_required":false},{"name":"IN_PROGRESS","comment_required":false},{"name":"RESOLVED","comment_required":false}]},{"name":"CONFIRMED","sort_key":200,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"IN_PROGRESS","comment_required":false},{"name":"RESOLVED","comment_required":false}]},{"name":"IN_PROGRESS","sort_key":300,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"CONFIRMED","comment_required":false},{"name":"RESOLVED","comment_required":false}]},{"name":"RESOLVED","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"CONFIRMED","comment_required":false},{"name":"VERIFIED","comment_required":false}]},{"name":"VERIFIED","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"CONFIRMED","comment_required":false}]}]},"cc":{"id":22,"type":0,"is_custom":false,"name":"cc","display_name":"CC","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"cclist_accessible":{"id":41,"type":0,"is_custom":false,"name":"cclist_accessible","display_name":"CC Accessible","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"cf_bugid":{"id":66,"type":6,"is_custom":true,"name":"cf_bugid","display_name":"bug id custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_datetime":{"id":65,"type":5,"is_custom":true,"name":"cf_datetime","display_name":"date time custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_dropdown":{"id":62,"type":2,"is_custom":true,"name":"cf_dropdown","display_name":"drop down custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[],"values":[{"name":"---","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"one","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"three","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"two","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false}]},"cf_freetext":{"id":61,"type":1,"is_custom":true,"name":"cf_freetext","display_name":"free text custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_largetextbox":{"id":63,"type":4,"is_custom":true,"name":"cf_largetextbox","display_name":"large text box custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_multiselect":{"id":64,"type":3,"is_custom":true,"name":"cf_multiselect","display_name":"multi selection box custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[],"values":[{"name":"Blue","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Green","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Red","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Yellow","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false}]},"classification":{"id":3,"type":2,"is_custom":false,"name":"classification","display_name":"Classification","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"Unclassified","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false}]},"comment_tag":{"id":58,"type":0,"is_custom":false,"name":"comment_tag","display_name":"Comment Tag","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"commenter":{"id":46,"type":0,"is_custom":false,"name":"commenter","display_name":"Commenter","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"component":{"id":15,"type":2,"is_custom":false,"name":"component","display_name":"Component","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[],"value_field":"product","values":[{"name":"TestComponent","sort_key":0,"visibility_values":["TestProduct"],"is_active":true,"is_open":false},{"name":"Component 1","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"Component 2","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"ManualC1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"ManualC2","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false}]},"content":{"id":52,"type":0,"is_custom":false,"name":"content","display_name":"Content","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"creation_ts":{"id":33,"type":0,"is_custom":false,"name":"creation_ts","display_name":"Creation date","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"days_elapsed":{"id":60,"type":0,"is_custom":false,"name":"days_elapsed","display_name":"Days since bug changed","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"deadline":{"id":45,"type":5,"is_custom":false,"name":"deadline","display_name":"Deadline","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"delta_ts":{"id":34,"type":0,"is_custom":false,"name":"delta_ts","display_name":"Last changed date","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"dependson":{"id":23,"type":0,"is_custom":false,"name":"dependson","display_name":"Depends on","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"dupe_of":{"id":59,"type":0,"is_custom":false,"name":"dupe_of","display_name":"Duplicate of","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"estimated_time":{"id":43,"type":0,"is_custom":false,"name":"estimated_time","display_name":"Estimated Hours","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"everconfirmed":{"id":39,"type":0,"is_custom":false,"name":"everconfirmed","display_name":"Ever Confirmed","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"flagtypes.name":{"id":47,"type":0,"is_custom":false,"name":"flagtypes.name","display_name":"Flags","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"keywords":{"id":11,"type":8,"is_custom":false,"name":"keywords","display_name":"Keywords","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"Keyword1","sort_key":0,"is_active":false,"description":"1","is_open":false},{"name":"Keyword2","sort_key":0,"is_active":false,"description":"2","is_open":false}]},"last_visit_ts":{"id":57,"type":5,"is_custom":false,"name":"last_visit_ts","display_name":"Last Visit","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"longdesc":{"id":35,"type":0,"is_custom":false,"name":"longdesc","display_name":"Comment","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"longdescs.count":{"id":37,"type":0,"is_custom":false,"name":"longdescs.count","display_name":"Number of Comments","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"longdescs.isprivate":{"id":36,"type":0,"is_custom":false,"name":"longdescs.isprivate","display_name":"Comment is private","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"op_sys":{"id":8,"type":2,"is_custom":false,"name":"op_sys","display_name":"OS/Version","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"All","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Windows","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Mac OS","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Linux","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Other","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false}]},"owner_idle_time":{"id":54,"type":0,"is_custom":false,"name":"owner_idle_time","display_name":"Time Since Assignee Touched","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"percentage_complete":{"id":51,"type":0,"is_custom":false,"name":"percentage_complete","display_name":"Percentage Complete","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"priority":{"id":14,"type":2,"is_custom":false,"name":"priority","display_name":"Priority","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"Highest","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"High","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Normal","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Low","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Lowest","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false},{"name":"---","sort_key":600,"visibility_values":[],"is_active":false,"is_open":false}]},"product":{"id":4,"type":2,"is_custom":false,"name":"product","display_name":"Product","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[]},"qa_contact":{"id":18,"type":0,"is_custom":false,"name":"qa_contact","display_name":"QAContact","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"qa_contact_realname":{"id":21,"type":0,"is_custom":false,"name":"qa_contact_realname","display_name":"QAContactName","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"remaining_time":{"id":44,"type":0,"is_custom":false,"name":"remaining_time","display_name":"Remaining Hours","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"rep_platform":{"id":6,"type":2,"is_custom":false,"name":"rep_platform","display_name":"Platform","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"All","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"PC","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Macintosh","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Other","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false}]},"reporter":{"id":17,"type":0,"is_custom":false,"name":"reporter","display_name":"ReportedBy","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"reporter_accessible":{"id":40,"type":0,"is_custom":false,"name":"reporter_accessible","display_name":"Reporter Accessible","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"reporter_realname":{"id":20,"type":0,"is_custom":false,"name":"reporter_realname","display_name":"ReportedByName","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"requestees.login_name":{"id":48,"type":0,"is_custom":false,"name":"requestees.login_name","display_name":"Flag Requestee","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"resolution":{"id":12,"type":2,"is_custom":false,"name":"resolution","display_name":"Resolution","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"FIXED","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"INVALID","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"WONTFIX","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"DUPLICATE","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false},{"name":"WORKSFORME","sort_key":600,"visibility_values":[],"is_active":false,"is_open":false}]},"see_also":{"id":55,"type":7,"is_custom":false,"name":"see_also","display_name":"See Also","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"setters.login_name":{"id":49,"type":0,"is_custom":false,"name":"setters.login_name","display_name":"Flag Setter","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"short_desc":{"id":2,"type":0,"is_custom":false,"name":"short_desc","display_name":"Summary","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[]},"status_whiteboard":{"id":10,"type":0,"is_custom":false,"name":"status_whiteboard","display_name":"Status Whiteboard","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"tag":{"id":56,"type":8,"is_custom":false,"name":"tag","display_name":"Personal Tags","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"target_milestone":{"id":32,"type":0,"is_custom":false,"name":"target_milestone","display_name":"Target Milestone","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"value_field":"product","values":[{"name":"---","sort_key":0,"visibility_values":["TestProduct"],"is_active":true,"is_open":false},{"name":"---","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"---","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M1.0","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"M2","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M2.0","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"M3","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M3.0","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false}]},"version":{"id":5,"type":0,"is_custom":false,"name":"version","display_name":"Version","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[],"value_field":"product","values":[{"name":"unspecified","sort_key":0,"visibility_values":["TestProduct"],"is_active":true,"is_open":false},{"name":"unspecified","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"a","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"b","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"c","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"unspecified","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"R1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"R1.1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"R2.0","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false}]},"work_time":{"id":50,"type":0,"is_custom":false,"name":"work_time","display_name":"Hours Worked","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]}},"products":{"ManualTest":{"id":3,"name":"ManualTest","is_active":true,"description":"Product for manual testing","default_milestone":"---","has_unconfirmed":false,"classification":"Unclassified","components":[{"id":4,"description":"1","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"ManualC1","sort_key":0,"is_active":true},{"id":5,"description":"2","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"ManualC2","sort_key":0,"is_active":true}],"versions":[{"name":"R1","sort_key":0,"is_active":true},{"name":"R1.1","sort_key":0,"is_active":true},{"name":"R2.0","sort_key":0,"is_active":true},{"name":"unspecified","sort_key":0,"is_active":true}],"milestones":[{"name":"---","sort_key":0,"is_active":true},{"name":"M1","sort_key":0,"is_active":true},{"name":"M2","sort_key":0,"is_active":true},{"name":"M3","sort_key":0,"is_active":true}]},"Product with Spaces":{"id":2,"name":"Product with Spaces","is_active":true,"description":"Product with Spaces is the renamed Scratch Product.","default_milestone":"---","has_unconfirmed":true,"classification":"Unclassified","components":[{"id":2,"description":"1","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"Component 1","sort_key":0,"is_active":true},{"id":3,"description":"2","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"Component 2","sort_key":0,"is_active":true}],"versions":[{"name":"a","sort_key":0,"is_active":true},{"name":"b","sort_key":0,"is_active":true},{"name":"c","sort_key":0,"is_active":true},{"name":"unspecified","sort_key":0,"is_active":true}],"milestones":[{"name":"---","sort_key":0,"is_active":true},{"name":"M1.0","sort_key":0,"is_active":true},{"name":"M2.0","sort_key":0,"is_active":true},{"name":"M3.0","sort_key":0,"is_active":true}]},"TestProduct":{"id":1,"name":"TestProduct","is_active":true,"description":"This is a test product. This ought to be blown away and replaced with real stuff in a finished installation of bugzilla.","default_milestone":"---","has_unconfirmed":true,"classification":"Unclassified","components":[{"id":1,"description":"This is a test component in the test product database. This ought to be blown away and replaced with real stuff in a finished installation of Bugzilla.","default_assigned_to":"admin@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"TestComponent","sort_key":0,"is_active":true}],"versions":[{"name":"unspecified","sort_key":0,"is_active":true}],"milestones":[{"name":"---","sort_key":0,"is_active":true}]}},"parameters":{"allowemailchange":"1","attachment_base":"","commentonchange_resolution":"0","commentonduplicate":"0","defaultopsys":"","defaultplatform":"","defaultpriority":"---","defaultseverity":"enhancement","duplicate_or_move_bug_status":"RESOLVED","emailregexpdesc":"A legal address must contain exactly one \u0027@\u0027, and at least one \u0027.\u0027 after the @.","emailsuffix":"","letsubmitterchoosemilestone":"1","letsubmitterchoosepriority":"1","mailfrom":"bugzilla-daemon","maintainer":"admin@mylyn.eclipse.org","maxattachmentsize":"1000","maxlocalattachment":"0","password_complexity":"no_constraints","rememberlogin":"on","requirelogin":"0","search_allow_no_criteria":"1","urlbase":"","use_see_also":"1","useclassification":"0","usemenuforusers":"0","useqacontact":"1","usestatuswhiteboard":"1","usetargetmilestone":"1"}}
\ No newline at end of file +{"repositoryId":"http://dummy.url","fields":{"alias":{"id":38,"type":0,"is_custom":false,"name":"alias","display_name":"Alias","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"assigned_to":{"id":16,"type":0,"is_custom":false,"name":"assigned_to","display_name":"AssignedTo","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"assigned_to_realname":{"id":19,"type":0,"is_custom":false,"name":"assigned_to_realname","display_name":"AssignedToName","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attach_data.thedata":{"id":53,"type":0,"is_custom":false,"name":"attach_data.thedata","display_name":"Attachment data","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.description":{"id":25,"type":0,"is_custom":false,"name":"attachments.description","display_name":"Attachment description","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.filename":{"id":26,"type":0,"is_custom":false,"name":"attachments.filename","display_name":"Attachment filename","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.isobsolete":{"id":29,"type":0,"is_custom":false,"name":"attachments.isobsolete","display_name":"Attachment is obsolete","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.ispatch":{"id":28,"type":0,"is_custom":false,"name":"attachments.ispatch","display_name":"Attachment is patch","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.isprivate":{"id":30,"type":0,"is_custom":false,"name":"attachments.isprivate","display_name":"Attachment is private","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.mimetype":{"id":27,"type":0,"is_custom":false,"name":"attachments.mimetype","display_name":"Attachment mime type","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"attachments.submitter":{"id":31,"type":0,"is_custom":false,"name":"attachments.submitter","display_name":"Attachment creator","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"blocked":{"id":24,"type":0,"is_custom":false,"name":"blocked","display_name":"Blocks","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_file_loc":{"id":7,"type":0,"is_custom":false,"name":"bug_file_loc","display_name":"URL","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_group":{"id":42,"type":0,"is_custom":false,"name":"bug_group","display_name":"Group","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_id":{"id":1,"type":0,"is_custom":false,"name":"bug_id","display_name":"Bug #","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"bug_severity":{"id":13,"type":2,"is_custom":false,"name":"bug_severity","display_name":"Severity","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"blocker","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"critical","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"major","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"normal","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"minor","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false},{"name":"trivial","sort_key":600,"visibility_values":[],"is_active":false,"is_open":false},{"name":"enhancement","sort_key":700,"visibility_values":[],"is_active":false,"is_open":false}]},"bug_status":{"id":9,"type":2,"is_custom":false,"name":"bug_status","display_name":"Status","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"sort_key":0,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"CONFIRMED","comment_required":false},{"name":"IN_PROGRESS","comment_required":false}]},{"name":"UNCONFIRMED","sort_key":100,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"CONFIRMED","comment_required":false},{"name":"IN_PROGRESS","comment_required":false},{"name":"RESOLVED","comment_required":false}]},{"name":"CONFIRMED","sort_key":200,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"IN_PROGRESS","comment_required":false},{"name":"RESOLVED","comment_required":false}]},{"name":"IN_PROGRESS","sort_key":300,"visibility_values":[],"is_active":false,"is_open":true,"can_change_to":[{"name":"CONFIRMED","comment_required":false},{"name":"RESOLVED","comment_required":false}]},{"name":"RESOLVED","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"CONFIRMED","comment_required":false},{"name":"VERIFIED","comment_required":false}]},{"name":"VERIFIED","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"CONFIRMED","comment_required":false}]}]},"cc":{"id":22,"type":0,"is_custom":false,"name":"cc","display_name":"CC","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"cclist_accessible":{"id":41,"type":0,"is_custom":false,"name":"cclist_accessible","display_name":"CC Accessible","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"cf_bugid":{"id":66,"type":6,"is_custom":true,"name":"cf_bugid","display_name":"bug id custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_datetime":{"id":65,"type":5,"is_custom":true,"name":"cf_datetime","display_name":"date time custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_dropdown":{"id":62,"type":2,"is_custom":true,"name":"cf_dropdown","display_name":"drop down custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[],"values":[{"name":"---","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"one","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"three","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"two","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false}]},"cf_freetext":{"id":61,"type":1,"is_custom":true,"name":"cf_freetext","display_name":"free text custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_largetextbox":{"id":63,"type":4,"is_custom":true,"name":"cf_largetextbox","display_name":"large text box custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[]},"cf_multiselect":{"id":64,"type":3,"is_custom":true,"name":"cf_multiselect","display_name":"multi selection box custom field","is_mandatory":false,"is_on_bug_entry":true,"visibility_values":[],"values":[{"name":"Blue","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Green","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Red","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Yellow","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false}]},"classification":{"id":3,"type":2,"is_custom":false,"name":"classification","display_name":"Classification","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"Unclassified","sort_key":0,"visibility_values":[],"is_active":false,"is_open":false}]},"comment_tag":{"id":58,"type":0,"is_custom":false,"name":"comment_tag","display_name":"Comment Tag","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"commenter":{"id":46,"type":0,"is_custom":false,"name":"commenter","display_name":"Commenter","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"component":{"id":15,"type":2,"is_custom":false,"name":"component","display_name":"Component","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[],"value_field":"product","values":[{"name":"TestComponent","sort_key":0,"visibility_values":["TestProduct"],"is_active":true,"is_open":false},{"name":"Component 1","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"Component 2","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"ManualC1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"ManualC2","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false}]},"content":{"id":52,"type":0,"is_custom":false,"name":"content","display_name":"Content","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"creation_ts":{"id":33,"type":0,"is_custom":false,"name":"creation_ts","display_name":"Creation date","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"days_elapsed":{"id":60,"type":0,"is_custom":false,"name":"days_elapsed","display_name":"Days since bug changed","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"deadline":{"id":45,"type":5,"is_custom":false,"name":"deadline","display_name":"Deadline","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"delta_ts":{"id":34,"type":0,"is_custom":false,"name":"delta_ts","display_name":"Last changed date","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"dependson":{"id":23,"type":0,"is_custom":false,"name":"dependson","display_name":"Depends on","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"dupe_of":{"id":59,"type":0,"is_custom":false,"name":"dupe_of","display_name":"Duplicate of","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"estimated_time":{"id":43,"type":0,"is_custom":false,"name":"estimated_time","display_name":"Estimated Hours","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"everconfirmed":{"id":39,"type":0,"is_custom":false,"name":"everconfirmed","display_name":"Ever Confirmed","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"flagtypes.name":{"id":47,"type":0,"is_custom":false,"name":"flagtypes.name","display_name":"Flags","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"keywords":{"id":11,"type":8,"is_custom":false,"name":"keywords","display_name":"Keywords","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"Keyword1","sort_key":0,"is_active":false,"description":"1","is_open":false},{"name":"Keyword2","sort_key":0,"is_active":false,"description":"2","is_open":false}]},"last_visit_ts":{"id":57,"type":5,"is_custom":false,"name":"last_visit_ts","display_name":"Last Visit","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"longdesc":{"id":35,"type":0,"is_custom":false,"name":"longdesc","display_name":"Comment","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"longdescs.count":{"id":37,"type":0,"is_custom":false,"name":"longdescs.count","display_name":"Number of Comments","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"longdescs.isprivate":{"id":36,"type":0,"is_custom":false,"name":"longdescs.isprivate","display_name":"Comment is private","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"op_sys":{"id":8,"type":2,"is_custom":false,"name":"op_sys","display_name":"OS/Version","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"All","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Windows","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Mac OS","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Linux","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Other","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false}]},"owner_idle_time":{"id":54,"type":0,"is_custom":false,"name":"owner_idle_time","display_name":"Time Since Assignee Touched","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"percentage_complete":{"id":51,"type":0,"is_custom":false,"name":"percentage_complete","display_name":"Percentage Complete","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"priority":{"id":14,"type":2,"is_custom":false,"name":"priority","display_name":"Priority","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"Highest","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"High","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Normal","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Low","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Lowest","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false},{"name":"---","sort_key":600,"visibility_values":[],"is_active":false,"is_open":false}]},"product":{"id":4,"type":2,"is_custom":false,"name":"product","display_name":"Product","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[]},"qa_contact":{"id":18,"type":0,"is_custom":false,"name":"qa_contact","display_name":"QAContact","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"qa_contact_realname":{"id":21,"type":0,"is_custom":false,"name":"qa_contact_realname","display_name":"QAContactName","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"remaining_time":{"id":44,"type":0,"is_custom":false,"name":"remaining_time","display_name":"Remaining Hours","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"rep_platform":{"id":6,"type":2,"is_custom":false,"name":"rep_platform","display_name":"Platform","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"All","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"PC","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Macintosh","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"Other","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false}]},"reporter":{"id":17,"type":0,"is_custom":false,"name":"reporter","display_name":"ReportedBy","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"reporter_accessible":{"id":40,"type":0,"is_custom":false,"name":"reporter_accessible","display_name":"Reporter Accessible","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"reporter_realname":{"id":20,"type":0,"is_custom":false,"name":"reporter_realname","display_name":"ReportedByName","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"requestees.login_name":{"id":48,"type":0,"is_custom":false,"name":"requestees.login_name","display_name":"Flag Requestee","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"resolution":{"id":12,"type":2,"is_custom":false,"name":"resolution","display_name":"Resolution","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"values":[{"name":"","sort_key":100,"visibility_values":[],"is_active":false,"is_open":false},{"name":"FIXED","sort_key":200,"visibility_values":[],"is_active":false,"is_open":false},{"name":"INVALID","sort_key":300,"visibility_values":[],"is_active":false,"is_open":false},{"name":"WONTFIX","sort_key":400,"visibility_values":[],"is_active":false,"is_open":false},{"name":"DUPLICATE","sort_key":500,"visibility_values":[],"is_active":false,"is_open":false},{"name":"WORKSFORME","sort_key":600,"visibility_values":[],"is_active":false,"is_open":false}]},"see_also":{"id":55,"type":7,"is_custom":false,"name":"see_also","display_name":"See Also","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"setters.login_name":{"id":49,"type":0,"is_custom":false,"name":"setters.login_name","display_name":"Flag Setter","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"short_desc":{"id":2,"type":0,"is_custom":false,"name":"short_desc","display_name":"Summary","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[]},"status_whiteboard":{"id":10,"type":0,"is_custom":false,"name":"status_whiteboard","display_name":"Status Whiteboard","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"tag":{"id":56,"type":8,"is_custom":false,"name":"tag","display_name":"Personal Tags","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]},"target_milestone":{"id":32,"type":0,"is_custom":false,"name":"target_milestone","display_name":"Target Milestone","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[],"value_field":"product","values":[{"name":"---","sort_key":0,"visibility_values":["TestProduct"],"is_active":true,"is_open":false},{"name":"---","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"---","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M1.0","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"M2","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M2.0","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"M3","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"M3.0","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false}]},"version":{"id":5,"type":0,"is_custom":false,"name":"version","display_name":"Version","is_mandatory":true,"is_on_bug_entry":false,"visibility_values":[],"value_field":"product","values":[{"name":"unspecified","sort_key":0,"visibility_values":["TestProduct"],"is_active":true,"is_open":false},{"name":"unspecified","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"a","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"b","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"c","sort_key":0,"visibility_values":["Product with Spaces"],"is_active":true,"is_open":false},{"name":"unspecified","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"R1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"R1.1","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false},{"name":"R2.0","sort_key":0,"visibility_values":["ManualTest"],"is_active":true,"is_open":false}]},"work_time":{"id":50,"type":0,"is_custom":false,"name":"work_time","display_name":"Hours Worked","is_mandatory":false,"is_on_bug_entry":false,"visibility_values":[]}},"products":{"ManualTest":{"id":3,"name":"ManualTest","is_active":true,"description":"Product for manual testing","default_milestone":"---","has_unconfirmed":false,"classification":"Unclassified","components":[{"id":4,"description":"1","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"ManualC1","sort_key":0,"is_active":true},{"id":5,"description":"2","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"ManualC2","sort_key":0,"is_active":true}],"versions":[{"name":"R1","sort_key":0,"is_active":true},{"name":"R1.1","sort_key":0,"is_active":true},{"name":"R2.0","sort_key":0,"is_active":true},{"name":"unspecified","sort_key":0,"is_active":true}],"milestones":[{"name":"---","sort_key":0,"is_active":true},{"name":"M1","sort_key":0,"is_active":true},{"name":"M2","sort_key":0,"is_active":true},{"name":"M3","sort_key":0,"is_active":true}]},"Product with Spaces":{"id":2,"name":"Product with Spaces","is_active":true,"description":"Product with Spaces is the renamed Scratch Product.","default_milestone":"---","has_unconfirmed":true,"classification":"Unclassified","components":[{"id":2,"description":"1","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"Component 1","sort_key":0,"is_active":true},{"id":3,"description":"2","default_assigned_to":"tests@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"Component 2","sort_key":0,"is_active":true}],"versions":[{"name":"a","sort_key":0,"is_active":true},{"name":"b","sort_key":0,"is_active":true},{"name":"c","sort_key":0,"is_active":true},{"name":"unspecified","sort_key":0,"is_active":true}],"milestones":[{"name":"---","sort_key":0,"is_active":true},{"name":"M1.0","sort_key":0,"is_active":true},{"name":"M2.0","sort_key":0,"is_active":true},{"name":"M3.0","sort_key":0,"is_active":true}]},"TestProduct":{"id":1,"name":"TestProduct","is_active":true,"description":"This is a test product. This ought to be blown away and replaced with real stuff in a finished installation of bugzilla.","default_milestone":"---","has_unconfirmed":true,"classification":"Unclassified","components":[{"id":1,"description":"This is a test component in the test product database. This ought to be blown away and replaced with real stuff in a finished installation of Bugzilla.","default_assigned_to":"admin@mylyn.eclipse.org","default_qa_contact":"","flag_types":{"bug":[{"id":1,"name":"BugFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":false,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":2,"name":"BugFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":false,"grant_group":0,"request_group":0},{"id":5,"name":"BugFlag3","description":"3","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":false,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":6,"name":"BugFlag4","description":"4","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}],"attachment":[{"id":3,"name":"AttachmentFlag1","description":"1","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0},{"id":4,"name":"AttachmentFlag2","description":"2","cc_list":"","sort_key":1,"is_active":true,"is_requestable":true,"is_requesteeble":true,"is_multiplicable":true,"grant_group":0,"request_group":0}]},"name":"TestComponent","sort_key":0,"is_active":true}],"versions":[{"name":"unspecified","sort_key":0,"is_active":true}],"milestones":[{"name":"---","sort_key":0,"is_active":true}]}},"parameters":{"allowemailchange":"1","attachment_base":"","commentonchange_resolution":"0","commentonduplicate":"0","defaultopsys":"","defaultplatform":"","defaultpriority":"---","defaultseverity":"enhancement","duplicate_or_move_bug_status":"RESOLVED","emailregexpdesc":"A legal address must contain exactly one \u0027@\u0027, and at least one \u0027.\u0027 after the @.","letsubmitterchoosemilestone":"1","letsubmitterchoosepriority":"1","mailfrom":"bugzilla-daemon","maintainer":"admin@mylyn.eclipse.org","maxattachmentsize":"1000","maxlocalattachment":"0","password_complexity":"no_constraints","rememberlogin":"on","requirelogin":"0","search_allow_no_criteria":"1","urlbase":"","use_see_also":"1","useclassification":"0","usemenuforusers":"0","useqacontact":"1","usestatuswhiteboard":"1","usetargetmilestone":"1"}}
\ No newline at end of file diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/parameters.json b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/parameters.json index 1681a4758..00be59bab 100644 --- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/parameters.json +++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/parameters.json @@ -1 +1 @@ -{"allowemailchange":"1","attachment_base":"","commentonchange_resolution":"0","commentonduplicate":"0","defaultopsys":"","defaultplatform":"","defaultpriority":"---","defaultseverity":"enhancement","duplicate_or_move_bug_status":"RESOLVED","emailregexpdesc":"A legal address must contain exactly one \u0027@\u0027, and at least one \u0027.\u0027 after the @.","emailsuffix":"","letsubmitterchoosemilestone":"1","letsubmitterchoosepriority":"1","mailfrom":"bugzilla-daemon","maintainer":"admin@mylyn.eclipse.org","maxattachmentsize":"1000","maxlocalattachment":"0","password_complexity":"no_constraints","rememberlogin":"on","requirelogin":"0","search_allow_no_criteria":"1","urlbase":"","use_see_also":"1","useclassification":"0","usemenuforusers":"0","useqacontact":"1","usestatuswhiteboard":"1","usetargetmilestone":"1"}
\ No newline at end of file +{"allowemailchange":"1","attachment_base":"","commentonchange_resolution":"0","commentonduplicate":"0","defaultopsys":"","defaultplatform":"","defaultpriority":"---","defaultseverity":"enhancement","duplicate_or_move_bug_status":"RESOLVED","emailregexpdesc":"A legal address must contain exactly one \u0027@\u0027, and at least one \u0027.\u0027 after the @.","letsubmitterchoosemilestone":"1","letsubmitterchoosepriority":"1","mailfrom":"bugzilla-daemon","maintainer":"admin@mylyn.eclipse.org","maxattachmentsize":"1000","maxlocalattachment":"0","password_complexity":"no_constraints","rememberlogin":"on","requirelogin":"0","search_allow_no_criteria":"1","urlbase":"","use_see_also":"1","useclassification":"0","usemenuforusers":"0","useqacontact":"1","usestatuswhiteboard":"1","usetargetmilestone":"1"}
\ No newline at end of file diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java index d6d2ecc04..c65a69cb7 100644 --- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java +++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java @@ -126,12 +126,19 @@ public class BugzillaRestGetTaskData extends BugzillaRestAuthenticatedGetRequest String attributeId = BugzillaRestTaskSchema.getAttributeNameFromFieldName(entry.getKey()); if (entry.getKey().equals("assigned_to_detail")) { //$NON-NLS-1$ TaskAttribute attribute = taskData.getRoot().getAttribute(taskSchema.ASSIGNED_TO.getKey()); - JsonElement value = entry.getValue().getAsJsonObject().get("email"); //$NON-NLS-1$//.get("real_name"); if (attribute != null) { - attribute.setValue(value.getAsString()); + JsonElement value = entry.getValue().getAsJsonObject().get("email"); //$NON-NLS-1$ + if (value != null) { + attribute.setValue(value.getAsString()); + } else { + value = entry.getValue().getAsJsonObject().get("name"); //$NON-NLS-1$ + if (value != null) { + attribute.setValue(value.getAsString()); + } + } } continue; - } else if (entry.getKey().equals("last_change_time")) { + } else if (entry.getKey().equals("last_change_time")) { //$NON-NLS-1$ TaskAttribute attribute = taskData.getRoot() .getAttribute(taskSchema.DATE_MODIFICATION.getKey()); JsonElement value = entry.getValue(); //.get("real_name"); diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java index 09db50c40..9d8ede6df 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java @@ -165,7 +165,7 @@ public class BugzillaClient { private static final String CONTENT_TYPE_TEXT_XML = "text/xml"; //$NON-NLS-1$ private static final String[] VALID_CONFIG_CONTENT_TYPES = { CONTENT_TYPE_APP_RDF_XML, CONTENT_TYPE_APP_XML, - CONTENT_TYPE_TEXT_XML }; + CONTENT_TYPE_TEXT_XML }; private static final String ATTR_CHARSET = "charset"; //$NON-NLS-1$ @@ -197,7 +197,7 @@ public class BugzillaClient { public BugzillaClient(AbstractWebLocation location, String characterEncoding, Map<String, String> configParameters, BugzillaLanguageSettings languageSettings, BugzillaRepositoryConnector connector) - throws MalformedURLException { + throws MalformedURLException { this.repositoryUrl = new URL(location.getUrl()); this.location = location; this.characterEncoding = characterEncoding; @@ -238,8 +238,8 @@ public class BugzillaClient { String transitionsFileName = configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE); if (transitionsFileName != null && !transitionsFileName.equals("")) { //$NON-NLS-1$ if (!validTransitions.parse(transitionsFileName)) { - throw new CoreException(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, - "Invalide Transition File Content")); //$NON-NLS-1$ + throw new CoreException( + new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, "Invalide Transition File Content")); //$NON-NLS-1$ } } @@ -249,12 +249,12 @@ public class BugzillaClient { try { uID = xmlRpcClient.login(monitor); if (uID == -1) { - throw new CoreException(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, - "XMLRPC user could not login")); //$NON-NLS-1$ + throw new CoreException( + new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, "XMLRPC user could not login")); //$NON-NLS-1$ } } catch (XmlRpcException e) { - throw new CoreException(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, - "XMLRPC is not installed")); //$NON-NLS-1$ + throw new CoreException( + new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, "XMLRPC is not installed")); //$NON-NLS-1$ } } @@ -277,8 +277,8 @@ public class BugzillaClient { } - protected GzipGetMethod getConnectGzip(String serverURL, IProgressMonitor monitor) throws IOException, - CoreException { + protected GzipGetMethod getConnectGzip(String serverURL, IProgressMonitor monitor) + throws IOException, CoreException { return getConnectGzip(serverURL, monitor, null); } @@ -376,7 +376,7 @@ public class BugzillaClient { throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_REPOSITORY_LOGIN, "All connection attempts to " + repositoryUrl.toString() //$NON-NLS-1$ - + " failed. Please verify connection and authentication information.")); //$NON-NLS-1$ + + " failed. Please verify connection and authentication information.")); //$NON-NLS-1$ } public void logout(IProgressMonitor monitor) throws IOException, CoreException { @@ -403,14 +403,16 @@ public class BugzillaClient { } private boolean isZippedReply(HttpMethodBase method) { - // content-encoding:gzip can be set by a dedicated perl script or mod_gzip + // content-encoding:gzip can be set by a dedicated perl script or + // mod_gzip boolean zipped = (null != method.getResponseHeader("Content-encoding") && method.getResponseHeader( //$NON-NLS-1$ "Content-encoding").getValue().equals(IBugzillaConstants.CONTENT_ENCODING_GZIP)) //$NON-NLS-1$ || - // content-type: application/x-gzip can be set by any apache after 302 redirect, based on .gz suffix + // content-type: application/x-gzip can be set by any apache + // after 302 redirect, based on .gz suffix (null != method.getResponseHeader("Content-Type") && method.getResponseHeader("Content-Type") //$NON-NLS-1$ //$NON-NLS-2$ - .getValue() - .equals("application/x-gzip")); //$NON-NLS-1$ + .getValue() + .equals("application/x-gzip")); //$NON-NLS-1$ return zipped; } @@ -448,7 +450,8 @@ public class BugzillaClient { getMethod.setDoAuthentication(true); getMethod.setFollowRedirects(false); httpClient.getState().clearCookies(); - // for Bugzilla > 4.4.2 but not 4.5, 4.5.1 or 4.5.2 we need first the Bugzilla_login_request_cookie + // for Bugzilla > 4.4.2 but not 4.5, 4.5.1 or 4.5.2 we need first + // the Bugzilla_login_request_cookie int code = WebUtil.execute(httpClient, hostConfiguration, getMethod, monitor); WebUtil.releaseConnection(getMethod, monitor); if (code != HttpURLConnection.HTTP_OK) { @@ -457,7 +460,8 @@ public class BugzillaClient { RepositoryStatus.ERROR_NETWORK, "Http error: " + HttpStatus.getStatusText(code))); //$NON-NLS-1$ } - // for Bugzilla > 4.4.2 but not 4.5, 4.5.1 or 4.5.2 we now do the real authentication + // for Bugzilla > 4.4.2 but not 4.5, 4.5.1 or 4.5.2 we now do the + // real authentication code = WebUtil.execute(httpClient, hostConfiguration, getMethod, monitor); if (code != HttpURLConnection.HTTP_OK) { loggedIn = false; @@ -520,12 +524,13 @@ public class BugzillaClient { RepositoryStatus.ERROR_EMPTY_PASSWORD, repositoryUrl.toString(), "Empty password not allowed for Authentication credentials.")); //$NON-NLS-1$ } - formData[0] = new NameValuePair(IBugzillaConstants.POST_INPUT_BUGZILLA_LOGIN, credentials.getUserName()); + formData[0] = new NameValuePair(IBugzillaConstants.POST_INPUT_BUGZILLA_LOGIN, + credentials.getUserName()); formData[1] = new NameValuePair(IBugzillaConstants.POST_INPUT_BUGZILLA_PASSWORD, credentials.getPassword()); } - postMethod = new GzipPostMethod(WebUtil.getRequestPath(repositoryUrl.toString() - + IBugzillaConstants.URL_POST_LOGIN), true); + postMethod = new GzipPostMethod( + WebUtil.getRequestPath(repositoryUrl.toString() + IBugzillaConstants.URL_POST_LOGIN), true); postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=" //$NON-NLS-1$ //$NON-NLS-2$ + getCharacterEncoding()); @@ -564,9 +569,12 @@ public class BugzillaClient { } if (httpAuthCredentials != null && httpAuthCredentials.getUserName() != null && httpAuthCredentials.getUserName().length() > 0) { - // If httpAuthCredentials are used HttpURLConnection.HTTP_UNAUTHORIZED when the credentials are invalide so we + // If httpAuthCredentials are used + // HttpURLConnection.HTTP_UNAUTHORIZED when the credentials are + // invalide so we // not need to test the cookies. - // see bug 305267 or https://bugzilla.mozilla.org/show_bug.cgi?id=385606 + // see bug 305267 or + // https://bugzilla.mozilla.org/show_bug.cgi?id=385606 loggedIn = true; InputStream inputStream = getResponseStream(postMethod, monitor); try { @@ -629,8 +637,8 @@ public class BugzillaClient { return null; } - private static String computeErrorMessage(HtmlStreamTokenizer tokenizer, Token token) throws IOException, - ParseException { + private static String computeErrorMessage(HtmlStreamTokenizer tokenizer, Token token) + throws IOException, ParseException { int tagDepth = 0; String errorMessage = ""; //$NON-NLS-1$ for (token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { @@ -664,6 +672,7 @@ public class BugzillaClient { return false; } + @SuppressWarnings("deprecation") public boolean getSearchHits(IRepositoryQuery query, TaskDataCollector collector, TaskAttributeMapper mapper, IProgressMonitor monitor) throws IOException, CoreException { HttpMethodBase postMethod = null; @@ -684,14 +693,15 @@ public class BugzillaClient { pairs.add(new NameValuePair(nameValue[0].trim(), "")); //$NON-NLS-1$ } else if (nameValue.length == 2 && nameValue[0] != null && nameValue[1] != null) { - //Hack around bugzilla's change of attribute name for comment search field bug#289155 + // Hack around bugzilla's change of attribute name + // for comment search field bug#289155 if (nameValue[0].startsWith("long_desc")) { //$NON-NLS-1$ pairs.add(new NameValuePair(nameValue[0].replace("long_desc", "longdesc"), //$NON-NLS-1$ //$NON-NLS-2$ URLDecoder.decode(nameValue[1].trim(), getCharacterEncoding()))); } - pairs.add(new NameValuePair(nameValue[0].trim(), URLDecoder.decode(nameValue[1].trim(), - getCharacterEncoding()))); + pairs.add(new NameValuePair(nameValue[0].trim(), + URLDecoder.decode(nameValue[1].trim(), getCharacterEncoding()))); } } } @@ -707,7 +717,8 @@ public class BugzillaClient { postMethod = postFormData(IBugzillaConstants.URL_BUGLIST, pairs.toArray(new NameValuePair[pairs.size()]), monitor); } catch (RedirectException r) { - // Handle one redirect (Bugzilla 3.4 provides a redirect upon query submission via post) + // Handle one redirect (Bugzilla 3.4 provides a redirect upon + // query submission via post) postMethod = getConnectGzip(r.getMessage(), monitor, null); } @@ -726,7 +737,8 @@ public class BugzillaClient { } } } - // because html is not a valid config content type it is save to get the response here + // because html is not a valid config content type it is save to get + // the response here throw new CoreException(parseHtmlError(getResponseStream(postMethod, monitor))); } finally { if (postMethod != null) { @@ -775,8 +787,8 @@ public class BugzillaClient { taskRepository, existingReport, false); BugzillaUtil.addAttributeIfUsed(BugzillaAttribute.REMOVE_SEE_ALSO, IBugzillaConstants.BUGZILLA_PARAM_USE_SEE_ALSO, taskRepository, existingReport, false); - BugzillaUtil.addAttributeIfUsed(BugzillaAttribute.SEE_ALSO_READ, - IBugzillaConstants.BUGZILLA_PARAM_USE_SEE_ALSO, taskRepository, existingReport, false); + BugzillaUtil.addAttributeIfUsed(BugzillaAttribute.SEE_ALSO_READ, IBugzillaConstants.BUGZILLA_PARAM_USE_SEE_ALSO, + taskRepository, existingReport, false); if (repositoryConfiguration == null) { repositoryConfiguration = connector.getRepositoryConfiguration(serverUrl); } @@ -812,8 +824,8 @@ public class BugzillaClient { } @Deprecated - public RepositoryConfiguration getRepositoryConfiguration(IProgressMonitor monitor) throws IOException, - CoreException { + public RepositoryConfiguration getRepositoryConfiguration(IProgressMonitor monitor) + throws IOException, CoreException { return getRepositoryConfiguration(monitor, null); } @@ -824,8 +836,10 @@ public class BugzillaClient { while (attempt < 2) { try { method = getConnectGzip(repositoryUrl + IBugzillaConstants.URL_GET_CONFIG_RDF, monitor, eTagValue); - // provide a solution for bug 196056 by allowing a (cached) gzipped configuration to be sent - // modified to also accept "application/x-gzip" as results from a 302 redirect to a previously gzipped file. + // provide a solution for bug 196056 by allowing a (cached) + // gzipped configuration to be sent + // modified to also accept "application/x-gzip" as results from + // a 302 redirect to a previously gzipped file. if (method == null) { throw new IOException("Could not retrieve configuratoin. HttpClient return null method."); //$NON-NLS-1$ } @@ -849,7 +863,8 @@ public class BugzillaClient { Header lastModifiedHeader = method.getResponseHeader("Last-Modified"); //$NON-NLS-1$ if (lastModifiedHeader != null) { try { - repositoryConfiguration.setLastModifiedHeader(DateUtil.parseDate(lastModifiedHeader.getValue())); + repositoryConfiguration.setLastModifiedHeader( + DateUtil.parseDate(lastModifiedHeader.getValue())); } catch (DateParseException e) { repositoryConfiguration.setLastModifiedHeader((Date) null); } @@ -864,7 +879,8 @@ public class BugzillaClient { configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE)); } else { repositoryConfiguration.setValidTransitions(monitor, - configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE), null); + configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE), + null); } if (!repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).isEmpty()) { repositoryConfiguration.setRepositoryUrl(repositoryUrl.toString()); @@ -874,13 +890,14 @@ public class BugzillaClient { return repositoryConfiguration; } else { if (attempt == 0) { - // empty configuration, retry authenticate + // empty configuration, retry + // authenticate loggedIn = false; break; } else { - throw new CoreException( - new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, - "No products found in repository configuration. Ensure credentials are valid.")); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.WARNING, + BugzillaCorePlugin.ID_PLUGIN, + "No products found in repository configuration. Ensure credentials are valid.")); //$NON-NLS-1$ } } } @@ -904,8 +921,8 @@ public class BugzillaClient { return null; } - public InputStream getAttachmentData(String attachmentId, IProgressMonitor monitor) throws IOException, - CoreException { + public InputStream getAttachmentData(String attachmentId, IProgressMonitor monitor) + throws IOException, CoreException { String url = repositoryUrl + IBugzillaConstants.URL_GET_ATTACHMENT_DOWNLOAD + attachmentId; GetMethod method = getConnect(url, monitor); Status status = null; @@ -915,7 +932,7 @@ public class BugzillaClient { if (contentDisposition == null) { status = parseHtmlError(method.getResponseBodyAsStream()); } else { - //copy the response + // copy the response return method.getResponseBodyAsStream(); } } else { @@ -943,8 +960,8 @@ public class BugzillaClient { } public void postAttachment(String bugReportID, String comment, AbstractTaskAttachmentSource source, - TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws HttpException, IOException, - CoreException { + TaskAttribute attachmentAttribute, IProgressMonitor monitor) + throws HttpException, IOException, CoreException { monitor = Policy.monitorFor(monitor); String description = source.getDescription(); String contentType = source.getContentType(); @@ -983,19 +1000,21 @@ public class BugzillaClient { GzipPostMethod postMethod = null; try { - postMethod = new GzipPostMethod(WebUtil.getRequestPath(repositoryUrl - + IBugzillaConstants.URL_POST_ATTACHMENT_UPLOAD), true); + postMethod = new GzipPostMethod( + WebUtil.getRequestPath(repositoryUrl + IBugzillaConstants.URL_POST_ATTACHMENT_UPLOAD), true); // This option causes the client to first // check // with the server to see if it will in fact receive the post before // actually sending the contents. postMethod.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true); List<PartBase> parts = new ArrayList<PartBase>(); - parts.add(new StringPart(IBugzillaConstants.POST_INPUT_ACTION, VALUE_ACTION_INSERT, getCharacterEncoding())); + parts.add( + new StringPart(IBugzillaConstants.POST_INPUT_ACTION, VALUE_ACTION_INSERT, getCharacterEncoding())); parts.add(new StringPart(IBugzillaConstants.POST_INPUT_BUGID, bugReportID, getCharacterEncoding())); if (description != null) { - parts.add(new StringPart(IBugzillaConstants.POST_INPUT_DESCRIPTION, description, getCharacterEncoding())); + parts.add( + new StringPart(IBugzillaConstants.POST_INPUT_DESCRIPTION, description, getCharacterEncoding())); } if (comment != null) { parts.add(new StringPart(IBugzillaConstants.POST_INPUT_COMMENT, comment, getCharacterEncoding())); @@ -1086,7 +1105,7 @@ public class BugzillaClient { WebUtil.releaseConnection(postMethod, monitor); throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_NETWORK, repositoryUrl.toString(), "Http error: " //$NON-NLS-1$ - + HttpStatus.getStatusText(status))); + + HttpStatus.getStatusText(status))); // throw new IOException("Communication error occurred during // upload. \n\n" // + HttpStatus.getStatusText(status)); @@ -1112,8 +1131,8 @@ public class BugzillaClient { authenticate(monitor); postMethod = new GzipPostMethod(WebUtil.getRequestPath(repositoryUrl.toString() + formUrl), true); - postMethod.setRequestHeader( - "Content-Type", "application/x-www-form-urlencoded; charset=" + getCharacterEncoding()); //$NON-NLS-1$ //$NON-NLS-2$ + postMethod.setRequestHeader("Content-Type", //$NON-NLS-1$ + "application/x-www-form-urlencoded; charset=" + getCharacterEncoding()); //$NON-NLS-1$ httpClient.getHttpConnectionManager().getParams().setSoTimeout(WebUtil.getConnectionTimeout()); @@ -1127,6 +1146,9 @@ public class BugzillaClient { Header locationHeader = postMethod.getResponseHeader("location"); //$NON-NLS-1$ if (locationHeader != null) { redirectLocation = locationHeader.getValue(); + if (!redirectLocation.startsWith("http")) { //$NON-NLS-1$ + redirectLocation = location.getUrl() + "/" + redirectLocation; //$NON-NLS-1$ + } WebUtil.releaseConnection(postMethod, monitor); throw new RedirectException(redirectLocation); } @@ -1207,7 +1229,8 @@ public class BugzillaClient { GzipPostMethod method = null; InputStream input = null; try { - method = postFormData(PROCESS_ATTACHMENT_CGI, formData.toArray(new NameValuePair[formData.size()]), monitor); + method = postFormData(PROCESS_ATTACHMENT_CGI, formData.toArray(new NameValuePair[formData.size()]), + monitor); if (method == null) { throw new IOException(Messages.BugzillaClient_could_not_post_form_null_returned); @@ -1217,57 +1240,69 @@ public class BugzillaClient { parsePostResponse(taskAttribute.getTaskData().getTaskId(), input); -// BufferedReader in = new BufferedReader(new InputStreamReader(input, method.getRequestCharSet())); -// if (in.markSupported()) { -// in.mark(1); -// } -// HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null); -// -// boolean isTitle = false; -// String title = ""; //$NON-NLS-1$ -// -// for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { -// -// if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.TITLE -// && !((HtmlTag) (token.getValue())).isEndTag()) { -// isTitle = true; -// continue; -// } -// -// if (isTitle) { -// // get all of the data in the title tag -// if (token.getType() != Token.TAG) { -// title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; //$NON-NLS-1$ -// continue; -// } else if (token.getType() == Token.TAG && ((HtmlTag) token.getValue()).getTagType() == Tag.TITLE -// && ((HtmlTag) token.getValue()).isEndTag()) { -// -// for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( -// BugzillaLanguageSettings.COMMAND_CHANGES_SUBMITTED).iterator(); iterator.hasNext() -// && !existingBugPosted;) { -// String value = iterator.next().toLowerCase(Locale.ENGLISH); -// existingBugPosted = existingBugPosted || title.indexOf(value) != -1; -// } -// break; -// } -// } -// } -// -// if (existingBugPosted != true) { -// try { -// if (in.markSupported()) { -// in.reset(); -// } -// } catch (IOException e) { -// // ignore -// } -// parseHtmlError(in); -// } -// -// } catch (ParseException e) { -// loggedIn = false; -// throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, -// RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ + // BufferedReader in = new BufferedReader(new + // InputStreamReader(input, method.getRequestCharSet())); + // if (in.markSupported()) { + // in.mark(1); + // } + // HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, + // null); + // + // boolean isTitle = false; + // String title = ""; //$NON-NLS-1$ + // + // for (Token token = tokenizer.nextToken(); token.getType() != + // Token.EOF; token = tokenizer.nextToken()) { + // + // if (token.getType() == Token.TAG && ((HtmlTag) + // (token.getValue())).getTagType() == Tag.TITLE + // && !((HtmlTag) (token.getValue())).isEndTag()) { + // isTitle = true; + // continue; + // } + // + // if (isTitle) { + // // get all of the data in the title tag + // if (token.getType() != Token.TAG) { + // title += ((StringBuffer) + // token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; + // //$NON-NLS-1$ + // continue; + // } else if (token.getType() == Token.TAG && ((HtmlTag) + // token.getValue()).getTagType() == Tag.TITLE + // && ((HtmlTag) token.getValue()).isEndTag()) { + // + // for (Iterator<String> iterator = + // bugzillaLanguageSettings.getResponseForCommand( + // BugzillaLanguageSettings.COMMAND_CHANGES_SUBMITTED).iterator(); + // iterator.hasNext() + // && !existingBugPosted;) { + // String value = iterator.next().toLowerCase(Locale.ENGLISH); + // existingBugPosted = existingBugPosted || title.indexOf(value) != + // -1; + // } + // break; + // } + // } + // } + // + // if (existingBugPosted != true) { + // try { + // if (in.markSupported()) { + // in.reset(); + // } + // } catch (IOException e) { + // // ignore + // } + // parseHtmlError(in); + // } + // + // } catch (ParseException e) { + // loggedIn = false; + // throw new CoreException(new BugzillaStatus(IStatus.ERROR, + // BugzillaCorePlugin.ID_PLUGIN, + // RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + // + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ } finally { if (input != null) { input.close(); @@ -1278,8 +1313,8 @@ public class BugzillaClient { } } - public RepositoryResponse postTaskData(TaskData taskData, IProgressMonitor monitor) throws IOException, - CoreException { + public RepositoryResponse postTaskData(TaskData taskData, IProgressMonitor monitor) + throws IOException, CoreException { try { return postTaskDataInternal(taskData, monitor); } catch (CoreException e) { @@ -1291,9 +1326,8 @@ public class BugzillaClient { && qaContactValue != null && !qaContactValue.equals("")) { //$NON-NLS-1$ if (e.getStatus() instanceof RepositoryStatus) { RepositoryStatus repositoryStatus = (RepositoryStatus) e.getStatus(); - RepositoryStatus status = RepositoryStatus.createHtmlStatus( - repositoryStatus.getRepositoryUrl(), IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN, - RepositoryStatus.ERROR_REPOSITORY, + RepositoryStatus status = RepositoryStatus.createHtmlStatus(repositoryStatus.getRepositoryUrl(), + IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_REPOSITORY, "Error may result when QAContact field not enabled.", //$NON-NLS-1$ repositoryStatus.getHtmlMessage()); throw new CoreException(status); @@ -1333,8 +1367,8 @@ public class BugzillaClient { code = WebUtil.execute(httpClient, hostConfiguration, getMethod, monitor); if (code == HttpURLConnection.HTTP_OK) { inStream = getResponseStream(getMethod, monitor); - HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(new BufferedReader(new InputStreamReader( - inStream, getCharacterEncoding())), null); + HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer( + new BufferedReader(new InputStreamReader(inStream, getCharacterEncoding())), null); for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.INPUT && !((HtmlTag) (token.getValue())).isEndTag()) { @@ -1358,7 +1392,7 @@ public class BugzillaClient { try { inStream.close(); } catch (IOException e) { - //ignore + // ignore } } WebUtil.releaseConnection(getMethod, monitor); @@ -1367,8 +1401,8 @@ public class BugzillaClient { return tokenValue; } - public RepositoryResponse postTaskDataInternal(TaskData taskData, IProgressMonitor monitor) throws IOException, - CoreException { + public RepositoryResponse postTaskDataInternal(TaskData taskData, IProgressMonitor monitor) + throws IOException, CoreException { NameValuePair[] formData = null; monitor = Policy.monitorFor(monitor); BugzillaRepositoryResponse response; @@ -1393,7 +1427,7 @@ public class BugzillaClient { token = getTokenInternal( taskData.getRepositoryUrl() + ENTER_BUG_PRODUCT_CGI - + URLEncoder.encode(productAttribute.getValue(), IBugzillaConstants.ENCODING_UTF_8), + + URLEncoder.encode(productAttribute.getValue(), IBugzillaConstants.ENCODING_UTF_8), monitor); } formData = getPairsForNew(taskData, token); @@ -1445,7 +1479,8 @@ public class BugzillaClient { // go through all of the attributes and add them to // the bug post - Collection<TaskAttribute> attributes = new ArrayList<TaskAttribute>(taskData.getRoot().getAttributes().values()); + Collection<TaskAttribute> attributes = new ArrayList<TaskAttribute>( + taskData.getRoot().getAttributes().values()); Iterator<TaskAttribute> itr = attributes.iterator(); while (itr.hasNext()) { TaskAttribute a = itr.next(); @@ -1458,12 +1493,12 @@ public class BugzillaClient { String id = a.getId(); if (id.equals(BugzillaAttribute.BUG_STATUS.getKey()) && bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) >= 0) { - if (repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains( - BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) - || repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains( - BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) { - TaskAttribute attributeOperation = taskData.getRoot().getMappedAttribute( - TaskAttribute.OPERATION); + if (repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS) + .contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) + || repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS) + .contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) { + TaskAttribute attributeOperation = taskData.getRoot() + .getMappedAttribute(TaskAttribute.OPERATION); value = attributeOperation.getValue().toUpperCase(); if (!BugzillaOperation.new_default.toString().toUpperCase().equals(value)) { fields.put(id, new NameValuePair(id, value != null ? value : "")); //$NON-NLS-1$ @@ -1475,11 +1510,11 @@ public class BugzillaClient { if (id.equals(BugzillaAttribute.NEWCC.getKey())) { TaskAttribute b = taskData.getRoot().createAttribute(BugzillaAttribute.CC.getKey()); b.getMetaData() - .defaults() - .setReadOnly(BugzillaAttribute.CC.isReadOnly()) - .setKind(BugzillaAttribute.CC.getKind()) - .setLabel(BugzillaAttribute.CC.toString()) - .setType(BugzillaAttribute.CC.getType()); + .defaults() + .setReadOnly(BugzillaAttribute.CC.isReadOnly()) + .setKind(BugzillaAttribute.CC.getKind()) + .setLabel(BugzillaAttribute.CC.toString()) + .setType(BugzillaAttribute.CC.getType()); for (String val : a.getValues()) { if (val != null) { b.addValue(val); @@ -1592,7 +1627,7 @@ public class BugzillaClient { if (id.equals(BugzillaAttribute.DELTA_TS.getKey())) { if (bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_4_7) < 0 || (bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_5) >= 0) - && bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_6) < 0) { + && bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_6) < 0) { value = stripTimeZone(value); } } @@ -1617,8 +1652,11 @@ public class BugzillaClient { id = "flag_type-" + flagTypeNumber; //$NON-NLS-1$ value = a.getValue(); if (value.equals("?") && requestee != null) { //$NON-NLS-1$ - fields.put("requestee_type-" + flagTypeNumber, new NameValuePair("requestee_type-" //$NON-NLS-1$ //$NON-NLS-2$ - + flagTypeNumber, requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ + fields.put("requestee_type-" + flagTypeNumber, //$NON-NLS-1$ + new NameValuePair( + "requestee_type-" //$NON-NLS-1$ + + flagTypeNumber, + requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ } } } else if (id.startsWith(BugzillaAttribute.KIND_FLAG)) { @@ -1631,14 +1669,18 @@ public class BugzillaClient { value = "X"; //$NON-NLS-1$ } if (value.equals("?") && requestee != null) { //$NON-NLS-1$ - fields.put("requestee-" + flagnumber.getValue(), new NameValuePair("requestee-" //$NON-NLS-1$//$NON-NLS-2$ - + flagnumber.getValue(), requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ + fields.put("requestee-" + flagnumber.getValue(), //$NON-NLS-1$ + new NameValuePair( + "requestee-" //$NON-NLS-1$ + + flagnumber.getValue(), + requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ } } else if (id.startsWith(TaskAttribute.PREFIX_COMMENT)) { String valueID = a.getValue(); - TaskAttribute definedIsPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE - + valueID); - TaskAttribute isPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE + valueID); + TaskAttribute definedIsPrivate = a + .getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE + valueID); + TaskAttribute isPrivate = a + .getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE + valueID); if (definedIsPrivate != null && isPrivate != null) { fields.put(definedIsPrivate.getId(), new NameValuePair(definedIsPrivate.getId(), definedIsPrivate.getValue() != null ? definedIsPrivate.getValue() : "")); //$NON-NLS-1$ @@ -1651,10 +1693,10 @@ public class BugzillaClient { TaskAttribute idAttribute = a.getAttribute("id"); //$NON-NLS-1$ if (idAttribute != null) { String valueID = idAttribute.getValue(); - TaskAttribute definedIsPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE - + valueID); - TaskAttribute isPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE - + valueID); + TaskAttribute definedIsPrivate = a + .getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE + valueID); + TaskAttribute isPrivate = a + .getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE + valueID); if (definedIsPrivate != null && isPrivate != null) { fields.put(definedIsPrivate.getId(), new NameValuePair(definedIsPrivate.getId(), definedIsPrivate.getValue() != null ? definedIsPrivate.getValue() : "")); //$NON-NLS-1$ @@ -1663,7 +1705,8 @@ public class BugzillaClient { } } } else if (id.startsWith("task.common.")) { //$NON-NLS-1$ - // Don't post any remaining non-bugzilla specific attributes + // Don't post any remaining non-bugzilla specific + // attributes continue; } if (id.equals(BugzillaAttribute.DELTA_TS.getKey())) { @@ -1687,14 +1730,14 @@ public class BugzillaClient { if (attributeOperation == null) { fields.put(KEY_KNOB, new NameValuePair(KEY_KNOB, VAL_NONE)); } else { - TaskAttribute originalOperation = model.getRoot().getAttribute( - TaskAttribute.PREFIX_OPERATION + attributeOperation.getValue()); + TaskAttribute originalOperation = model.getRoot() + .getAttribute(TaskAttribute.PREFIX_OPERATION + attributeOperation.getValue()); if (originalOperation == null) { // Work around for bug#241012 fields.put(KEY_KNOB, new NameValuePair(KEY_KNOB, VAL_NONE)); } else { - String inputAttributeId = originalOperation.getMetaData().getValue( - TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID); + String inputAttributeId = originalOperation.getMetaData() + .getValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID); if (inputAttributeId == null || inputAttributeId.equals("")) { //$NON-NLS-1$ String sel = attributeOperation.getValue(); fields.put(KEY_KNOB, new NameValuePair(KEY_KNOB, sel)); @@ -1725,10 +1768,8 @@ public class BugzillaClient { } if (model.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW) != null && model.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW).getValue().length() > 0) { - fields.put(KEY_COMMENT, - new NameValuePair(KEY_COMMENT, model.getRoot() - .getMappedAttribute(TaskAttribute.COMMENT_NEW) - .getValue())); + fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, + model.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW).getValue())); } else if (attributeOperation != null && attributeOperation.getValue().equals(BugzillaOperation.duplicate.toString())) { // fix for bug#198677 @@ -1744,14 +1785,14 @@ public class BugzillaClient { if (attributeOperation == null) { fields.put(fieldName, new NameValuePair(fieldName, attributeStatus.getValue())); } else { - TaskAttribute originalOperation = model.getRoot().getAttribute( - TaskAttribute.PREFIX_OPERATION + attributeOperation.getValue()); + TaskAttribute originalOperation = model.getRoot() + .getAttribute(TaskAttribute.PREFIX_OPERATION + attributeOperation.getValue()); if (originalOperation == null) { // Work around for bug#241012 fields.put(fieldName, new NameValuePair(fieldName, attributeStatus.getValue())); } else { - String inputAttributeId = originalOperation.getMetaData().getValue( - TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID); + String inputAttributeId = originalOperation.getMetaData() + .getValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID); String selOp = attributeOperation.getValue().toUpperCase(); if (selOp.equals("NONE")) { //$NON-NLS-1$ selOp = attributeStatus.getValue(); @@ -1814,19 +1855,14 @@ public class BugzillaClient { if (model.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW) != null && model.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW).getValue().length() > 0) { - fields.put(KEY_COMMENT, - new NameValuePair(KEY_COMMENT, model.getRoot() - .getMappedAttribute(TaskAttribute.COMMENT_NEW) - .getValue())); + fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, + model.getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW).getValue())); } } if (model.getRoot().getMappedAttribute(BugzillaAttribute.SHORT_DESC.getKey()) != null) { - fields.put( - KEY_SHORT_DESC, - new NameValuePair(KEY_SHORT_DESC, model.getRoot() - .getMappedAttribute(BugzillaAttribute.SHORT_DESC.getKey()) - .getValue())); + fields.put(KEY_SHORT_DESC, new NameValuePair(KEY_SHORT_DESC, + model.getRoot().getMappedAttribute(BugzillaAttribute.SHORT_DESC.getKey()).getValue())); } TaskAttribute attributeRemoveCC = model.getRoot().getMappedAttribute(BugzillaAttribute.REMOVECC.getKey()); @@ -1835,22 +1871,23 @@ public class BugzillaClient { if (removeCC != null && removeCC.size() > 0) { String[] s = new String[removeCC.size()]; fields.put(KEY_CC, new NameValuePair(KEY_CC, toCommaSeparatedList(removeCC.toArray(s)))); - fields.put(BugzillaAttribute.REMOVECC.getKey(), new NameValuePair(BugzillaAttribute.REMOVECC.getKey(), - VAL_TRUE)); + fields.put(BugzillaAttribute.REMOVECC.getKey(), + new NameValuePair(BugzillaAttribute.REMOVECC.getKey(), VAL_TRUE)); } } - TaskAttribute attributeRemoveSeeAlso = model.getRoot().getMappedAttribute( - BugzillaAttribute.REMOVE_SEE_ALSO.getKey()); + TaskAttribute attributeRemoveSeeAlso = model.getRoot() + .getMappedAttribute(BugzillaAttribute.REMOVE_SEE_ALSO.getKey()); if (attributeRemoveSeeAlso != null) { List<String> removeSeeAlso = attributeRemoveSeeAlso.getValues(); int idx = 0; for (String string : removeSeeAlso) { - fields.put(BugzillaAttribute.REMOVE_SEE_ALSO.getKey() + idx++, new NameValuePair( - BugzillaAttribute.REMOVE_SEE_ALSO.getKey(), string)); + fields.put(BugzillaAttribute.REMOVE_SEE_ALSO.getKey() + idx++, + new NameValuePair(BugzillaAttribute.REMOVE_SEE_ALSO.getKey(), string)); } } - // check for security token (required for successful submit on Bugzilla 3.2.1 and greater but not in xml until Bugzilla 3.2.3 bug#263318) + // check for security token (required for successful submit on Bugzilla + // 3.2.1 and greater but not in xml until Bugzilla 3.2.3 bug#263318) if (groupSecurityEnabled || (!tokenFound && tokenRequired)) { // get security and token if exists from html and include in post @@ -1866,8 +1903,8 @@ public class BugzillaClient { if (tokenPair != null) { tokenPair.setValue(htmlInfo.getToken()); } else { - fields.put(BugzillaAttribute.TOKEN.getKey(), new NameValuePair(BugzillaAttribute.TOKEN.getKey(), - htmlInfo.getToken())); + fields.put(BugzillaAttribute.TOKEN.getKey(), + new NameValuePair(BugzillaAttribute.TOKEN.getKey(), htmlInfo.getToken())); } } } @@ -1892,8 +1929,8 @@ public class BugzillaClient { code = WebUtil.execute(httpClient, hostConfiguration, getMethod, monitor); if (code == HttpURLConnection.HTTP_OK) { inStream = getResponseStream(getMethod, monitor); - HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(new BufferedReader(new InputStreamReader( - inStream, getCharacterEncoding())), null); + HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer( + new BufferedReader(new InputStreamReader(inStream, getCharacterEncoding())), null); String formName = null; for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.FORM @@ -1903,7 +1940,7 @@ public class BugzillaClient { } else if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.INPUT && !((HtmlTag) (token.getValue())).isEndTag()) { HtmlTag tag = (HtmlTag) token.getValue(); - // String name = tag.getAttribute("name"); + // String name = tag.getAttribute("name"); String id = tag.getAttribute("id"); //$NON-NLS-1$ String checkedValue = tag.getAttribute("checked"); //$NON-NLS-1$ String type = tag.getAttribute("type"); //$NON-NLS-1$ @@ -1927,7 +1964,7 @@ public class BugzillaClient { try { inStream.close(); } catch (IOException e) { - //ignore + // ignore } } WebUtil.releaseConnection(getMethod, monitor); @@ -1980,15 +2017,15 @@ public class BugzillaClient { } } - private BugzillaRepositoryResponse parsePostResponse(String taskId, InputStream inputStream) throws IOException, - CoreException { + private BugzillaRepositoryResponse parsePostResponse(String taskId, InputStream inputStream) + throws IOException, CoreException { BufferedReader in = new BufferedReader(new InputStreamReader(inputStream, getCharacterEncoding())); return parseRepositoryResponse(taskId, in); } - private BugzillaRepositoryResponse parseRepositoryResponse(String taskId, BufferedReader in) throws IOException, - CoreException { + private BugzillaRepositoryResponse parseRepositoryResponse(String taskId, BufferedReader in) + throws IOException, CoreException { HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null); BugzillaRepositoryResponse response; @@ -2017,7 +2054,8 @@ public class BugzillaClient { // Results for posting to Existing bugs - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_CHANGES_SUBMITTED)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_CHANGES_SUBMITTED)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; if (found) { @@ -2027,7 +2065,8 @@ public class BugzillaClient { } } - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_PROCESSED)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_PROCESSED)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; @@ -2040,19 +2079,22 @@ public class BugzillaClient { // Results for posting NEW bugs - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_SUBMITTED)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_SUBMITTED)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; if (found) { int stopIndex = title.indexOf(value); if (stopIndex > -1) { - for (String string2 : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_BUG)) { + for (String string2 : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_BUG)) { value = string2.toLowerCase(Locale.ENGLISH); int startIndex = title.indexOf(value); if (startIndex > -1) { startIndex = startIndex + value.length(); String result = (title.substring(startIndex, stopIndex)).trim(); - response = new BugzillaRepositoryResponse(ResponseKind.TASK_CREATED, result); + response = new BugzillaRepositoryResponse(ResponseKind.TASK_CREATED, + result); parseResultOK(tokenizer, response); return response; } @@ -2069,7 +2111,8 @@ public class BugzillaClient { // Error results - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_LOGIN)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_LOGIN)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; if (found) { @@ -2079,15 +2122,16 @@ public class BugzillaClient { BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(), title)); } else { - throw new CoreException(new BugzillaStatus(IStatus.ERROR, - BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_REPOSITORY_LOGIN, - repositoryUrl.toString(), - Messages.BugzillaClient_anonymous_user_not_allowed)); + throw new CoreException( + new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, + RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(), + Messages.BugzillaClient_anonymous_user_not_allowed)); } } } - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_COLLISION)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_COLLISION)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; if (found) { @@ -2096,7 +2140,8 @@ public class BugzillaClient { } } - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_COMMENT_REQUIRED)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_COMMENT_REQUIRED)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; if (found) { @@ -2105,19 +2150,21 @@ public class BugzillaClient { } } - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_SUSPICIOUS_ACTION)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_SUSPICIOUS_ACTION)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; if (found) { - for (Token tokenError = tokenizer.nextToken(); tokenError.getType() != Token.EOF; tokenError = tokenizer.nextToken()) { + for (Token tokenError = tokenizer.nextToken(); tokenError + .getType() != Token.EOF; tokenError = tokenizer.nextToken()) { body += tokenError.toString(); if (tokenError.getType() == Token.COMMENT) { if (tokenError.getValue().toString().startsWith("reason=")) { //$NON-NLS-1$ String reason = tokenError.getValue().toString().substring(7); - throw new CoreException(new BugzillaStatus(IStatus.ERROR, - BugzillaCorePlugin.ID_PLUGIN, - IBugzillaConstants.REPOSITORY_STATUS_SUSPICIOUS_ACTION, - repositoryUrl.toString(), "Reason = " + reason)); //$NON-NLS-1$ + throw new CoreException( + new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, + IBugzillaConstants.REPOSITORY_STATUS_SUSPICIOUS_ACTION, + repositoryUrl.toString(), "Reason = " + reason)); //$NON-NLS-1$ } } } @@ -2128,7 +2175,8 @@ public class BugzillaClient { } } - for (String string : bugzillaLanguageSettings.getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_LOGGED_OUT)) { + for (String string : bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_LOGGED_OUT)) { String value = string.toLowerCase(Locale.ENGLISH); found = title.indexOf(value) != -1; if (found) { @@ -2139,9 +2187,9 @@ public class BugzillaClient { } } - for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( - BugzillaLanguageSettings.COMMAND_ERROR_CONFIRM_MATCH).iterator(); iterator.hasNext() - && !found;) { + for (Iterator<String> iterator = bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_CONFIRM_MATCH) + .iterator(); iterator.hasNext() && !found;) { String value = iterator.next().toLowerCase(Locale.ENGLISH); found = found || title.indexOf(value) != -1; } @@ -2151,9 +2199,9 @@ public class BugzillaClient { } found = false; - for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( - BugzillaLanguageSettings.COMMAND_ERROR_MATCH_FAILED).iterator(); iterator.hasNext() - && !found;) { + for (Iterator<String> iterator = bugzillaLanguageSettings + .getResponseForCommand(BugzillaLanguageSettings.COMMAND_ERROR_MATCH_FAILED) + .iterator(); iterator.hasNext() && !found;) { String value = iterator.next().toLowerCase(Locale.ENGLISH); found = found || title.indexOf(value) != -1; } @@ -2172,13 +2220,14 @@ public class BugzillaClient { } if (hasAuthenticationCredentials() && !loggedIn) { - // None of the usual errors occurred. Log what cookies were received to aid authentication debugging + // None of the usual errors occurred. Log what cookies were + // received to aid authentication debugging StringBuilder builder = new StringBuilder("Cookies: "); //$NON-NLS-1$ for (Cookie cookie : httpClient.getState().getCookies()) { builder.append(cookie.getName() + " = " + cookie.getValue() + " "); //$NON-NLS-1$ //$NON-NLS-2$ } - StatusHandler.log(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, UNKNOWN_REPOSITORY_ERROR - + body)); + StatusHandler.log( + new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, UNKNOWN_REPOSITORY_ERROR + body)); StatusHandler.log(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, builder.toString())); } @@ -2206,8 +2255,9 @@ public class BugzillaClient { } catch (ParseException e) { loggedIn = false; - throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, - RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ + throw new CoreException( + new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_INTERNAL, + "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ } finally { in.close(); } @@ -2277,8 +2327,8 @@ public class BugzillaClient { if (responseTypeHeader.getValue().toLowerCase(Locale.ENGLISH).contains(type)) { InputStream input = getResponseStream(method, monitor); try { - MultiBugReportFactory factory = new MultiBugReportFactory(input, - getCharacterEncoding(), connector); + MultiBugReportFactory factory = new MultiBugReportFactory(input, getCharacterEncoding(), + connector); List<BugzillaCustomField> customFields = new ArrayList<BugzillaCustomField>(); if (repositoryConfiguration != null) { customFields = repositoryConfiguration.getCustomFields(); @@ -2296,14 +2346,15 @@ public class BugzillaClient { } if (!parseable) { - // because html is not a valid config content type it is save to get the response here + // because html is not a valid config content type it is + // save to get the response here throw new CoreException(parseHtmlError(getResponseStream(method, monitor))); } } catch (CoreException c) { if (c.getStatus().getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN && authenticationAttempt < 1) { loggedIn = false; authenticationAttempt++; - //StatusHandler.log(c.getStatus()); + // StatusHandler.log(c.getStatus()); } else { throw c; } @@ -2368,14 +2419,15 @@ public class BugzillaClient { // authentication // getMethod.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); -// headMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new BugzillaRetryHandler()); + // headMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, + // new BugzillaRetryHandler()); headMethod.setDoAuthentication(true); int code; try { code = WebUtil.execute(httpClient, hostConfiguration, headMethod, monitor); } catch (IOException e) { -// ignore the response + // ignore the response WebUtil.releaseConnection(headMethod, monitor); throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_IO, repositoryUrl.toString(), e)); @@ -2384,19 +2436,19 @@ public class BugzillaClient { if (code == HttpURLConnection.HTTP_OK) { return headMethod; } else if (code == HttpURLConnection.HTTP_UNAUTHORIZED || code == HttpURLConnection.HTTP_FORBIDDEN) { -// ignore the response + // ignore the response WebUtil.releaseConnection(headMethod, monitor); loggedIn = false; authenticate(monitor); } else if (code == HttpURLConnection.HTTP_PROXY_AUTH) { loggedIn = false; -// ignore the response + // ignore the response WebUtil.releaseConnection(headMethod, monitor); throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(), "Proxy authentication required")); //$NON-NLS-1$ } else { -// ignore the response + // ignore the response WebUtil.releaseConnection(headMethod, monitor); throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_NETWORK, "Http error: " + HttpStatus.getStatusText(code))); //$NON-NLS-1$ @@ -2407,7 +2459,7 @@ public class BugzillaClient { throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_REPOSITORY_LOGIN, "All connection attempts to " + repositoryUrl.toString() //$NON-NLS-1$ - + " failed. Please verify connection and authentication information.")); //$NON-NLS-1$ + + " failed. Please verify connection and authentication information.")); //$NON-NLS-1$ } public void setRepositoryConfiguration(RepositoryConfiguration repositoryConfiguration) { @@ -2480,8 +2532,8 @@ public class BugzillaClient { } - private void parseResultOK(HtmlStreamTokenizer tokenizer, BugzillaRepositoryResponse response) throws IOException, - CoreException { + private void parseResultOK(HtmlStreamTokenizer tokenizer, BugzillaRepositoryResponse response) + throws IOException, CoreException { String codeString = ""; //$NON-NLS-1$ boolean inBugzillaBody = false; int dlLevel = 0; @@ -2541,8 +2593,9 @@ public class BugzillaClient { } } } catch (ParseException e) { - throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, - RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ + throw new CoreException( + new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, RepositoryStatus.ERROR_INTERNAL, + "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ } } @@ -2580,8 +2633,8 @@ public class BugzillaClient { try { BugzillaXmlRpcClient client = getXmlRpcClient(); if (client == null) { - throw new CoreException(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, - "XMLRPC is not available")); //$NON-NLS-1$ + throw new CoreException( + new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, "XMLRPC is not available")); //$NON-NLS-1$ } return client.getHistory(new Integer[] { bugId }, monitor); } catch (XmlRpcException e) { diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java index 1b384429b..0253a467e 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java @@ -112,7 +112,14 @@ public class BugzillaUserMatchResponse { if (optionValue == -1) { int startText = divString.indexOf("<", endBold + 4) + 1; //$NON-NLS-1$ int endText = divString.indexOf(">", startText + 1); //$NON-NLS-1$ - String temp = divString.substring(startText + 3, endText); + String temp = null; + if (startText == 0) { + startText = divString.indexOf("(", endBold + 4) + 1; //$NON-NLS-1$ + endText = divString.indexOf(")", startText + 1); //$NON-NLS-1$ + temp = divString.substring(startText, endText); + } else { + temp = divString.substring(startText + 3, endText); + } value = temp.replace("@", "@"); //$NON-NLS-1$ //$NON-NLS-2$ if (lastDTValue.equals("newcc")) { //$NON-NLS-1$ List<String> proposalList = newCCProposals.get(name); diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java index 088ee455c..c028066b5 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java @@ -46,9 +46,13 @@ public class BugzillaVersion implements Comparable<BugzillaVersion>, Serializabl public final static BugzillaVersion BUGZILLA_4_5_2 = new BugzillaVersion("4.5.2"); //$NON-NLS-1$ - public final static BugzillaVersion BUGZILLA_HEAD = new BugzillaVersion("4.5"); //$NON-NLS-1$ + public final static BugzillaVersion BUGZILLA_5_0 = new BugzillaVersion("5.0"); //$NON-NLS-1$ - public final static BugzillaVersion MAX_VERSION = BUGZILLA_4_0; + public final static BugzillaVersion BUGZILLA_5_1 = new BugzillaVersion("5.1"); //$NON-NLS-1$ + + public final static BugzillaVersion BUGZILLA_HEAD = new BugzillaVersion("5.1"); //$NON-NLS-1$ + + public final static BugzillaVersion MAX_VERSION = BUGZILLA_5_0; private final int major; diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp index 770df2a54..85c3db523 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp @@ -35,47 +35,47 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug micro => "16", } - bugzilla::site { "bugzilla-4.4.11-bugaliases": + bugzilla::site { "bugzilla-4.4.12-bugaliases": major => "4", minor => "4", - micro => "11", + micro => "12", usebugaliases => true, } - bugzilla::site { "bugzilla-4.4.11": + bugzilla::site { "bugzilla-4.4.12": major => "4", minor => "4", - micro => "11", + micro => "12", envdefault => true, } - bugzilla::site { "bugzilla-4.4.11-custom-wf": + bugzilla::site { "bugzilla-4.4.12-custom-wf": major => "4", minor => "4", - micro => "11", + micro => "12", custom_wf => true, } - bugzilla::site { "bugzilla-4.4.11-custom-wf-and-status": + bugzilla::site { "bugzilla-4.4.12-custom-wf-and-status": major => "4", minor => "4", - micro => "11", + micro => "12", custom_wf_and_status => true, } - bugzilla::site { "bugzilla-5.0.2": + bugzilla::site { "bugzilla-5.0.3": major => "5", minor => "0", - micro => "2", + micro => "3", } - + bugzilla::site { "bugzilla-master": major => "5", minor => "1", - micro => "", + micro => "1", branch => "master", branchTag => "HEAD", - envversion => "5.1", + envversion => "5.1.1+", envinfo => "Master", } @@ -83,10 +83,10 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug * REST sites *******************************************************************************/ - bugzilla::site { "bugzilla-rest-5.0.2": + bugzilla::site { "bugzilla-rest-5.0.3": major => "5", minor => "0", - micro => "2", + micro => "3", envtype => "bugzillaREST", rest_enabled => true, envdefault_rest => true, @@ -97,10 +97,10 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug bugzilla::site { "bugzilla-rest-master": major => "5", minor => "1", - micro => "", + micro => "1", branch => "master", branchTag => "HEAD", - envversion => "5.1", + envversion => "5.1.1+", envinfo => "Master", envtype => "bugzillaREST", rest_enabled => true, diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp index e4b96c845..7bcce82bb 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp @@ -77,6 +77,7 @@ class bugzilla { "php5", "phpmyadmin", "puppet", + "cpanminus" ] @@ -195,7 +196,7 @@ class bugzilla { } exec { "prepare bugzilla": - command => "echo Bugzilla pre-requisites are installed", + command => "cpanm CGI; cpanm DBI; cpanm DateTime::TimeZone; cpanm Email::Sender;echo Bugzilla pre-requisites are installed", require => [Exec["mysql create user ${dbuser}"],Exec["create $confDir"]], } diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp index 1fde3fa1d..5b8c9f667 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp @@ -261,7 +261,7 @@ define bugzilla::site ( } exec { "init bugzilla_checksetup $bugzillaDir": - command => "$base/$bugzillaDir/callchecksetup.pl", + command => "$base/$bugzillaDir/checksetup.pl $base/$bugzillaDir/answers || exit 0", cwd => "$base/$bugzillaDir", creates => "$base/$bugzillaDir/localconfig", user => "$userOwner", @@ -273,11 +273,11 @@ define bugzilla::site ( File["$base/$bugzillaDir/extensions/Mylyn/Extension.pm"]] } + exec { "update bugzilla_checksetup $bugzillaDir": - command => "$base/$bugzillaDir/callchecksetup.pl", + command => "$base/$bugzillaDir/checksetup.pl $base/$bugzillaDir/answers || exit 0", cwd => "$base/$bugzillaDir", logoutput => true, - user => "$userOwner", require => [ Exec["mysql-createdb-$bugzillaDir"], Exec["init bugzilla_checksetup $bugzillaDir"], diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb index c9ff65bdc..b61d4c014 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb @@ -62,6 +62,10 @@ sub install_before_final_checks { # create tests@mylyn.eclipse.org # add this user to group bz_canusewhineatothers my $testu = Bugzilla::User->create({ login_name => 'tests@mylyn.eclipse.org', +<% if @envversionInternal >= "5.1" %> + + email => 'tests@mylyn.eclipse.org', +<% end %> realname => 'Mylyn Test', cryptpassword => 'mylyntest' }); my $private_group = new Bugzilla::Group({name => 'bz_canusewhineatothers'}); @@ -72,6 +76,9 @@ sub install_before_final_checks { # create guest@mylyn.eclipse.org Bugzilla::User->create({ login_name => 'guest@mylyn.eclipse.org', +<% if @envversionInternal >= "5.1" %> + email => 'guest@mylyn.eclipse.org', +<% end %> realname => 'Mylyn guest', cryptpassword => 'mylyntest' }); } diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb index eca2ac51a..fcaefa243 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb @@ -7,6 +7,7 @@ $answer{'db_user'} = '<%= @bugz_user %>'; $answer{'db_pass'} = '<%= @bugz_password %>'; $answer{'urlbase'} = ''; $answer{'ADMIN_OK'} = 'Y'; +$answer{'ADMIN_LOGIN'} = 'admin@mylyn.eclipse.org'; $answer{'ADMIN_EMAIL'} = 'admin@mylyn.eclipse.org'; $answer{'ADMIN_PASSWORD'} = 'main4Afo'; $answer{'ADMIN_REALNAME'} = 'Mylyn Admin'; @@ -16,6 +17,7 @@ $answer{'mail_delivery_method'} = 'None'; $answer{'useqacontact'} = '1'; $answer{'usestatuswhiteboard'} = '1'; $answer{'maintainer'} = 'admin@mylyn.eclipse.org'; +$answer{'use_email_as_login'} = '1'; $answer{'insidergroup'} = 'bz_canusewhineatothers'; <% if @custom_wf_and_status %>$answer{'duplicate_or_move_bug_status'} = 'VERIFIED';<% end %> diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java index 539a3e649..ce92050d4 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java @@ -302,10 +302,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { } else { IProgressMonitor monitor = new NullProgressMonitor(); String version = bugzillaClient.getVersion(monitor); - assertEquals( - 0, - new BugzillaVersion(BugzillaFixture.current().getVersion()).compareMajorMinorOnly(new BugzillaVersion( - version))); + assertEquals(0, new BugzillaVersion(BugzillaFixture.current().getVersion()) + .compareMajorMinorOnly(new BugzillaVersion(version))); } } @@ -315,6 +313,7 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { return; } else { IProgressMonitor monitor = new NullProgressMonitor(); + BugzillaVersion version = BugzillaFixture.current().getBugzillaVersion(); bugzillaClient.logout(monitor); int uID = bugzillaClient.login(monitor); assertEquals(2, uID); @@ -322,13 +321,17 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { assertNotNull(userList0); assertEquals(2, userList0.length); assertEquals(((Integer) 1), ((HashMap<String, Integer>) userList0[0]).get("id")); - assertEquals("admin@mylyn.eclipse.org", ((HashMap<String, String>) userList0[0]).get("email")); + if (BugzillaFixture.current().isBugzilla51OrGreater()) { + assertEquals("admin@mylyn.eclipse.org", ((HashMap<String, String>) userList0[0]).get("email")); + } assertEquals("admin@mylyn.eclipse.org", ((HashMap<String, String>) userList0[0]).get("name")); assertEquals("Mylyn Admin", ((HashMap<String, String>) userList0[0]).get("real_name")); assertEquals(((Boolean) true), ((HashMap<String, Boolean>) userList0[0]).get("can_login")); assertEquals(((Integer) 2), ((HashMap<String, Integer>) userList0[1]).get("id")); - assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList0[1]).get("email")); + if (BugzillaFixture.current().isBugzilla51OrGreater()) { + assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList0[1]).get("email")); + } assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList0[1]).get("name")); assertEquals("Mylyn Test", ((HashMap<String, String>) userList0[1]).get("real_name")); assertEquals(((Boolean) true), ((HashMap<String, Boolean>) userList0[1]).get("can_login")); @@ -338,7 +341,9 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { assertNotNull(userList1); assertEquals(1, userList1.length); assertEquals(((Integer) 2), ((HashMap<String, Integer>) userList1[0]).get("id")); - assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList1[0]).get("email")); + if (version.compareTo(BugzillaVersion.BUGZILLA_5_1) < 0) { + assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList1[0]).get("email")); + } assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList1[0]).get("name")); assertEquals("Mylyn Test", ((HashMap<String, String>) userList1[0]).get("real_name")); assertEquals(((Boolean) true), ((HashMap<String, Boolean>) userList1[0]).get("can_login")); @@ -383,7 +388,6 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { } } - @SuppressWarnings("unused") public void testXmlRpcInstalled() throws Exception { int uID = -1; IProgressMonitor monitor = new NullProgressMonitor(); @@ -496,8 +500,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { public void accept(TaskData taskData) { try { AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); - taskDataHandler.initializeTaskData(repository, taskData, null, new SubProgressMonitor(monitor2, - 1)); + taskDataHandler.initializeTaskData(repository, taskData, null, + new SubProgressMonitor(monitor2, 1)); } catch (CoreException e) { // this info CoreException is only used internal if (e.getStatus().getCode() == IStatus.INFO && e.getMessage().contains("Update Config")) { //$NON-NLS-1$ @@ -620,7 +624,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { if (!BugzillaFixture.current().isXmlRpcEnabled()) { return; } - RepositoryConfiguration repositoryConfiguration = connector.getRepositoryConfiguration(repository.getRepositoryUrl()); + RepositoryConfiguration repositoryConfiguration = connector + .getRepositoryConfiguration(repository.getRepositoryUrl()); for (String product : repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT)) { repositoryConfiguration.setDefaultMilestone(product, null); @@ -628,7 +633,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest { bugzillaClient.updateProductInfo(new NullProgressMonitor(), repositoryConfiguration); for (String product : repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT)) { - if (product.equals("ManualTest") || product.equals("Product with Spaces") || product.equals("TestProduct")) { + if (product.equals("ManualTest") || product.equals("Product with Spaces") + || product.equals("TestProduct")) { assertEquals("---", repositoryConfiguration.getDefaultMilestones(product)); } else { fail("never reach this"); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java index 6420c36a6..e7430947a 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java @@ -18,8 +18,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import junit.framework.AssertionFailedError; - import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; @@ -49,6 +47,8 @@ import org.eclipse.mylyn.tasks.core.data.TaskData; import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; import org.eclipse.mylyn.tests.util.TestFixture; +import junit.framework.AssertionFailedError; + /** * @author Steffen Pingel * @author Thomas Ehrnhoefer @@ -130,8 +130,8 @@ public class BugzillaFixture extends TestFixture { return client(getRepositoryUrl(), credentials.getUserName(), credentials.getPassword(), "", "", "UTF-8"); } - public BugzillaClient client(String hostUrl, String username, String password, String htAuthUser, - String htAuthPass, String encoding) throws CoreException, IOException { + public BugzillaClient client(String hostUrl, String username, String password, String htAuthUser, String htAuthPass, + String encoding) throws CoreException, IOException { WebLocation location = new WebLocation(hostUrl); location.setCredentials(AuthenticationType.REPOSITORY, username, password); location.setCredentials(AuthenticationType.HTTP, htAuthUser, htAuthPass); @@ -187,7 +187,7 @@ public class BugzillaFixture extends TestFixture { /** * Create and returns a minimal task. - * + * * @param summary * may be <code>null</code> * @param description @@ -243,7 +243,7 @@ public class BugzillaFixture extends TestFixture { /** * Retrieve task data for given task id - * + * * @param id * @param client * @return The taskData retrieved @@ -305,4 +305,8 @@ public class BugzillaFixture extends TestFixture { public BugzillaHarness createHarness() { return new BugzillaHarness(this); } + + public boolean isBugzilla51OrGreater() { + return bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_5_1) < 0; + } } |