Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2007-12-16 07:00:13 +0000
committerspingel2007-12-16 07:00:13 +0000
commitdac0a51abd6a7bed9b6dbb981f2964663c383e30 (patch)
tree508f5fda3b464d62a3b867fd5764d318e5401e2a /org.eclipse.mylyn.tests.report
parentc287077fb09e424646d29b497882e674b6ef6bc0 (diff)
downloadorg.eclipse.mylyn.incubator-dac0a51abd6a7bed9b6dbb981f2964663c383e30.tar.gz
org.eclipse.mylyn.incubator-dac0a51abd6a7bed9b6dbb981f2964663c383e30.tar.xz
org.eclipse.mylyn.incubator-dac0a51abd6a7bed9b6dbb981f2964663c383e30.zip
NEW - bug 213100: automate publishing failed tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=213100
Diffstat (limited to 'org.eclipse.mylyn.tests.report')
-rw-r--r--org.eclipse.mylyn.tests.report/.classpath10
-rw-r--r--org.eclipse.mylyn.tests.report/.project17
-rw-r--r--org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.core.prefs266
-rw-r--r--org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.ui.prefs101
-rw-r--r--org.eclipse.mylyn.tests.report/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.mylyn.tests.report/.settings/org.eclipse.wst.validation.prefs6
-rw-r--r--org.eclipse.mylyn.tests.report/lib/org.eclipse.equinox.common_3.4.0.v20070910.jarbin0 -> 93195 bytes
-rw-r--r--org.eclipse.mylyn.tests.report/repository.properties3
-rw-r--r--org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Build.java15
-rw-r--r--org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Main.java98
-rw-r--r--org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/ReportParser.java102
-rw-r--r--org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Reporter.java191
-rw-r--r--org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCase.java54
-rw-r--r--org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseResult.java54
-rw-r--r--org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseVisitor.java17
15 files changed, 938 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tests.report/.classpath b/org.eclipse.mylyn.tests.report/.classpath
new file mode 100644
index 00000000..8e208302
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/.classpath
@@ -0,0 +1,10 @@
+<?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/JavaSE-1.6"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.mylyn.trac.core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.mylyn.tasks.core"/>
+ <classpathentry kind="lib" path="lib/org.eclipse.equinox.common_3.4.0.v20070910.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.mylyn.web.core"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.mylyn.tests.report/.project b/org.eclipse.mylyn.tests.report/.project
new file mode 100644
index 00000000..431fb0fe
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.mylyn.tests.report</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..a3d8ac47
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,266 @@
+#Sat Dec 15 19:32:24 GMT-08:00 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
+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=16
+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_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_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=true
+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=80
+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=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+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
diff --git a/org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..c0d49ce5
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,101 @@
+#Sat Dec 15 19:36:11 GMT-08:00 2007
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=true
+cleanup.format_source_code=true
+cleanup.make_local_variable_final=false
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_variable_declarations_final=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=true
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_Mylyn based on Eclipse
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Mylyn based on Eclipse [built-in]
+formatter_settings_version=11
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.format_source_code=true
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=true
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.mylyn.tests.report/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..650aa91d
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Sat Dec 15 19:32:21 GMT-08:00 2007
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.tests.report/.settings/org.eclipse.wst.validation.prefs b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.wst.validation.prefs
new file mode 100644
index 00000000..0efb33f5
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/.settings/org.eclipse.wst.validation.prefs
@@ -0,0 +1,6 @@
+#Sat Dec 15 19:32:22 GMT-08:00 2007
+DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;
+USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;
+USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;
+USER_PREFERENCE=overrideGlobalPreferencesfalse
+eclipse.preferences.version=1
diff --git a/org.eclipse.mylyn.tests.report/lib/org.eclipse.equinox.common_3.4.0.v20070910.jar b/org.eclipse.mylyn.tests.report/lib/org.eclipse.equinox.common_3.4.0.v20070910.jar
new file mode 100644
index 00000000..b1b8d1ab
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/lib/org.eclipse.equinox.common_3.4.0.v20070910.jar
Binary files differ
diff --git a/org.eclipse.mylyn.tests.report/repository.properties b/org.eclipse.mylyn.tests.report/repository.properties
new file mode 100644
index 00000000..182f4aab
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/repository.properties
@@ -0,0 +1,3 @@
+url=http\://localhost/tractest
+username=
+password= \ No newline at end of file
diff --git a/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Build.java b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Build.java
new file mode 100644
index 00000000..9c006ef2
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Build.java
@@ -0,0 +1,15 @@
+package org.eclipse.mylyn.internal.tests.report;
+
+public class Build {
+
+ private final String id;
+
+ public Build(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+}
diff --git a/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Main.java b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Main.java
new file mode 100644
index 00000000..f1ccc7e8
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Main.java
@@ -0,0 +1,98 @@
+package org.eclipse.mylyn.internal.tests.report;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+
+import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
+import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.web.core.AuthenticationCredentials;
+import org.eclipse.mylyn.web.core.AuthenticationType;
+
+public class Main {
+
+ public static void main(String[] args) {
+ Build build = null;
+ String filename = null;
+ String propertiesFilename = null;
+
+ for (int i = 0; i < args.length; i++) {
+ if ("-build".equals(args[i])) {
+ build = new Build(readArg(args, ++i));
+ } else if ("-in".equals(args[i])) {
+ filename = readArg(args, ++i);
+ }
+ if ("-config".equals(args[i])) {
+ propertiesFilename = readArg(args, ++i);
+ }
+ }
+
+ if (build == null || filename == null || propertiesFilename == null) {
+ printUsage();
+ System.exit(1);
+ }
+
+ try {
+ TaskRepository repository = readConfig(new File(propertiesFilename));
+ process(repository, new File(filename), build);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private static void printUsage() {
+ System.err.println("Main -in [junit report file] -config [config file] -build [id]");
+
+ }
+
+ private static void process(TaskRepository repository, File file, Build build) throws Exception {
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ InputStream in = new FileInputStream(file);
+ try {
+ XMLEventReader reader = inputFactory.createXMLEventReader(in);
+ Reporter report = new Reporter(build, repository);
+ ReportParser parser = new ReportParser(report);
+ parser.parse(reader);
+ } finally {
+ in.close();
+ }
+ }
+
+ private static String readArg(String[] args, int i) {
+ if (i > args.length) {
+ printUsage();
+ System.exit(1);
+ }
+ return args[i];
+ }
+
+ private static TaskRepository readConfig(File file) throws Exception {
+ Properties properties = new Properties();
+ InputStream in = new FileInputStream(file);
+ try {
+ properties.load(in);
+ String url = properties.getProperty("url", null);
+
+ if (url == null) {
+ throw new Exception("propertiy 'url' not defined in config file");
+ }
+
+ String userName = properties.getProperty("username", "");
+ String password = properties.getProperty("password", "");
+ AuthenticationCredentials credentials = new AuthenticationCredentials(userName, password);
+
+ TaskRepository repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url);
+ repository.setCredentials(AuthenticationType.REPOSITORY, credentials, false);
+ repository.setVersion(Version.XML_RPC.name());
+ return repository;
+ } finally {
+ in.close();
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/ReportParser.java b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/ReportParser.java
new file mode 100644
index 00000000..b7d1f9db
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/ReportParser.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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.tests.report;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.StartElement;
+import javax.xml.stream.events.XMLEvent;
+
+import org.eclipse.mylyn.internal.tests.report.TestCaseResult.TestCaseResultType;
+
+/**
+ * @author Steffen Pingel
+ */
+public class ReportParser {
+
+ private static final String TAG_TEST_CASE = "testcase";
+
+ private static final String TAG_TEST_CASE_FAILURE = "failure";
+
+ private static final String TAG_TEST_CASE_ERROR = "error";
+
+ private static final String ATTRIBUTE_CLASS_NAME = "classname";
+
+ private static final String ATTRIBUTE_TEST_NAME = "name";
+
+ private static final String ATTRIBUTE_MESSAGE = "message";
+
+ private static final String ATTRIBUTE_TYPE = "type";
+
+ private final TestCaseVisitor reportVisitor;
+
+ public ReportParser(TestCaseVisitor reportVisitor) {
+ this.reportVisitor = reportVisitor;
+ }
+
+ private String getAttributeValue(StartElement element, String name) throws XMLStreamException {
+ Attribute attribute = element.getAttributeByName(new QName(name));
+ if (attribute == null) {
+ throw new XMLStreamException("Missing mandatory attribute: " + name, element.getLocation());
+ }
+ return attribute.getValue();
+ }
+
+ private String getOptionalAttributeValue(StartElement element, String name) {
+ Attribute attribute = element.getAttributeByName(new QName(name));
+ if (attribute == null) {
+ return null;
+ }
+ return attribute.getValue();
+ }
+
+ public void parse(XMLEventReader reader) throws XMLStreamException {
+ while (reader.hasNext()) {
+ XMLEvent event = reader.nextEvent();
+ if (event.isStartElement()) {
+ StartElement element = event.asStartElement();
+ if (TAG_TEST_CASE.equals(element.getName().getLocalPart())) {
+ TestCase testCase = parseTestCase(reader, element);
+ if (testCase != null) {
+ reportVisitor.visit(testCase);
+ }
+ }
+ }
+ }
+ }
+
+ private TestCase parseTestCase(XMLEventReader reader, StartElement testCaseElement) throws XMLStreamException {
+ String className = getAttributeValue(testCaseElement, ATTRIBUTE_CLASS_NAME);
+ String testName = getAttributeValue(testCaseElement, ATTRIBUTE_TEST_NAME);
+ TestCaseResult result = null;
+ while (reader.hasNext()) {
+ XMLEvent event = reader.nextEvent();
+ if (event.isStartElement()) {
+ StartElement element = event.asStartElement();
+ if (TAG_TEST_CASE_FAILURE.equals(element.getName().getLocalPart())) {
+ result = parseTestCaseResult(reader, element, TestCaseResultType.FAILURE);
+ } else if (TAG_TEST_CASE_ERROR.equals(element.getName().getLocalPart())) {
+ result = parseTestCaseResult(reader, element, TestCaseResultType.FAILURE);
+ }
+ } else if (event.isEndElement()) {
+ break;
+ }
+ }
+
+ return new TestCase(className, testName, result);
+ }
+
+ private TestCaseResult parseTestCaseResult(XMLEventReader reader, StartElement resultElement,
+ TestCaseResultType resultType) throws XMLStreamException {
+ String type = getAttributeValue(resultElement, ATTRIBUTE_TYPE);
+ String message = getOptionalAttributeValue(resultElement, ATTRIBUTE_MESSAGE);
+ return new TestCaseResult(resultType, type, message, reader.getElementText());
+ }
+}
diff --git a/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Reporter.java b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Reporter.java
new file mode 100644
index 00000000..8badcc07
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/Reporter.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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.tests.report;
+
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.mylyn.internal.tests.report.TestCaseResult.TestCaseResultType;
+import org.eclipse.mylyn.internal.trac.core.ITracClient;
+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.model.TracSearch;
+import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
+import org.eclipse.mylyn.tasks.core.AbstractTask;
+import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler;
+import org.eclipse.mylyn.tasks.core.ITaskCollector;
+import org.eclipse.mylyn.tasks.core.ITaskFactory;
+import org.eclipse.mylyn.tasks.core.QueryHitCollector;
+import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute;
+import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+
+/**
+ * @author Steffen Pingel
+ */
+class Reporter implements TestCaseVisitor {
+
+ private final TracRepositoryConnector connector;
+
+ private final AbstractTaskDataHandler taskDataHandler;
+
+ private final TaskRepository repository;
+
+ private final Build build;
+
+ public Reporter(Build build, TaskRepository repository) {
+ this.build = build;
+ this.repository = repository;
+ this.connector = new TracRepositoryConnector();
+ this.taskDataHandler = connector.getTaskDataHandler();
+ }
+
+ private RepositoryTaskData createTaskData(TestCase testCase) throws CoreException {
+ AbstractAttributeFactory attributeFactory = taskDataHandler.getAttributeFactory(repository.getUrl(), repository
+ .getConnectorKind(), AbstractTask.DEFAULT_TASK_KIND);
+
+ RepositoryTaskData taskData = new RepositoryTaskData(attributeFactory, repository.getConnectorKind(),
+ repository.getUrl(), "0");
+ taskData.setNew(true);
+ taskDataHandler.initializeTaskData(repository, taskData, new NullProgressMonitor());
+ taskData.setSummary(getTaskSummary(testCase));
+ taskData.setDescription(getTaskDescription(testCase));
+ return taskData;
+ }
+
+ private String getQueryUrl(TestCase testCase) {
+ TracSearch search = new TracSearch();
+ search.addFilter("summary", getTaskSummary(testCase));
+ search.addFilter("description", getTaskDescription(testCase));
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(repository.getUrl());
+ sb.append(ITracClient.QUERY_URL);
+ sb.append(search.toUrl());
+ return sb.toString();
+ }
+
+ private String getTaskComment(TestCaseResult result) {
+ StringBuilder sb = new StringBuilder();
+ if (result.getResultType() == TestCaseResultType.FAILURE) {
+ sb.append("Failure in build ");
+ } else {
+ sb.append("Error in build ");
+ }
+
+ sb.append(build.getId());
+ sb.append(": ");
+ if (result.getMessage() != null) {
+ sb.append(result.getMessage());
+ }
+ sb.append("\n\n");
+ sb.append(result.getStackTrace());
+
+ return sb.toString();
+ }
+
+ private String getTaskDescription(TestCase testCase) {
+ return "Test results for " + testCase.getClassName() + "." + testCase.getTestName() + "()";
+ }
+
+ private String getTaskSummary(TestCase testCase) {
+ return testCase.getShortClassName() + ": " + testCase.getTestName();
+ }
+
+ private void handleError(IStatus status) {
+ System.err.println(status);
+ if (status.getException() != null) {
+ status.getException().printStackTrace();
+ }
+ System.exit(1);
+ }
+
+ private void handleResults(TestCase testCase, Set<AbstractTask> tasks) throws CoreException {
+ String id;
+ RepositoryTaskData taskData = null;
+ if (tasks.isEmpty()) {
+ if (testCase.getResult() != null) {
+ message(" creating task");
+ taskData = createTaskData(testCase);
+ id = taskDataHandler.postTaskData(repository, taskData, new NullProgressMonitor());
+ } else {
+ // test case succeeded and task does not exist
+ message(" nothing to do");
+ return;
+ }
+ } else {
+ AbstractTask task = tasks.iterator().next();
+ id = task.getTaskId();
+ }
+
+ message(" downloading task");
+ taskData = taskDataHandler.getTaskData(repository, id, new NullProgressMonitor());
+
+ RepositoryTaskAttribute statusAttribute = taskData.getAttribute(RepositoryTaskAttribute.STATUS);
+ if (testCase.getResult() != null) {
+ if (TracTask.Status.CLOSED == TracTask.Status.fromStatus(statusAttribute.getValue())) {
+ statusAttribute.setValue(TracTask.Status.REOPENED.toStatusString());
+ }
+ taskData.setNewComment(getTaskComment(testCase.getResult()));
+ } else {
+ if (TracTask.Status.CLOSED == TracTask.Status.fromStatus(statusAttribute.getValue())) {
+ // test case succeeded and task is closed
+ message(" nothing to do");
+ return;
+ } else {
+ statusAttribute.setValue(TracTask.Status.CLOSED.toStatusString());
+ }
+ }
+
+ message(" submitting task");
+ taskDataHandler.postTaskData(repository, taskData, new NullProgressMonitor());
+ }
+
+ private void message(String string) {
+ System.out.println(string);
+ }
+
+ @Override
+ public void visit(TestCase testCase) {
+ // ITracClient client =
+ // connector.getClientManager().getRepository(repository);
+ // if (!client.hasAttributes()) {
+ // message("Updating repository configuration: " + repository.getUrl());
+ // try {
+ // client.updateAttributes(new NullProgressMonitor(), false);
+ // } catch (TracException e) {
+ // handleError(TracCorePlugin.toStatus(e, repository));
+ // }
+ // }
+ //
+ message("Processing: " + testCase.getClassName() + "#" + testCase.getTestName());
+ String queryUrl = getQueryUrl(testCase);
+ AbstractRepositoryQuery query = new TracRepositoryQuery(repository.getUrl(), queryUrl, "");
+ ITaskCollector resultCollector = new QueryHitCollector(new ITaskFactory() {
+ public AbstractTask createTask(RepositoryTaskData taskData, IProgressMonitor monitor) throws CoreException {
+ throw new UnsupportedOperationException();
+ }
+ });
+ IStatus status = connector.performQuery(query, repository, new NullProgressMonitor(), resultCollector);
+ if (status.isOK()) {
+ try {
+ handleResults(testCase, resultCollector.getTasks());
+ } catch (CoreException e) {
+ handleError(e.getStatus());
+ }
+ } else {
+ handleError(status);
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCase.java b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCase.java
new file mode 100644
index 00000000..5bb9839d
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCase.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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.tests.report;
+
+/**
+ * @author Steffen Pingel
+ */
+public class TestCase {
+
+ private final String className;
+
+ private final String testName;
+
+ private final TestCaseResult result;
+
+ public TestCase(String className, String testName, TestCaseResult result) {
+ this.className = className;
+ this.testName = testName;
+ this.result = result;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public String getPackageName() {
+ int i = className.lastIndexOf(".");
+ return i != -1 ? className.substring(0, i) : "";
+ }
+
+ public TestCaseResult getResult() {
+ return result;
+ }
+
+ public String getShortClassName() {
+ int i = className.lastIndexOf(".");
+ return i != -1 ? className.substring(i + 1) : className;
+ }
+
+ public String getTestName() {
+ return testName;
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getName() + " [className=" + className + ",testName=" + testName + ",result=" + result + "]";
+ }
+
+}
diff --git a/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseResult.java b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseResult.java
new file mode 100644
index 00000000..de9a7be9
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseResult.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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.tests.report;
+
+/**
+ * @author Steffen Pingel
+ */
+public class TestCaseResult {
+
+ public enum TestCaseResultType {
+ ERROR, FAILURE
+ };
+
+ private final TestCaseResultType resultType;
+
+ private final String type;
+
+ private final String message;
+
+ private final String stackTrace;
+
+ public TestCaseResult(TestCaseResultType resultType, String type, String message, String stackTrace) {
+ this.resultType = resultType;
+ this.type = type;
+ this.message = message;
+ this.stackTrace = stackTrace;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public TestCaseResultType getResultType() {
+ return resultType;
+ }
+
+ public String getStackTrace() {
+ return stackTrace;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ @Override
+ public String toString() {
+ return resultType.name();
+ }
+}
diff --git a/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseVisitor.java b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseVisitor.java
new file mode 100644
index 00000000..577fb48f
--- /dev/null
+++ b/org.eclipse.mylyn.tests.report/src/org/eclipse/mylyn/internal/tests/report/TestCaseVisitor.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 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.tests.report;
+
+/**
+ * @author Steffen Pingel
+ */
+public interface TestCaseVisitor {
+
+ public void visit(TestCase testCase);
+
+}

Back to the top