From 8a0613fae3d438ff096d22cf5762bc6ed083e16b Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Mon, 27 Jul 2015 18:15:03 -0400 Subject: [PATCH] Add Javadoc and related settings Always better to clearly identify what test does what. Signed-off-by: Alexandre Montplaisir --- .settings/org.eclipse.jdt.core.prefs | 387 ++++++++++++++++++ .settings/org.eclipse.jdt.ui.prefs | 3 + .../jul/handler/JulHandlerBenchmarkBase.java | 13 + .../builtin/DummyHandlerBenchmark.java | 7 + .../handler/builtin/FileHandlerBenchmark.java | 37 +- .../handler/builtin/NoHandlerBenchmark.java | 6 +- ...tngJulHandlerTracingDisabledBenchmark.java | 12 + ...ttngJulHandlerTracingEnabledBenchmark.java | 11 + ...tngJulHandlerTracingDisabledBenchmark.java | 10 + ...ttngJulHandlerTracingEnabledBenchmark.java | 11 + .../integration/EnabledEventsTestBase.java | 10 + .../integration/MultiSessionTestBase.java | 8 +- .../integration/jul/JulEnabledEventsTest.java | 18 + .../integration/jul/JulLegacyApiTest.java | 24 ++ .../integration/jul/JulMultiSessionTest.java | 18 + .../agent/integration/jul/JulTestUtils.java | 3 + .../log4j/Log4jEnabledEventsTest.java | 18 + .../integration/log4j/Log4jLegacyApiTest.java | 25 ++ .../log4j/Log4jMultiSessionTest.java | 18 + .../integration/log4j/Log4jTestUtils.java | 3 + .../lttng/ust/agent/utils/LttngSession.java | 37 +- .../lttng/ust/agent/utils/MiscTestUtils.java | 12 + 22 files changed, 677 insertions(+), 14 deletions(-) create mode 100644 .settings/org.eclipse.jdt.ui.prefs diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 714351a..3ef0c30 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,392 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=warning +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=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +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=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.source=1.8 +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_annotation=0 +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_method_declaration=0 +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_resources_in_try=80 +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.alignment_for_union_type_in_multicatch=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_lambda_body=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=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.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +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.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +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_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not 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_after_type_annotation=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=do not 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_lambda_arrow=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_try=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_semicolon_in_try_resources=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_try=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_lambda_arrow=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_try=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_semicolon_in_try_resources=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.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +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=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..090a296 --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_Spaces +formatter_settings_version=12 diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/JulHandlerBenchmarkBase.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/JulHandlerBenchmarkBase.java index 997d128..9ac3df5 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/JulHandlerBenchmarkBase.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/JulHandlerBenchmarkBase.java @@ -28,6 +28,10 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +/** + * Base abstract class for JUL benchmarks. Sub-classes can setup parameters to + * test different types of log handlers. + */ public abstract class JulHandlerBenchmarkBase { // ------------------------------------------------------------------------ @@ -54,6 +58,9 @@ public abstract class JulHandlerBenchmarkBase { // Maintenance methods // ------------------------------------------------------------------------ + /** + * Base test setup + */ @Before public void setup() { /* Set up the logger */ @@ -64,6 +71,9 @@ public abstract class JulHandlerBenchmarkBase { /* Sub-classes' @Before will setup the Handler */ } + /** + * Base test teardown + */ @After public void teardown() { if (handler != null) { @@ -78,6 +88,9 @@ public abstract class JulHandlerBenchmarkBase { // Test methods // ------------------------------------------------------------------------ + /** + * Main test class for running the benchmark + */ @Test public void runBenchmark() { if (handler != null) { diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java index 573ed53..44a5290 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/DummyHandlerBenchmark.java @@ -24,8 +24,15 @@ import java.util.logging.LogRecord; import org.junit.Before; import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; +/** + * Test suite of using a "dummy" handler, which means a handler that does + * exactly nothing. + */ public class DummyHandlerBenchmark extends JulHandlerBenchmarkBase { + /** + * Test setup + */ @Before public void testSetup() { handler = new DummyHandler(); diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/FileHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/FileHandlerBenchmark.java index 62f1e8e..af4ab7c 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/FileHandlerBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/FileHandlerBenchmark.java @@ -28,20 +28,37 @@ import org.junit.After; import org.junit.Before; import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; +/** + * Test class using a {@link FileHandler}, which a {@link SimpleFormatter}. + */ public class FileHandlerBenchmark extends JulHandlerBenchmarkBase { private Path outputFile; - @Before - public void testSetup() throws SecurityException, IOException { - outputFile = Files.createTempFile(this.getClass().getSimpleName(), null); + /** + * Test setup + * + * @throws SecurityException + * If there is problem setting up the handler + * @throws IOException + * If there is problem setting up the handler + */ + @Before + public void testSetup() throws SecurityException, IOException { + outputFile = Files.createTempFile(this.getClass().getSimpleName(), null); - handler = new FileHandler(outputFile.toString(), false); - handler.setFormatter(new SimpleFormatter()); - } + handler = new FileHandler(outputFile.toString(), false); + handler.setFormatter(new SimpleFormatter()); + } - @After - public void testTeardown() throws IOException { - Files.deleteIfExists(outputFile); - } + /** + * Test cleanup + * + * @throws IOException + * If we could not delete the test file + */ + @After + public void testTeardown() throws IOException { + Files.deleteIfExists(outputFile); + } } diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java index e2d2323..09457d2 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/builtin/NoHandlerBenchmark.java @@ -20,7 +20,11 @@ package org.lttng.ust.agent.benchmarks.jul.handler.builtin; import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; +/** + * Benchmark that will attach no {@link java.util.logging.Handler} to the + * {@link java.util.logging.Logger} object. + */ public class NoHandlerBenchmark extends JulHandlerBenchmarkBase { - /* Do not setup any handler */ + /* Do not setup any handler */ } diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java index 101967f..3ba6291 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingDisabledBenchmark.java @@ -29,10 +29,19 @@ import org.lttng.ust.agent.jul.LttngLogHandler; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; +/** + * Benchmark the LTTng-JUL handler, but with tracing disabled in the tracing + * session. + */ public class LttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; + /** + * Test setup + * + * @throws IOException + */ @Before public void testSetup() throws IOException { handler = new LttngLogHandler(); @@ -42,6 +51,9 @@ public class LttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchmark assertTrue(session.start()); } + /** + * Test cleanup + */ @After public void testTeardown() { assertTrue(session.stop()); diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java index b188115..4a150b6 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/LttngJulHandlerTracingEnabledBenchmark.java @@ -29,10 +29,18 @@ import org.lttng.ust.agent.jul.LttngLogHandler; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; +/** + * Test the LTTng-JUL handler, with it actually sending events to the tracer. + */ public class LttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; + /** + * Test setup + * + * @throws IOException + */ @Before public void testSetup() throws IOException { handler = new LttngLogHandler(); @@ -42,6 +50,9 @@ public class LttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchmarkB assertTrue(session.start()); } + /** + * Test cleanup + */ @After public void testTeardown() { assertTrue(session.stop()); diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java index 1da3ed7..15628f0 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java @@ -27,11 +27,18 @@ import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; +/** + * Benchmark for the LTTng-UST handler, using the legacy API. Tracing is + * disabled in the tracing session. + */ @SuppressWarnings("deprecation") public class OldLttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; + /** + * Test setup + */ @Before public void testSetup() { LTTngAgent.getLTTngAgent(); @@ -41,6 +48,9 @@ public class OldLttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchm assertTrue(session.start()); } + /** + * Test cleanup + */ @After public void testTeardown() { assertTrue(session.stop()); diff --git a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java index d5593fc..018190d 100644 --- a/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java +++ b/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java @@ -31,12 +31,20 @@ import org.lttng.ust.agent.jul.LttngLogHandler; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; +/** + * Benchmark for the LTTng-UST handler, using the legacy API. Tracing is + * enabled in the tracing session. + */ @SuppressWarnings("deprecation") public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchmarkBase { private LttngSession session; private LttngLogHandler agentHandler; + + /** + * Test setup + */ @Before public void testSetup() { LTTngAgent agentInstance = LTTngAgent.getLTTngAgent(); @@ -66,6 +74,9 @@ public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchma assertTrue(session.start()); } + /** + * Test cleanup + */ @After public void testTeardown() { assertTrue(session.stop()); diff --git a/src/test/java/org/lttng/ust/agent/integration/EnabledEventsTestBase.java b/src/test/java/org/lttng/ust/agent/integration/EnabledEventsTestBase.java index 159b6f7..49ee622 100644 --- a/src/test/java/org/lttng/ust/agent/integration/EnabledEventsTestBase.java +++ b/src/test/java/org/lttng/ust/agent/integration/EnabledEventsTestBase.java @@ -31,6 +31,10 @@ import org.lttng.ust.agent.ILttngHandler; import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; +/** + * Base abstract class to implement all sorts of integration tests verifying the + * presence of enabled events in resulting traces. + */ public abstract class EnabledEventsTestBase { protected static final String EVENT_NAME_A = "EventA"; @@ -49,11 +53,17 @@ public abstract class EnabledEventsTestBase { protected abstract void sendEventsToLoggers(); + /** + * Base test setup + */ @Before public void testSetup() { session = new LttngSession(null, getDomain()); } + /** + * Base test teardown + */ @After public void testTeardown() { session.close(); diff --git a/src/test/java/org/lttng/ust/agent/integration/MultiSessionTestBase.java b/src/test/java/org/lttng/ust/agent/integration/MultiSessionTestBase.java index f5d4c07..cb04e7a 100644 --- a/src/test/java/org/lttng/ust/agent/integration/MultiSessionTestBase.java +++ b/src/test/java/org/lttng/ust/agent/integration/MultiSessionTestBase.java @@ -32,7 +32,7 @@ import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; /** - * Tests with multiple concurrent tracing sessions + * Base abstract class for tests with multiple concurrent tracing sessions */ public abstract class MultiSessionTestBase { @@ -55,6 +55,9 @@ public abstract class MultiSessionTestBase { protected abstract void sendEventsToLoggers(); + /** + * Base test setup + */ @Before public void testSetup() { session1 = new LttngSession(null, getDomain()); @@ -62,6 +65,9 @@ public abstract class MultiSessionTestBase { session3 = new LttngSession(null, getDomain()); } + /** + * Base test teardown + */ @After public void testTeardown() { session1.close(); diff --git a/src/test/java/org/lttng/ust/agent/integration/jul/JulEnabledEventsTest.java b/src/test/java/org/lttng/ust/agent/integration/jul/JulEnabledEventsTest.java index 880c217..793e2db 100644 --- a/src/test/java/org/lttng/ust/agent/integration/jul/JulEnabledEventsTest.java +++ b/src/test/java/org/lttng/ust/agent/integration/jul/JulEnabledEventsTest.java @@ -35,6 +35,9 @@ import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; import org.lttng.ust.agent.utils.MiscTestUtils; +/** + * Enabled events test for the LTTng-UST JUL log handler. + */ public class JulEnabledEventsTest extends EnabledEventsTestBase { private static final Domain DOMAIN = Domain.JUL; @@ -44,6 +47,9 @@ public class JulEnabledEventsTest extends EnabledEventsTestBase { private Logger loggerC; private Logger loggerD; + /** + * Class setup + */ @BeforeClass public static void julClassSetup() { /* Skip tests if we can't find the JNI library or lttng-tools */ @@ -53,11 +59,20 @@ public class JulEnabledEventsTest extends EnabledEventsTestBase { LttngSession.destroyAllSessions(); } + /** + * Class cleanup + */ @AfterClass public static void julClassCleanup() { LttngSession.deleteAllTracee(); } + /** + * Test setup + * + * @throws SecurityException + * @throws IOException + */ @Before public void julSetup() throws SecurityException, IOException { loggerA = Logger.getLogger(EVENT_NAME_A); @@ -79,6 +94,9 @@ public class JulEnabledEventsTest extends EnabledEventsTestBase { loggerC.addHandler((Handler) handlerC); } + /** + * Test teardown + */ @After public void julTeardown() { loggerA.removeHandler((Handler) handlerA); diff --git a/src/test/java/org/lttng/ust/agent/integration/jul/JulLegacyApiTest.java b/src/test/java/org/lttng/ust/agent/integration/jul/JulLegacyApiTest.java index 49d0ecf..5f6a9a0 100644 --- a/src/test/java/org/lttng/ust/agent/integration/jul/JulLegacyApiTest.java +++ b/src/test/java/org/lttng/ust/agent/integration/jul/JulLegacyApiTest.java @@ -40,6 +40,9 @@ import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; import org.lttng.ust.agent.utils.MiscTestUtils; +/** + * Enabled events test for the LTTng-UST JUL log handler, using the legacy API. + */ @SuppressWarnings("deprecation") public class JulLegacyApiTest { @@ -53,6 +56,9 @@ public class JulLegacyApiTest { private Logger loggerA; private Logger loggerB; + /** + * Class setup + */ @BeforeClass public static void julClassSetup() { /* Skip tests if we can't find the JNI library or lttng-tools */ @@ -62,11 +68,17 @@ public class JulLegacyApiTest { LttngSession.destroyAllSessions(); } + /** + * Class cleanup + */ @AfterClass public static void julClassCleanup() { LttngSession.deleteAllTracee(); } + /** + * Test setup + */ @Before public void setup() { loggerA = Logger.getLogger(EVENT_NAME_A); @@ -79,6 +91,9 @@ public class JulLegacyApiTest { session = new LttngSession(null, DOMAIN); } + /** + * Test cleanup + */ @After public void tearDown() { session.close(); @@ -89,6 +104,9 @@ public class JulLegacyApiTest { loggerB = null; } + /** + * Test tracing with no events enabled in the tracing session. + */ @Test public void testNoEvents() { assertTrue(session.start()); @@ -106,6 +124,9 @@ public class JulLegacyApiTest { assertEquals(0, handler.getEventCount()); } + /** + * Test tracing with all events enabled (-j -a) in the tracing session. + */ @Test public void testAllEvents() { assertTrue(session.enableAllEvents()); @@ -124,6 +145,9 @@ public class JulLegacyApiTest { assertEquals(20, handler.getEventCount()); } + /** + * Test tracing with a subset of events enabled in the tracing session. + */ @Test public void testSomeEvents() { assertTrue(session.enableEvents(EVENT_NAME_A)); diff --git a/src/test/java/org/lttng/ust/agent/integration/jul/JulMultiSessionTest.java b/src/test/java/org/lttng/ust/agent/integration/jul/JulMultiSessionTest.java index d59e636..646876f 100644 --- a/src/test/java/org/lttng/ust/agent/integration/jul/JulMultiSessionTest.java +++ b/src/test/java/org/lttng/ust/agent/integration/jul/JulMultiSessionTest.java @@ -35,6 +35,9 @@ import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; import org.lttng.ust.agent.utils.MiscTestUtils; +/** + * JUL tests for multiple concurrent tracing sessions + */ public class JulMultiSessionTest extends MultiSessionTestBase { private static final Domain DOMAIN = Domain.JUL; @@ -44,6 +47,9 @@ public class JulMultiSessionTest extends MultiSessionTestBase { private Logger loggerC; private Logger loggerD; + /** + * Class setup + */ @BeforeClass public static void julClassSetup() { /* Skip tests if we can't find the JNI library or lttng-tools */ @@ -53,11 +59,20 @@ public class JulMultiSessionTest extends MultiSessionTestBase { LttngSession.destroyAllSessions(); } + /** + * Class cleanup + */ @AfterClass public static void julClassCleanup() { LttngSession.deleteAllTracee(); } + /** + * Test setup + * + * @throws SecurityException + * @throws IOException + */ @Before public void julSetup() throws SecurityException, IOException { loggerA = Logger.getLogger(EVENT_NAME_A); @@ -81,6 +96,9 @@ public class JulMultiSessionTest extends MultiSessionTestBase { loggerD.addHandler((Handler) handlerD); } + /** + * Test teardown + */ @After public void julTeardown() { loggerA.removeHandler((Handler) handlerA); diff --git a/src/test/java/org/lttng/ust/agent/integration/jul/JulTestUtils.java b/src/test/java/org/lttng/ust/agent/integration/jul/JulTestUtils.java index 1e26313..0a3e13c 100644 --- a/src/test/java/org/lttng/ust/agent/integration/jul/JulTestUtils.java +++ b/src/test/java/org/lttng/ust/agent/integration/jul/JulTestUtils.java @@ -21,6 +21,9 @@ package org.lttng.ust.agent.integration.jul; import java.util.logging.Level; import java.util.logging.Logger; +/** + * Utility methods for JUL tests + */ final class JulTestUtils { JulTestUtils() { diff --git a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jEnabledEventsTest.java b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jEnabledEventsTest.java index a96e1d5..35a17ab 100644 --- a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jEnabledEventsTest.java +++ b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jEnabledEventsTest.java @@ -35,6 +35,9 @@ import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; import org.lttng.ust.agent.utils.MiscTestUtils; +/** + * Enabled events test for the LTTng-UST Log4j log handler. + */ public class Log4jEnabledEventsTest extends EnabledEventsTestBase { private static final Domain DOMAIN = Domain.LOG4J; @@ -44,6 +47,9 @@ public class Log4jEnabledEventsTest extends EnabledEventsTestBase { private Logger loggerC; private Logger loggerD; + /** + * Class setup + */ @BeforeClass public static void log4jClassSetup() { /* Skip tests if we can't find the JNI library or lttng-tools */ @@ -53,11 +59,20 @@ public class Log4jEnabledEventsTest extends EnabledEventsTestBase { LttngSession.destroyAllSessions(); } + /** + * Class teardown + */ @AfterClass public static void log4jClassCleanup() { LttngSession.deleteAllTracee(); } + /** + * Test setup + * + * @throws SecurityException + * @throws IOException + */ @Before public void log4jSetup() throws SecurityException, IOException { loggerA = Logger.getLogger(EVENT_NAME_A); @@ -79,6 +94,9 @@ public class Log4jEnabledEventsTest extends EnabledEventsTestBase { loggerC.addAppender((Appender) handlerC); } + /** + * Test teardown + */ @After public void log4jTeardown() { loggerA.removeAppender((Appender) handlerA); diff --git a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jLegacyApiTest.java b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jLegacyApiTest.java index a15fadb..6dcc30f 100644 --- a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jLegacyApiTest.java +++ b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jLegacyApiTest.java @@ -40,6 +40,10 @@ import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; import org.lttng.ust.agent.utils.MiscTestUtils; +/** + * Enabled events test for the LTTng-UST Log4j log handler, using the legacy + * API. + */ @SuppressWarnings("deprecation") public class Log4jLegacyApiTest { @@ -53,6 +57,9 @@ public class Log4jLegacyApiTest { private Logger loggerA; private Logger loggerB; + /** + * Class setup + */ @BeforeClass public static void classSetup() { /* Skip tests if we can't find the JNI library or lttng-tools */ @@ -62,11 +69,17 @@ public class Log4jLegacyApiTest { LttngSession.destroyAllSessions(); } + /** + * Class cleanup + */ @AfterClass public static void classCleanup() { LttngSession.deleteAllTracee(); } + /** + * Test setup + */ @Before public void setup() { loggerA = Logger.getLogger(EVENT_NAME_A); @@ -79,6 +92,9 @@ public class Log4jLegacyApiTest { session = new LttngSession(null, DOMAIN); } + /** + * Test cleanup + */ @After public void tearDown() { session.close(); @@ -89,6 +105,9 @@ public class Log4jLegacyApiTest { loggerB = null; } + /** + * Test tracing with no events enabled in the tracing session. + */ @Test public void testNoEvents() { assertTrue(session.start()); @@ -106,6 +125,9 @@ public class Log4jLegacyApiTest { assertEquals(0, handler.getEventCount()); } + /** + * Test tracing with all events enabled (-l -a) in the tracing session. + */ @Test public void testAllEvents() { assertTrue(session.enableAllEvents()); @@ -124,6 +146,9 @@ public class Log4jLegacyApiTest { assertEquals(20, handler.getEventCount()); } + /** + * Test tracing with a subset of events enabled in the tracing session. + */ @Test public void testSomeEvents() { assertTrue(session.enableEvents(EVENT_NAME_A)); diff --git a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jMultiSessionTest.java b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jMultiSessionTest.java index eb3df2b..31556b6 100644 --- a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jMultiSessionTest.java +++ b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jMultiSessionTest.java @@ -35,6 +35,9 @@ import org.lttng.ust.agent.utils.LttngSession; import org.lttng.ust.agent.utils.LttngSession.Domain; import org.lttng.ust.agent.utils.MiscTestUtils; +/** + * Log4j tests for multiple concurrent tracing sessions + */ public class Log4jMultiSessionTest extends MultiSessionTestBase { private static final Domain DOMAIN = Domain.LOG4J; @@ -44,6 +47,9 @@ public class Log4jMultiSessionTest extends MultiSessionTestBase { private Logger loggerC; private Logger loggerD; + /** + * Class setup + */ @BeforeClass public static void log4jClassSetup() { /* Skip tests if we can't find the JNI library or lttng-tools */ @@ -53,11 +59,20 @@ public class Log4jMultiSessionTest extends MultiSessionTestBase { LttngSession.destroyAllSessions(); } + /** + * Class teardown + */ @AfterClass public static void log4jClassCleanup() { LttngSession.deleteAllTracee(); } + /** + * Test setup + * + * @throws SecurityException + * @throws IOException + */ @Before public void log4jSetup() throws SecurityException, IOException { // TODO Wipe all existing LTTng sessions? @@ -83,6 +98,9 @@ public class Log4jMultiSessionTest extends MultiSessionTestBase { loggerD.addAppender((Appender) handlerD); } + /** + * Test teardown + */ @After public void log4jTeardown() { loggerA.removeAppender((Appender) handlerA); diff --git a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jTestUtils.java b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jTestUtils.java index 77c7189..c69f7bc 100644 --- a/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jTestUtils.java +++ b/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jTestUtils.java @@ -23,6 +23,9 @@ import java.io.IOException; import org.apache.log4j.Level; import org.apache.log4j.Logger; +/** + * Utility methods for log4j tests + */ final class Log4jTestUtils { private Log4jTestUtils() { diff --git a/src/test/java/org/lttng/ust/agent/utils/LttngSession.java b/src/test/java/org/lttng/ust/agent/utils/LttngSession.java index cc3b4d7..9c77f59 100644 --- a/src/test/java/org/lttng/ust/agent/utils/LttngSession.java +++ b/src/test/java/org/lttng/ust/agent/utils/LttngSession.java @@ -31,10 +31,21 @@ import java.util.List; import java.util.UUID; import java.util.stream.Collectors; +/** + * Java representation of a LTTng tracing session. It uses the command-line + * "lttng" tool to manipulate the session. Creating an instance will run + * "lttng create", close()'ing it will run "lttng destroy". + * + * @author Alexandre Montplaisir + */ public class LttngSession implements AutoCloseable { + /** + * Tracing domains as they are defined by lttng-tools + */ public enum Domain { - JUL("-j"), + /** The JUL (java.util.logging) domain */ + JUL("-j"), /** The log4j (org.apache.log4j) domain */ LOG4J("-l"); private final String flag; @@ -43,6 +54,10 @@ public class LttngSession implements AutoCloseable { this.flag = flag; } + /** + * @return The corresponding command-line flag to pass to options like + * "lttng enable-event" + */ public String flag() { return flag; } @@ -53,6 +68,15 @@ public class LttngSession implements AutoCloseable { private volatile boolean channelCreated = false; + /** + * Constructor to create a new LTTng tracing session. + * + * @param sessionName + * The name of the session to use. It can be null, in which case + * we will provide a unique random name. + * @param domain + * The tracing domain of this session + */ public LttngSession(String sessionName, Domain domain) { if (sessionName != null) { this.sessionName = sessionName; @@ -123,6 +147,11 @@ public class LttngSession implements AutoCloseable { "-s", sessionName)); } + /** + * Start tracing + * + * @return If the command executed successfully (return code = 0). + */ public boolean start() { /* * We have to enable a channel for 'lttng start' to work. However, we @@ -203,7 +232,11 @@ public class LttngSession implements AutoCloseable { } /** - * Just to test the environment / stdout are working correctly + * Simple command to test that the environment / stdout are working + * correctly. + * + * @param args + * Command-line arguments */ public static void main(String[] args) { List command = Arrays.asList("ls", "-l"); diff --git a/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java b/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java index dd5505c..3aac32c 100644 --- a/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java +++ b/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java @@ -91,6 +91,12 @@ public final class MiscTestUtils { } } + /** + * Check if there is a user session daemon currently running on the system. + * It needs to be of the same user as the application running this program. + * + * @return If there is a user session daemon currently running + */ public static boolean checkForUserSessiond() { String userName = System.getProperty("user.name"); @@ -104,6 +110,12 @@ public final class MiscTestUtils { .anyMatch(s -> s.startsWith(shortUserName)); } + /** + * Check if there is a root user session daemon daemon currently running on + * the system. + * + * @return If there is a root session daemon currently running + */ public static boolean checkForRootSessiond() { List command = Arrays.asList("ps", "-e", "u"); List output = getOutputFromCommand(false, command); -- 2.34.1