diff options
author | spingel | 2008-05-07 18:31:01 +0000 |
---|---|---|
committer | spingel | 2008-05-07 18:31:01 +0000 |
commit | ff3480c81e63968b71fd230090da0321fd995f0c (patch) | |
tree | 9ba1a319ea4283c3b6f80780a58b79e70d3804c1 /org.eclipse.mylyn.bugzilla.tests | |
parent | de870d7f0f9bf78df6f9aa3fbb072657d4abae44 (diff) | |
download | org.eclipse.mylyn.tasks-ff3480c81e63968b71fd230090da0321fd995f0c.tar.gz org.eclipse.mylyn.tasks-ff3480c81e63968b71fd230090da0321fd995f0c.tar.xz org.eclipse.mylyn.tasks-ff3480c81e63968b71fd230090da0321fd995f0c.zip |
NEW - bug 221043: enable code cleanup for bugzilla plug-ins
https://bugs.eclipse.org/bugs/show_bug.cgi?id=221043
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
17 files changed, 179 insertions, 120 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs index 17d32793d..5e70d0848 100644 --- a/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.mylyn.bugzilla.tests/.settings/org.eclipse.jdt.ui.prefs @@ -1,6 +1,7 @@ -#Sat Mar 01 13:22:50 PST 2008 +#Sat Mar 01 03:38:47 PST 2008 cleanup_settings_version=2 eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_Mylyn based on Eclipse formatter_settings_version=11 internal.default.compliance=default @@ -10,3 +11,53 @@ org.eclipse.jdt.ui.javadoc=false org.eclipse.jdt.ui.keywordthis=false org.eclipse.jdt.ui.overrideannotation=true org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\n * Copyright (c) 2004, 2007 Mylyn project committers and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *******************************************************************************/\n\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ignore\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ignore</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=true +sp_cleanup.correct_indentation=true +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=true +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java index 2f7c9b82b..9828de528 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java @@ -39,7 +39,7 @@ import org.xml.sax.helpers.XMLReaderFactory; public class BugzillaConfigurationTest extends TestCase { BugzillaClientManager bugzillaClientManager = new BugzillaClientManager(); - + @Override protected void setUp() throws Exception { super.setUp(); @@ -63,7 +63,7 @@ public class BugzillaConfigurationTest extends TestCase { taskRepository.setCharacterEncoding(encoding); return bugzillaClientManager.getClient(taskRepository, null); } - + public void test222RDFProductConfig() throws Exception { BugzillaClient client = createClient(IBugzillaConstants.TEST_BUGZILLA_222_URL, "", "", @@ -194,13 +194,13 @@ public class BugzillaConfigurationTest extends TestCase { // incoming.append("xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#"); // incoming.append("xmlns:bz=\"http://www.bugzilla.org/rdf#\">"); // incoming.append("<li>"); -// incoming.append("<bz:product +// incoming.append("<bz:product // incoming.append("</bz:product>"); // incoming.append("</li>"); // incoming.append("</RDF>"); -// +// // StringBuffer result = XmlCleaner.clean(new StringReader(incoming.toString())); -// System.err.println(result); +// System.err.println(result); // } /** @@ -245,7 +245,7 @@ public class BugzillaConfigurationTest extends TestCase { assertNotNull(config); assertTrue(config.getProducts().contains( - "Test-Long-Named-Product-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); + "Test-Long-Named-Product-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); // Add your additional checking for valid data here if necessary diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java index 5eb4663f3..61a313f8d 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java @@ -69,9 +69,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { //// connector.performQuery(query, repository, new NullProgressMonitor(), collector); //// System.err.println(">>> Collector: "+collector.getTasks().size()); //// for (AbstractTask task : collector.getTasks()) { -//// TasksUiPlugin.getTaskList().addTask(task); +//// TasksUiPlugin.getTaskList().addTask(task); //// } -// +// // TasksUiPlugin.getSynchronizationManager().synchronize(connector, query, null, true); // //System.err.println(">>> initial size: "+query.getChildren().size()); // for (AbstractTask task : query.getChildren()) { @@ -80,11 +80,11 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { // task.setLastReadTimeStamp("1970-01-01"); // assertTrue(task.getSynchronizationState() == SynchronizationState.SYNCHRONIZED); // } -// +// // for (AbstractTask task : query.getChildren()) { // assertTrue(task.getSynchronizationState() == SynchronizationState.SYNCHRONIZED); // } -// +// // repository.setSynchronizationTimeStamp("1970-01-01");//getSynchronizationTimeStamp(); // //connector.markStaleTasks(repository, query.getChildren(), new NullProgressMonitor()); // TasksUiPlugin.getSynchronizationManager().synchronize(connector, query, null, true); @@ -92,7 +92,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { // assertTrue(task.getSynchronizationState() == SynchronizationState.INCOMING); // } // } - + BugzillaTask fruitTask; RepositoryTaskData fruitTaskData; private void setFruitValueTo(String newValue) throws CoreException { @@ -197,8 +197,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { fail("Should have failed due to invalid userid and password."); } -// testReassign Bugs -// Version BugNr assigned reporter +// testReassign Bugs +// Version BugNr assigned reporter // 2.22 92 user@mylar.eclipse.org tests@mylar.eclipse.org // 3.0 5 tests@mylar.eclipse.org tests2@mylar.eclipse.org // 3.1 1 rob.elves@eclipse.org tests@mylar.eclipse.org @@ -260,7 +260,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { private void reassignToDefault31(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { // Modify it (reassignbycomponent) String newCommentText = "BugzillaRepositoryClientTest.testReassign31(): reassignbycomponent " - + (new Date()).toString(); + + (new Date()).toString(); taskData.setNewComment(newCommentText); Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); @@ -332,14 +332,14 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { private void reassignToDefaultOld(BugzillaTask task, RepositoryTaskData taskData) throws CoreException { // Modify it (reassignbycomponent) String newCommentText = "BugzillaRepositoryClientTest.testReassignOld(): reassignbycomponent " - + (new Date()).toString(); + + (new Date()).toString(); taskData.setNewComment(newCommentText); Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); - for (Iterator<RepositoryOperation> it = taskData.getOperations().iterator(); it.hasNext();) { - RepositoryOperation o = it.next(); - if (o.isChecked()) + for (RepositoryOperation o : taskData.getOperations()) { + if (o.isChecked()) { o.setChecked(false); + } if (o.getKnobName().compareTo("reassignbycomponent") == 0) { o.setChecked(true); taskData.setSelectedOperation(o); @@ -357,10 +357,10 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { taskData.setNewComment(newCommentText); Set<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>(); changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); - for (Iterator<RepositoryOperation> it = taskData.getOperations().iterator(); it.hasNext();) { - RepositoryOperation o = it.next(); - if (o.isChecked()) + for (RepositoryOperation o : taskData.getOperations()) { + if (o.isChecked()) { o.setChecked(false); + } if (o.getKnobName().compareTo("reassign") == 0) { o.setInputValue("tests2@mylyn.eclipse.org"); o.setChecked(true); @@ -391,7 +391,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { BugzillaRepositoryQuery bugQuery = new BugzillaRepositoryQuery( IBugzillaConstants.TEST_BUGZILLA_222_URL, "http://mylyn.eclipse.org/bugs222/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&product=Read+Only+Test+Cases&long_desc_type=allwordssubstr&long_desc=&bug_status=NEW&order=Importance", - "testFocedQuerySynchronization"); + "testFocedQuerySynchronization"); taskList.addQuery(bugQuery); @@ -444,7 +444,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { // repository, // "http://mylyn.eclipse.org/bugs218/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=search-match-test&product=TestProduct&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&deadlinefrom=&deadlineto=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=", // null, collector, "-1"); - // + // String queryUrl = "http://mylyn.eclipse.org/bugs218/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=search-match-test&product=TestProduct&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&deadlinefrom=&deadlineto=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0="; BugzillaRepositoryQuery bugzillaQuery = new BugzillaRepositoryQuery(repository.getRepositoryUrl(), queryUrl, "search"); @@ -815,7 +815,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { priority = "P1"; recentTaskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); } - + // disabled due to TasksUi.synchronizeChanged(connector, repository) being removed // REMOVE ALL TASK DATA // TasksUiPlugin.getTaskDataManager().clear(); @@ -881,20 +881,23 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { estimatedTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKeyString())); remainingTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKeyString())); actualTime = Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKeyString())); - if (enableDeadline) + if (enableDeadline) { deadline = bugtaskdata.getAttributeValue(BugzillaReportElement.DEADLINE.getKeyString()); + } estimatedTime += 2; remainingTime += 1.5; addTime = 0.75f; - if (enableDeadline) + if (enableDeadline) { deadline = generateNewDay(); + } bugtaskdata.setAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKeyString(), "" + estimatedTime); bugtaskdata.setAttributeValue(BugzillaReportElement.REMAINING_TIME.getKeyString(), "" + remainingTime); bugtaskdata.setAttributeValue(BugzillaReportElement.WORK_TIME.getKeyString(), "" + addTime); - if (enableDeadline) + if (enableDeadline) { bugtaskdata.setAttributeValue(BugzillaReportElement.DEADLINE.getKeyString(), deadline); + } // for (AbstractTask task : tasks) { // RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData( @@ -907,7 +910,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { synchAndAssertState(tasks, SynchronizationState.SYNCHRONIZED); bugtaskdata = TasksUiPlugin.getTaskDataStorageManager() - .getNewTaskData(bugtask.getRepositoryUrl(), bugtask.getTaskId()); + .getNewTaskData(bugtask.getRepositoryUrl(), bugtask.getTaskId()); assertEquals(estimatedTime, Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKeyString()))); @@ -915,8 +918,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.REMAINING_TIME.getKeyString()))); assertEquals(actualTime + addTime, Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ACTUAL_TIME.getKeyString()))); - if (enableDeadline) + if (enableDeadline) { assertEquals(deadline, bugtaskdata.getAttributeValue(BugzillaReportElement.DEADLINE.getKeyString())); + } } @@ -980,13 +984,13 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { // assertEquals(abstractRepositoryConnector.getRepositoryType(), DEFAULT_KIND); // // connector = (BugzillaRepositoryConnector) abstractRepositoryConnector; -// +// // long start = System.currentTimeMillis(); // BugzillaTask task = null; // for(int x = 1; x < 5; x++) { // if(task != null) // taskList.deleteTask(task); -// +// // task = this.generateLocalTaskAndDownload("154100"); // assertNotNull(task); // } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java index 6e60ca3d6..04cf5c76c 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java @@ -49,7 +49,7 @@ public class BugzillaTaskDataHandlerTest extends TestCase { repository.setAuthenticationCredentials(credentials.username, credentials.password); return repository; } - + private void testAttributesFromCloneBug(RepositoryTaskData repositoryTaskData, boolean valueFromBug9) { assertEquals("Clone Bug 1", repositoryTaskData.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) .getValue()); @@ -154,7 +154,7 @@ public class BugzillaTaskDataHandlerTest extends TestCase { testAttributesFromCloneBug(report2, false); } - + public void testCharacterEscaping() throws CoreException { String bugid = "17"; setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_30_URL); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java index de2e61105..4174c458e 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java @@ -33,23 +33,23 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase { private static final String DUPLICATE = "duplicate of " + DUPLICATE_NUMBER; - private String TASK_FORMAT_1 = "task#1"; + private final String TASK_FORMAT_1 = "task#1"; - private String TASK_FORMAT_2 = "task# 1"; + private final String TASK_FORMAT_2 = "task# 1"; - private String TASK_FORMAT_3 = "task1"; + private final String TASK_FORMAT_3 = "task1"; - private String TASK_FORMAT_4 = "task #1"; + private final String TASK_FORMAT_4 = "task #1"; - private String BUG_FORMAT_1 = "bug# 1"; + private final String BUG_FORMAT_1 = "bug# 1"; - private String BUG_FORMAT_2 = "bug # 1"; + private final String BUG_FORMAT_2 = "bug # 1"; - private String BUG_FORMAT_3 = "bug1"; + private final String BUG_FORMAT_3 = "bug1"; - private String BUG_FORMAT_4 = "bug #1"; + private final String BUG_FORMAT_4 = "bug #1"; - private String BUG_FORMAT_1_2 = "bug# 2"; + private final String BUG_FORMAT_1_2 = "bug# 2"; //private BugzillaTaskHyperlinkDetector detector = new BugzillaTaskHyperlinkDetector(); private TaskHyperlinkDetector detector; @@ -91,7 +91,7 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase { detector.dispose(); repositoryManager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - + shell.dispose(); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java index 97b0951ea..8ecae026d 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java @@ -98,10 +98,10 @@ public class BugzillaTaskListManagerTest extends TestCase { .getChildren() .size()); ITask readTask = manager.getTaskList() - .getUnmatchedContainer(IBugzillaConstants.ECLIPSE_BUGZILLA_URL) - .getChildren() - .iterator() - .next(); + .getUnmatchedContainer(IBugzillaConstants.ECLIPSE_BUGZILLA_URL) + .getChildren() + .iterator() + .next(); assertEquals(repositoryTask.getHandleIdentifier(), readTask.getHandleIdentifier()); assertEquals(repositoryTask.getSummary(), readTask.getSummary()); @@ -146,9 +146,9 @@ public class BugzillaTaskListManagerTest extends TestCase { manager.readExistingOrCreateNewList(); assertEquals(1, manager.getTaskList().getQueries().size()); BugzillaRepositoryQuery readQuery = (BugzillaRepositoryQuery) manager.getTaskList() - .getQueries() - .iterator() - .next(); + .getQueries() + .iterator() + .next(); assertTrue(readQuery.isCustomQuery()); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java index 7874d2b46..c3795f278 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java @@ -32,7 +32,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; */ public class BugzillaTaskTest extends TestCase { - private BugzillaAttributeFactory attributeFactory = new BugzillaAttributeFactory(); + private final BugzillaAttributeFactory attributeFactory = new BugzillaAttributeFactory(); @Override protected void setUp() throws Exception { diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java index 0b9aa30cd..76f907d06 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java @@ -75,8 +75,9 @@ public class BugzillaTestPlugin extends AbstractUIPlugin { */ public ResourceBundle getResourceBundle() { try { - if (resourceBundle == null) + if (resourceBundle == null) { resourceBundle = ResourceBundle.getBundle("org.eclipse.mylyn.bugzilla.tests.TestsPluginResources"); + } } catch (MissingResourceException x) { resourceBundle = null; } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java index 5bee32fc9..428969f9b 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java @@ -44,7 +44,7 @@ public class DuplicateDetetionTest extends TestCase { RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); @@ -63,7 +63,7 @@ public class DuplicateDetetionTest extends TestCase { String fakeStackTrace = "this is not really a stacktrace"; RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(fakeStackTrace); model.setNew(true); IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); @@ -85,7 +85,7 @@ public class DuplicateDetetionTest extends TestCase { RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(extraText + "\n" + stackTrace + "\n"); model.setNew(true); @@ -105,17 +105,17 @@ public class DuplicateDetetionTest extends TestCase { public void testStackTraceMisaligned() throws Exception { String stackTrace = "java.lang.IllegalStateException: zip file closed\n" - + " at java.util.zip.ZipFile.ensureOpen (ZipFile.java:518)\n" - + "at java.util.zip.ZipFile.getEntry (ZipFile.java:251)\n" - + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" - + "at sun.net.www.protocol.jar.URLJarFile.getEntry\n" + " (URLJarFile.java:90)\n" - + "at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" - + "at sun.net.www.protocol.jar.JarURLConnection.getInputStream\n" + "(JarURLConnection.java:124)\n" - + "at org.eclipse.jdt.internal.core.JavaElement\n.getURLContents(JavaElement.java:734)"; + + " at java.util.zip.ZipFile.ensureOpen (ZipFile.java:518)\n" + + "at java.util.zip.ZipFile.getEntry (ZipFile.java:251)\n" + + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" + + "at sun.net.www.protocol.jar.URLJarFile.getEntry\n" + " (URLJarFile.java:90)\n" + + "at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" + + "at sun.net.www.protocol.jar.JarURLConnection.getInputStream\n" + "(JarURLConnection.java:124)\n" + + "at org.eclipse.jdt.internal.core.JavaElement\n.getURLContents(JavaElement.java:734)"; RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -136,17 +136,17 @@ public class DuplicateDetetionTest extends TestCase { // SUN, IBM (no space before brackets, one set of brackets) String stackTrace = "java.lang.IllegalStateException: zip file closed\n" - + " at java.util.zip.ZipFile.ensureOpen(ZipFile.java:518)\n" - + " at java.util.zip.ZipFile.getEntry(ZipFile.java:251)\n" - + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" - + " at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)\n" - + " at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" - + " at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)\n" - + " at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:734)"; + + " at java.util.zip.ZipFile.ensureOpen(ZipFile.java:518)\n" + + " at java.util.zip.ZipFile.getEntry(ZipFile.java:251)\n" + + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" + + " at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)\n" + + " at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" + + " at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)\n" + + " at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:734)"; RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -167,13 +167,13 @@ public class DuplicateDetetionTest extends TestCase { // gcj/gij (path and lib names in additional brackets) String stackTrace = "java.lang.Error: Something bad happened\n" - + " at testcase.main(java.lang.String[]) (Unknown Source)\n" - + " at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)\n" - + " at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)"; + + " at testcase.main(java.lang.String[]) (Unknown Source)\n" + + " at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)\n" + + " at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)"; RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -194,11 +194,11 @@ public class DuplicateDetetionTest extends TestCase { // ikvm (no line numbers) String stackTrace = "java.lang.Error: Something bad happened\n" + " at testcase.main (testcase.java)\n" - + " at java.lang.reflect.Method.Invoke (Method.java)"; + + " at java.lang.reflect.Method.Invoke (Method.java)"; RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -219,14 +219,14 @@ public class DuplicateDetetionTest extends TestCase { // jrockit (slash delimiters) String stackTrace = "java.lang.Error: Something bad happened\n" - + " at java/io/BufferedReader.readLine(BufferedReader.java:331)\n" - + " at java/io/BufferedReader.readLine(BufferedReader.java:362)\n" - + " at java/util/Properties.load(Properties.java:192)\n" - + " at java/util/logging/LogManager.readConfiguration(L:555)"; + + " at java/io/BufferedReader.readLine(BufferedReader.java:331)\n" + + " at java/io/BufferedReader.readLine(BufferedReader.java:362)\n" + + " at java/util/Properties.load(Properties.java:192)\n" + + " at java/util/logging/LogManager.readConfiguration(L:555)"; RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -247,12 +247,12 @@ public class DuplicateDetetionTest extends TestCase { // jamvm, sablevm, kaffe, cacao (space before brackets, one set of brackets) String stackTrace = "java.lang.Error: Something bad happened\n" + " at testcase.main (testcase.java:3)\n" - + " at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)\n" - + " at java.lang.VirtualMachine.main (VirtualMachine.java:108)"; + + " at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)\n" + + " at java.lang.VirtualMachine.main (VirtualMachine.java:108)"; RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java index b035be61a..397ebeb45 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java @@ -54,7 +54,7 @@ public class EncodingTest extends AbstractBugzillaTest { repository.setCharacterEncoding("ISO-8859-1"); task = (BugzillaTask) TasksUiUtil.createTask(repository, "57", new NullProgressMonitor()); assertNotNull(task); - //TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); + //TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); // iso-8859-1 'incorrect' interpretation assertFalse(task.getSummary().equals("\u00E6"));//"\u05D0")); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java index 354117edb..5b14c380b 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java @@ -43,43 +43,46 @@ public class NewBugWizardTest extends TestCase { BugzillaCorePlugin.getDefault().setPlatformOptions(newReport); String os = Platform.getOS(); - if (os.equals("win32")) + if (os.equals("win32")) { assertEquals("Windows", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("solaris")) + } else if (os.equals("solaris")) { assertEquals("Solaris", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("qnx")) + } else if (os.equals("qnx")) { assertEquals("QNX-Photon", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("macosx")) + } else if (os.equals("macosx")) { assertEquals("Mac OS", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("linux")) + } else if (os.equals("linux")) { assertEquals("Linux", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("hpux")) + } else if (os.equals("hpux")) { assertEquals("HP-UX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); - else if (os.equals("aix")) + } else if (os.equals("aix")) { assertEquals("AIX", newReport.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()).getValue()); + } String platform = Platform.getOSArch(); if (platform.equals("x86")) { - if (os.equals("macosx")) + if (os.equals("macosx")) { assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) .getValue()); - else + } else { assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - } else if (platform.equals("x86_64")) + } + } else if (platform.equals("x86_64")) { assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("ia64")) + } else if (platform.equals("ia64")) { assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("ia64_32")) + } else if (platform.equals("ia64_32")) { assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("sparc")) + } else if (platform.equals("sparc")) { assertEquals("Sun", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); - else if (platform.equals("ppc")) { - if (os.equals("macosx")) + } else if (platform.equals("ppc")) { + if (os.equals("macosx")) { assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) .getValue()); - else + } else { assertEquals("Power", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) .getValue()); + } } } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java index 89e808c68..0bf872684 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java @@ -80,7 +80,7 @@ public class RepositoryEditorWizardTest extends TestCase { try { BugzillaClient client = createClient(page.getServerUrl(), page.getUserName(), page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), - page.getCharacterEncoding()); + page.getCharacterEncoding()); client.validate(null); } catch (CoreException e) { return; @@ -184,7 +184,7 @@ public class RepositoryEditorWizardTest extends TestCase { page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); try { client = createClient(page.getServerUrl(), page.getUserName(), page.getPassword(), - page.getHttpAuthUserId(), page.getHttpAuthPassword(), + page.getHttpAuthUserId(), page.getHttpAuthPassword(), page.getCharacterEncoding()); client.validate(null); } catch (CoreException e) { diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java index 68c1ea79a..c3aad8c32 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java @@ -90,7 +90,7 @@ public class RepositoryReportFactoryTest extends TestCase { // setRepository(BugzillaCorePlugin.REPOSITORY_KIND, // IBugzillaConstants.TEST_BUGZILLA_222_URL); // RepositoryTaskData report = init(bugid); - // + // // assertNotNull(report); // assertEquals("search-match-test 1", // report.getAttribute(BugzillaReportElement.SHORT_DESC.getKeyString()) diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java index 9879b4d6b..1c8bc1388 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java @@ -68,10 +68,10 @@ public class RepositoryTaskHandleTest extends TestCase { manager.readExistingOrCreateNewList(); BugzillaTask readReport = (BugzillaTask) manager.getTaskList() - .getUnmatchedContainer(repositoryUrl) - .getChildren() - .iterator() - .next(); + .getUnmatchedContainer(repositoryUrl) + .getChildren() + .iterator() + .next(); assertEquals(readReport.getSummary(), readReport.getSummary()); assertEquals(readReport.getRepositoryUrl(), readReport.getRepositoryUrl()); TasksUiPlugin.getRepositoryManager().removeRepository(repository, diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java index 41aed0b9b..7615bb4e6 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java @@ -59,7 +59,7 @@ public class TaskEditorTest extends TestCase { RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setNew(true); AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager().getRepositoryConnector( repository.getConnectorKind()); @@ -83,14 +83,14 @@ public class TaskEditorTest extends TestCase { // editor.doSave(new NullProgressMonitor()); } - public void testinitializeTaskData() throws Exception { + public void testinitializeTaskData() throws Exception { TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), TasksUiPlugin.getTaskDataStorageManager() - .getNewRepositoryTaskId()); + .getNewRepositoryTaskId()); model.setNew(true); AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager().getRepositoryConnector( repository.getConnectorKind()); @@ -102,6 +102,6 @@ public class TaskEditorTest extends TestCase { model.setAttributeValue(RepositoryTaskAttribute.PRODUCT, "TestProduct"); assertEquals("TestProduct", model.getProduct()); assertTrue(taskDataHandler.initializeTaskData(repository, model, null)); - + } } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java index 459233447..4c8df296b 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java @@ -92,7 +92,7 @@ public class TaskListNotificationManagerTest extends TestCase { BugzillaTask hit = new BugzillaTask("https://bugs.eclipse.org/bugs", "1", "summary"); assertFalse(hit.isNotified()); BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("https://bugs.eclipse.org/bugs", "queryUrl", - "summary"); + "summary"); TasksUiPlugin.getTaskList().addQuery(query); TasksUiPlugin.getTaskList().addTask(hit, query); @@ -112,7 +112,7 @@ public class TaskListNotificationManagerTest extends TestCase { String hitHandle = hit.getHandleIdentifier(); assertFalse(hit.isNotified()); BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("https://bugs.eclipse.org/bugs", "queryUrl", - "summary"); + "summary"); TasksUiPlugin.getTaskList().addQuery(query); TasksUiPlugin.getTaskList().addTask(hit, query); TaskListNotificationManager notificationManager = TasksUiPlugin.getTaskListNotificationManager(); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java index 9b9caa848..eae425ad2 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java @@ -111,11 +111,11 @@ public class BugzillaQueryTest extends TestCase { // // You can use the getAttributeValue to pull up the information on any // // part of the bug // assertEquals("P1", taskData.getAttributeValue(BugzillaReportElement.PRIORITY.getKeyString())); -// +// // taskData = taskDataMap.get("2"); // assertEquals("nhapke@cs.ubc.ca", taskData.getAssignedTo()); // assertEquals("search-match-test 1", taskData.getDescription()); -// +// // taskData = taskDataMap.get("4"); // assertEquals("relves@cs.ubc.ca", taskData.getReporter()); // assertEquals("Test", taskData.getDescription()); @@ -130,7 +130,7 @@ public class BugzillaQueryTest extends TestCase { // taskData.setSummary("New Summary"); // // post this modification back to the repository // handler.postTaskData(repository, taskData); - // + // // // You can use the getAttributeValue to pull up the information on any // // part of the bug // // assertEquals("P1", @@ -141,7 +141,7 @@ public class BugzillaQueryTest extends TestCase { @SuppressWarnings("deprecation") public void testQueryViaConnector() throws Exception { String queryUrlString = repository.getRepositoryUrl() - + "/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=search-match-test&product=TestProduct&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&deadlinefrom=&deadlineto=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0="; + + "/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=search-match-test&product=TestProduct&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&deadlinefrom=&deadlineto=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0="; // holds onto actual hit objects ITaskList taskList = new TaskList(); |