Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.core.prefs359
-rw-r--r--bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.launching.prefs3
-rw-r--r--bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.ui.prefs15
-rw-r--r--bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/Activator.java9
-rw-r--r--bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/ExtendedLogServiceTest.java17
-rw-r--r--bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java79
-rw-r--r--bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogServiceTest.java43
-rw-r--r--bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/TestListener.java13
-rw-r--r--bundles/org.eclipse.equinox.log/src/org/eclipse/equinox/log/internal/Activator.java137
9 files changed, 617 insertions, 58 deletions
diff --git a/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.core.prefs
index dcbca80c6..aae570f8f 100644
--- a/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,351 @@
-#Wed Aug 13 16:26:28 EDT 2008
+#Mon Mar 23 17:35:20 EDT 2009
eclipse.preferences.version=1
-org.eclipse.jdt.core.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+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.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+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.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+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=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+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=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+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=0
+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=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_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+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=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not 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=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+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=do not 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=do not 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=do not 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=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=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=800
+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=false
+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
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.launching.prefs
new file mode 100644
index 000000000..d5918292b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.launching.prefs
@@ -0,0 +1,3 @@
+#Mon Mar 23 17:19:09 EDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning
diff --git a/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.ui.prefs
index 57fd40d0b..21bd9f3c7 100644
--- a/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.equinox.log.test/.settings/org.eclipse.jdt.ui.prefs
@@ -1,15 +1,16 @@
-#Thu Aug 14 01:38:50 EDT 2008
+#Tue Aug 21 11:30:07 CDT 2007
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.overrideannotation=true
+formatter_profile=_core
+formatter_settings_version=11
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.ondemandthreshold=3
+org.eclipse.jdt.ui.staticondemandthreshold=3
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_serial_version_id=false
@@ -20,11 +21,9 @@ sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
sp_cleanup.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=true
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
diff --git a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/Activator.java b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/Activator.java
index dc53f9214..0873d5a50 100644
--- a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/Activator.java
+++ b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others All rights reserved. This
+ * Copyright (c) 2007, 2009 IBM Corporation 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
@@ -56,4 +56,11 @@ public class Activator implements BundleActivator {
}
return null;
}
+
+ static synchronized void refreshPackages() {
+ if (packageAdmin == null)
+ throw new IllegalStateException("PackageAdmin not registered"); //$NON-NLS-1$
+
+ packageAdmin.refreshPackages(null);
+ }
}
diff --git a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/ExtendedLogServiceTest.java b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/ExtendedLogServiceTest.java
index e338e7c86..484ad7f9d 100644
--- a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/ExtendedLogServiceTest.java
+++ b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/ExtendedLogServiceTest.java
@@ -1,7 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation 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: IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.equinox.log.test;
import junit.framework.TestCase;
-import org.eclipse.equinox.log.*;
+
+import org.eclipse.equinox.log.ExtendedLogReaderService;
+import org.eclipse.equinox.log.ExtendedLogService;
+import org.eclipse.equinox.log.LogFilter;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
@@ -145,11 +156,11 @@ public class ExtendedLogServiceTest extends TestCase {
String message = "test";
Throwable t = new Throwable("test");
synchronized (listener) {
- log.getLogger(logBundle, "test").log(logReference, LogService.LOG_INFO, message, t);
+ log.getLogger(bundle, "test").log(logReference, LogService.LOG_INFO, message, t);
listener.wait();
}
assertTrue(listener.getEntryX().getLoggerName() == "test");
- assertTrue(listener.getEntry().getBundle() == logBundle);
+ assertTrue(listener.getEntry().getBundle() == bundle);
assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
assertTrue(listener.getEntry().getMessage().equals(message));
assertTrue(listener.getEntry().getException().getMessage().equals(t.getMessage()));
diff --git a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java
index 915ff834b..1955e3f48 100644
--- a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java
+++ b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogReaderServiceTest.java
@@ -1,9 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation 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: IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.equinox.log.test;
import java.io.*;
+import java.util.Hashtable;
import junit.framework.TestCase;
import org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory;
-import org.osgi.framework.ServiceReference;
+import org.osgi.framework.*;
import org.osgi.service.log.*;
public class LogReaderServiceTest extends TestCase {
@@ -18,7 +27,7 @@ public class LogReaderServiceTest extends TestCase {
}
protected void setUp() throws Exception {
- Activator.getBundle("org.eclipse.equinox.log").start();
+ Activator.getBundle("org.eclipse.equinox.log").start(); //$NON-NLS-1$
logReference = Activator.getBundleContext().getServiceReference(LogService.class.getName());
readerReference = Activator.getBundleContext().getServiceReference(LogReaderService.class.getName());
@@ -29,14 +38,14 @@ public class LogReaderServiceTest extends TestCase {
protected void tearDown() throws Exception {
Activator.getBundleContext().ungetService(logReference);
Activator.getBundleContext().ungetService(readerReference);
- Activator.getBundle("org.eclipse.equinox.log").stop();
+ Activator.getBundle("org.eclipse.equinox.log").stop(); //$NON-NLS-1$
}
public void testaddListener() throws Exception {
TestListener listener = new TestListener();
reader.addLogListener(listener);
synchronized (listener) {
- log.log(LogService.LOG_INFO, "info");
+ log.log(LogService.LOG_INFO, "info"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
@@ -47,7 +56,7 @@ public class LogReaderServiceTest extends TestCase {
reader.addLogListener(listener);
reader.addLogListener(listener);
synchronized (listener) {
- log.log(LogService.LOG_INFO, "info");
+ log.log(LogService.LOG_INFO, "info"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
@@ -66,7 +75,7 @@ public class LogReaderServiceTest extends TestCase {
LogListener listener = new LogListener() {
public synchronized void logged(LogEntry entry) {
notifyAll();
- throw new RuntimeException("Expected error for testBadListener.");
+ throw new RuntimeException("Expected error for testBadListener."); //$NON-NLS-1$
}
};
reader.addLogListener(listener);
@@ -78,7 +87,7 @@ public class LogReaderServiceTest extends TestCase {
}));
synchronized (listener) {
- log.log(LogService.LOG_INFO, "info");
+ log.log(LogService.LOG_INFO, "info"); //$NON-NLS-1$
listener.wait();
}
}
@@ -88,14 +97,64 @@ public class LogReaderServiceTest extends TestCase {
reader.addLogListener(listener);
long timeBeforeLog = System.currentTimeMillis();
synchronized (listener) {
- log.log(logReference, LogService.LOG_INFO, "info", new Throwable("test"));
+ log.log(logReference, LogService.LOG_INFO, "info", new Throwable("test")); //$NON-NLS-1$ //$NON-NLS-2$
listener.wait();
}
assertTrue(listener.getEntry().getBundle() == Activator.getBundleContext().getBundle());
- assertTrue(listener.getEntry().getMessage().equals("info"));
- assertTrue(listener.getEntry().getException().getMessage().equals("test"));
+ assertTrue(listener.getEntry().getMessage().equals("info")); //$NON-NLS-1$
+ assertTrue(listener.getEntry().getException().getMessage().equals("test")); //$NON-NLS-1$
assertTrue(listener.getEntry().getServiceReference() == logReference);
assertTrue(listener.getEntry().getTime() >= timeBeforeLog);
assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
}
+
+ public void testLogBundleEventInfo() throws Exception {
+
+ // this is just a bundle that is harmless to start/stop
+ Bundle servicesBundle = Activator.getBundle("org.eclipse.osgi.services"); //$NON-NLS-1$
+ if (servicesBundle == null)
+ return; // ignore
+
+ servicesBundle.stop();
+
+ TestListener listener = new TestListener();
+ reader.addLogListener(listener);
+ synchronized (listener) {
+ servicesBundle.start();
+ listener.wait();
+ }
+ assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
+ }
+
+ public void testLogServiceEventInfo() throws Exception {
+ TestListener listener = new TestListener();
+ reader.addLogListener(listener);
+ synchronized (listener) {
+ Activator.getBundleContext().registerService(Object.class.getName(), new Object(), null);
+ listener.wait();
+ }
+ assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
+ }
+
+ public void testLogServiceEventDebug() throws Exception {
+ ServiceRegistration registration = Activator.getBundleContext().registerService(Object.class.getName(), new Object(), null);
+
+ TestListener listener = new TestListener();
+ reader.addLogListener(listener);
+ synchronized (listener) {
+ registration.setProperties(new Hashtable());
+ listener.wait();
+ }
+ assertTrue(listener.getEntry().getLevel() == LogService.LOG_DEBUG);
+ }
+
+ public void testLogFrameworkEvent() throws Exception {
+ TestListener listener = new TestListener();
+ reader.addLogListener(listener);
+ synchronized (listener) {
+ Activator.refreshPackages();
+ listener.wait();
+ }
+ assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
+ }
}
diff --git a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogServiceTest.java b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogServiceTest.java
index 0cd97c92b..5c7371d9e 100644
--- a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogServiceTest.java
+++ b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/LogServiceTest.java
@@ -1,3 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation 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: IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.equinox.log.test;
import junit.framework.TestCase;
@@ -18,7 +26,7 @@ public class LogServiceTest extends TestCase {
}
protected void setUp() throws Exception {
- Activator.getBundle("org.eclipse.equinox.log").start();
+ Activator.getBundle("org.eclipse.equinox.log").start(); //$NON-NLS-1$
logReference = Activator.getBundleContext().getServiceReference(LogService.class.getName());
readerReference = Activator.getBundleContext().getServiceReference(LogReaderService.class.getName());
@@ -33,12 +41,12 @@ public class LogServiceTest extends TestCase {
reader.removeLogListener(listener);
Activator.getBundleContext().ungetService(logReference);
Activator.getBundleContext().ungetService(readerReference);
- Activator.getBundle("org.eclipse.equinox.log").stop();
+ Activator.getBundle("org.eclipse.equinox.log").stop(); //$NON-NLS-1$
}
public void testLogDebug() throws Exception {
synchronized (listener) {
- log.log(LogService.LOG_DEBUG, "debug");
+ log.log(LogService.LOG_DEBUG, "debug"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == LogService.LOG_DEBUG);
@@ -46,7 +54,7 @@ public class LogServiceTest extends TestCase {
public void testLogError() throws Exception {
synchronized (listener) {
- log.log(LogService.LOG_ERROR, "error");
+ log.log(LogService.LOG_ERROR, "error"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == LogService.LOG_ERROR);
@@ -54,7 +62,7 @@ public class LogServiceTest extends TestCase {
public void testLogInfo() throws Exception {
synchronized (listener) {
- log.log(LogService.LOG_INFO, "info");
+ log.log(LogService.LOG_INFO, "info"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == LogService.LOG_INFO);
@@ -62,7 +70,7 @@ public class LogServiceTest extends TestCase {
public void testLogWarning() throws Exception {
synchronized (listener) {
- log.log(LogService.LOG_WARNING, "warning");
+ log.log(LogService.LOG_WARNING, "warning"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == LogService.LOG_WARNING);
@@ -70,7 +78,7 @@ public class LogServiceTest extends TestCase {
public void testLogZeroLevel() throws Exception {
synchronized (listener) {
- log.log(0, "zero");
+ log.log(0, "zero"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == 0);
@@ -78,7 +86,7 @@ public class LogServiceTest extends TestCase {
public void testLogNegativeLevel() throws Exception {
synchronized (listener) {
- log.log(-1, "negative");
+ log.log(-1, "negative"); //$NON-NLS-1$
listener.wait();
}
assertTrue(listener.getEntry().getLevel() == -1);
@@ -86,10 +94,10 @@ public class LogServiceTest extends TestCase {
public void testLogMessage() throws Exception {
synchronized (listener) {
- log.log(LogService.LOG_INFO, "message");
+ log.log(LogService.LOG_INFO, "message"); //$NON-NLS-1$
listener.wait();
}
- assertTrue(listener.getEntry().getMessage().equals("message"));
+ assertTrue(listener.getEntry().getMessage().equals("message")); //$NON-NLS-1$
}
public void testLogNullMessage() throws Exception {
@@ -101,7 +109,7 @@ public class LogServiceTest extends TestCase {
}
public void testLogThrowable() throws Exception {
- Throwable t = new Throwable("throwable");
+ Throwable t = new Throwable("throwable"); //$NON-NLS-1$
synchronized (listener) {
log.log(LogService.LOG_INFO, null, t);
listener.wait();
@@ -186,7 +194,7 @@ public class LogServiceTest extends TestCase {
}
public void testLogFull1() throws Exception {
- String message = "test";
+ String message = "test"; //$NON-NLS-1$
synchronized (listener) {
log.log(LogService.LOG_INFO, message);
listener.wait();
@@ -198,8 +206,8 @@ public class LogServiceTest extends TestCase {
}
public void testLogFull2() throws Exception {
- String message = "test";
- Throwable t = new Throwable("test");
+ String message = "test"; //$NON-NLS-1$
+ Throwable t = new Throwable("test"); //$NON-NLS-1$
synchronized (listener) {
log.log(LogService.LOG_INFO, message, t);
listener.wait();
@@ -211,7 +219,7 @@ public class LogServiceTest extends TestCase {
}
public void testLogFull3() throws Exception {
- String message = "test";
+ String message = "test"; //$NON-NLS-1$
synchronized (listener) {
log.log(logReference, LogService.LOG_INFO, message);
listener.wait();
@@ -223,8 +231,8 @@ public class LogServiceTest extends TestCase {
}
public void testLogFull4() throws Exception {
- String message = "test";
- Throwable t = new Throwable("test");
+ String message = "test"; //$NON-NLS-1$
+ Throwable t = new Throwable("test"); //$NON-NLS-1$
synchronized (listener) {
log.log(logReference, LogService.LOG_INFO, message, t);
listener.wait();
@@ -234,5 +242,4 @@ public class LogServiceTest extends TestCase {
assertTrue(listener.getEntry().getException().getMessage().equals(t.getMessage()));
assertTrue(listener.getEntry().getServiceReference() == logReference);
}
-
}
diff --git a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/TestListener.java b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/TestListener.java
index e1a5f17a4..8e3ec71b6 100644
--- a/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/TestListener.java
+++ b/bundles/org.eclipse.equinox.log.test/src/org/eclipse/equinox/log/test/TestListener.java
@@ -1,20 +1,23 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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
+ * Copyright (c) 2007, 2009 IBM Corporation 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.equinox.log.test;
import org.eclipse.equinox.log.ExtendedLogEntry;
-
+import org.osgi.framework.Bundle;
import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogListener;
class TestListener implements LogListener {
LogEntry entry;
+ final Bundle logImpl = Activator.getBundle("org.eclipse.equinox.log");
public synchronized void logged(LogEntry entry) {
+ if (entry.getBundle() == logImpl)
+ return; // discard logs from the logImpl
this.entry = entry;
notifyAll();
}
diff --git a/bundles/org.eclipse.equinox.log/src/org/eclipse/equinox/log/internal/Activator.java b/bundles/org.eclipse.equinox.log/src/org/eclipse/equinox/log/internal/Activator.java
index 1f3a55c34..ad604b3df 100644
--- a/bundles/org.eclipse.equinox.log/src/org/eclipse/equinox/log/internal/Activator.java
+++ b/bundles/org.eclipse.equinox.log/src/org/eclipse/equinox/log/internal/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Cognos Incorporated, IBM Corporation and others
+ * Copyright (c) 2006, 2009 Cognos Incorporated, IBM Corporation 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
@@ -13,7 +13,7 @@ import org.osgi.framework.*;
import org.osgi.service.log.LogReaderService;
import org.osgi.service.log.LogService;
-public class Activator implements BundleActivator {
+public class Activator implements BundleActivator, BundleListener, FrameworkListener, ServiceListener {
private static final String EVENT_ADMIN_CLASS = "org.osgi.service.event.EventAdmin"; //$NON-NLS-1$
private static final String[] LOGSERVICE_CLASSES = {LogService.class.getName(), ExtendedLogService.class.getName()};
@@ -22,10 +22,14 @@ public class Activator implements BundleActivator {
private ServiceRegistration logReaderServiceRegistration;
private ServiceRegistration logServiceRegistration;
private EventAdminAdapter eventAdminAdapter;
+ private final ExtendedLogReaderServiceFactory logReaderServiceFactory = new ExtendedLogReaderServiceFactory();
private ExtendedLogServiceFactory logServiceFactory;
public void start(BundleContext context) throws Exception {
- ExtendedLogReaderServiceFactory logReaderServiceFactory = new ExtendedLogReaderServiceFactory();
+ context.addBundleListener(this);
+ context.addServiceListener(this);
+ context.addFrameworkListener(this);
+
if (checkEventAdmin()) {
eventAdminAdapter = new EventAdminAdapter(context, logReaderServiceFactory);
eventAdminAdapter.start();
@@ -40,13 +44,16 @@ public class Activator implements BundleActivator {
logServiceRegistration.unregister();
logServiceRegistration = null;
logReaderServiceRegistration.unregister();
+ logReaderServiceRegistration = null;
logServiceFactory.shutdown();
logServiceFactory = null;
if (eventAdminAdapter != null) {
eventAdminAdapter.stop();
eventAdminAdapter = null;
}
- logReaderServiceRegistration = null;
+ context.removeFrameworkListener(this);
+ context.removeServiceListener(this);
+ context.removeBundleListener(this);
}
private static boolean checkEventAdmin() {
@@ -59,4 +66,126 @@ public class Activator implements BundleActivator {
}
}
+ /**
+ * BundleListener.bundleChanged method.
+ *
+ */
+ public void bundleChanged(BundleEvent event) {
+ Bundle bundle = event.getBundle();
+ if (logReaderServiceFactory.isLoggable(bundle, null, LogService.LOG_INFO))
+ logReaderServiceFactory.log(bundle, null, null, LogService.LOG_INFO, getBundleEventTypeName(event.getType()), null);
+ }
+
+ /**
+ * ServiceListener.serviceChanged method.
+ *
+ */
+ public void serviceChanged(ServiceEvent event) {
+ ServiceReference reference = event.getServiceReference();
+ Bundle bundle = reference.getBundle();
+ int eventType = event.getType();
+ int logType = (eventType == ServiceEvent.MODIFIED) ? LogService.LOG_DEBUG : LogService.LOG_INFO;
+ if (logReaderServiceFactory.isLoggable(bundle, null, logType))
+ logReaderServiceFactory.log(bundle, null, reference, logType, getServiceEventTypeName(eventType), null);
+ }
+
+ /**
+ * FrameworkListener.frameworkEvent method.
+ *
+ */
+ public void frameworkEvent(FrameworkEvent event) {
+ Bundle bundle = event.getBundle();
+ int eventType = event.getType();
+ int logType = (eventType == FrameworkEvent.ERROR) ? LogService.LOG_ERROR : LogService.LOG_INFO;
+ Throwable throwable = (eventType == FrameworkEvent.ERROR) ? event.getThrowable() : null;
+ if (logReaderServiceFactory.isLoggable(bundle, null, logType))
+ logReaderServiceFactory.log(bundle, null, null, logType, getFrameworkEventTypeName(eventType), throwable);
+ }
+
+ /**
+ * Convert BundleEvent type to a string.
+ *
+ */
+ protected static String getBundleEventTypeName(int type) {
+ switch (type) {
+ case BundleEvent.INSTALLED :
+ return ("BundleEvent INSTALLED"); //$NON-NLS-1$
+
+ case BundleEvent.RESOLVED :
+ return ("BundleEvent RESOLVED"); //$NON-NLS-1$
+
+ case BundleEvent.STARTED :
+ return ("BundleEvent STARTED"); //$NON-NLS-1$
+
+ case BundleEvent.STARTING :
+ return ("BundleEvent STARTING"); //$NON-NLS-1$
+
+ case BundleEvent.STOPPED :
+ return ("BundleEvent STOPPED"); //$NON-NLS-1$
+
+ case BundleEvent.STOPPING :
+ return ("BundleEvent STOPPING"); //$NON-NLS-1$
+
+ case BundleEvent.UNINSTALLED :
+ return ("BundleEvent UNINSTALLED"); //$NON-NLS-1$
+
+ case BundleEvent.UNRESOLVED :
+ return ("BundleEvent UNRESOLVED"); //$NON-NLS-1$
+
+ case BundleEvent.UPDATED :
+ return ("BundleEvent UPDATED"); //$NON-NLS-1$
+
+ default :
+ return ("BundleEvent " + Integer.toHexString(type)); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Convert ServiceEvent type to a string.
+ *
+ */
+ protected static String getServiceEventTypeName(int type) {
+ switch (type) {
+ case ServiceEvent.REGISTERED :
+ return ("ServiceEvent REGISTERED"); //$NON-NLS-1$
+
+ case ServiceEvent.MODIFIED :
+ return ("ServiceEvent MODIFIED"); //$NON-NLS-1$
+
+ case ServiceEvent.UNREGISTERING :
+ return ("ServiceEvent UNREGISTERING"); //$NON-NLS-1$
+
+ default :
+ return ("ServiceEvent " + Integer.toHexString(type)); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Convert FrameworkEvent type to a string.
+ *
+ */
+ protected static String getFrameworkEventTypeName(int type) {
+ switch (type) {
+ case FrameworkEvent.ERROR :
+ return ("FrameworkEvent ERROR"); //$NON-NLS-1$
+
+ case FrameworkEvent.INFO :
+ return ("FrameworkEvent INFO"); //$NON-NLS-1$
+
+ case FrameworkEvent.PACKAGES_REFRESHED :
+ return ("FrameworkEvent PACKAGES REFRESHED"); //$NON-NLS-1$
+
+ case FrameworkEvent.STARTED :
+ return ("FrameworkEvent STARTED"); //$NON-NLS-1$
+
+ case FrameworkEvent.STARTLEVEL_CHANGED :
+ return ("FrameworkEvent STARTLEVEL CHANGED"); //$NON-NLS-1$
+
+ case FrameworkEvent.WARNING :
+ return ("FrameworkEvent WARNING"); //$NON-NLS-1$
+
+ default :
+ return ("FrameworkEvent " + Integer.toHexString(type)); //$NON-NLS-1$
+ }
+ }
}

Back to the top