Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/.classpath7
-rw-r--r--org.eclipse.mylyn.trac.tests/.cvsignore3
-rw-r--r--org.eclipse.mylyn.trac.tests/.project28
-rw-r--r--org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs316
-rw-r--r--org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs6
-rw-r--r--org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs4
-rw-r--r--org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs4
-rw-r--r--org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs12
-rw-r--r--org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF23
-rw-r--r--org.eclipse.mylyn.trac.tests/about.html27
-rw-r--r--org.eclipse.mylyn.trac.tests/build.properties11
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java204
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java113
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java233
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java100
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java53
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java90
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java234
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java210
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java96
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java79
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java75
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java37
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java348
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java80
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java108
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java136
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java167
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java44
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java33
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java54
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java70
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java51
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java84
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java56
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java85
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java507
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java58
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java97
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java370
42 files changed, 0 insertions, 4320 deletions
diff --git a/org.eclipse.mylyn.trac.tests/.classpath b/org.eclipse.mylyn.trac.tests/.classpath
deleted file mode 100644
index 304e86186..000000000
--- a/org.eclipse.mylyn.trac.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.mylyn.trac.tests/.cvsignore b/org.eclipse.mylyn.trac.tests/.cvsignore
deleted file mode 100644
index b0b9ecf46..000000000
--- a/org.eclipse.mylyn.trac.tests/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-credentials.properties
-credentials.properties
diff --git a/org.eclipse.mylyn.trac.tests/.project b/org.eclipse.mylyn.trac.tests/.project
deleted file mode 100644
index 4241ae65f..000000000
--- a/org.eclipse.mylyn.trac.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.mylyn.trac.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 888de1277..000000000
--- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,316 +0,0 @@
-#Sun Jun 24 11:52:58 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=error
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=1
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.comment.format_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=120
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=120
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true \ No newline at end of file
diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 276c2e6d8..000000000
--- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Feb 05 18:45:19 PST 2007
-eclipse.preferences.version=1
-formatter_profile=_Mylar based on Eclipse [built-in]
-formatter_settings_version=11
-internal.default.compliance=default
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><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">/**\r\n * @return the ${bare_field_name}\r\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">/**\r\n * @param ${param} the ${bare_field_name} to set\r\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">/**\r\n * ${tags}\r\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">/**\r\n * \r\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">/**\r\n * @author ${user}\r\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">/**\r\n * \r\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">/**\r\n * ${tags}\r\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><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) 2004 - 2006 University Of British Columbia and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * University Of British Columbia - initial API and implementation\r\n *******************************************************************************/\r\n\r\n${package_declaration}\r\n\r\n${typecomment}\r\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">\r\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">\r\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">\r\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">\r\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\r\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\r\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}\r\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></templates>
diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index 7ab03bdac..000000000
--- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Jun 02 15:30:09 PDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=true
diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs
deleted file mode 100644
index a6cf96a98..000000000
--- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylar.tasklist.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Fri Oct 20 16:54:30 PDT 2006
-eclipse.preferences.version=1
-project.repository.kind=bugzilla
-project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs
deleted file mode 100644
index 0a2cc0b30..000000000
--- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasklist.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Mon Jun 18 17:14:59 PDT 2007
-eclipse.preferences.version=1
-project.repository.kind=bugzilla
-project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs
deleted file mode 100644
index d8c6d26af..000000000
--- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Mon Jun 25 03:02:37 GMT 2007
-eclipse.preferences.version=1
-project.repository.kind=bugzilla
-project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 769b229ff..000000000
--- a/org.eclipse.mylyn.trac.tests/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Thu Nov 03 15:45:55 PST 2005
-compilers.p.deprecated=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 353e0d7f6..000000000
--- a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Mylar Trac Connector Tests
-Bundle-SymbolicName: org.eclipse.mylyn.trac.tests
-Bundle-Version: 0.0.0
-Require-Bundle: org.junit,
- org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.mylyn.context.core,
- org.eclipse.mylyn.tasks.ui,
- org.eclipse.mylyn.tasks.core,
- org.eclipse.mylyn.context.tests,
- org.eclipse.mylyn.trac.ui,
- org.eclipse.mylyn.trac.core,
- org.eclipse.search,
- org.eclipse.mylyn,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.jface.text,
- org.eclipse.mylyn.web.core
-Export-Package: org.eclipse.mylyn.trac.tests
-Bundle-Activator: org.eclipse.mylyn.trac.tests.TracTestPlugin
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.mylyn.trac.tests/about.html b/org.eclipse.mylyn.trac.tests/about.html
deleted file mode 100644
index 0dd939c09..000000000
--- a/org.eclipse.mylyn.trac.tests/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 7, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.trac.tests/build.properties b/org.eclipse.mylyn.trac.tests/build.properties
deleted file mode 100644
index 81b51c58c..000000000
--- a/org.eclipse.mylyn.trac.tests/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2006 Mylyn project committers and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java
deleted file mode 100644
index 5b2a26ae4..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtilTest.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Mylyn project committers and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.mylyn.internal.trac.ui;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TaskHyperlink;
-import org.eclipse.mylyn.tasks.ui.WebHyperlink;
-
-public class TracHyperlinkUtilTest extends TestCase {
-
- private TaskRepository repository;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, "http://localhost");
- }
-
- public void testFindHyperlinksComment() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "comment:ticket:12:34", 0, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 20), links[0].getHyperlinkRegion());
- assertEquals("12", ((TaskHyperlink) links[0]).getTaskId());
- }
-
- public void testFindHyperlinksTicket() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "#11", 0, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 3), links[0].getHyperlinkRegion());
- assertEquals("11", ((TaskHyperlink) links[0]).getTaskId());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "#11, #234", 6, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("234", ((TaskHyperlink) links[0]).getTaskId());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, " ticket:123 ", 2, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals(new Region(2, 10), links[0].getHyperlinkRegion());
- assertEquals("123", ((TaskHyperlink) links[0]).getTaskId());
- }
-
- public void testFindHyperlinksReport() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "report:123", 0, 0);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 10), links[0].getHyperlinkRegion());
- assertEquals("http://localhost/report/123", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "{123}", 0, 0);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 5), links[0].getHyperlinkRegion());
- assertEquals("http://localhost/report/123", ((WebHyperlink) links[0]).getURLString());
- }
-
- public void testFindHyperlinksChangeset() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "r123", 0, 0);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 4), links[0].getHyperlinkRegion());
- assertEquals("http://localhost/changeset/123", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "[123]", 0, 0);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 5), links[0].getHyperlinkRegion());
- assertEquals("http://localhost/changeset/123", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "changeset:123", 0, 0);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 13), links[0].getHyperlinkRegion());
- assertEquals("http://localhost/changeset/123", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "[123/trunk]", 0, 0);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 11), links[0].getHyperlinkRegion());
- assertEquals("http://localhost/changeset/123/trunk", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "changeset:123/trunk", 0, 0);
- assertEquals(1, links.length);
- assertEquals(new Region(0, 19), links[0].getHyperlinkRegion());
- assertEquals("http://localhost/changeset/123/trunk", ((WebHyperlink) links[0]).getURLString());
- }
-
- public void testFindHyperlinksRevisionLog() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "r123:456", 0, 0);
- assertEquals(2, links.length);
- assertEquals("http://localhost/log/?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString());
- assertEquals(new Region(0, 8), links[0].getHyperlinkRegion());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "[123:456]", 0, 0);
- assertEquals(1, links.length);
- assertEquals("http://localhost/log/?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString());
- assertEquals(new Region(0, 9), links[0].getHyperlinkRegion());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "log:@123:456", 0, 0);
- assertEquals(1, links.length);
- assertEquals("http://localhost/log/?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString());
- assertEquals(new Region(0, 12), links[0].getHyperlinkRegion());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "log:trunk@123:456", 0, 0);
- assertEquals(1, links.length);
- assertEquals("http://localhost/log/trunk?rev=123&stop_rev=456", ((WebHyperlink) links[0]).getURLString());
- assertEquals(new Region(0, 17), links[0].getHyperlinkRegion());
- }
-
- public void testFindHyperlinksDiff() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "diff:@123:456", 0, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/changeset/?new=456&old=123", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539",
- 0, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals(
- "http://localhost/changeset/?new_path=sandbox%2Fvc-refactoring%2Ftrac&old_path=trunk%2Ftrac&new=3539&old=3538",
- ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository,
- "diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default", 0, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals(
- "http://localhost/changeset/?new_path=tags%2Ftrac-0.9.3%2Fwiki-default&old_path=tags%2Ftrac-0.9.2%2Fwiki-default",
- ((WebHyperlink) links[0]).getURLString());
- }
-
- public void testFindHyperlinksWiki() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "[wiki:page]", 1, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/wiki/page", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "wiki:page", 0, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/wiki/page", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "Page", 0, 0);
- assertNull(links);
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "ab Page dc", 0, 0);
- assertNull(links);
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "paGe", 0, 0);
- assertNull(links);
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "WikiPage", 0, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/wiki/WikiPage", ((WebHyperlink) links[0]).getURLString());
- assertEquals(new Region(0, 8), links[0].getHyperlinkRegion());
-
- }
-
- public void testFindHyperlinksMilestone() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "milestone:1.0", 1, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/milestone/1.0", ((WebHyperlink) links[0]).getURLString());
- }
-
- public void testFindHyperlinksAttachment() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "attachment:ticket:123:foo.bar", 1, 0);
- assertNotNull(links);
- assertEquals("123", ((TaskHyperlink) links[0]).getTaskId());
- }
-
- public void testFindHyperlinksFiles() {
- IHyperlink[] links = TracHyperlinkUtil.findHyperlinks(repository, "source:trunk/foo", 1, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/browser/trunk/foo", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "source:trunk/foo@123", 1, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/browser/trunk/foo?rev=123", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "source:trunk/foo@123#L456", 1, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/browser/trunk/foo?rev=123#L456", ((WebHyperlink) links[0]).getURLString());
-
- links = TracHyperlinkUtil.findHyperlinks(repository, "source:/tags/foo_bar-1.1", 1, 0);
- assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals("http://localhost/browser/tags/foo_bar-1.1", ((WebHyperlink) links[0]).getURLString());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java
deleted file mode 100644
index 9c9a5012a..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientRepositoryTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.Proxy.Type;
-
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracException;
-import org.eclipse.mylyn.internal.trac.core.TracLoginException;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-
-/**
- * Test cases for classes that implement {@link ITracClient}.
- *
- * @author Steffen Pingel
- */
-public class AbstractTracClientRepositoryTest extends AbstractTracClientTest {
-
- public AbstractTracClientRepositoryTest(Version version) {
- super(version);
- }
-
- public void testValidate010() throws Exception {
- validate(TracTestConstants.TEST_TRAC_010_URL);
- }
-
- public void testValidate010DigestAuth() throws Exception {
- validate(TracTestConstants.TEST_TRAC_010_DIGEST_AUTH_URL);
- }
-
- public void testValidate011() throws Exception {
- validate(TracTestConstants.TEST_TRAC_011_URL);
- }
-
- public void testValidate010FormAuth() throws Exception {
- validate(TracTestConstants.TEST_TRAC_010_FORM_AUTH_URL);
- }
-
- protected void validate(String url) throws Exception {
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
-
- // standard connect
- connect(url);
- repository.validate();
-
- // invalid url
- connect("http://non.existant/repository");
- try {
- repository.validate();
- fail("Expected TracException");
- } catch (TracException e) {
- }
-
- // invalid password
- connect(url, credentials.username, "wrongpassword");
- try {
- repository.validate();
- fail("Expected TracLoginException");
- } catch (TracLoginException e) {
- }
-
- // invalid username
- connect(url, "wrongusername", credentials.password);
- try {
- repository.validate();
- fail("Expected TracLoginException");
- } catch (TracLoginException e) {
- }
- }
-
- public void testProxy() throws Exception {
- connect(TracTestConstants.TEST_TRAC_010_URL, "", "", new Proxy(Type.HTTP, new InetSocketAddress(
- "invalidhostname", 8080)));
- try {
- repository.validate();
- fail("Expected IOException");
- } catch (TracException e) {
- }
-
- connect(TracTestConstants.TEST_TRAC_010_URL, "", "", null);
- repository.setProxy(new Proxy(Type.HTTP, new InetSocketAddress("invalidhostname", 8080)));
- try {
- repository.validate();
- fail("Expected IOException");
- } catch (TracException e) {
- }
-
- connect(TracTestConstants.TEST_TRAC_010_URL);
- repository.validate();
- repository.setProxy(new Proxy(Type.HTTP, new InetSocketAddress("invalidhostname", 8080)));
- try {
- repository.validate();
- fail("Expected IOException");
- } catch (TracException e) {
- }
-
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java
deleted file mode 100644
index 8df5d4fdb..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientSearchTest.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracException;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
-import org.eclipse.mylyn.trac.tests.support.TestFixture;
-import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
-import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.Ticket;
-
-/**
- * Test cases that validate search results for classes that implement {@link ITracClient}.
- *
- * @author Steffen Pingel
- */
-public abstract class AbstractTracClientSearchTest extends AbstractTracClientTest {
-
- protected List<Ticket> tickets;
-
- private TestData data;
-
- public AbstractTracClientSearchTest(Version version) {
- super(version);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- data = TestFixture.init010();
- tickets = data.tickets;
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- // TestFixture.cleanupRepository1();
- }
-
- protected void assertTicketEquals(Ticket ticket, TracTicket tracTicket) throws Exception {
- assertTrue(tracTicket.isValid());
-
- Map<?, ?> expectedValues = ticket.getValues();
- Map<String, String> values = tracTicket.getValues();
- for (String key : values.keySet()) {
- assertEquals("Values for key '" + key + "' did not match", expectedValues.get(key), values.get(key));
- }
- }
-
- public void testGetTicket010() throws Exception {
- connect010();
- getTickets();
- }
-
- public void testGetTicket011() throws Exception {
- if (version == Version.TRAC_0_9) {
- // XXX need to fix bug 175211
- return;
- }
-
- connect011();
- getTickets();
- }
-
- private void getTickets() throws Exception {
- TracTicket ticket = repository.getTicket(tickets.get(0).getId());
- assertTicketEquals(tickets.get(0), ticket);
-
- ticket = repository.getTicket(tickets.get(1).getId());
- assertTicketEquals(tickets.get(1), ticket);
- }
-
- public void testGetTicketInvalidId010() throws Exception {
- connect010();
- getTicketInvalidId();
- }
-
- public void testGetTicketInvalidId011() throws Exception {
- connect011();
- getTicketInvalidId();
- }
-
- private void getTicketInvalidId() throws Exception {
- try {
- repository.getTicket(Integer.MAX_VALUE);
- fail("Expected TracException");
- } catch (TracException e) {
- }
- }
-
- public void testGetTicketUmlaute010() throws Exception {
- connect010();
- getTicketUmlaute();
- }
-
- public void testGetTicketUmlaute011() throws Exception {
- if (version == Version.TRAC_0_9) {
- // XXX need to fix bug 175211
- return;
- }
-
- connect011();
- getTicketUmlaute();
- }
-
- private void getTicketUmlaute() throws Exception {
- TracTicket ticket = repository.getTicket(data.htmlEntitiesTicketId);
- assertEquals("test html entities: \u00E4\u00F6\u00FC", ticket.getValue(Key.SUMMARY));
- if (version == Version.XML_RPC) {
- assertEquals("\u00C4\u00D6\u00DC\n\nmulti\nline\n\n'''bold'''\n", ticket.getValue(Key.DESCRIPTION));
- } else {
- assertEquals(null, ticket.getValue(Key.DESCRIPTION));
- }
- }
-
- public void testSearchAll010() throws Exception {
- connect010();
- searchAll();
- }
-
- public void testSearchAll011() throws Exception {
- connect011();
- searchAll();
- }
-
- private void searchAll() throws Exception {
- TracSearch search = new TracSearch();
- List<TracTicket> result = new ArrayList<TracTicket>();
- repository.search(search, result);
- assertEquals(tickets.size(), result.size());
- }
-
- public void testSearchEmpty010() throws Exception {
- connect010();
- searchEmpty();
- }
-
- public void testSearchEmpty011() throws Exception {
- connect011();
- searchEmpty();
- }
-
- private void searchEmpty() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "does not exist");
- List<TracTicket> result = new ArrayList<TracTicket>();
- repository.search(search, result);
- assertEquals(0, result.size());
- }
-
- public void testSearchMilestone1010() throws Exception {
- connect010();
- searchMilestone1();
- }
-
- public void testSearchMilestone1011() throws Exception {
- connect011();
- searchMilestone1();
- }
-
- private void searchMilestone1() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- List<TracTicket> result = new ArrayList<TracTicket>();
- repository.search(search, result);
- assertEquals(1, result.size());
- assertTicketEquals(tickets.get(0), result.get(0));
- }
-
- public void testSearchMilestone2010() throws Exception {
- connect010();
- searchMilestone2();
- }
-
- public void testSearchMilestone2011() throws Exception {
- connect011();
- searchMilestone2();
- }
-
- private void searchMilestone2() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- search.addFilter("milestone", "milestone2");
- search.setOrderBy("id");
- List<TracTicket> result = new ArrayList<TracTicket>();
- repository.search(search, result);
- assertEquals(3, result.size());
- assertTicketEquals(tickets.get(0), result.get(0));
- assertTicketEquals(tickets.get(1), result.get(1));
- assertTicketEquals(tickets.get(2), result.get(2));
- }
-
- public void testSearchExactMatch010() throws Exception {
- connect010();
- searchExactMatch();
- }
-
- public void testSearchExactMatch011() throws Exception {
- connect011();
- searchExactMatch();
- }
-
- private void searchExactMatch() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- search.addFilter("summary", "summary1");
- List<TracTicket> result = new ArrayList<TracTicket>();
- repository.search(search, result);
- assertEquals(1, result.size());
- assertTicketEquals(tickets.get(0), result.get(0));
- assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE));
- assertEquals("summary1", result.get(0).getValue(Key.SUMMARY));
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java
deleted file mode 100644
index ce3d01db2..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AbstractTracClientTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.net.Proxy;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracClientFactory;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-
-/**
- * Provides a base implementation for test cases that access trac repositories.
- *
- * @author Steffen Pingel
- */
-public abstract class AbstractTracClientTest extends TestCase {
-
- public String repositoryUrl;
-
- public ITracClient repository;
-
- public String username;
-
- public String password;
-
- public Version version;
-
- private PrivilegeLevel level;
-
- public AbstractTracClientTest(Version version, PrivilegeLevel level) {
- this.version = version;
- this.level = level;
- }
-
- public AbstractTracClientTest(Version version) {
- this(version, PrivilegeLevel.USER);
- }
-
- public AbstractTracClientTest() {
- this(null, PrivilegeLevel.USER);
- }
-
- public ITracClient connect096() throws Exception {
- return connect(TracTestConstants.TEST_TRAC_096_URL);
- }
-
- public ITracClient connect010() throws Exception {
- return connect(TracTestConstants.TEST_TRAC_010_URL);
- }
-
- public ITracClient connect010DigestAuth() throws Exception {
- return connect(TracTestConstants.TEST_TRAC_010_DIGEST_AUTH_URL);
- }
-
- public ITracClient connect011() throws Exception {
- return connect(TracTestConstants.TEST_TRAC_011_URL);
- }
-
- public ITracClient connect(String url) throws Exception {
- return connect(url, Proxy.NO_PROXY);
- }
-
- public ITracClient connect(String url, Proxy proxy) throws Exception {
- Credentials credentials = TestUtil.readCredentials(level);
- return connect(url, credentials.username, credentials.password, proxy);
- }
-
- public ITracClient connect(String url, String username, String password) throws Exception {
- return connect(url, username, password, Proxy.NO_PROXY);
- }
-
- public ITracClient connect(String url, String username, String password, Proxy proxy) throws Exception {
- return connect(url, username, password, proxy, version);
- }
-
- public ITracClient connect(String url, String username, String password, Proxy proxy, Version version)
- throws Exception {
- this.repositoryUrl = url;
- this.username = username;
- this.password = password;
- this.repository = TracClientFactory.createClient(url, version, username, password, proxy);
-
- return this.repository;
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
deleted file mode 100644
index a741e8d5c..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.mylyn.internal.trac.ui.TracHyperlinkUtilTest;
-
-/**
- * @author Mik Kersten
- * @author Steffen Pingel
- */
-public class AllTracTests {
-
- public static Test suite() {
-// UrlConnectionUtil.initCommonsLoggingSettings();
-
- TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.trac.tests");
- // $JUnit-BEGIN$
- // suite.addTestSuite(TracXmlRpcTest.class);
- suite.addTestSuite(TracSearchTest.class);
- suite.addTestSuite(TracTicketTest.class);
- suite.addTestSuite(TracXmlRpcClientTest.class);
- suite.addTestSuite(TracXmlRpcClientSearchTest.class);
- suite.addTestSuite(TracWebClientTest.class);
- suite.addTestSuite(TracWebClientSearchTest.class);
- suite.addTestSuite(TracClientFactoryTest.class);
- suite.addTestSuite(TracRepositoryConnectorTest.class);
- suite.addTestSuite(TracQueryTest.class);
- suite.addTestSuite(TracRepositoryQueryTest.class);
- suite.addTestSuite(TracClientManagerTest.class);
- suite.addTestSuite(TracAttachmentHandlerTest.class);
- suite.addTestSuite(RepositorySearchQueryTest.class);
- suite.addTestSuite(TracTaskDataHandlerTest.class);
- suite.addTestSuite(TracTaskTest.class);
- suite.addTestSuite(TracRepositorySettingsPageTest.class);
- suite.addTestSuite(TracClientProxyTest.class);
- suite.addTestSuite(TracHyperlinkUtilTest.class);
- // $JUnit-END$
- return suite;
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java
deleted file mode 100644
index 89606aa9e..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.tasks.ui.TaskFactory;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector;
-import org.eclipse.mylyn.trac.tests.support.TestFixture;
-import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
-
-/**
- * @author Steffen Pingel
- */
-public class RepositorySearchQueryTest extends TestCase {
-
- private TestData data;
-
- private TaskRepositoryManager manager;
-
-// private TracRepositoryConnector connector;
-
- private TaskRepository repository;
-
- public RepositorySearchQueryTest() {
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- data = TestFixture.init010();
- manager = TasksUiPlugin.getRepositoryManager();
- manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
-// connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracUiPlugin.REPOSITORY_KIND);
- TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
- }
-
- protected void init(String url, Version version) {
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
-
- repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url);
- repository.setAuthenticationCredentials(credentials.username, credentials.password);
- repository.setTimeZoneId(ITracClient.TIME_ZONE);
- repository.setCharacterEncoding(ITracClient.CHARSET);
- repository.setVersion(version.name());
-
- manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
- }
-
- public void testSearch() {
- init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9);
-
- TracSearch search = new TracSearch();
- String queryUrl = repository.getUrl() + ITracClient.QUERY_URL + search.toUrl();
- TracRepositoryQuery query = new TracRepositoryQuery(repository.getUrl(), queryUrl, "description");
- SearchHitCollector collector = new SearchHitCollector(TasksUiPlugin.getTaskListManager().getTaskList(),
- repository, query, new TaskFactory(repository, false, false));
-
- collector.run(new NullProgressMonitor());
- for (AbstractTask task : collector.getTasks()) {
- assertEquals(TracTestConstants.TEST_TRAC_096_URL, task.getRepositoryUrl());
- }
- assertEquals(data.tickets.size(), collector.getTasks().size());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java
deleted file mode 100644
index 368262191..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TestProxy.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Mylyn project committers and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.InterruptedIOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-public class TestProxy implements Runnable {
-
- public static final String NOT_FOUND = "HTTP/1.1 404 Not Found";
-
- private int listenPort;
-
- private Message request;
-
- private Message response;
-
- private Thread runner;
-
- private IOException exception;
-
- private volatile boolean stopped = false;
-
- public TestProxy(int listenPort) {
- this.listenPort = listenPort;
- }
-
- public TestProxy() {
- }
-
- public synchronized int getListenPort() throws InterruptedException {
- while (listenPort == 0) {
- wait();
- }
- return listenPort;
- }
-
- public void start() {
- runner = new Thread(this, "TestProxy :" + listenPort);
- runner.start();
- }
-
- public int startAndWait() throws InterruptedException {
- start();
- int port = getListenPort();
- // wait for socket to enter accept call
- Thread.sleep(100);
- return port;
- }
-
- public void run() {
- ServerSocket serverSocket = null;
- try {
- serverSocket = new ServerSocket(listenPort);
- synchronized (this) {
- listenPort = serverSocket.getLocalPort();
- notifyAll();
- }
- while (!stopped) {
- Socket socket = serverSocket.accept();
- try {
- Message request = readMessage(socket.getInputStream());
- setRequest(request);
-
- Message response = waitForResponse();
- writeMessage(response, socket.getOutputStream());
- } finally {
- try {
- socket.close();
- } catch (IOException e1) {
- }
- }
- }
- } catch (InterruptedIOException e) {
- } catch (IOException e) {
- setException(e);
- } catch (InterruptedException e) {
- } finally {
- if (serverSocket != null) {
- try {
- serverSocket.close();
- } catch (IOException e) {
- }
- }
- }
-
- }
-
- private void writeMessage(Message message, OutputStream out) throws IOException {
- BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out));
- writer.write(message.toString());
- }
-
- private synchronized void setException(IOException exception) {
- this.exception = exception;
- notifyAll();
- }
-
- public synchronized void checkForException() throws IOException {
- if (exception != null) {
- throw exception;
- }
- }
-
- private Message readMessage(InputStream in) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- Message message = null;
- String line;
- while ((line = reader.readLine()) != null) {
- if (line.length() == 0) {
- if (message == null) {
- throw new IOException("Incomplete message");
- }
- return message;
- }
-
- if (message == null) {
- message = new Message(line);
- } else {
- StringTokenizer t = new StringTokenizer(line, ":");
- message.headers.put(t.nextToken(), t.nextToken().trim());
- }
- }
- throw new EOFException();
- }
-
- public void stop() {
- stopped = true;
- runner.interrupt();
- try {
- runner.join(500);
- } catch (InterruptedException e) {
- }
- }
-
- public Message getRequest() {
- return request;
- }
-
- public synchronized Message waitForRequest() throws InterruptedException {
- while (request == null) {
- wait();
- }
- return request;
- }
-
- public synchronized Message waitForResponse() throws InterruptedException {
- while (response == null) {
- wait();
- }
- return response;
- }
-
- public synchronized void setResponse(Message response) {
- this.response = response;
- notifyAll();
- }
-
- public synchronized void setResponse(String response) {
- this.response = new Message(response);
- notifyAll();
- }
-
- public synchronized void setRequest(Message request) {
- this.request = request;
- notifyAll();
- }
-
- public static class Message {
-
- public Message(String request) {
- this.request = request;
- }
-
- public String request;
-
- public Map<String, String> headers = new HashMap<String, String>();
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(request);
- sb.append("\n");
- if (headers != null) {
- for (String key : headers.keySet()) {
- sb.append(key + ": " + headers.get(key));
- sb.append("\n");
- }
- }
- sb.append("\n");
- return sb.toString();
- }
-
- public String getMethod() {
- int i = request.indexOf(" ");
- return (i != -1) ? request.substring(0, i) : request;
- }
-
- }
-
- public static void main(String[] args) {
- TestProxy proxy = new TestProxy(8080);
- proxy.start();
- try {
- proxy.setResponse(new Message("404 / HTTP 1.1"));
- try {
- System.out.println(proxy.waitForRequest());
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- } finally {
- proxy.stop();
- }
-
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
deleted file mode 100644
index 9e63498bd..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
-import org.eclipse.mylyn.internal.trac.core.TracTask;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.FileAttachment;
-import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.trac.tests.support.TestFixture;
-import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
-
-/**
- * @author Steffen Pingel
- */
-public class TracAttachmentHandlerTest extends TestCase {
-
- private TaskRepository repository;
-
- private TaskRepositoryManager manager;
-
- private TracRepositoryConnector connector;
-
- private AbstractAttachmentHandler attachmentHandler;
-
- private TestData data;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- manager = TasksUiPlugin.getRepositoryManager();
- manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
- data = TestFixture.init010();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- protected void init(String url, Version version) {
- String kind = TracCorePlugin.REPOSITORY_KIND;
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
-
- repository = new TaskRepository(kind, url);
- repository.setAuthenticationCredentials(credentials.username, credentials.password);
- repository.setTimeZoneId(ITracClient.TIME_ZONE);
- repository.setCharacterEncoding(ITracClient.CHARSET);
- repository.setVersion(version.name());
-
- manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
- AbstractRepositoryConnector abstractConnector = manager.getRepositoryConnector(kind);
- connector = (TracRepositoryConnector) abstractConnector;
- TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
-
- attachmentHandler = connector.getAttachmentHandler();
- }
-
- public void testDownloadAttachmentXmlRpc010() throws Exception {
- downloadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_010_URL);
- }
-
- public void testDownloadAttachmentXmlRpc011() throws Exception {
- downloadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_011_URL);
- }
-
- private void downloadAttachmentXmlRpc(String url) throws Exception {
- init(url, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(),
- task.getTaskId());
-
- assertTrue(taskData.getAttachments().size() > 0);
- File file = File.createTempFile("attachment", null);
- file.deleteOnExit();
- attachmentHandler.downloadAttachment(repository, taskData.getAttachments().get(0), new FileOutputStream(file),
- new NullProgressMonitor());
-
- byte[] result = new byte[6];
- InputStream in = new FileInputStream(file);
- try {
- in.read(result);
- assertEquals("Mylar\n", new String(result));
- assertEquals(-1, in.read());
- } finally {
- in.close();
- }
- }
-
- public void testGetAttachmentDataXmlRpc010() throws Exception {
- getAttachmentDataXmlRpc(TracTestConstants.TEST_TRAC_010_URL);
- }
-
- public void testGetAttachmentDataXmlRpc011() throws Exception {
- getAttachmentDataXmlRpc(TracTestConstants.TEST_TRAC_011_URL);
- }
-
- private void getAttachmentDataXmlRpc(String url) throws Exception {
- init(url, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(),
- task.getTaskId());
-
- assertTrue(taskData.getAttachments().size() > 0);
- InputStream in = attachmentHandler.getAttachmentAsStream(repository, taskData.getAttachments().get(0),
- new NullProgressMonitor());
- byte[] result = new byte[6];
- try {
- in.read(result);
- } finally {
- in.close();
- }
- assertEquals("Mylar\n", new String(result));
- }
-
- public void testUploadAttachmentXmlRpc010() throws Exception {
- uploadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_010_URL);
- }
-
- public void testUploadAttachmentXmlRpc011() throws Exception {
- uploadAttachmentXmlRpc(TracTestConstants.TEST_TRAC_011_URL);
- }
-
- private void uploadAttachmentXmlRpc(String url) throws Exception {
- init(url, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- File file = File.createTempFile("attachment", null);
- file.deleteOnExit();
- OutputStream out = new FileOutputStream(file);
- try {
- out.write("Mylar".getBytes());
- } finally {
- out.close();
- }
- FileAttachment attachment = new FileAttachment(file);
- attachment.setDescription("");
- attachmentHandler.uploadAttachment(repository, task, attachment, "comment", new NullProgressMonitor());
-
- ITracClient client = connector.getClientManager().getRepository(repository);
- InputStream in = client.getAttachmentData(data.attachmentTicketId, file.getName());
- byte[] result = new byte[5];
- in.read(result);
- assertEquals("Mylar", new String(result));
- }
-
- public void testCanUploadAttachmentXmlRpc() throws CoreException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- assertTrue(attachmentHandler.canUploadAttachment(repository, task));
- }
-
- public void testCanUploadAttachmentWeb() throws CoreException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- assertFalse(attachmentHandler.canUploadAttachment(repository, task));
- }
-
- public void testCanDownloadAttachmentXmlRpc() throws Exception {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- assertTrue(attachmentHandler.canDownloadAttachment(repository, task));
- }
-
- public void testCanDownloadAttachmentWeb() throws Exception {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- assertFalse(attachmentHandler.canDownloadAttachment(repository, task));
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java
deleted file mode 100644
index d7b71c8da..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientFactoryTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.net.Proxy;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracWebClient;
-import org.eclipse.mylyn.internal.trac.core.TracClientFactory;
-import org.eclipse.mylyn.internal.trac.core.TracException;
-import org.eclipse.mylyn.internal.trac.core.TracLoginException;
-import org.eclipse.mylyn.internal.trac.core.TracXmlRpcClient;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-
-/**
- * @author Steffen Pingel
- */
-public class TracClientFactoryTest extends TestCase {
-
- public void testCreateClient() throws Exception {
- ITracClient client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9,
- "user", "password", Proxy.NO_PROXY);
- assertTrue(client instanceof TracWebClient);
- client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_SSL_URL, Version.TRAC_0_9, "user",
- "password", Proxy.NO_PROXY);
- assertTrue(client instanceof TracWebClient);
-
- client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC, "user",
- "password", Proxy.NO_PROXY);
- assertTrue(client instanceof TracXmlRpcClient);
- client = TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_SSL_URL, Version.XML_RPC, "user",
- "password", Proxy.NO_PROXY);
- assertTrue(client instanceof TracXmlRpcClient);
- }
-
- public void testCreateClientNull() throws Exception {
- try {
- TracClientFactory.createClient(TracTestConstants.TEST_TRAC_010_URL, null, "user", "password",
- Proxy.NO_PROXY);
- fail("Expected Exception");
- } catch (Exception e) {
- }
- }
-
- public void testProbeClient096() throws Exception {
- probeClient(TracTestConstants.TEST_TRAC_096_URL, false);
- }
-
- public void testProbeClient010() throws Exception {
- probeClient(TracTestConstants.TEST_TRAC_010_URL, true);
- }
-
- public void testProbeClient010DigestAuth() throws Exception {
- probeClient(TracTestConstants.TEST_TRAC_010_DIGEST_AUTH_URL, true);
- }
-
- protected void probeClient(String url, boolean xmlrpcInstalled) throws Exception {
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- Version version = TracClientFactory.probeClient(url, credentials.username, credentials.password, Proxy.NO_PROXY);
- if (xmlrpcInstalled) {
- assertEquals(Version.XML_RPC, version);
- } else {
- assertEquals(Version.TRAC_0_9, version);
- }
-
- version = TracClientFactory.probeClient(url, "", "", Proxy.NO_PROXY);
- assertEquals(Version.TRAC_0_9, version);
-
- try {
- version = TracClientFactory.probeClient(url, "invaliduser", "password", Proxy.NO_PROXY);
- fail("Expected TracLoginException, got " + version);
- } catch (TracLoginException e) {
- }
-
- try {
- version = TracClientFactory.probeClient(url + "/nonexistant", "", "", Proxy.NO_PROXY);
- fail("Expected TracException, got " + version);
- } catch (TracException e) {
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java
deleted file mode 100644
index c508bd402..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientManagerTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.io.File;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracClientManager;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracMilestone;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-
-/**
- * @author Steffen Pingel
- */
-public class TracClientManagerTest extends TestCase {
-
- public void testNullCache() throws Exception {
- TaskRepository taskRepository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND,
- TracTestConstants.TEST_TRAC_096_URL);
- taskRepository.setVersion(Version.TRAC_0_9.name());
-
- TracClientManager manager = new TracClientManager(null);
- ITracClient client = manager.getRepository(taskRepository);
- assertNull(client.getMilestones());
-
- manager.writeCache();
- assertNull(client.getMilestones());
- }
-
- public void testReadCache() throws Exception {
- TaskRepository taskRepository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND,
- TracTestConstants.TEST_TRAC_096_URL);
- taskRepository.setVersion(Version.TRAC_0_9.name());
-
- File file = File.createTempFile("mylar", null);
- file.deleteOnExit();
-
- TracClientManager manager = new TracClientManager(file);
- ITracClient client = manager.getRepository(taskRepository);
- assertNull(client.getMilestones());
- }
-
- public void testWriteCache() throws Exception {
- TaskRepository taskRepository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND,
- TracTestConstants.TEST_TRAC_096_URL);
- taskRepository.setVersion(Version.TRAC_0_9.name());
-
- File file = File.createTempFile("mylar", null);
- file.deleteOnExit();
-
- TracClientManager manager = new TracClientManager(file);
- ITracClient client = manager.getRepository(taskRepository);
- assertNull(client.getMilestones());
-
- client.updateAttributes(new NullProgressMonitor(), false);
- assertTrue(client.getMilestones().length > 0);
- TracMilestone[] milestones = client.getMilestones();
-
- manager.writeCache();
- manager = new TracClientManager(file);
- assertEquals(Arrays.asList(milestones), Arrays.asList(client.getMilestones()));
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java
deleted file mode 100644
index b772fae50..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracClientProxyTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Mylyn project committers and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.mylyn.trac.tests;
-
-import java.net.Proxy;
-
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracException;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.web.core.WebClientUtil;
-
-public class TracClientProxyTest extends AbstractTracClientTest {
-
- private TestProxy testProxy;
-
- private Proxy proxy;
-
- private int proxyPort;
-
- public TracClientProxyTest() {
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- testProxy = new TestProxy();
- proxyPort = testProxy.startAndWait();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- testProxy.stop();
- }
-
- public void testConnectProxyWeb() throws Exception {
- version = Version.TRAC_0_9;
- connectProxy(TracTestConstants.TEST_TRAC_010_URL, "GET");
- }
-
- public void testConnectProxyXmlRpc() throws Exception {
- version = Version.XML_RPC;
- connectProxy(TracTestConstants.TEST_TRAC_010_URL, "POST");
- }
-
- public void testConnectProxySslWeb() throws Exception {
- version = Version.TRAC_0_9;
- connectProxy(TracTestConstants.TEST_TRAC_010_SSL_URL, "CONNECT");
- }
-
- public void testConnectProxySslXmlRpc() throws Exception {
- version = Version.XML_RPC;
- connectProxy(TracTestConstants.TEST_TRAC_010_SSL_URL, "CONNECT");
- }
-
- private void connectProxy(String url, String expectedMethod) throws Exception {
- testProxy.setResponse(TestProxy.NOT_FOUND);
- proxy = WebClientUtil.getProxy("localhost", proxyPort + "", "", "");
- ITracClient client = connect(url, proxy);
- try {
- client.validate();
- } catch (TracException e) {
- }
-
- assertEquals(expectedMethod, testProxy.getRequest().getMethod());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java
deleted file mode 100644
index 46f82c339..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracQueryTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-
-/**
- * @author Steffen Pingel
- */
-public class TracQueryTest extends TestCase {
-
- private TracRepositoryQuery createQuery(String parameter) {
- String url = "http://oss.steffenpingel.de/mylar-trac-connector";
- return new TracRepositoryQuery(url, url + ITracClient.QUERY_URL + parameter, "description");
- }
-
- public void testGetTracSearch() {
- String queryParameter = "&order=priority&status=new&status=assigned&status=reopened&milestone=M1&owner=%7E%C3%A4%C3%B6%C3%BC";
- TracRepositoryQuery query = createQuery(queryParameter);
- TracSearch search = query.getTracSearch();
- assertEquals(queryParameter, search.toUrl());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
deleted file mode 100644
index d2baf47f2..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.mylyn.context.core.ContextCorePlugin;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.InvalidTicketException;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery;
-import org.eclipse.mylyn.internal.trac.core.TracTask;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-import org.eclipse.mylyn.internal.trac.core.model.TracVersion;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
-import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.QueryHitCollector;
-import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.tasks.ui.TaskFactory;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.trac.tests.support.TestFixture;
-import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Steffen Pingel
- */
-public class TracRepositoryConnectorTest extends TestCase {
-
- private TestData data;
-
- private TaskRepository repository;
-
- private TaskRepositoryManager manager;
-
- private TracRepositoryConnector connector;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- manager = TasksUiPlugin.getRepositoryManager();
- manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
- data = TestFixture.init010();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- // TestFixture.cleanupRepository1();
- }
-
- protected void init(String url, Version version) {
- String kind = TracCorePlugin.REPOSITORY_KIND;
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
-
- repository = new TaskRepository(kind, url);
- repository.setAuthenticationCredentials(credentials.username, credentials.password);
- repository.setTimeZoneId(ITracClient.TIME_ZONE);
- repository.setCharacterEncoding(ITracClient.CHARSET);
- repository.setVersion(version.name());
-
- manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
- AbstractRepositoryConnector abstractConnector = manager.getRepositoryConnector(kind);
- assertEquals(abstractConnector.getConnectorKind(), kind);
-
- connector = (TracRepositoryConnector) abstractConnector;
- TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
- }
-
- public void testGetRepositoryUrlFromTaskUrl() {
- TracRepositoryConnector connector = new TracRepositoryConnector();
- assertEquals("http://host/repo", connector.getRepositoryUrlFromTaskUrl("http://host/repo/ticket/1"));
- assertEquals("http://host", connector.getRepositoryUrlFromTaskUrl("http://host/ticket/2342"));
- assertEquals(null, connector.getRepositoryUrlFromTaskUrl("http://host/repo/2342"));
- assertEquals(null, connector.getRepositoryUrlFromTaskUrl("http://host/repo/ticket-2342"));
- }
-
- public void testCreateTaskFromExistingKeyXmlRpc011() throws CoreException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- createTaskFromExistingKey();
- }
-
- public void testCreateTaskFromExistingKeyXmlRpc010() throws CoreException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- createTaskFromExistingKey();
- }
-
- public void testCreateTaskFromExistingKeyTracWeb011() throws CoreException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- createTaskFromExistingKey();
- }
-
- public void testCreateTaskFromExistingKeyTracWeb010() throws CoreException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- createTaskFromExistingKey();
- }
-
- public void testCreateTaskFromExistingKeyTracWeb096() throws CoreException {
- init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9);
- createTaskFromExistingKey();
- }
-
- protected void createTaskFromExistingKey() throws CoreException {
- String id = data.tickets.get(0).getId() + "";
- AbstractTask task = connector.createTaskFromExistingId(repository, id, new NullProgressMonitor());
- assertNotNull(task);
- assertEquals(TracTask.class, task.getClass());
- assertTrue(task.getSummary().contains("summary1"));
- assertEquals(repository.getUrl() + ITracClient.TICKET_URL + id, task.getUrl());
-
- try {
- task = connector.createTaskFromExistingId(repository, "does not exist", new NullProgressMonitor());
- fail("Expected CoreException");
- } catch (CoreException e) {
- }
-
- // No longer parsing as an integer
- // try {
- // task = connector.createTaskFromExistingId(repository,
- // Integer.MAX_VALUE + "");
- // fail("Expected CoreException");
- // } catch (CoreException e) {
- // }
- }
-
- public void testClientManagerChangeTaskRepositorySettings() throws MalformedURLException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- ITracClient client = connector.getClientManager().getRepository(repository);
- assertEquals(Version.TRAC_0_9, client.getVersion());
-
- EditRepositoryWizard wizard = new EditRepositoryWizard(repository);
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
-
- ((TracRepositorySettingsPage) wizard.getSettingsPage()).setTracVersion(Version.XML_RPC);
- assertTrue(wizard.performFinish());
-
- client = connector.getClientManager().getRepository(repository);
- assertEquals(Version.XML_RPC, client.getVersion());
- }
-
- public void testPerformQueryXmlRpc011() {
- performQuery(TracTestConstants.TEST_TRAC_011_URL, Version.XML_RPC);
- }
-
- public void testPerformQueryXmlRpc010() {
- performQuery(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- }
-
- public void testPerformQueryWeb011() {
- performQuery(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- }
-
- public void testPerformQueryWeb010() {
- performQuery(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- }
-
- public void testPerformQueryWeb096() {
- performQuery(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9);
- }
-
- @SuppressWarnings("deprecation")
- protected void performQuery(String url, Version version) {
- init(url, version);
-
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- search.addFilter("milestone", "milestone2");
- search.setOrderBy("id");
-
- String queryUrl = url + ITracClient.QUERY_URL + search.toUrl();
- TracRepositoryQuery query = new TracRepositoryQuery(url, queryUrl, "description");
-
- //MultiStatus queryStatus = new MultiStatus(TracUiPlugin.PLUGIN_ID, IStatus.OK, "Query result", null);
- final List<AbstractTask> result = new ArrayList<AbstractTask>();
- QueryHitCollector hitCollector = new QueryHitCollector(new TaskFactory(repository)) {
- @Override
- public void accept(RepositoryTaskData data) {
- fail("Unexpected call to accept()");
- }
-
- @Override
- public void accept(AbstractTask hit) {
- result.add(hit);
- }
- };
- IStatus queryStatus = connector.performQuery(query, repository, new NullProgressMonitor(), hitCollector);
-
- assertTrue(queryStatus.isOK());
- assertEquals(3, result.size());
- assertEquals(data.tickets.get(0).getId() + "", result.get(0).getTaskId());
- assertEquals(data.tickets.get(1).getId() + "", result.get(1).getTaskId());
- assertEquals(data.tickets.get(2).getId() + "", result.get(2).getTaskId());
- }
-
- public void testUpdateTaskDetails() throws InvalidTicketException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
-
- TracTicket ticket = new TracTicket(123);
- ticket.putBuiltinValue(Key.DESCRIPTION, "mydescription");
- ticket.putBuiltinValue(Key.PRIORITY, "mypriority");
- ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
- ticket.putBuiltinValue(Key.TYPE, "mytype");
-
- TracTask task = new TracTask(TracTestConstants.TEST_TRAC_010_URL, "" + 123, "desc");
- assertEquals(TracTestConstants.TEST_TRAC_010_URL + ITracClient.TICKET_URL + "123", task.getUrl());
- assertEquals("desc", task.getSummary());
-
- connector.updateTaskFromTicket(task, ticket, false);
- assertEquals(TracTestConstants.TEST_TRAC_010_URL + ITracClient.TICKET_URL + "123", task.getUrl());
- assertEquals("123", task.getTaskKey());
- assertEquals("mysummary", task.getSummary());
- assertEquals("P3", task.getPriority());
- assertEquals("mytype", task.getTaskKind());
- }
-
- public void testUpdateTaskDetailsSummaryOnly() throws InvalidTicketException {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
-
- TracTicket ticket = new TracTicket(456);
- ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
-
- TracTask task = new TracTask(TracTestConstants.TEST_TRAC_010_URL, "" + 456, "desc");
-
- connector.updateTaskFromTicket(task, ticket, false);
- assertEquals(TracTestConstants.TEST_TRAC_010_URL + ITracClient.TICKET_URL + "456", task.getUrl());
- assertEquals("456", task.getTaskKey());
- assertEquals("mysummary", task.getSummary());
- assertEquals("P3", task.getPriority());
- assertEquals(AbstractTask.DEFAULT_TASK_KIND, task.getTaskKind());
- }
-
- public void testUpdateAttributesWeb011() throws Exception {
- init(TracTestConstants.TEST_TRAC_011_URL, Version.TRAC_0_9);
- updateAttributes();
- }
-
- public void testUpdateAttributesWeb010() throws Exception {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- updateAttributes();
- }
-
- public void testUpdateAttributesWeb096() throws Exception {
- init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9);
- updateAttributes();
- }
-
- public void testUpdateAttributesXmlRpc011() throws Exception {
- init(TracTestConstants.TEST_TRAC_011_URL, Version.XML_RPC);
- updateAttributes();
- }
-
- public void testUpdateAttributesXmlRpc010() throws Exception {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- updateAttributes();
- }
-
- protected void updateAttributes() throws Exception {
- connector.updateAttributes(repository, new NullProgressMonitor());
-
- ITracClient server = connector.getClientManager().getRepository(repository);
- TracVersion[] versions = server.getVersions();
- assertEquals(2, versions.length);
- Arrays.sort(versions, new Comparator<TracVersion>() {
- public int compare(TracVersion o1, TracVersion o2) {
- return o1.getName().compareTo(o2.getName());
- }
- });
- assertEquals("1.0", versions[0].getName());
- assertEquals("2.0", versions[1].getName());
- }
-
- public void testContextXmlRpc010() throws Exception {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
-
- //int size = task.getTaskData().getAttachments().size();
-
- File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
- sourceContextFile.createNewFile();
- sourceContextFile.deleteOnExit();
-
- assertTrue(connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor()));
-
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
- // TODO attachment may have been overridden therefore size may not have changed
- //assertEquals(size + 1, task.getTaskData().getAttachments().size());
-
- //RepositoryAttachment attachment = task.getTaskData().getAttachments().get(size);
- //assertTrue(connector.retrieveContext(repository, task, attachment, TasksUiPlugin.getDefault().getProxySettings(), TasksUiPlugin.getDefault().getDataDirectory()));
- }
-
- public void testContextWeb096() throws Exception {
- init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.attachmentTicketId + "",
- new NullProgressMonitor());
-
- File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
- sourceContextFile.createNewFile();
- sourceContextFile.deleteOnExit();
-
- try {
- connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor());
- fail("expected CoreException"); // operation should not be supported
- } catch (CoreException e) {
- }
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java
deleted file mode 100644
index e20d31636..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery;
-import org.eclipse.mylyn.internal.trac.core.TracTask;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearchFilter;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-
-/**
- * @author Steffen Pingel
- */
-public class TracRepositoryQueryTest extends TestCase {
-
- public void testChangeRepositoryUrl() {
- TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
- manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
- TaskRepository repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND,
- TracTestConstants.TEST_TRAC_096_URL);
- manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
- TracSearch search = new TracSearch();
- String queryUrl = repository.getUrl() + ITracClient.QUERY_URL + search.toUrl();
- TracRepositoryQuery query = new TracRepositoryQuery(repository.getUrl(), queryUrl, "description");
- TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query);
-
- TracTask task = new TracTask(TracTestConstants.TEST_TRAC_096_URL, "" + 123, "desc");
- TasksUiPlugin.getTaskListManager().getTaskList().addTask(task);
-
- String oldUrl = repository.getUrl();
- String newUrl = TracTestConstants.TEST_TRAC_010_URL;
- TasksUiPlugin.getTaskListManager().refactorRepositoryUrl(oldUrl, newUrl);
- repository.setUrl(newUrl);
-
- assertEquals(newUrl, query.getRepositoryUrl());
- assertEquals(newUrl + ITracClient.QUERY_URL + search.toUrl(), query.getUrl());
- assertEquals(newUrl + ITracClient.TICKET_URL + 123, task.getUrl());
- }
-
- public void testGetFilterList() {
- String repositoryUrl = "https://foo.bar/repo";
- String parameterUrl = "&status=new&status=assigned&status=reopened&milestone=0.1";
- String queryUrl = repositoryUrl + ITracClient.QUERY_URL + parameterUrl;
- TracRepositoryQuery query = new TracRepositoryQuery(repositoryUrl, queryUrl, "description");
-
- TracSearch filterList = query.getTracSearch();
-
- assertEquals(parameterUrl, filterList.toUrl());
- assertEquals("&status=new|assigned|reopened&milestone=0.1", filterList.toQuery());
-
- List<TracSearchFilter> list = filterList.getFilters();
- TracSearchFilter filter = list.get(0);
- assertEquals("status", filter.getFieldName());
- assertEquals(Arrays.asList("new", "assigned", "reopened"), filter.getValues());
- filter = list.get(1);
- assertEquals("milestone", filter.getFieldName());
- assertEquals(Arrays.asList("0.1"), filter.getValues());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java
deleted file mode 100644
index da124b6d1..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositorySettingsPageTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.net.Proxy;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.ui.TracConnectorUi;
-import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage;
-import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage.TracValidator;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Steffen Pingel
- */
-public class TracRepositorySettingsPageTest extends AbstractTracClientTest {
-
- private TracConnectorUi connector;
-
- private TracRepositorySettingsPage page;
-
- private TracValidator validator;
-
- public TracRepositorySettingsPageTest() {
- super(null);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- connector = (TracConnectorUi) TasksUiPlugin.getConnectorUi(TracCorePlugin.REPOSITORY_KIND);
- page = new TracRepositorySettingsPage(connector);
-
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- page.createControl(shell);
- page.setVisible(true);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- // TestFixture.cleanupRepository1();
- }
-
- @Override
- public ITracClient connect(String url, String username, String password, Proxy proxy, Version version)
- throws Exception {
- page.setUrl(url);
- page.setUserId(username);
- page.setPassword(password);
- page.setTracVersion(version);
- validator = page.new TracValidator(page.createTaskRepository(), version);
- return null;
- }
-
- public void testValidateXmlRpc() throws Exception {
- version = Version.XML_RPC;
- connect010();
-
- validator.run(new NullProgressMonitor());
- assertNull(validator.getResult());
- assertNull(validator.getStatus());
- }
-
- public void testValidateWeb() throws Exception {
- version = Version.TRAC_0_9;
- connect010();
-
- validator.run(new NullProgressMonitor());
- assertNull(validator.getResult());
- assertNull(validator.getStatus());
- }
-
- public void testValidateAutomaticUser() throws Exception {
- version = null;
- connect010();
-
- validator.run(new NullProgressMonitor());
- assertEquals(Version.XML_RPC, validator.getResult());
- assertNull(validator.getStatus());
- }
-
- public void testValidateAutomaticAnonymous() throws Exception {
- version = null;
- connect(TracTestConstants.TEST_TRAC_010_URL, "", "");
-
- validator.run(new NullProgressMonitor());
- assertEquals(Version.TRAC_0_9, validator.getResult());
- assertNotNull(validator.getStatus());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java
deleted file mode 100644
index b36b5d265..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracSearchTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-
-/**
- * @author Steffen Pingel
- */
-public class TracSearchTest extends TestCase {
-
- private static final String QUERY1 = "&status=new|assigned|reopened&milestone~=0.1";
-
- private static final String URL1 = "&status=new&status=assigned&status=reopened&milestone=%7E0.1";
-
- private TracSearch search1;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- search1 = new TracSearch();
- search1.addFilter("status", "new");
- search1.addFilter("status", "assigned");
- search1.addFilter("status", "reopened");
- search1.addFilter("milestone", "~0.1");
- }
-
- public void testToQuery() {
- assertEquals(QUERY1, search1.toQuery());
- }
-
- public void testToQueryEmpty() {
- assertEquals("", new TracSearch().toQuery());
- }
-
- public void testToQueryOperators1() {
- TracSearch search = new TracSearch();
- search.addFilter("is", "a");
- search.addFilter("contains", "~b");
- search.addFilter("starts", "^c");
- search.addFilter("ends", "$d");
- search.addFilter("nis", "!e");
- search.addFilter("ncontains", "!~f");
- search.addFilter("nstarts", "!^g");
- search.addFilter("nends", "!$h");
-
- assertEquals("&is=a&contains~=b&starts^=c&ends$=d&nis!=e&ncontains!~=f&nstarts!^=g&nends!$=h", search.toQuery());
- }
-
- public void testToQueryOperators2() {
- TracSearch search = new TracSearch();
- search.addFilter("nstarts", "!^g");
- search.addFilter("nis", "!e");
- search.addFilter("is", "a");
-
- assertEquals("&nstarts!^=g&nis!=e&is=a", search.toQuery());
- }
-
- public void testToQuerySortOrder() {
- search1.setOrderBy("id");
- assertEquals("&order=id" + QUERY1, search1.toQuery());
-
- search1.setAscending(false);
- assertEquals("&order=id&desc=1" + QUERY1, search1.toQuery());
-
- search1.setOrderBy("summary");
- search1.setAscending(true);
- assertEquals("&order=summary" + QUERY1, search1.toQuery());
- }
-
- public void testToUrl() {
- assertEquals(URL1, search1.toUrl());
- }
-
- public void testToUrlEmpty() {
- // assertEquals("", new TracSearch().toUrl());
- // returns non-empty string to work around a strange Trac behaviour, see
- // TracSearch.toUrl()
- assertEquals("&order=id", new TracSearch().toUrl());
- }
-
- public void testToUrlEncoding() {
- search1.addFilter("encoded", "&");
- assertEquals(URL1 + "&encoded=%26", search1.toUrl());
- }
-
- public void testToUrlOperators1() {
- TracSearch search = new TracSearch();
- search.addFilter("is", "a");
- search.addFilter("contains", "~b");
- search.addFilter("starts", "^c");
- search.addFilter("ends", "$d");
- search.addFilter("nis", "!e");
- search.addFilter("ncontains", "!~f");
- search.addFilter("nstarts", "!^g");
- search.addFilter("nends", "!$h");
-
- assertEquals(
- "&is=a&contains=%7Eb&starts=%5Ec&ends=%24d&nis=%21e&ncontains=%21%7Ef&nstarts=%21%5Eg&nends=%21%24h",
- search.toUrl());
- }
-
- public void testToUrlOperators2() {
- TracSearch search = new TracSearch();
- search.addFilter("nstarts", "!^g");
- search.addFilter("nis", "!e");
- search.addFilter("is", "a");
-
- assertEquals("&nstarts=%21%5Eg&nis=%21e&is=a", search.toUrl());
- }
-
- public void testToUrlSortOrder() {
- search1.setOrderBy("id");
- assertEquals("&order=id" + QUERY1, search1.toQuery());
-
- search1.setAscending(false);
- assertEquals("&order=id&desc=1" + QUERY1, search1.toQuery());
-
- search1.setOrderBy("summary");
- search1.setAscending(true);
- assertEquals("&order=summary" + QUERY1, search1.toQuery());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java
deleted file mode 100644
index f3ded9f15..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
-import org.eclipse.mylyn.internal.trac.core.TracTask;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.trac.tests.support.TestFixture;
-import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
-
-/**
- * @author Steffen Pingel
- */
-public class TracTaskDataHandlerTest extends TestCase {
-
- private TracRepositoryConnector connector;
-
- private TaskRepository repository;
-
- private TaskRepositoryManager manager;
-
- private TestData data;
-
- public TracTaskDataHandlerTest() {
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- data = TestFixture.init010();
-
- manager = TasksUiPlugin.getRepositoryManager();
- manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
- connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracCorePlugin.REPOSITORY_KIND);
- TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
- }
-
- protected void init(String url, Version version) {
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
-
- repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url);
- repository.setAuthenticationCredentials(credentials.username, credentials.password);
- repository.setTimeZoneId(ITracClient.TIME_ZONE);
- repository.setCharacterEncoding(ITracClient.CHARSET);
- repository.setVersion(version.name());
-
- manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
- }
-
- public void testGetChangedSinceLastSyncWeb096() throws Exception {
- init(TracTestConstants.TEST_TRAC_096_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.offlineHandlerTicketId + "",
- new NullProgressMonitor());
-
- Set<AbstractTask> tasks = new HashSet<AbstractTask>();
- tasks.add(task);
-
- assertEquals(null, repository.getSynchronizationTimeStamp());
- boolean changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
- assertEquals(true, changed);
- assertEquals(null, repository.getSynchronizationTimeStamp());
- assertFalse(task.isStale());
-
- int time = (int) (System.currentTimeMillis() / 1000) + 1;
- repository.setSynchronizationTimeStamp(time + "");
- changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
- assertEquals(true, changed);
- assertFalse(task.isStale());
- }
-
- public void testGetChangedSinceLastSyncXmlRpc010() throws Exception {
- init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
- getChangedSinceLastSync();
- }
-
- public void testGetChangedSinceLastSyncXmlRpc011() throws Exception {
- init(TracTestConstants.TEST_TRAC_011_URL, Version.XML_RPC);
- getChangedSinceLastSync();
- }
-
- private void getChangedSinceLastSync() throws Exception {
- TracTask task = (TracTask) connector.createTaskFromExistingId(repository, data.offlineHandlerTicketId + "",
- new NullProgressMonitor());
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
- RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(),
- task.getTaskId());
-
- int lastModified = Integer.parseInt(taskData.getLastModified());
-
- Set<AbstractTask> tasks = new HashSet<AbstractTask>();
- tasks.add(task);
-
- assertEquals(null, repository.getSynchronizationTimeStamp());
- boolean changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
- assertTrue(changed);
- assertTrue(task.isStale());
-
- // always returns the ticket because time comparison mode is >=
- task.setStale(false);
- repository.setSynchronizationTimeStamp(lastModified + "");
- changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
- assertTrue(changed);
- assertTrue(task.isStale());
-
- task.setStale(false);
- repository.setSynchronizationTimeStamp((lastModified + 1) + "");
- changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
- assertTrue(changed);
- assertFalse(task.isStale());
-
- // change ticket making sure it gets a new change time
- Thread.sleep(1000);
- ITracClient client = connector.getClientManager().getRepository(repository);
- TracTicket ticket = client.getTicket(data.offlineHandlerTicketId);
- if (ticket.getValue(Key.DESCRIPTION).equals(lastModified + "")) {
- ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + "x");
- } else {
- ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + "");
- }
- client.updateTicket(ticket, "comment");
-
- task.setStale(false);
- repository.setSynchronizationTimeStamp((lastModified + 1) + "");
- changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
- assertTrue(changed);
- assertTrue(task.isStale());
- }
-
- public void testNonNumericTaskId() {
- try {
- connector.getTaskDataHandler().getTaskData(repository, "abc", new NullProgressMonitor());
- fail("Expected CoreException");
- } catch (CoreException e) {
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java
deleted file mode 100644
index 2154d7c29..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.internal.trac.core.TracTask;
-
-/**
- * @author Steffen Pingel
- */
-public class TracTaskTest extends TestCase {
-
- public void testIsCompleted() {
- assertTrue(TracTask.isCompleted("closed"));
- assertFalse(TracTask.isCompleted("Closed"));
- assertFalse(TracTask.isCompleted("new"));
- assertFalse(TracTask.isCompleted("assigned"));
- assertFalse(TracTask.isCompleted("reopened"));
- assertFalse(TracTask.isCompleted("foobar"));
- assertFalse(TracTask.isCompleted(""));
- assertFalse(TracTask.isCompleted(null));
- }
-
- public void testGetMylarPriority() {
- assertEquals("P1", TracTask.getMylarPriority("blocker"));
- assertEquals("P2", TracTask.getMylarPriority("critical"));
- assertEquals("P3", TracTask.getMylarPriority("major"));
- assertEquals("P3", TracTask.getMylarPriority(null));
- assertEquals("P3", TracTask.getMylarPriority(""));
- assertEquals("P3", TracTask.getMylarPriority("foo bar"));
- assertEquals("P4", TracTask.getMylarPriority("minor"));
- assertEquals("P5", TracTask.getMylarPriority("trivial"));
- }
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java
deleted file mode 100644
index db47a3df8..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestConstants.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-/**
- * @author Steffen Pingel
- */
-public class TracTestConstants {
-
- public static final String TEST_TRAC_096_URL = "http://mylyn.eclipse.org/trac096";
-
- public static final String TEST_TRAC_010_URL = "http://mylyn.eclipse.org/trac010";
-
- public static final String TEST_TRAC_010_SSL_URL = "https://mylyn.eclipse.org/trac010";
-
- public static final String TEST_TRAC_010_DIGEST_AUTH_URL = "http://mylyn.eclipse.org/trac010digest";
-
- public static final String TEST_TRAC_010_FORM_AUTH_URL = "http://mylyn.eclipse.org/trac010formauth";
-
- public static final String TEST_TRAC_011_URL = "http://mylyn.eclipse.org/trac011";
-
- public static final String TEST_TRAC_INVALID_URL = "http://mylyn.eclipse.org/doesnotexist";
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java
deleted file mode 100644
index 784ab7d2e..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTestPlugin.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- * @author Steffen Pingel
- */
-public class TracTestPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.mylyn.trac.tests";
-
- // The shared instance
- private static TracTestPlugin plugin;
-
- public TracTestPlugin() {
- plugin = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static TracTestPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java
deleted file mode 100644
index 68ffc9cd9..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTicketTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.internal.trac.core.InvalidTicketException;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
-import org.eclipse.mylyn.internal.trac.core.util.TracUtils;
-
-/**
- * @author Steffen Pingel
- */
-public class TracTicketTest extends TestCase {
-
- public void testValid() {
- TracTicket ticket = new TracTicket();
- assertFalse(ticket.isValid());
-
- ticket.setId(1);
- assertTrue(ticket.isValid());
- }
-
- public void testPutTracValue() throws InvalidTicketException {
- TracTicket ticket = new TracTicket(1);
- ticket.putValue("summary", "a");
- assertEquals("a", ticket.getValue(Key.SUMMARY));
- assertEquals(null, ticket.getCustomValue("summary"));
- assertEquals(null, ticket.getCustomValue("a"));
-
- ticket.putValue("summary", "b");
- ticket.putValue("custom", "c");
- assertEquals("b", ticket.getValue(Key.SUMMARY));
- assertEquals(null, ticket.getCustomValue("summary"));
- assertEquals("c", ticket.getCustomValue("custom"));
- }
-
- public void testPutTracValueId() throws InvalidTicketException {
- TracTicket ticket = new TracTicket();
- assertFalse(ticket.putValue("id", "1"));
- }
-
- public void testSetCreated() throws InvalidTicketException {
- TracTicket ticket = new TracTicket(1);
- ticket.setCreated(TracUtils.parseDate(0));
- assertEquals(TimeZone.getTimeZone("GMT").getOffset(0) * 1000, ticket.getCreated().getTime());
-
- Date date = new Date();
- Calendar utc = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- utc.setTime(date);
- ticket.setCreated(TracUtils.parseDate((int) (utc.getTimeInMillis() / 1000)));
-
- assertEquals(date.getTime() / 1000, ticket.getCreated().getTime() / 1000);
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java
deleted file mode 100644
index b821557dc..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientSearchTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-
-/**
- * @author Steffen Pingel
- */
-public class TracWebClientSearchTest extends AbstractTracClientSearchTest {
-
- public TracWebClientSearchTest() {
- super(Version.TRAC_0_9);
- }
-
- // TODO move this test to AbstracTracClientTest when bug 162094 is resolved
- public void testSearchMilestoneAmpersand010() throws Exception {
- connect010();
- searchMilestoneAmpersand();
- }
-
- public void testSearchMilestoneAmpersand011() throws Exception {
- connect011();
- searchMilestoneAmpersand();
- }
-
- private void searchMilestoneAmpersand() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "mile&stone");
- search.setOrderBy("id");
- List<TracTicket> result = new ArrayList<TracTicket>();
- repository.search(search, result);
- assertEquals(1, result.size());
- assertTicketEquals(tickets.get(7), result.get(0));
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java
deleted file mode 100644
index 993a7b938..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracWebClientTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.trac.core.TracException;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracVersion;
-
-/**
- * @author Steffen Pingel
- */
-public class TracWebClientTest extends AbstractTracClientRepositoryTest {
-
- public TracWebClientTest() {
- super(Version.TRAC_0_9);
- }
-
- public void testValidate096() throws Exception {
- validate(TracTestConstants.TEST_TRAC_096_URL);
- }
-
- @Override
- public void testValidate011() throws Exception {
- try {
- validate(TracTestConstants.TEST_TRAC_011_URL);
- } catch (TracException e) {
- }
- }
-
- public void testValidateAnyPage() throws Exception {
- connect("http://mylyn.eclipse.org/");
- try {
- repository.validate();
- fail("Expected TracException");
- } catch (TracException e) {
- }
- }
-
- public void testValidateAnonymousLogin() throws Exception {
- connect(TracTestConstants.TEST_TRAC_010_URL, "", "");
- repository.validate();
-
- connect(TracTestConstants.TEST_TRAC_096_URL, "", "");
- repository.validate();
- }
-
- public void testUpdateAttributesAnonymous096() throws Exception {
- connect(TracTestConstants.TEST_TRAC_096_URL, "", "");
- updateAttributes();
- }
-
- public void testUpdateAttributesAnonymous010() throws Exception {
- connect(TracTestConstants.TEST_TRAC_010_URL, "", "");
- updateAttributes();
- }
-
- private void updateAttributes() throws TracException {
- assertNull(repository.getMilestones());
- repository.updateAttributes(new NullProgressMonitor(), true);
- TracVersion[] versions = repository.getVersions();
- assertEquals(2, versions.length);
- Arrays.sort(versions, new Comparator<TracVersion>() {
- public int compare(TracVersion o1, TracVersion o2) {
- return o1.getName().compareTo(o2.getName());
- }
- });
- assertEquals("1.0", versions[0].getName());
- assertEquals("2.0", versions[1].getName());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java
deleted file mode 100644
index 37c655806..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientSearchTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
-
-/**
- * @author Steffen Pingel
- */
-public class TracXmlRpcClientSearchTest extends AbstractTracClientSearchTest {
-
- public TracXmlRpcClientSearchTest() {
- super(Version.XML_RPC);
- }
-
- public void testSearchValidateTicket010() throws Exception {
- connect010();
- searchValidateTicket();
- }
-
- public void testSearchValidateTicket011() throws Exception {
- connect011();
- searchValidateTicket();
- }
-
- public void searchValidateTicket() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("summary", "summary1");
- List<TracTicket> result = new ArrayList<TracTicket>();
- repository.search(search, result);
- assertEquals(1, result.size());
- assertTicketEquals(tickets.get(0), result.get(0));
- assertEquals("component1", result.get(0).getValue(Key.COMPONENT));
- assertEquals("description1", result.get(0).getValue(Key.DESCRIPTION));
- assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE));
- assertEquals("anonymous", result.get(0).getValue(Key.REPORTER));
- assertEquals("summary1", result.get(0).getValue(Key.SUMMARY));
- // assertEquals("", result.get(0).getValue(Key.VERSION));
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java
deleted file mode 100644
index 216c83fa3..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcClientTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Date;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.trac.core.TracPermissionDeniedException;
-import org.eclipse.mylyn.internal.trac.core.TracRemoteException;
-import org.eclipse.mylyn.internal.trac.core.TracXmlRpcClient;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracVersion;
-
-/**
- * @author Steffen Pingel
- */
-public class TracXmlRpcClientTest extends AbstractTracClientRepositoryTest {
-
- public TracXmlRpcClientTest() {
- super(Version.XML_RPC);
- }
-
- @Override
- public void testValidate011() throws Exception {
- validate(TracTestConstants.TEST_TRAC_011_URL);
- }
-
- public void testValidateFailNoAuth() throws Exception {
- connect(TracTestConstants.TEST_TRAC_010_URL, "", "");
- try {
- repository.validate();
- fail("Expected TracLoginException");
- } catch (TracPermissionDeniedException e) {
- }
- }
-
- public void testMulticallExceptions() throws Exception {
- connect010();
- try {
- ((TracXmlRpcClient) repository).getTickets(new int[] { 1, Integer.MAX_VALUE });
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
- }
-
- public void testUpdateAttributes010() throws Exception {
- connect010();
- updateAttributes();
- }
-
- public void testUpdateAttributes011() throws Exception {
- connect011();
- updateAttributes();
- }
-
- public void updateAttributes() throws Exception {
- assertNull(repository.getMilestones());
- repository.updateAttributes(new NullProgressMonitor(), true);
- TracVersion[] versions = repository.getVersions();
- assertEquals(2, versions.length);
- Arrays.sort(versions, new Comparator<TracVersion>() {
- public int compare(TracVersion o1, TracVersion o2) {
- return o1.getName().compareTo(o2.getName());
- }
- });
- assertEquals("1.0", versions[0].getName());
- assertEquals("", versions[0].getDescription());
- assertEquals(new Date(0), versions[0].getTime());
- assertEquals("2.0", versions[1].getName());
- assertEquals("", versions[1].getDescription());
- assertEquals(new Date(0), versions[1].getTime());
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java
deleted file mode 100644
index 7201a3688..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracXmlRpcTest.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
-import junit.framework.TestCase;
-
-import org.apache.xmlrpc.XmlRpcException;
-import org.apache.xmlrpc.client.XmlRpcClient;
-import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.util.TracHttpClientTransportFactory;
-
-/**
- * Test cases for <a href="http://trac-hacks.org/wiki/XmlRpcPlugin">Trac XML-RPC Plugin</a> API. Revision 1188 or
- * higher is required.
- *
- * <p>
- * This class does not depend on any Mylar (connector) classes except for TracHttpClientTransportFactory which is needed
- * for initialization of HttpClient.
- *
- * @author Steffen Pingel
- */
-public class TracXmlRpcTest extends TestCase {
-
- public static final String XMLRPC_URL = "/login/xmlrpc";
-
- private XmlRpcClient xmlrpc;
-
- private String username;
-
- // private String password;
-
- private Random random;
-
- private ArrayList<Integer> tickets;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- random = new Random();
-
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.ADMIN);
- createConnection(new URL(TracTestConstants.TEST_TRAC_010_URL + XMLRPC_URL), credentials.username,
- credentials.password);
-
- tickets = new ArrayList<Integer>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- for (int id : tickets) {
- call("ticket.delete", id);
- }
- }
-
- private void createConnection(URL url, String username, String password) throws Exception {
- XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
- config.setEncoding("UTF-8");
- config.setBasicUserName(username);
- config.setBasicPassword(password);
- config.setServerURL(url);
-
- xmlrpc = new XmlRpcClient();
- xmlrpc.setConfig(config);
-
- TracHttpClientTransportFactory factory = new TracHttpClientTransportFactory(xmlrpc);
- xmlrpc.setTransportFactory(factory);
-
- this.username = username;
- // this.password = password;
- }
-
- private int createTicket(String summary, String description, Map<String, Object> attributes)
- throws XmlRpcException, IOException {
- int id = (Integer) call("ticket.create", summary, description, attributes);
- tickets.add(id);
- return id;
- }
-
- private Object call(String method, Object... parameters) throws XmlRpcException, IOException {
- Object result = xmlrpc.execute(method, parameters);
- if (result instanceof XmlRpcException) {
- throw (XmlRpcException) result;
- }
- return result;
- }
-
- public Map<String, Object> createMultiCall(String methodName, Object... parameters) throws XmlRpcException,
- IOException {
- Map<String, Object> table = new Hashtable<String, Object>();
- table.put("methodName", methodName);
- table.put("params", parameters);
- return table;
- }
-
- private void internalTestCrud(String module) throws XmlRpcException, IOException {
- try {
- call(module + ".delete", "foo");
- } catch (XmlRpcException e) {
- }
-
- call(module + ".create", "foo", "bar");
- try {
- assertHasValue((Object[]) call(module + ".getAll"), "foo");
- assertEquals("bar", (String) (call(module + ".get", "foo")));
-
- call(module + ".update", "foo", "baz");
- assertEquals("baz", (String) (call(module + ".get", "foo")));
- } finally {
- call(module + ".delete", "foo");
- }
- }
-
- private Object createValue(Object fieldName, Object clazz) {
- if (clazz == String.class) {
- return fieldName.toString() + random.nextInt();
- } else if (clazz == Date.class) {
- return new Date();
- } else if (clazz == Boolean.class) {
- return random.nextBoolean();
- } else if (clazz == Double.class) {
- return random.nextDouble();
- } else if (clazz == Integer.class) {
- return random.nextInt();
- }
-
- throw new RuntimeException("Invalid test data: " + fieldName + ", " + clazz);
- }
-
- private void internalTestComponent(String module, Object... fields) throws XmlRpcException, IOException {
- try {
- call(module + ".delete", "foo");
- } catch (XmlRpcException e) {
- }
-
- Map<String, Object> attributes = new Hashtable<String, Object>();
- for (int i = 0; i < fields.length; i += 2) {
- attributes.put((String) fields[i], createValue(fields[i], fields[i + 1]));
- }
-
- call(module + ".create", "foo", attributes);
-
- try {
- assertHasValue((Object[]) call(module + ".getAll"), "foo");
- Map<?, ?> values = (Map<?, ?>) call(module + ".get", "foo");
- for (String attribute : attributes.keySet()) {
- assertEquals(attributes.get(attribute), values.get(attribute));
- }
-
- for (int i = 0; i < fields.length; i += 2) {
- attributes.put((String) fields[i], createValue(fields[i], fields[i + 1]));
- }
-
- call(module + ".update", "foo", attributes);
- values = (Map<?, ?>) call(module + ".get", "foo");
- for (String attribute : attributes.keySet()) {
- assertEquals(attributes.get(attribute), values.get(attribute));
- }
- } finally {
- call(module + ".delete", "foo");
- }
- }
-
- public void testMilestoneDate() throws XmlRpcException, IOException {
- try {
- call("ticket.milestone.delete", "foo");
- } catch (XmlRpcException e) {
- }
-
- int due = (int) (System.currentTimeMillis() / 1000) + 1000;
- int completed = (int) (System.currentTimeMillis() / 1000);
-
- Map<String, Object> attributes = new Hashtable<String, Object>();
- attributes.put("description", "description");
- attributes.put("due", due);
- attributes.put("completed", completed);
-
- call("ticket.milestone.create", "foo", attributes);
-
- Map<?, ?> values = (Map<?, ?>) call("ticket.milestone.get", "foo");
- assertEquals(new Integer(due), values.get("due"));
- assertEquals(new Integer(completed), values.get("completed"));
-
- call("ticket.milestone.delete", "foo");
- }
-
- private void assertHasValue(Object[] items, Object value) {
- for (Object item : items) {
- if (item.equals(value)) {
- return;
- }
- }
- fail("Could not find expected value: " + value);
- }
-
- private void assertTicketHasAttributes(Map<String, Object> attributes, int id, Object[] ticket) {
- assertTicketHasAttributes(attributes, id, ticket, true);
- }
-
- private void assertTicketHasAttributes(Map<String, Object> attributes, int id, Object[] ticket, boolean newTicket) {
- assertEquals(id, ticket[0]);
- assertTrue(ticket[1] instanceof Integer); // time created
- // time changed
- if (newTicket) {
- assertEquals(ticket[1], ticket[2]);
- } else {
- assertTrue((Integer) ticket[2] >= (Integer) ticket[1]);
- }
- Map<?, ?> values = (Map<?, ?>) ticket[3];
- for (String attribute : attributes.keySet()) {
- assertEquals(attributes.get(attribute), values.get(attribute));
- }
- }
-
- public void testGetTicket() throws XmlRpcException, IOException {
- Map<String, Object> attributes = new Hashtable<String, Object>();
- attributes.put("type", "task");
- attributes.put("status", "closed");
- int id = createTicket("summary", "description", attributes);
-
- attributes.put("summary", "summary");
- attributes.put("description", "description");
-
- Object[] ticket = (Object[]) call("ticket.get", id);
- assertTicketHasAttributes(attributes, id, ticket);
- }
-
- public void testGetTicketNonExistant() throws XmlRpcException, IOException {
- try {
- call("ticket.delete", Integer.MAX_VALUE);
- } catch (Exception e) {
- // ignore
- }
-
- try {
- List<?> ticket = (List<?>) call("ticket.get", Integer.MAX_VALUE);
- fail("Expected XmlRpcException, got ticket instead: " + ticket);
- } catch (XmlRpcException e) {
- // ignore
- }
- }
-
- public void testGetTicketUmlaute() throws XmlRpcException, IOException {
- Map<String, Object> attributes = new Hashtable<String, Object>();
- int id = createTicket("summarya\u0308O\u030b", "\u00d8", attributes);
-
- attributes.put("summary", "summarya\u0308O\u030b");
- attributes.put("description", "\u00d8");
-
- Object[] ticket = (Object[]) call("ticket.get", id);
- assertTicketHasAttributes(attributes, id, ticket);
- }
-
- public void testUpdateTicket() throws XmlRpcException, IOException {
- int id = createTicket("summary", "description", new Hashtable<String, Object>());
-
- Map<String, Object> attributes = new Hashtable<String, Object>();
- attributes.put("summary", "changed");
- call("ticket.update", id, "my comment", attributes);
-
- attributes.put("description", "description");
-
- Object[] ticket = (Object[]) call("ticket.get", id);
- Map<?, ?> values = (Map<?, ?>) ticket[3];
- for (String attribute : attributes.keySet()) {
- assertEquals(attributes.get(attribute), values.get(attribute));
- }
- }
-
- public void testTicketCustomFields() throws XmlRpcException, IOException {
- Map<String, Object> attributes = new Hashtable<String, Object>();
- attributes.put("custom_text_field", "myvalue");
- int id = createTicket("summary", "description", attributes);
-
- // check for default values
- attributes.put("custom_checkbox_field", "1");
- attributes.put("custom_select_field", "two");
- attributes.put("custom_radio_field", "baz");
- attributes.put("custom_textarea_field", "default text");
-
- Object[] ticket = (Object[]) call("ticket.get", id);
- assertTicketHasAttributes(attributes, id, ticket);
-
- attributes.put("custom_text_field", "myvalue2");
- attributes.put("custom_checkbox_field", "0");
- attributes.put("custom_select_field", "one");
- attributes.put("custom_radio_field", "foo");
- attributes.put("custom_textarea_field", "mytext");
-
- call("ticket.update", id, "my comment", attributes);
-
- ticket = (Object[]) call("ticket.get", id);
- assertTicketHasAttributes(attributes, id, ticket, false);
- }
-
- public void testGetChangeLog() throws XmlRpcException, IOException {
- int id = createTicket("summary", "description", new Hashtable<String, Object>());
-
- Map<String, Object> attributes = new Hashtable<String, Object>();
- attributes.put("summary", "changed");
- call("ticket.update", id, "my comment", attributes);
-
- Object[] log = (Object[]) call("ticket.changeLog", id, 0);
- Object[] entry = (Object[]) log[0];
- assertTrue(entry[0] instanceof Integer); // time
- assertEquals(username, entry[1]); // author
- assertEquals("summary", entry[2]); // field
- assertEquals("summary", entry[3]); // old value
- assertEquals("changed", entry[4]); // new value
- }
-
- public void testMultiGetTicket() throws XmlRpcException, IOException {
- int id1 = createTicket("summary1", "description1", new Hashtable<String, Object>());
- int id2 = createTicket("summary2", "description2", new Hashtable<String, Object>());
-
- List<Map<?, ?>> calls = new ArrayList<Map<?, ?>>();
- calls.add(createMultiCall("ticket.get", id1));
- calls.add(createMultiCall("ticket.get", id2));
- Object[] ret = (Object[]) call("system.multicall", calls);
-
- Object[] ticket = (Object[]) ((Object[]) ret[0])[0];
- Map<String, Object> attributes = new Hashtable<String, Object>();
- attributes.put("summary", "summary1");
- attributes.put("description", "description1");
- assertTicketHasAttributes(attributes, id1, ticket);
-
- ticket = (Object[]) ((Object[]) ret[1])[0];
- attributes.clear();
- attributes.put("summary", "summary2");
- attributes.put("description", "description2");
- assertTicketHasAttributes(attributes, id2, ticket);
- }
-
- public void testAttachment() throws XmlRpcException, IOException {
- int id = createTicket("summary", "description", new Hashtable<String, Object>());
-
- String filename = (String) call("ticket.putAttachment", id, "attach.txt", "description", "data".getBytes(),
- true);
- // the returned filename may differ, since another ticket may have an
- // attachment named "attach.txt"
- // assertEquals("attach.txt", filename);
-
- Object[] ret = (Object[]) call("ticket.listAttachments", id);
- assertEquals(1, ret.length);
- Object[] attachment = (Object[]) ret[0];
- assertEquals("attach.txt", attachment[0]);
- assertEquals("description", attachment[1]);
- assertEquals(4, attachment[2]);
- // date
- assertEquals(username, attachment[4]);
-
- byte[] bytes = (byte[]) call("ticket.getAttachment", id, filename);
- String data = new String(bytes);
- assertEquals("data", data);
-
- // test override
-
- String filename2 = (String) call("ticket.putAttachment", id, filename, "newdescription", "newdata".getBytes(),
- true);
- assertEquals(filename, filename2);
- ret = (Object[]) call("ticket.listAttachments", id);
- assertEquals(1, ret.length);
- attachment = (Object[]) ret[0];
- assertEquals("attach.txt", attachment[0]);
- assertEquals("newdescription", attachment[1]);
- assertEquals(7, attachment[2]);
- // date
- assertEquals(username, attachment[4]);
- bytes = (byte[]) call("ticket.getAttachment", id, filename);
- data = new String(bytes);
- assertEquals("newdata", data);
-
- String filename3 = (String) call("ticket.putAttachment", id, "attach.txt", "description", "data".getBytes(),
- false);
- assertFalse("attach.txt".equals(filename3));
- ret = (Object[]) call("ticket.listAttachments", id);
- assertEquals(2, ret.length);
- }
-
- public void testDeleteAttachment() throws XmlRpcException, IOException {
- int id = createTicket("summary", "description", new Hashtable<String, Object>());
-
- String filename = (String) call("ticket.putAttachment", id, "attach.txt", "description", "data".getBytes(),
- true);
-
- Object[] ret = (Object[]) call("ticket.listAttachments", id);
- assertEquals(1, ret.length);
-
- call("ticket.deleteAttachment", id, filename);
-
- ret = (Object[]) call("ticket.listAttachments", id);
- assertEquals(0, ret.length);
- }
-
- public void testDuplicateAttachment() throws XmlRpcException, IOException {
- int id1 = createTicket("summary", "description", new Hashtable<String, Object>());
- int id2 = createTicket("summary", "description", new Hashtable<String, Object>());
-
- String filename1 = (String) call("ticket.putAttachment", id1, "attach.txt", "description", "data".getBytes(),
- true);
- String filename2 = (String) call("ticket.putAttachment", id2, "attach.txt", "description", "data2".getBytes(),
- true);
- assertEquals("attach.txt", filename1);
- assertEquals(filename1, filename2);
-
- byte[] bytes = (byte[]) call("ticket.getAttachment", id1, "attach.txt");
- String data = new String(bytes);
- assertEquals("data", data);
-
- bytes = (byte[]) call("ticket.getAttachment", id2, "attach.txt");
- data = new String(bytes);
- assertEquals("data2", data);
- }
-
- public void testQuery() throws XmlRpcException, IOException {
- Object[] ret = (Object[]) call("ticket.query", "summary~=foo|bar|baz");
- for (Object id : ret) {
- call("ticket.delete", (Integer) id);
- }
-
- int id1 = createTicket("foobarsum1", "description", new Hashtable<String, Object>());
- int id2 = createTicket("foobaz sum2", "description", new Hashtable<String, Object>());
- int id3 = createTicket("foobarbaz3", "foobarbaz description3", new Hashtable<String, Object>());
-
- ret = (Object[]) call("ticket.query", "summary=foobarsum1|foobaz sum2");
- assertEquals(2, ret.length);
- assertEquals(id1, ret[0]);
- assertEquals(id2, ret[1]);
-
- // the first criterium is ignored
- ret = (Object[]) call("ticket.query", "summary~=foobarsum1&summary~=foobaz sum2");
- assertEquals(1, ret.length);
- assertEquals(id2, ret[0]);
-
- ret = (Object[]) call("ticket.query", "summary~=bar|baz");
- assertEquals(3, ret.length);
-
- ret = (Object[]) call("ticket.query", "description~=foobarbaz description3");
- assertEquals(1, ret.length);
- assertEquals(id3, ret[0]);
- }
-
- public void testQueryAll() throws XmlRpcException, IOException {
- int id = createTicket("foo", "description", new Hashtable<String, Object>());
-
- Object[] ret = (Object[]) call("ticket.query", "order=id");
- assertTrue(ret.length > 0);
- assertHasValue(ret, id);
- }
-
- public void testPriorities() throws XmlRpcException, IOException {
- internalTestCrud("ticket.priority");
- }
-
- public void testSeverities() throws XmlRpcException, IOException {
- internalTestCrud("ticket.severity");
- }
-
- public void testType() throws XmlRpcException, IOException {
- internalTestCrud("ticket.type");
- }
-
- public void testStatus() throws XmlRpcException, IOException {
- internalTestCrud("ticket.status");
- }
-
- public void testResolutions() throws XmlRpcException, IOException {
- internalTestCrud("ticket.resolution");
- }
-
- public void testVersions() throws XmlRpcException, IOException {
- internalTestComponent("ticket.version", "time", Integer.class, "description", String.class);
- }
-
- public void testComponents() throws XmlRpcException, IOException {
- internalTestComponent("ticket.component", "owner", String.class, "description", String.class);
- }
-
- public void testMilestones() throws XmlRpcException, IOException {
- internalTestComponent("ticket.milestone", "due", Integer.class, "completed", Integer.class, "description",
- String.class);
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java
deleted file mode 100644
index 8b7a33f69..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestCleanupUtil.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Mylyn project committers and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.mylyn.trac.tests.support;
-
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.internal.trac.core.TracException;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-import org.eclipse.mylyn.internal.trac.core.model.TracAttachment;
-import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
-import org.eclipse.mylyn.trac.tests.AbstractTracClientTest;
-import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
-
-/**
- * Utility that cleans up artifacts created by the Trac test suite. This class should be run periodically to speed up
- * execution of (attachment) tests.
- *
- * @author Steffen Pingel
- */
-public class TestCleanupUtil extends AbstractTracClientTest {
-
- private TestData data;
-
- public TestCleanupUtil() {
- super(Version.XML_RPC, PrivilegeLevel.ADMIN);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- data = TestFixture.init010();
- }
-
- public void testCleanup010() throws Exception {
- connect010();
- cleanup();
- }
-
- public void testCleanup011() throws Exception {
- connect011();
- cleanup();
- }
-
- private void cleanup() throws TracException {
- TracTicket ticket = repository.getTicket(data.attachmentTicketId);
- TracAttachment[] attachments = ticket.getAttachments();
- // skips the first attachment
- for (int i = 1; i < attachments.length; i++) {
- repository.deleteAttachment(data.attachmentTicketId, attachments[i].getFilename());
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java
deleted file mode 100644
index 93a6c7da3..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TestFixture.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests.support;
-
-import org.eclipse.mylyn.context.tests.support.TestUtil;
-import org.eclipse.mylyn.context.tests.support.TestUtil.Credentials;
-import org.eclipse.mylyn.context.tests.support.TestUtil.PrivilegeLevel;
-import org.eclipse.mylyn.trac.tests.TracTestConstants;
-
-/**
- * Initializes Trac repositories to a defined state. This is done once per test run, since cleaning and initializing the
- * repository for each test method would take too long.
- *
- * @author Steffen Pingel
- */
-public class TestFixture {
-
- public static XmlRpcServer.TestData data010;
-
- /**
- * Adds the existing repository content to the test data of <code>server</code>.
- */
- private static void initializeTestData(XmlRpcServer server) throws Exception {
- server.ticketMilestone("milestone1").itemCreated();
- server.ticketMilestone("milestone2").itemCreated();
- server.ticketMilestone("milestone3").itemCreated();
- server.ticketMilestone("milestone4").itemCreated();
- server.ticketMilestone("mile&stone").itemCreated();
-
- server.ticketVersion("1.0").itemCreated();
- server.ticketVersion("2.0").itemCreated();
-
- server.ticket(1).itemCreated();
- server.ticket(2).itemCreated();
- server.ticket(3).itemCreated();
- server.ticket(4).itemCreated();
- server.ticket(5).itemCreated();
- server.ticket(6).itemCreated();
- server.ticket(7).itemCreated();
- server.ticket(8).itemCreated();
- }
-
-// private static void initializeRepository(XmlRpcServer server) throws Exception {
-// server.ticketVersion(null).deleteAll();
-// server.ticketVersion("1.0").create(0, "");
-// server.ticketVersion("2.0").create(0, "");
-//
-// server.ticketMilestone(null).deleteAll();
-// server.ticketMilestone("milestone1").create();
-// server.ticketMilestone("milestone2").create();
-// server.ticketMilestone("milestone3").create();
-// server.ticketMilestone("milestone4").create();
-//
-// server.ticket().deleteAll();
-// Ticket ticket = server.ticket().create("summary1", "description1");
-// ticket.update("comment", "milestone", "milestone1");
-// ticket = server.ticket().create("summary2", "description2");
-// ticket.update("comment", "milestone", "milestone2");
-// ticket = server.ticket().create("summary3", "description3");
-// ticket.update("comment", "milestone", "milestone2");
-// ticket = server.ticket().create("summary4", "description4");
-//
-// ticket = server.ticket().create("attachment test", "");
-// // create attachment named attachment.txt that contains the text "Mylar"
-// ticket = server.ticket().create("test html entities: ���", "���\n\nmulti\nline\n\n'''bold'''\n");
-// ticket = server.ticket().create("offline handler test", "");
-// }
-
- public static XmlRpcServer.TestData init010() throws Exception {
- if (data010 == null) {
- Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
- XmlRpcServer server = new XmlRpcServer(TracTestConstants.TEST_TRAC_010_URL, credentials.username,
- credentials.password);
-
- initializeTestData(server);
- data010 = server.getData();
- }
- return data010;
- }
-
- public static void cleanup010() throws Exception {
- if (data010 != null) {
- // data010.cleanup();
- data010 = null;
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java
deleted file mode 100644
index 88698b52e..000000000
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/XmlRpcServer.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2006 Mylar eclipse.org project and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mylar project committers - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.trac.tests.support;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.apache.xmlrpc.XmlRpcException;
-import org.apache.xmlrpc.client.XmlRpcClient;
-import org.eclipse.mylyn.internal.trac.core.TracXmlRpcClient;
-import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
-
-/**
- * @author Steffen Pingel
- */
-public class XmlRpcServer {
-
- public abstract class AbstractTracItem {
-
- public abstract void delete() throws Exception;
-
- void itemCreated() {
- data.items.add(this);
- }
-
- void itemDeleted() {
- data.items.remove(this);
- }
-
- }
-
- /**
- * Represents a Trac type with multiple attributes such as a milestone.
- */
- public class ModelEnum extends AbstractTracItem {
-
- private String[] attributes;
-
- private String id;
-
- private String module;
-
- public ModelEnum(String module, String id, String... attributes) {
- this.module = module;
- this.id = id;
- this.attributes = attributes;
- }
-
- public ModelEnum create(Object... params) throws Exception {
- call(module + ".create", id, toMap(params));
- itemCreated();
- return this;
- }
-
- @Override
- public void delete() throws Exception {
- call(module + ".delete", id);
- itemDeleted();
- }
-
- public void deleteAll() throws Exception {
- String[] ids = getAll();
- for (String id : ids) {
- call(module + ".delete", id);
- }
- }
-
- public ModelEnum deleteAndCreate(Object... params) throws Exception {
- if (Arrays.asList(getAll()).contains(id)) {
- delete();
- }
-
- return create(params);
- }
-
- @SuppressWarnings("unchecked")
- public Object[] get() throws Exception {
- Hashtable values = (Hashtable) call(module + ".get", id);
- Object[] result = new Object[values.size()];
- for (int i = 0; i < result.length && i < attributes.length; i++) {
- result[i] = values.get(attributes[i]);
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public String[] getAll() throws Exception {
- return Arrays.asList((Object[]) call(module + ".getAll")).toArray(new String[0]);
- }
-
- private Hashtable<String, Object> toMap(Object... params) {
- Hashtable<String, Object> attrs = new Hashtable<String, Object>();
- for (int i = 0; i < attributes.length && i < params.length; i++) {
- attrs.put(attributes[i], params[i]);
- }
- return attrs;
- }
-
- public ModelEnum update(Object... params) throws Exception {
- call(module + ".update", id, toMap(params));
- return this;
- }
-
- }
-
- /**
- * Records changes to the repository.
- */
- public class TestData {
-
- // all created items
- List<AbstractTracItem> items = new ArrayList<AbstractTracItem>();
-
- // all created tickets
- public List<Ticket> tickets = new ArrayList<Ticket>();
-
- public int attachmentTicketId = 5;
-
- public int htmlEntitiesTicketId = 6;
-
- public int offlineHandlerTicketId = 7;
-
- /**
- * Undo all changes.
- */
- public void cleanup() throws Exception {
- while (!items.isEmpty()) {
- items.get(0).delete();
- }
- }
-
- }
-
- /**
- * Represents a Trac ticket.
- */
- public class Ticket extends AbstractTracItem {
-
- private Integer id;
-
- public Ticket(Integer id) {
- this.id = id;
- }
-
- public Ticket create(String summary, String description) throws Exception {
- this.id = (Integer) call("ticket.create", summary, description, new Hashtable<String, Object>());
- if (id == null) {
- throw new RuntimeException("Could not create ticket: " + summary);
- }
- itemCreated();
- return this;
- }
-
- @Override
- public void delete() throws Exception {
- call("ticket.delete", id);
- itemDeleted();
- }
-
- public void deleteAll() throws Exception {
- Integer[] ids = getAll();
- for (Integer id : ids) {
- call("ticket.delete", id);
- }
- }
-
- public Object getValue(String key) throws Exception {
- return getValues().get(key);
- }
-
- public Map<?, ?> getValues() throws Exception {
- return (Map<?, ?>) ((Object[]) call("ticket.get", id))[3];
- }
-
- @SuppressWarnings("unchecked")
- public Integer[] getAll() throws Exception {
- return Arrays.asList((Object[]) call("ticket.query", "order=id")).toArray(new Integer[0]);
- }
-
- public int getId() {
- return id;
- }
-
- @Override
- protected void itemCreated() {
- super.itemCreated();
- data.tickets.add(this);
- }
-
- @Override
- protected void itemDeleted() {
- super.itemDeleted();
- data.tickets.remove(this);
- }
-
- public Ticket update(String comment, String key, String value) throws Exception {
- Hashtable<String, Object> attrs = new Hashtable<String, Object>();
- attrs.put(key, value);
- call("ticket.update", id, comment, attrs);
- return this;
- }
-
- }
-
- /**
- * Represents a Trac type that has a single attribute such as a priority.
- */
- public class TicketEnum extends AbstractTracItem {
-
- private String id;
-
- private String module;
-
- public TicketEnum(String module, String id) {
- this.module = module;
- this.id = id;
- }
-
- public TicketEnum create(String param) throws Exception {
- call(module + ".create", id, param);
- itemCreated();
- return this;
- }
-
- @Override
- public void delete() throws Exception {
- call(module + ".delete", id);
- itemDeleted();
- }
-
- public void deleteAll() throws Exception {
- String[] ids = getAll();
- for (String id : ids) {
- call(module + ".delete", id);
- }
- }
-
- public TicketEnum deleteAndCreate(String param) throws Exception {
- if (Arrays.asList(getAll()).contains(id)) {
- delete();
- }
-
- return create(param);
- }
-
- public String get() throws Exception {
- return (String) call(module + ".get", id);
- }
-
- @SuppressWarnings("unchecked")
- public String[] getAll() throws Exception {
- return Arrays.asList((Object[]) call(module + ".getAll")).toArray(new String[0]);
- }
-
- public TicketEnum update(String param) throws Exception {
- call(module + ".update", id, param);
- return this;
- }
-
- }
-
- private XmlRpcClient client;
-
- private TestData data;
-
- private String password;
-
- private TracXmlRpcClient repository;
-
- private String url;
-
- private String username;
-
- public XmlRpcServer(String url, String username, String password) throws Exception {
- this.url = url;
- this.username = username;
- this.password = password;
-
- this.data = new TestData();
-
- this.repository = new TracXmlRpcClient(new URL(url), Version.XML_RPC, username, password, null);
- this.client = repository.getClient();
- }
-
- private Object call(String method, Object... parameters) throws XmlRpcException, IOException {
- Vector<Object> params = new Vector<Object>(parameters.length);
- for (Object parameter : parameters) {
- params.add(parameter);
- }
-
- Object result = client.execute(method, params);
- if (result instanceof XmlRpcException) {
- throw (XmlRpcException) result;
- }
- return result;
- }
-
- public TestData getData() {
- return data;
- }
-
- public String getPassword() {
- return password;
- }
-
- public TracXmlRpcClient getRepository() throws MalformedURLException {
- return repository;
- }
-
- public String getUrl() {
- return url;
- }
-
- public String getUsername() {
- return username;
- }
-
- public Ticket ticket() throws Exception {
- return new Ticket(null);
- }
-
- public Ticket ticket(int id) throws Exception {
- return new Ticket(id);
- }
-
- public ModelEnum ticketComponent(String id) throws Exception {
- return new ModelEnum("ticket.component", id, "owner", "description");
- }
-
- public ModelEnum ticketMilestone(String id) throws Exception {
- return new ModelEnum("ticket.milestone", id, "due", "completed", "description");
- }
-
- public TicketEnum ticketPriority(String id) throws Exception {
- return new TicketEnum("ticket.priority", id);
- }
-
- public TicketEnum ticketSeverity(String id) throws Exception {
- return new TicketEnum("ticket.severity", id);
- }
-
- public TicketEnum ticketStatus(String id) throws Exception {
- return new TicketEnum("ticket.status", id);
- }
-
- public TicketEnum ticketType(String id) throws Exception {
- return new TicketEnum("ticket.type", id);
- }
-
- public ModelEnum ticketVersion(String id) throws Exception {
- return new ModelEnum("ticket.version", id, "time", "description");
- }
-
-}

Back to the top