diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.core.resources.prefs b/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.jdt.core.prefs b/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..288b4a92 --- /dev/null +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,284 @@ +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.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 +org.eclipse.jdt.core.compiler.compliance=21 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=21 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=18 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=2 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=2 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=2 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=18 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=18 +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=18 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=20 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=4 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0 +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=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=false +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=180 +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.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=4 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4 +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=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=8 +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_member=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_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_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=do not 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=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +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=180 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false +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=true +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.formatter.wrap_outer_expressions_when_nested=true diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.jdt.ui.prefs b/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..4962123f --- /dev/null +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,114 @@ +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=true +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=true +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=false +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=false +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=false +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=false +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +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_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=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 +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSClientImpl.java b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSClientImpl.java index 82f46267..9dacee28 100644 --- a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSClientImpl.java +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSClientImpl.java @@ -38,12 +38,12 @@ import org.eclipse.lsp4jakarta.commons.JakartaJavaProjectLabelsParams; import org.eclipse.lsp4jakarta.commons.JavaCursorContextResult; import org.eclipse.lsp4jakarta.commons.ProjectLabelInfoEntry; +import org.eclipse.lsp4jakarta.commons.codeaction.CodeActionResolveData; +import org.eclipse.lsp4jakarta.commons.utils.JSONUtility; import org.eclipse.lsp4jakarta.jdt.core.ProjectLabelManager; import org.eclipse.lsp4jakarta.jdt.core.PropertiesManagerForJava; import org.eclipse.lsp4jakarta.jdt.internal.core.ls.JDTUtilsLSImpl; import org.eclipse.lsp4jakarta.ls.api.JakartaLanguageClientAPI; -import org.eclipse.lsp4jakarta.commons.codeaction.CodeActionResolveData; -import org.eclipse.lsp4jakarta.commons.utils.JSONUtility; import io.openliberty.tools.eclipse.ls.plugin.LibertyToolsLSPlugin; @@ -79,7 +79,7 @@ public CompletableFuture getJavaCompletion(JakartaJ try { completionList = PropertiesManagerForJava.getInstance().completion(javaParams, JDTUtilsLSImpl.getInstance(), monitor); JavaCursorContextResult javaCursorContext = PropertiesManagerForJava.getInstance().javaCursorContext(javaParams, - JDTUtilsLSImpl.getInstance(), monitor); + JDTUtilsLSImpl.getInstance(), monitor); return new JakartaJavaCompletionResult(completionList, javaCursorContext); } catch (JavaModelException e) { LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e); @@ -145,7 +145,7 @@ public CompletableFuture> getJavaCodeAction(JakartaJavaCodeActi IProgressMonitor monitor = getProgressMonitor(cancelChecker); try { return (List) PropertiesManagerForJava.getInstance().codeAction(javaParams, JDTUtilsLSImpl.getInstance(), - monitor); + monitor); } catch (JavaModelException e) { LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e); return Collections.emptyList(); @@ -164,7 +164,7 @@ public CompletableFuture resolveCodeAction(CodeAction unresolved) { CodeActionResolveData resolveData = JSONUtility.toModel(unresolved.getData(), CodeActionResolveData.class); unresolved.setData(resolveData); return (CodeAction) PropertiesManagerForJava.getInstance().resolveCodeAction(unresolved, JDTUtilsLSImpl.getInstance(), - monitor); + monitor); } catch (JavaModelException e) { LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e); return null; diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSConnection.java b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSConnection.java index fab8905c..ffbee81b 100644 --- a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSConnection.java +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSConnection.java @@ -60,8 +60,7 @@ public JakartaLSConnection() { setCommands(commands); setWorkingDirectory(System.getProperty("user.dir")); } catch (IOException e) { - LibertyToolsLSPlugin.getDefault().getLog() - .log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e)); + LibertyToolsLSPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e)); } } diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSClientImpl.java b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSClientImpl.java index 2c41df6b..d99d0c50 100644 --- a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSClientImpl.java +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSClientImpl.java @@ -83,8 +83,8 @@ public boolean visit(IResourceDelta delta) { // Look for changes to liberty-plugin-config.xml, *.properties, and *.env if ("liberty-plugin-config.xml".equalsIgnoreCase(resource.getName()) - || "properties".equalsIgnoreCase(resource.getFileExtension()) - || "env".equalsIgnoreCase(resource.getFileExtension())) { + || "properties".equalsIgnoreCase(resource.getFileExtension()) + || "env".equalsIgnoreCase(resource.getFileExtension())) { changed.add(resource.getLocationURI().toString()); } } diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSConnection.java b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSConnection.java index cc89ee78..94a8c6d7 100644 --- a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSConnection.java +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSConnection.java @@ -48,8 +48,7 @@ public LibertyLSConnection() { setCommands(commands); setWorkingDirectory(System.getProperty("user.dir")); } catch (IOException e) { - LibertyToolsLSPlugin.getDefault().getLog() - .log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e)); + LibertyToolsLSPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e)); } } diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/ls/plugin/LibertyToolsLSPlugin.java b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/ls/plugin/LibertyToolsLSPlugin.java index f03d4b53..a1c00929 100644 --- a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/ls/plugin/LibertyToolsLSPlugin.java +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/ls/plugin/LibertyToolsLSPlugin.java @@ -23,55 +23,55 @@ */ public class LibertyToolsLSPlugin extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "io.openliberty.tools.eclipse.lsp4e"; //$NON-NLS-1$ + // The plug-in ID + public static final String PLUGIN_ID = "io.openliberty.tools.eclipse.lsp4e"; //$NON-NLS-1$ - // The shared instance - private static LibertyToolsLSPlugin plugin; + // The shared instance + private static LibertyToolsLSPlugin plugin; - /** - * The constructor - */ - public LibertyToolsLSPlugin() { - } + /** + * The constructor + */ + public LibertyToolsLSPlugin() { + } - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static LibertyToolsLSPlugin getDefault() { - return plugin; - } + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static LibertyToolsLSPlugin getDefault() { + return plugin; + } - public static void logException(String localizedMessage, JavaModelException e) { - // TODO Auto-generated method stub + public static void logException(String localizedMessage, JavaModelException e) { + // TODO Auto-generated method stub - } + } - public static String getPluginId() { - return LibertyToolsLSPlugin.PLUGIN_ID; - } + public static String getPluginId() { + return LibertyToolsLSPlugin.PLUGIN_ID; + } - public static void log(IStatus status) { - getDefault().getLog().log(status); - } + public static void log(IStatus status) { + getDefault().getLog().log(status); + } - public static void logException(String errMsg, Throwable ex) { - getDefault().getLog().log(new Status(IStatus.ERROR, getPluginId(), errMsg, ex)); + public static void logException(String errMsg, Throwable ex) { + getDefault().getLog().log(new Status(IStatus.ERROR, getPluginId(), errMsg, ex)); - } + } } diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSClientImpl.java b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSClientImpl.java index afaa70fe..334f5fb2 100644 --- a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSClientImpl.java +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSClientImpl.java @@ -167,7 +167,7 @@ public CompletableFuture> getJavaCodeAction(MicroProfileJavaCod } return (List) PropertiesManagerForJava.getInstance().codeAction(javaParams, JDTUtilsLSImpl.getInstance(), - monitor); + monitor); } catch (JavaModelException e) { LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e); return Collections.emptyList(); @@ -218,9 +218,9 @@ public CompletableFuture getJavaCompletion(Mic IProgressMonitor monitor = getProgressMonitor(cancelChecker); try { CompletionList completionList = PropertiesManagerForJava.getInstance().completion(javaParams, JDTUtilsLSImpl.getInstance(), - monitor); + monitor); JavaCursorContextResult javaCursorContext = PropertiesManagerForJava.getInstance().javaCursorContext(javaParams, - JDTUtilsLSImpl.getInstance(), monitor); + JDTUtilsLSImpl.getInstance(), monitor); return new MicroProfileJavaCompletionResult(completionList, javaCursorContext); } catch (JavaModelException e) { LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e); diff --git a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSConnection.java b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSConnection.java index d44a3999..8ec6bf50 100644 --- a/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSConnection.java +++ b/bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSConnection.java @@ -52,8 +52,7 @@ public LibertyMPLSConnection() { setCommands(commands); setWorkingDirectory(System.getProperty("user.dir")); } catch (IOException e) { - LibertyToolsLSPlugin.getDefault().getLog() - .log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e)); + LibertyToolsLSPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e)); } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.core.resources.prefs b/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..288b4a92 --- /dev/null +++ b/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,284 @@ +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.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 +org.eclipse.jdt.core.compiler.compliance=21 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=21 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=18 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=2 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=2 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=2 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=18 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=18 +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=18 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=20 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=4 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0 +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=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=false +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=180 +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.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=4 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4 +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=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=8 +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_member=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_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_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=do not 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=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +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=180 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false +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=true +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.formatter.wrap_outer_expressions_when_nested=true diff --git a/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..4962123f --- /dev/null +++ b/bundles/io.openliberty.tools.eclipse.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,114 @@ +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=true +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=true +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=false +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=false +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=false +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=false +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +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_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=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 +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java index ba869cd7..bc75af63 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java @@ -54,15 +54,14 @@ private CommandBuilder(String projectPath, String pathEnv, boolean isMaven) { * Returns the full Maven command to run. * * @param projectPath The project's path. - * @param cmdArgs The mvn command args - * @param pathEnv The PATH env var + * @param cmdArgs The mvn command args + * @param pathEnv The PATH env var * * @return The full Maven command to run. * * @throws CommandNotFoundException */ - public static String getMavenCommandLine(String projectPath, String cmdArgs, String pathEnv) - throws CommandBuilder.CommandNotFoundException { + public static String getMavenCommandLine(String projectPath, String cmdArgs, String pathEnv) throws CommandBuilder.CommandNotFoundException { if (Trace.isEnabled()) { Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { projectPath, cmdArgs }); } @@ -75,8 +74,7 @@ public static String getMavenCommandLine(String projectPath, String cmdArgs, Str return cmdLine; } - public static String getGradleCommandLine(String projectPath, String cmdArgs, String pathEnv) - throws CommandBuilder.CommandNotFoundException { + public static String getGradleCommandLine(String projectPath, String cmdArgs, String pathEnv) throws CommandBuilder.CommandNotFoundException { if (Trace.isEnabled()) { Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { projectPath, cmdArgs }); } @@ -130,8 +128,8 @@ private String getCommandFromWrapper() { Path p2mwProps = Paths.get(projectPath, ".mvn", "wrapper", "maven-wrapper.properties"); if (p2mw.toFile().exists() && p2mwProps.toFile().exists()) { - cmd = Utils.isWindows()? MVNW_WRAPPER_WIN : MVNW_WRAPPER; - } + cmd = Utils.isWindows() ? MVNW_WRAPPER_WIN : MVNW_WRAPPER; + } } else { // Check if there is wrapper defined. Path p2gw = (Utils.isWindows()) ? Paths.get(projectPath, "gradlew.bat") : Paths.get(projectPath, "gradlew"); @@ -139,7 +137,7 @@ private String getCommandFromWrapper() { Path p2gwProps = Paths.get(projectPath, "gradle", "wrapper", "gradle-wrapper.properties"); if (p2gw.toFile().exists() && p2gwJar.toFile().exists() && p2gwProps.toFile().exists()) { - cmd = Utils.isWindows()? GRADLE_WRAPPER_WIN : GRADLE_WRAPPER; + cmd = Utils.isWindows() ? GRADLE_WRAPPER_WIN : GRADLE_WRAPPER; } } if (cmd != null) { @@ -160,7 +158,7 @@ private String getCommandFromPreferences() throws IllegalStateException { if (installLocPref == null || installLocPref.isBlank() || installLocPref.isEmpty()) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, - "The mvn/gradle preference path: " + installLocPref + " was null, blank, or empty"); + "The mvn/gradle preference path: " + installLocPref + " was null, blank, or empty"); } return null; } @@ -255,14 +253,14 @@ public CommandNotFoundException(Throwable cause) { } } - + /** * Function to enclose the command in double quotes if it contains any spaces */ - private String encloseCmdInQuotesIfNeeded(String cmd) { - if (cmd.contains(" ")) { - return "\"" + cmd + "\""; - } - return cmd; - } + private String encloseCmdInQuotesIfNeeded(String cmd) { + if (cmd.contains(" ")) { + return "\"" + cmd + "\""; + } + return cmd; + } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java index d4d94952..769f3563 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/DevModeOperations.java @@ -83,12 +83,9 @@ public class DevModeOperations { private static final String ANSI_SUPPORT_KEY = "ANSI_support_enabled"; private static final int STOP_TIMEOUT_SECONDS = 60; - protected static final QualifiedName STOP_JOB_COMPLETION_TIMEOUT = new QualifiedName("io.openliberty.tools.eclipse.ui", - "stopJobCompletionTimeout"); - protected static final QualifiedName STOP_JOB_COMPLETION_EXIT_CODE = new QualifiedName("io.openliberty.tools.eclipse.ui", - "stopJobCompletionExitCode"); - protected static final QualifiedName STOP_JOB_COMPLETION_OUTPUT = new QualifiedName("io.openliberty.tools.eclipse.ui", - "stopJobCompletionOutput"); + protected static final QualifiedName STOP_JOB_COMPLETION_TIMEOUT = new QualifiedName("io.openliberty.tools.eclipse.ui", "stopJobCompletionTimeout"); + protected static final QualifiedName STOP_JOB_COMPLETION_EXIT_CODE = new QualifiedName("io.openliberty.tools.eclipse.ui", "stopJobCompletionExitCode"); + protected static final QualifiedName STOP_JOB_COMPLETION_OUTPUT = new QualifiedName("io.openliberty.tools.eclipse.ui", "stopJobCompletionOutput"); private Map runningJobs = new ConcurrentHashMap(); /** @@ -163,11 +160,11 @@ public static DevModeOperations getInstance() { } /** - * @param iProject The project instance to associate with this action. - * @param parms The configuration parameters to be used when starting dev mode. + * @param iProject The project instance to associate with this action. + * @param parms The configuration parameters to be used when starting dev mode. * @param javaHomePath The configuration java installation home to be set in the process running dev mode. - * @param launch The launch associated with this run. - * @param mode The configuration mode. + * @param launch The launch associated with this run. + * @param mode The configuration mode. */ public void start(IProject iProject, String parms, String javaHomePath, ILaunch launch, String mode, boolean runProjectClean) { @@ -233,25 +230,25 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch String cmd = ""; if (buildType == Project.BuildType.MAVEN) { - cmd = CommandBuilder.getMavenCommandLine(projectPath, (runProjectClean == true ? " clean " : "" ) + "io.openliberty.tools:liberty-maven-plugin:dev " + startParms, - pathEnv); - } else if (buildType == Project.BuildType.GRADLE) { - - if (runProjectClean == true) { - try { - String stopGradleDaemonCmd= CommandBuilder.getGradleCommandLine(projectPath," --stop", pathEnv); - executeCommand(stopGradleDaemonCmd, projectPath); - } catch (IOException | InterruptedException e) { - Logger.logError("An attempt to stop the Gradle daemon failed...."); - } - - } - cmd = CommandBuilder.getGradleCommandLine(projectPath, - (runProjectClean == true ? " clean " : "") + "libertyDev " + startParms, pathEnv); - - } else { + cmd = CommandBuilder.getMavenCommandLine(projectPath, (runProjectClean == true ? " clean " : "") + "io.openliberty.tools:liberty-maven-plugin:dev " + startParms, + pathEnv); + } else if (buildType == Project.BuildType.GRADLE) { + + if (runProjectClean == true) { + try { + String stopGradleDaemonCmd = CommandBuilder.getGradleCommandLine(projectPath, " --stop", pathEnv); + executeCommand(stopGradleDaemonCmd, projectPath); + } catch (IOException | InterruptedException e) { + Logger.logError("An attempt to stop the Gradle daemon failed...."); + } + + } + cmd = CommandBuilder.getGradleCommandLine(projectPath, + (runProjectClean == true ? " clean " : "") + "libertyDev " + startParms, pathEnv); + + } else { throw new Exception("Unexpected project build type: " + buildType + ". Project " + projectName - + "does not appear to be a Maven or Gradle built project."); + + "does not appear to be a Maven or Gradle built project."); } // Run the application in dev mode. @@ -283,11 +280,11 @@ public void start(IProject iProject, String parms, String javaHomePath, ILaunch /** * Starts the Liberty server in dev mode in a container. * - * @param iProject The project instance to associate with this action. - * @param parms The configuration parameters to be used when starting dev mode. + * @param iProject The project instance to associate with this action. + * @param parms The configuration parameters to be used when starting dev mode. * @param javaHomePath The configuration java installation home to be set in the process running dev mode. - * @param launch The launch associated with this run. - * @param mode The configuration mode. + * @param launch The launch associated with this run. + * @param mode The configuration mode. */ public void startInContainer(IProject iProject, String parms, String javaHomePath, ILaunch launch, String mode, boolean runProjectClean) { @@ -353,23 +350,23 @@ public void startInContainer(IProject iProject, String parms, String javaHomePat String cmd = ""; if (buildType == Project.BuildType.MAVEN) { cmd = CommandBuilder.getMavenCommandLine(projectPath, (runProjectClean == true ? " clean " : "") + "io.openliberty.tools:liberty-maven-plugin:devc " + startParms, - pathEnv); - } else if (buildType == Project.BuildType.GRADLE) { - if (runProjectClean == true) { - try { - - String stopGradleDaemonCmd = CommandBuilder.getGradleCommandLine(projectPath, " --stop", - pathEnv); - executeCommand(stopGradleDaemonCmd, projectPath); - } catch (IOException | InterruptedException e) { - Logger.logError("An attempt to stop the Gradle daemon failed...."); - } - } - cmd = CommandBuilder.getGradleCommandLine(projectPath, - (runProjectClean == true ? " clean " : "") + "libertyDevc " + startParms, pathEnv); - } else { + pathEnv); + } else if (buildType == Project.BuildType.GRADLE) { + if (runProjectClean == true) { + try { + + String stopGradleDaemonCmd = CommandBuilder.getGradleCommandLine(projectPath, " --stop", + pathEnv); + executeCommand(stopGradleDaemonCmd, projectPath); + } catch (IOException | InterruptedException e) { + Logger.logError("An attempt to stop the Gradle daemon failed...."); + } + } + cmd = CommandBuilder.getGradleCommandLine(projectPath, + (runProjectClean == true ? " clean " : "") + "libertyDevc " + startParms, pathEnv); + } else { throw new Exception("Unexpected project build type: " + buildType + ". Project " + projectName - + "does not appear to be a Maven or Gradle built project."); + + "does not appear to be a Maven or Gradle built project."); } // Run the application in dev mode. @@ -421,9 +418,9 @@ public void stop(IProject inputProject) { String projectName = iProject.getName(); Project project = projectModel.getProject(projectName); - + if (project != null) { - Utils.reEnableAppMonitoring(project); + Utils.reEnableAppMonitoring(project); } // Check if the stop action has already been issued of if a start action was never issued before. @@ -488,7 +485,7 @@ public void runTests(IProject inputProject) { // Check if the stop action has already been issued of if a start action was never issued before. if (!processController.isProcessStarted(projectName)) { String msg = "No start request was issued first or the stop request was already issued on project " + projectName - + ". Issue a start request before you issue the run tests request."; + + ". Issue a start request before you issue the run tests request."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. ProcessController: " + processController); } @@ -564,7 +561,7 @@ public void openMavenIntegrationTestReport(IProject inputProject) { } } catch (Exception e) { String msg = "An error was detected when the view integration test report request was processed on project " + projectName - + "."; + + "."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg, e); } @@ -686,16 +683,16 @@ public void openGradleTestReport(IProject inputProject) { Path path = getGradleTestReportPath(projectPath); if (!path.toFile().exists()) { String msg = "No test results were found for project " + projectName + ". Select \"" - + DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \"" - + DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT + "\" on the menu."; + + DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \"" + + DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT + "\" on the menu."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Path: " + path); } - ErrorHandler - .processErrorMessage( - NLS.bind(Messages.gradle_test_report_none_found, new String[] { projectName, - DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT }), - true); + ErrorHandler.processErrorMessage( + NLS.bind(Messages.gradle_test_report_none_found, new String[] { projectName, + DashboardView.APP_MENU_ACTION_RUN_TESTS, + DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT }), + true); return; } @@ -720,10 +717,10 @@ public void openGradleTestReport(IProject inputProject) { * Opens the specified report in a browser. * * @param projectName The application project name. - * @param path The path to the HTML report file. - * @param browserId The Id to use for the browser display. - * @param name The name to use for the browser display. - * @param toolTip The tool tip to use for the browser display. + * @param path The path to the HTML report file. + * @param browserId The Id to use for the browser display. + * @param name The name to use for the browser display. + * @param toolTip The tool tip to use for the browser display. * * @throws Exception If an error occurs while displaying the test report. */ @@ -733,7 +730,7 @@ public void openTestReport(String projectName, Path path, String browserId, Stri IWebBrowser browser = null; if (bSupport.isInternalWebBrowserAvailable()) { browser = bSupport.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.LOCATION_BAR - | IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS, browserId, name, toolTip); + | IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS, browserId, name, toolTip); } else { browser = bSupport.createBrowser(browserId); } @@ -744,7 +741,7 @@ public void openTestReport(String projectName, Path path, String browserId, Stri /** * Runs the specified command. * - * @param cmd The command to run. + * @param cmd The command to run. * @param projectName The name of the project currently being processed. * @param projectPath The project's path. * @@ -778,7 +775,7 @@ public void startDevMode(String cmd, String projectName, String projectPath, Str * for the specified project. * * @param projectName The name of the project for which the the Liberty plugin stop command is issued. - * @param baseMsg The base message to display. + * @param baseMsg The base message to display. */ private void handleStopActionError(String projectName, String baseMsg) { String stopPromptMsg = NLS.bind(Messages.issue_stop_prompt, null); @@ -827,7 +824,7 @@ private void issueLPStopCommand(String projectName) { buildTypeName = "Gradle"; } else { throw new Exception("Unexpected project build type: " + buildType + ". Project " + projectName - + "does not appear to be a Maven or Gradle built project."); + + "does not appear to be a Maven or Gradle built project."); } // Issue the command. @@ -906,12 +903,12 @@ public void done(IJobChangeEvent event) { public void run() { String msg = "The Liberty Maven or Gradle stop command issued for project " + projectName - + " timed out after " + STOP_TIMEOUT_SECONDS + " seconds."; + + " timed out after " + STOP_TIMEOUT_SECONDS + " seconds."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg); } ErrorHandler.rawErrorMessageDialog(NLS.bind(Messages.plugin_stop_timeout, - new String[] { projectName, Integer.toString(STOP_TIMEOUT_SECONDS) })); + new String[] { projectName, Integer.toString(STOP_TIMEOUT_SECONDS) })); } }); return; @@ -967,28 +964,29 @@ public static Path getMavenIntegrationTestReportPath(String projectPath, String if (!path1.toFile().exists() && !path2.toFile().exists()) { String msg = "No integration test results were found for project " + projectName + ". Select \"" - + DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \"" - + DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT + "\" on the menu."; + + DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \"" + + DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT + "\" on the menu."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Paths checked: " + path1 + ", " + path2); } ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_int_test_report_none_found, new String[] { projectName, - DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT }), true); + DashboardView.APP_MENU_ACTION_RUN_TESTS, + DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT }), + true); return null; } return path1.toFile().exists() ? path1 : path2; } - public Path getLibertyPluginConfigXmlPath(Project project) throws Exception { - + public Path getLibertyPluginConfigXmlPath(Project project) throws Exception { + Project serverProj = getLibertyServerProject(project); String buildDir = serverProj.getBuildType() == BuildType.GRADLE ? "build" : "target"; - + Path path = Paths.get(serverProj.getPath(), buildDir, "liberty-plugin-config.xml"); return path; } - /** * Returns the liberty server module project associated with the input project. @@ -1028,13 +1026,15 @@ public static Path getMavenUnitTestReportPath(String projectPath, String project if (!path1.toFile().exists() && !path2.toFile().exists()) { String msg = "No unit test results were found for project " + projectName + ". Select \"" - + DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \"" - + DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT + "\" on the menu."; + + DashboardView.APP_MENU_ACTION_RUN_TESTS + "\" before you select \"" + + DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT + "\" on the menu."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, msg + " No-op. Paths checked: " + path1 + ", " + path2); } ErrorHandler.processErrorMessage(NLS.bind(Messages.mvn_unit_test_report_none_found, new String[] { projectName, - DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }), true); + DashboardView.APP_MENU_ACTION_RUN_TESTS, + DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }), + true); return null; } @@ -1134,15 +1134,16 @@ public boolean isProjectStarted(String projectName) { } public void restartServer(String projectName) { - String restartCommand = "r"; - try { - processController.writeToProcessStream(projectName, restartCommand); - } catch (Exception e) { - if (Trace.isEnabled()) { - Trace.getTracer().trace(Trace.TRACE_TOOLS, "An error was detected during the restart server." + projectName, e); - } - } + String restartCommand = "r"; + try { + processController.writeToProcessStream(projectName, restartCommand); + } catch (Exception e) { + if (Trace.isEnabled()) { + Trace.getTracer().trace(Trace.TRACE_TOOLS, "An error was detected during the restart server." + projectName, e); + } + } } + /** * Refreshes the dashboard view. */ @@ -1159,17 +1160,16 @@ public void cancelRunningJobs() { // Cancel will remove job from 'runningJobs' Map runningJobs.keySet().forEach(j -> j.cancel()); } - - public void executeCommand(String fullCommand, String projectPath) throws IOException, InterruptedException { - // Split the full command into individual arguments - List command = Arrays.asList(fullCommand.trim().split("\\s+")); + public void executeCommand(String fullCommand, String projectPath) throws IOException, InterruptedException { + // Split the full command into individual arguments + List command = Arrays.asList(fullCommand.trim().split("\\s+")); - ProcessBuilder builder = new ProcessBuilder(command); - builder.directory(new File(projectPath)); // Set working directory + ProcessBuilder builder = new ProcessBuilder(command); + builder.directory(new File(projectPath)); // Set working directory - Process process = builder.start(); - process.waitFor(); - } + Process process = builder.start(); + process.waitFor(); + } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/LibertyResourceChangeListener.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/LibertyResourceChangeListener.java index c7da9ca2..8ae883a6 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/LibertyResourceChangeListener.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/LibertyResourceChangeListener.java @@ -60,34 +60,34 @@ public void run() { int updateFlag = resourceChanged.getFlags(); switch (resourceChanged.getKind()) { - // Project opened/closed. - // Flag OPEN (16384): "Change constant (bit mask) indicating that the resource was opened or closed" - // Flag 147456: Although IResourceDelta does not have a predefined constant, this flag value is used to - // denote open/close actions. - case IResourceDelta.CHANGED: - if (updateFlag == IResourceDelta.OPEN || updateFlag == 147456) { - refreshNeeded = true; - } - break; - // Project created/imported. - // Flag OPEN (16384): "This flag is ... set when the project did not exist in the "before" state." - // Flag 147456: Although IResourceDelta does not have a predefined constant, this flag - // value is set when a project, that previously did not exist, is created. - case IResourceDelta.ADDED: - if (project == null && (updateFlag == IResourceDelta.OPEN || updateFlag == 147456)) { - refreshNeeded = true; - } - break; - // Project deleted. - // Flag NO_CHANGE (0). - // Flag MARKERS (130172). - case IResourceDelta.REMOVED: - if (project != null && (updateFlag == IResourceDelta.NO_CHANGE || updateFlag == IResourceDelta.MARKERS)) { - refreshNeeded = true; - } - break; - default: - break; + // Project opened/closed. + // Flag OPEN (16384): "Change constant (bit mask) indicating that the resource was opened or closed" + // Flag 147456: Although IResourceDelta does not have a predefined constant, this flag value is used to + // denote open/close actions. + case IResourceDelta.CHANGED: + if (updateFlag == IResourceDelta.OPEN || updateFlag == 147456) { + refreshNeeded = true; + } + break; + // Project created/imported. + // Flag OPEN (16384): "This flag is ... set when the project did not exist in the "before" state." + // Flag 147456: Although IResourceDelta does not have a predefined constant, this flag + // value is set when a project, that previously did not exist, is created. + case IResourceDelta.ADDED: + if (project == null && (updateFlag == IResourceDelta.OPEN || updateFlag == 147456)) { + refreshNeeded = true; + } + break; + // Project deleted. + // Flag NO_CHANGE (0). + // Flag MARKERS (130172). + case IResourceDelta.REMOVED: + if (project != null && (updateFlag == IResourceDelta.NO_CHANGE || updateFlag == IResourceDelta.MARKERS)) { + refreshNeeded = true; + } + break; + default: + break; } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java index 23f309c0..b522333a 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/Project.java @@ -89,7 +89,7 @@ public boolean hasLibertyNature() { } catch (Exception e) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, - "An error occurred while attempting to find the nature of project " + iProject.getName(), e); + "An error occurred while attempting to find the nature of project " + iProject.getName(), e); } return false; } @@ -120,7 +120,7 @@ private BuildType findBuildType() { } catch (Exception e) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, - "An error occurred while attempting to find the nature of project " + iProject.getName(), e); + "An error occurred while attempting to find the nature of project " + iProject.getName(), e); } } @@ -299,7 +299,7 @@ public void classifyAsLibertyNature() { /** * Adds the specified nature ID to the project's description/metadata (.project). * - * @param project The project to process. + * @param project The project to process. * @param natureId The nature ID to add. * * @throws Exception @@ -331,7 +331,7 @@ public static void addNature(IProject project, String natureId) throws Exception /** * Removes the specified nature ID from the project's description/metadata (.project). * - * @param project The project to process. + * @param project The project to process. * @param natureId The nature ID to remove. * * @throws Exception @@ -403,9 +403,9 @@ private String formatChildProjectToString() { @Override public String toString() { return "IProject: " + iProject.toString() + ". BuildType: " + type + ". Liberty Server Module: " + libertyServerModule - + ". isParentOfServerModule:" + isParentOfServerModule + ". parentDirProj: " - + (parentDirProject != null ? parentDirProject.getName() : " ") + ". childDirProjects: " - + formatChildProjectToString() + ";"; + + ". isParentOfServerModule:" + isParentOfServerModule + ". parentDirProj: " + + (parentDirProject != null ? parentDirProject.getName() : " ") + ". childDirProjects: " + + formatChildProjectToString() + ";"; } public boolean isLibertyServerModule() { diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java index 650eec93..1470a190 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/WorkspaceProjectsModel.java @@ -85,7 +85,7 @@ private void initProjectModels() { /** * @param projectsToScan Projects to include in model update - * @param classify Whether to classify + * @param classify Whether to classify */ private void buildMultiProjectModel(List projectsToScan, boolean classify) { @@ -205,7 +205,7 @@ public List getSortedDashboardProjectList() { } else { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_TOOLS, - "Project " + p.getIProject().getName() + " could not be identified as being a Maven or Gradle project."); + "Project " + p.getIProject().getName() + " could not be identified as being a Maven or Gradle project."); } } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java index 09e7d261..61539bd0 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/DebugModeHandler.java @@ -106,8 +106,8 @@ public DebugModeHandler(DevModeOperations devModeOps) { /** * Returns the input configuration parameters with the debug port argument appended. * - * @param project The project associated with this call. - * @param debugPort The debug port to add to the config parameters. + * @param project The project associated with this call. + * @param debugPort The debug port to add to the config parameters. * @param configParms The input parameters from the Run configuration's dialog. * * @return The input configuration parameters with the debug port argument appended. @@ -134,7 +134,7 @@ public String addDebugDataToStartParms(Project project, String debugPort, String } } else { throw new Exception("Unexpected project build type: " + buildType + ". Project" + project.getIProject().getName() - + "does not appear to be a Maven or Gradle built project."); + + "does not appear to be a Maven or Gradle built project."); } } @@ -154,7 +154,7 @@ public String addDebugDataToStartParms(Project project, String debugPort, String /** * Determines and returns the debug port to be used. * - * @param project The project + * @param project The project * @param inputParms * * @return The debug port to be used. @@ -176,7 +176,7 @@ public String calculateDebugPort(Project project, String inputParms) throws Exce searchKey = GRADLE_DEVMODE_DEBUG_PORT_PARM; } else { throw new Exception("Unexpected project build type: " + buildType + ". Project " + project.getIProject().getName() - + "does not appear to be a Maven or Gradle built project."); + + "does not appear to be a Maven or Gradle built project."); } if (inputParms.contains(searchKey)) { @@ -209,8 +209,8 @@ public String calculateDebugPort(Project project, String inputParms) throws Exce /** * Starts the job that will attempt to connect the debugger with the server's JVM. * - * @param project The project for which the debugger needs to be attached. - * @param launch The launch to which the debug target will be added. + * @param project The project for which the debugger needs to be attached. + * @param launch The launch to which the debug target will be added. * @param debugPort The debug port to use to attach the debugger to. * * @throws Exception @@ -275,14 +275,13 @@ protected IStatus run(IProgressMonitor monitor) { Map map = connector.defaultArguments(); configureConnector(map, DEFAULT_ATTACH_HOST, Integer.parseInt(portToConnect)); IDebugTarget debugTarget = createRemoteJDTDebugTarget(launch, Integer.parseInt(portToConnect), - DEFAULT_ATTACH_HOST, - connector, map); + DEFAULT_ATTACH_HOST, + connector, map); launch.addDebugTarget(debugTarget); } catch (Exception e) { - return new Status(IStatus.ERROR, LibertyDevPlugin.PLUGIN_ID, JOB_STATUS_DEBUGGER_CONN_ERROR, - "An error was detected while attaching the debugger to the JVM.", e); + return new Status(IStatus.ERROR, LibertyDevPlugin.PLUGIN_ID, JOB_STATUS_DEBUGGER_CONN_ERROR, "An error was detected while attaching the debugger to the JVM.", e); } return Status.OK_STATUS; @@ -335,8 +334,8 @@ private AttachingConnector getAttachingConnector() { /** * Configure the connector properties. * - * @param map argument map - * @param host the host name or IP address + * @param map argument map + * @param host the host name or IP address * @param portNumber the port number */ private void configureConnector(Map map, String host, int portNumber) { @@ -352,16 +351,16 @@ private void configureConnector(Map map, String host, int port Connector.IntegerArgument timeoutArg = (Connector.IntegerArgument) map.get("timeout"); if (timeoutArg != null) { int timeout = Platform.getPreferencesService().getInt( - "org.eclipse.jdt.launching", - JavaRuntime.PREF_CONNECT_TIMEOUT, - JavaRuntime.DEF_CONNECT_TIMEOUT, - null); + "org.eclipse.jdt.launching", + JavaRuntime.PREF_CONNECT_TIMEOUT, + JavaRuntime.DEF_CONNECT_TIMEOUT, + null); timeoutArg.setValue(timeout); } } private IDebugTarget createRemoteJDTDebugTarget(ILaunch launch, int remoteDebugPortNum, String hostName, - AttachingConnector connector, Map map) throws CoreException { + AttachingConnector connector, Map map) throws CoreException { if (launch == null || hostName == null || hostName.length() == 0) { return null; } @@ -373,8 +372,7 @@ private IDebugTarget createRemoteJDTDebugTarget(ILaunch launch, int remoteDebugP ex = e; } if (remoteVM == null) { - throw new CoreException( - new Status(IStatus.ERROR, this.getClass(), IJavaLaunchConfigurationConstants.ERR_CONNECTION_FAILED, "", ex)); + throw new CoreException(new Status(IStatus.ERROR, this.getClass(), IJavaLaunchConfigurationConstants.ERR_CONNECTION_FAILED, "", ex)); } LibertyDebugTarget libertyDebugTarget = new LibertyDebugTarget(launch, remoteVM, hostName + ":" + remoteDebugPortNum); @@ -413,7 +411,7 @@ private VirtualMachine attachJVM(String hostName, int port, AttachingConnector c } catch (IOException e) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, - "Error occured while trying to connect to the remote virtual machine " + e.getMessage(), e); + "Error occured while trying to connect to the remote virtual machine " + e.getMessage(), e); } } catch (TimeoutException e2) { // do nothing @@ -486,8 +484,6 @@ private void openDebugPerspective() { */ private Path getServerEnvFile(Project project) throws Exception { - - Path libertyPluginConfigXmlPath = devModeOps.getLibertyPluginConfigXmlPath(project); // Read server.env path from liberty-plugin-config.xml @@ -553,8 +549,8 @@ public String readDebugPortFromServerEnv(Path serverEnv) throws Exception { /** * Waits for the JDWP socket on the JVM to start listening for connections. * - * @param host The host to connect to. - * @param port The port to connect to. + * @param host The host to connect to. + * @param port The port to connect to. * @param monitor The progress monitor instance. * * @returns The port that the debugger actually connected to. @@ -594,10 +590,9 @@ private String waitForSocketActivation(Project project, String host, String port } throw new Exception("Timed out trying to attach the debugger to JVM on host: " + host + " and port: " + port - + ". If the server starts later you might try to manually connect the debugger from the launch in the Debug view You can confirm the debug port used in the console output looking for a message like 'Liberty debug port: [ 63624 ]'."); + + ". If the server starts later you might try to manually connect the debugger from the launch in the Debug view You can confirm the debug port used in the console output looking for a message like 'Liberty debug port: [ 63624 ]'."); } - private class DataHolder { boolean started; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java index 5398636e..75aaf8a2 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugReconnectHandler.java @@ -73,8 +73,7 @@ public boolean isEnabled() { public Object execute(ExecutionEvent event) throws ExecutionException { Object target = null; - ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event) - .getActivePage().getSelection(); + ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); if (selection != null & selection instanceof IStructuredSelection) { IStructuredSelection strucSelection = (IStructuredSelection) selection; Object[] elements = strucSelection.toArray(); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceErrorDialog.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceErrorDialog.java index 4a712447..2d72ebfd 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceErrorDialog.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceErrorDialog.java @@ -42,7 +42,7 @@ public class LibertyHotCodeReplaceErrorDialog extends HotCodeReplaceErrorDialog { public LibertyHotCodeReplaceErrorDialog(Shell parentShell, String dialogTitle, String message, IStatus status, String preferenceKey, - String toggleMessage1, String toggleMessage2, IPreferenceStore store, IDebugTarget target) { + String toggleMessage1, String toggleMessage2, IPreferenceStore store, IDebugTarget target) { super(parentShell, dialogTitle, message, status, preferenceKey, toggleMessage1, toggleMessage2, store, target); } @@ -58,6 +58,7 @@ protected void createButtonsForButtonBar(Composite parent) { /* * (non-Javadoc) + * * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int) */ @Override diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceListener.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceListener.java index 3d78c742..d1196d65 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceListener.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyHotCodeReplaceListener.java @@ -57,10 +57,10 @@ public void hotCodeReplaceSucceeded(IJavaDebugTarget target) { @Override public void hotCodeReplaceFailed(final IJavaDebugTarget target, final DebugException exception) { if ((exception != null - && !JDIDebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IJDIPreferencesConstants.PREF_ALERT_HCR_FAILED)) || - ((exception == null) && !JDIDebugUIPlugin.getDefault().getPreferenceStore() - .getBoolean(IJDIPreferencesConstants.PREF_ALERT_HCR_NOT_SUPPORTED)) - || checkFailurePopUpPref(target)) { + && !JDIDebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IJDIPreferencesConstants.PREF_ALERT_HCR_FAILED)) + || + ((exception == null) && !JDIDebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IJDIPreferencesConstants.PREF_ALERT_HCR_NOT_SUPPORTED)) + || checkFailurePopUpPref(target)) { return; } @@ -91,20 +91,18 @@ public void hotCodeReplaceFailed(final IJavaDebugTarget target, final DebugExcep ILaunchConfiguration config = target.getLaunch().getLaunchConfiguration(); final String launchName = (config != null ? config.getName() : DebugUIMessages.JavaHotCodeReplaceListener_0); if (exception == null) { - status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, - DebugUIMessages.JDIDebugUIPlugin_The_target_VM_does_not_support_hot_code_replace_1, null); + status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, DebugUIMessages.JDIDebugUIPlugin_The_target_VM_does_not_support_hot_code_replace_1, null); preference = IJDIPreferencesConstants.PREF_ALERT_HCR_NOT_SUPPORTED; alertMessage = DebugUIMessages.JDIDebugUIPlugin_3; } else { - status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, exception.getMessage(), - exception.getCause()); + status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, exception.getMessage(), exception.getCause()); preference = IJDIPreferencesConstants.PREF_ALERT_HCR_FAILED; alertMessage = DebugUIMessages.JDIDebugUIPlugin_1; } final String title = DebugUIMessages.JDIDebugUIPlugin_Hot_code_replace_failed_1; final String message = NLS.bind( - DebugUIMessages.JDIDebugUIPlugin__0__was_unable_to_replace_the_running_code_with_the_code_in_the_workspace__2, - new Object[] { vmName, launchName }); + DebugUIMessages.JDIDebugUIPlugin__0__was_unable_to_replace_the_running_code_with_the_code_in_the_workspace__2, + new Object[] { vmName, launchName }); display.asyncExec(new Runnable() { @Override public void run() { @@ -118,9 +116,7 @@ public void run() { } } Shell shell = JDIDebugUIPlugin.getActiveWorkbenchShell(); - fHotCodeReplaceFailedErrorDialog = new LibertyHotCodeReplaceErrorDialog(shell, title, message, status, preference, - alertMessage, - toggleMessage, JDIDebugUIPlugin.getDefault().getPreferenceStore(), target) { + fHotCodeReplaceFailedErrorDialog = new LibertyHotCodeReplaceErrorDialog(shell, title, message, status, preference, alertMessage, toggleMessage, JDIDebugUIPlugin.getDefault().getPreferenceStore(), target) { @Override public boolean close() { fHotCodeReplaceFailedErrorDialog = null; @@ -139,7 +135,7 @@ public boolean close() { @Override public void obsoleteMethods(final IJavaDebugTarget target) { if (!JDIDebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IJDIPreferencesConstants.PREF_ALERT_OBSOLETE_METHODS) - || checkFailurePopUpPref(target)) { + || checkFailurePopUpPref(target)) { return; } final Display display = JDIDebugUIPlugin.getStandardDisplay(); @@ -149,8 +145,7 @@ public void obsoleteMethods(final IJavaDebugTarget target) { final String vmName = fLabelProvider.getText(target); final String dialogTitle = DebugUIMessages.JDIDebugUIPlugin_Obsolete_methods_remain_1; final String message = NLS.bind(DebugUIMessages.JDIDebugUIPlugin__0__contains_obsolete_methods_1, new Object[] { vmName }); - final IStatus status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, - DebugUIMessages.JDIDebugUIPlugin_Stepping_may_be_hazardous_1, null); + final IStatus status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, DebugUIMessages.JDIDebugUIPlugin_Stepping_may_be_hazardous_1, null); final String toggleMessage = DebugUIMessages.JDIDebugUIPlugin_2; final String toggleMessage2 = DebugUIMessages.JDIDebugUIPlugin_5; display.asyncExec(new Runnable() { @@ -160,9 +155,7 @@ public void run() { return; } Shell shell = JDIDebugUIPlugin.getActiveWorkbenchShell(); - LibertyHotCodeReplaceErrorDialog dialog = new LibertyHotCodeReplaceErrorDialog(shell, dialogTitle, message, status, - IJDIPreferencesConstants.PREF_ALERT_OBSOLETE_METHODS, toggleMessage, toggleMessage2, - JDIDebugUIPlugin.getDefault().getPreferenceStore(), target); + LibertyHotCodeReplaceErrorDialog dialog = new LibertyHotCodeReplaceErrorDialog(shell, dialogTitle, message, status, IJDIPreferencesConstants.PREF_ALERT_OBSOLETE_METHODS, toggleMessage, toggleMessage2, JDIDebugUIPlugin.getDefault().getPreferenceStore(), target); dialog.setBlockOnOpen(false); dialog.open(); } @@ -173,7 +166,7 @@ public void run() { * Check whether user has enabled or disabled HCR failure error pop up for current debug session * * @param target - * IJavaDebugTarget of current debugging session + * IJavaDebugTarget of current debugging session * * @return false if user wishes to see failure pop up, else true if user don't want see pop up */ diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertySourcePathComputer.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertySourcePathComputer.java index 3b88ed7f..af809e54 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertySourcePathComputer.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertySourcePathComputer.java @@ -49,10 +49,10 @@ public class LibertySourcePathComputer implements ISourcePathComputerDelegate { /** * Gradle distribution that supports Java 21. - * Gradle version 8.4+ supports Java 21. + * Gradle version 8.4+ supports Java 21. */ private static String GRADLE_DISTRIBUTION_VERISION = "8.8"; - + ArrayList unresolvedClasspathEntries; @Override @@ -100,7 +100,8 @@ public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configura // Resolve and get final list of source containers IRuntimeClasspathEntry[] resolvedClasspathDependencies = JavaRuntime.resolveSourceLookupPath( - unresolvedClasspathEntries.toArray(new IRuntimeClasspathEntry[unresolvedClasspathEntries.size()]), configuration); + unresolvedClasspathEntries.toArray(new IRuntimeClasspathEntry[unresolvedClasspathEntries.size()]), + configuration); ArrayList containersList = new ArrayList(); @@ -129,7 +130,7 @@ private List getProjectDependencies(Project project) throws CoreExcept if (project.getBuildType() == Project.BuildType.MAVEN) { MavenProject mavenModuleProject = MavenPlugin.getMavenModelManager().readMavenProject(project.getIProject().getFile("pom.xml"), - new NullProgressMonitor()); + new NullProgressMonitor()); Set artifacts = mavenModuleProject.getArtifacts(); for (Artifact artifact : artifacts) { @@ -147,7 +148,7 @@ private List getProjectDependencies(Project project) throws CoreExcept try { eclipseProject = connection.getModel(EclipseProject.class); - } catch(BuildException e) { + } catch (BuildException e) { // When using Eclipse IDE 2024-06, this exception could have been caused by the // Gradle tooling API using a Gradle distribution that does not support Java 21. // @@ -163,12 +164,12 @@ private List getProjectDependencies(Project project) throws CoreExcept // provided by the tooling API, setting the version can be revised at a later time. Throwable rootCause = Utils.findRootCause(e); if (rootCause != null && rootCause instanceof IllegalArgumentException) { - String message = rootCause.getMessage(); - - if (message != null && message.contains("Unsupported class file major version 65")) { - connection = getProjectGradleConnection(project.getIProject(), GRADLE_DISTRIBUTION_VERISION); - eclipseProject = connection.getModel(EclipseProject.class); - } + String message = rootCause.getMessage(); + + if (message != null && message.contains("Unsupported class file major version 65")) { + connection = getProjectGradleConnection(project.getIProject(), GRADLE_DISTRIBUTION_VERISION); + eclipseProject = connection.getModel(EclipseProject.class); + } } else { throw e; } @@ -179,7 +180,7 @@ private List getProjectDependencies(Project project) throws CoreExcept GradleModuleVersion gradleModuleVersion = externalDependency.getGradleModuleVersion(); IProject localProject = getLocalProject(gradleModuleVersion.getGroup(), gradleModuleVersion.getName(), - gradleModuleVersion.getVersion()); + gradleModuleVersion.getVersion()); if (localProject != null) { projectDependencies.add(localProject); } @@ -195,9 +196,9 @@ private List getProjectDependencies(Project project) throws CoreExcept /** * Returns a connection to the input gradle project. * - * @param project The Gradle project. + * @param project The Gradle project. * @param gradleDistVersion The gradle distribution version to be used by the - * Gradle API tooling. + * Gradle API tooling. * * @return A connection to the input gradle project. */ @@ -248,8 +249,7 @@ private void addRuntimeDependencies(IProject project) throws CoreException { // If the project is a java project, get classpath entries for runtime dependencies if (project.isNatureEnabled(JavaCore.NATURE_ID)) { - List runtimeDependencies = Arrays - .asList(JavaRuntime.computeUnresolvedRuntimeClasspath(JavaCore.create(project))); + List runtimeDependencies = Arrays.asList(JavaRuntime.computeUnresolvedRuntimeClasspath(JavaCore.create(project))); for (IRuntimeClasspathEntry runtimeDependency : runtimeDependencies) { if (!unresolvedClasspathEntries.contains(runtimeDependency)) { unresolvedClasspathEntries.add(runtimeDependency); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java index 49d50b0d..6bdfb2b4 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/handlers/ExplorerMenuHandler.java @@ -106,7 +106,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { } ErrorHandler.processErrorMessage( - NLS.bind(Messages.menu_command_process_error, new String[] { commandName, iProject.getName() }), e); + NLS.bind(Messages.menu_command_process_error, new String[] { commandName, iProject.getName() }), e); } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/logging/Logger.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/logging/Logger.java index 210b1358..e11b67ab 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/logging/Logger.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/logging/Logger.java @@ -43,7 +43,7 @@ public static void logError(String msg) { * Writes an error message and throwable to the log. * * @param msg The message to write. - * @param t The throwable to write. + * @param t The throwable to write. */ public static void logError(String msg, Throwable t) { LOGGER.log(new Status(Status.ERROR, BUNDLE.getSymbolicName(), msg, t)); @@ -62,7 +62,7 @@ public static void logWarning(String msg) { * Writes an error message and throwable to the log. * * @param msg The message to write. - * @param t The throwable to write. + * @param t The throwable to write. */ public static void logWarning(String msg, Throwable t) { LOGGER.log(new Status(Status.WARNING, BUNDLE.getSymbolicName(), msg, t)); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/LibertyDebugEventListener.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/LibertyDebugEventListener.java index 00271318..54bf9039 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/LibertyDebugEventListener.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/LibertyDebugEventListener.java @@ -32,31 +32,31 @@ public void handleDebugEvents(DebugEvent[] events) { if (projectName.equals(iProcess.getLabel())) { // We match - cleanup Project project = devModeOps.getProjectModel().getProject(projectName); - + if (project != null) { - Utils.reEnableAppMonitoring(project); + Utils.reEnableAppMonitoring(project); } devModeOps.cleanupProcess(projectName); DebugPlugin.getDefault().removeDebugEventListener(this); } } else if (events[i].getKind() == DebugEvent.CHANGE && source instanceof IDebugTarget) { - IDebugTarget target = (IDebugTarget) source; - if (target.isDisconnected()) { - ILaunch launch = target.getLaunch(); - if (launch != null) { - IProcess[] processes = launch.getProcesses(); - if (processes.length > 0) { - String label = processes[0].getLabel(); - if (projectName.equals(label)) { - Project project = devModeOps.getProjectModel().getProject(projectName); - if (project != null) { - Utils.reEnableAppMonitoring(project); - } - } - } - } - } - } + IDebugTarget target = (IDebugTarget) source; + if (target.isDisconnected()) { + ILaunch launch = target.getLaunch(); + if (launch != null) { + IProcess[] processes = launch.getProcesses(); + if (processes.length > 0) { + String label = processes[0].getLabel(); + if (projectName.equals(label)) { + Project project = devModeOps.getProjectModel().getProject(projectName); + if (project != null) { + Utils.reEnableAppMonitoring(project); + } + } + } + } + } + } } } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java index 8f8bf392..9db01358 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/process/ProcessController.java @@ -60,13 +60,12 @@ public static ProcessController getInstance() { * * @param projectName The application project name. * @param projectPath The application project path. - * @param command The command to execute. - * @param envs The environment properties to be set for the process. + * @param command The command to execute. + * @param envs The environment properties to be set for the process. * * @throws IOException */ - public Process runProcess(String projectName, String projectPath, String command, List envs, boolean printCmd) - throws IOException { + public Process runProcess(String projectName, String projectPath, String command, List envs, boolean printCmd) throws IOException { List commandList = new ArrayList(); @@ -125,7 +124,7 @@ private void addTerminateListener(String projectName) { * Writes the input data to the running process associated with the input project name. * * @param projectName The application project name. - * @param content The data to write. + * @param content The data to write. * * @throws Exception */ @@ -134,7 +133,7 @@ public void writeToProcessStream(String projectName, String data) throws Excepti if (process == null) { String msg = "Unable to write to the process associated with project " + projectName - + ". Internal process object not found."; + + ". Internal process object not found."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg + ". Data to write: " + new String(data)); } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java index 0cb85faf..797ebcc9 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/dashboard/DashboardView.java @@ -227,8 +227,7 @@ private void createActions() { // Get the image descriptors for the menu actions and toolbar. // If there is a failure, display the error and proceed without the icons. try { - ActionImg = ImageDescriptor - .createFromURL(new URL("platform:/plugin/org.eclipse.jdt.debug.ui/icons/full/elcl16/thread_view.gif")); + ActionImg = ImageDescriptor.createFromURL(new URL("platform:/plugin/org.eclipse.jdt.debug.ui/icons/full/elcl16/thread_view.gif")); refreshImg = ImageDescriptor.createFromURL(new URL("platform:/plugin/org.eclipse.ui.browser/icons/clcl16/nav_refresh.png")); } catch (Exception e) { String msg = "An error was detected while retrieving image descriptions."; @@ -278,7 +277,7 @@ public void run() { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_START_CONFIG), e, - true); + true); } } }; @@ -296,7 +295,7 @@ public void run() { StartInContainerAction.run(iProject, ILaunchManager.RUN_MODE); } catch (Exception e) { String msg = "An error was detected during the " + APP_MENU_ACTION_START_IN_CONTAINER - + " action."; + + " action."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } @@ -318,7 +317,7 @@ public void run() { StartInContainerAction.run(iProject, ILaunchManager.DEBUG_MODE); } catch (Exception e) { String msg = "An error was detected during the " + APP_MENU_ACTION_DEBUG_IN_CONTAINER - + " action."; + + " action."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } @@ -425,7 +424,7 @@ public void run() { OpenMavenITestReportAction.run(iProject); } catch (Exception e) { String msg = "An error was detected during the " + APP_MENU_ACTION_VIEW_MVN_IT_REPORT - + " action."; + + " action."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } @@ -447,7 +446,7 @@ public void run() { OpenMavenUTestReportAction.run(iProject); } catch (Exception e) { String msg = "An error was detected during the " + APP_MENU_ACTION_VIEW_MVN_UT_REPORT - + " action."; + + " action."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } @@ -469,12 +468,12 @@ public void run() { OpenGradleTestReportAction.run(iProject); } catch (Exception e) { String msg = "An error was detected during the " + APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT - + " action."; + + " action."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage(NLS.bind(Messages.action_general_error, APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT), e, - true); + true); } } }; diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java index 2af7296c..3acc6433 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/JRETab.java @@ -81,7 +81,7 @@ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { } } catch (Exception e) { ErrorHandler.processWarningMessage( - NLS.bind(Messages.java_default_set_error, new String[] { activeProject.getName(), configuration.getName() }), e); + NLS.bind(Messages.java_default_set_error, new String[] { activeProject.getName(), configuration.getName() }), e); } super.setDefaults(configuration); @@ -105,7 +105,7 @@ public static String resolveJavaHome(ILaunchConfiguration configuration) { keyValue = configWorkingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String) null); } catch (Exception e) { String msg = "Unable to resolve the Java installation path by using configuration." + configuration.getName() - + ". Using the workspace Java installation"; + + ". Using the workspace Java installation"; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigTabGroup.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigTabGroup.java index cc841f8b..eed4e1ed 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigTabGroup.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigTabGroup.java @@ -12,10 +12,10 @@ *******************************************************************************/ package io.openliberty.tools.eclipse.ui.launch; +import org.eclipse.cdt.launch.ui.CommonTabLite; import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.cdt.launch.ui.CommonTabLite; import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; /** @@ -30,4 +30,4 @@ public class LaunchConfigTabGroup extends AbstractLaunchConfigurationTabGroup { public void createTabs(ILaunchConfigurationDialog dialog, String mode) { setTabs(new ILaunchConfigurationTab[] { new StartTab(), new JRETab(), new SourceLookupTab(), new CommonTabLite() }); } -} +} \ No newline at end of file diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java index 21362152..f5d170f7 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationDelegateLauncher.java @@ -105,9 +105,9 @@ private void assertProjectsMatch(ILaunchConfiguration configuration, IProject se if (!configProjectName.equals(selectedProject.getName())) { String configurationName = configuration.getName(); String msg = "The selected Run/Debug configuration '" + configurationName - + "' cannot be used to run selected project '" + selectedProject.getName() - + ", because the configuration is associated with project '" + configProjectName - + "'. Create a new configuration, or use an existing configuration associated with the selected project."; + + "' cannot be used to run selected project '" + selectedProject.getName() + + ", because the configuration is associated with project '" + configProjectName + + "'. Create a new configuration, or use an existing configuration associated with the selected project."; throw new IllegalStateException(msg); } } @@ -122,10 +122,10 @@ private void assertProjectsMatch(ILaunchConfiguration configuration, IProject se /** * Starts dev mode * - * @param iProject The project to process. + * @param iProject The project to process. * @param iConfiguration The configuration for this start. - * @param launch The launch associated with this start - * @param mode The operation mode type. Run or debug. + * @param launch The launch associated with this start + * @param mode The operation mode type. Run or debug. * * @throws Exception */ @@ -145,8 +145,7 @@ private void launchDevMode(IProject iProject, ILaunchConfiguration iConfiguratio // If the configuration was not provided by the caller, determine what configuration to use. LaunchConfigurationHelper launchConfigHelper = LaunchConfigurationHelper.getInstance(); - ILaunchConfiguration configuration = (iConfiguration != null) ? iConfiguration - : launchConfigHelper.getLaunchConfiguration(iProject, mode, RuntimeEnv.LOCAL); + ILaunchConfiguration configuration = (iConfiguration != null) ? iConfiguration : launchConfigHelper.getLaunchConfiguration(iProject, mode, RuntimeEnv.LOCAL); // Save the time when this configuration was processed. launchConfigHelper.saveConfigProcessingTime(configuration); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationHelper.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationHelper.java index 0d0463f1..4c7d8582 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationHelper.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/LaunchConfigurationHelper.java @@ -46,11 +46,11 @@ public static LaunchConfigurationHelper getInstance() { /** * Returns the configuration to be used by the project associated with the action being processed. * - * @param iProject The project for which the configuration will be returned. It must not be null. - * @param mode The launch mode. + * @param iProject The project for which the configuration will be returned. It must not be null. + * @param mode The launch mode. * @param container The indicator of whether or not the caller is running in a container. If true, It allows multiple - * configurations associated to a single project to be filtered based on whether or not the configuration was previously - * used to run the project in a container. + * configurations associated to a single project to be filtered based on whether or not the configuration was previously + * used to run the project in a container. * * @return The configuration to be used by the project associated with the action being processed. * @@ -64,8 +64,7 @@ public ILaunchConfiguration getLaunchConfiguration(IProject iProject, String mod DevModeOperations devModeOps = DevModeOperations.getInstance(); ILaunchConfiguration configuration = null; ILaunchManager iLaunchMgr = DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfigurationType iLaunchConfigType = iLaunchMgr - .getLaunchConfigurationType(LaunchConfigurationDelegateLauncher.LAUNCH_CONFIG_TYPE_ID); + ILaunchConfigurationType iLaunchConfigType = iLaunchMgr.getLaunchConfigurationType(LaunchConfigurationDelegateLauncher.LAUNCH_CONFIG_TYPE_ID); // Find the set of configurations that were used by the currently active project last. ILaunchConfiguration[] existingConfigs = iLaunchMgr.getLaunchConfigurations(iLaunchConfigType); @@ -111,15 +110,15 @@ public ILaunchConfiguration getLaunchConfiguration(IProject iProject, String mod * Returns a filtered list of launch configurations. * * @param rawConfigList The raw list of Liberty associated launch configurations to be filtered. - * @param projectName The project name to be used as filter. - * @param container The processing type to be used as filter. + * @param projectName The project name to be used as filter. + * @param container The processing type to be used as filter. * * @return A filtered list of launch configurations. * * @throws Exception */ public List filterLaunchConfigurations(ILaunchConfiguration[] rawConfigList, String projectName, - RuntimeEnv runtimeEnv) throws Exception { + RuntimeEnv runtimeEnv) throws Exception { ArrayList matchingConfigList = new ArrayList<>(); for (ILaunchConfiguration existingConfig : rawConfigList) { String configProjName = existingConfig.getAttribute(StartTab.PROJECT_NAME, ""); @@ -176,7 +175,7 @@ public int compare(ILaunchConfiguration lc1, ILaunchConfiguration lc2) { rc = (time2 > time1) ? 1 : -1; } catch (Exception e) { String msg = "An error occurred while trying to determine which configuration ran last. Configuration list: " - + launchConfigList; + + launchConfigList; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java index 2439aa61..2826faa1 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/StartTab.java @@ -61,7 +61,7 @@ public class StartTab extends AbstractLaunchConfigurationTab { /** Configuration map key with a value stating whether or not the associated project ran in a container. */ public static final String PROJECT_RUN_IN_CONTAINER = "io.openliberty.tools.eclipse.launch.project.container.run"; - + /** Configuration map key with a value stating whether or not the associated project ran with clean option. */ public static final String PROJECT_CLEAN = "io.openliberty.tools.eclipse.launch.project.clean"; @@ -87,7 +87,7 @@ public class StartTab extends AbstractLaunchConfigurationTab { /** Holds the run in container check box. */ private Button runInContainerCheckBox; - + /** Holds the project clean check box. */ private Button projectCleanCheckBox; @@ -166,14 +166,14 @@ public void initializeFrom(ILaunchConfiguration configuration) { boolean runInContainer = configuration.getAttribute(PROJECT_RUN_IN_CONTAINER, false); runInContainerCheckBox.setSelection(runInContainer); - + boolean projectClean = configuration.getAttribute(PROJECT_CLEAN, false); projectCleanCheckBox.setSelection(projectClean); String projectName = configuration.getAttribute(PROJECT_NAME, (String) null); if (projectName == null) { super.setErrorMessage( - "A project must be selected in order to provide a context to associate the run configuration with. Either use a tree view like Package Explorer or have an editor window."); + "A project must be selected in order to provide a context to associate the run configuration with. Either use a tree view like Package Explorer or have an editor window."); } else { projectNameLabel.setText(projectName); } @@ -215,7 +215,7 @@ public boolean isValid(ILaunchConfiguration config) { if (configProjectName == null) { super.setErrorMessage( - "This Run/Debug config is corrupted and can't be used since no project was selected before creating. To create a new Run/Debug config first select a project in the Liberty dashboard, Project/Package explorer view, or via editor."); + "This Run/Debug config is corrupted and can't be used since no project was selected before creating. To create a new Run/Debug config first select a project in the Liberty dashboard, Project/Package explorer view, or via editor."); return false; } @@ -224,7 +224,7 @@ public boolean isValid(ILaunchConfiguration config) { String selectedProjectName = selectedProject.getName(); if (!configProjectName.equals(selectedProjectName)) { super.setWarningMessage( - "Must use an existing (or new) configuration associated with selected project: " + selectedProjectName); + "Must use an existing (or new) configuration associated with selected project: " + selectedProjectName); return false; } } @@ -258,18 +258,18 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) { String startParamStr = startParmText.getText(); boolean runInContainerBool = runInContainerCheckBox.getSelection(); - + boolean projectCleanBool = projectCleanCheckBox.getSelection(); configuration.setAttribute(PROJECT_RUN_IN_CONTAINER, runInContainerBool); - + configuration.setAttribute(PROJECT_CLEAN, projectCleanBool); configuration.setAttribute(PROJECT_START_PARM, startParamStr); if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, "In performApply with project name = " + projectNameLabel.getText() + ", text = " - + startParamStr + ", runInContainer = " + runInContainerBool + ", clean project = " + projectCleanBool); + + startParamStr + ", runInContainer = " + runInContainerBool + ", clean project = " + projectCleanBool); } } @@ -302,8 +302,8 @@ public void dispose() { /** * Creates a composite that will display a set of elements as a group. * - * @param parent The parent composite. - * @param groupName The title of the group to be created. + * @param parent The parent composite. + * @param groupName The title of the group to be created. * @param numColumns The number of columns of the grid layout in the composite to be created. * * @return A composite that will display a set of elements as a group. @@ -422,33 +422,33 @@ public void widgetSelected(SelectionEvent event) { Label emptyColumnLabel = new Label(parent, SWT.NONE); GridDataFactory.swtDefaults().applyTo(emptyColumnLabel); } - + /** * Creates the button entry that indicates whether or not the project should run with project clean command. * * @param parent The parent composite. */ - private void createProjectCleanButton(Composite parent) { - projectCleanCheckBox = new Button(parent, SWT.CHECK); - projectCleanCheckBox.setText("Clean project"); - projectCleanCheckBox.setSelection(false); - projectCleanCheckBox.setFont(font); - projectCleanCheckBox.addSelectionListener(new SelectionAdapter() { - - /** - * {@inheritDoc} - */ - @Override - public void widgetSelected(SelectionEvent event) { - setDirty(true); - updateLaunchConfigurationDialog(); - } - }); - GridDataFactory.swtDefaults().applyTo(projectCleanCheckBox); - - Label emptyColumnLabel = new Label(parent, SWT.NONE); - GridDataFactory.swtDefaults().applyTo(emptyColumnLabel); - } + private void createProjectCleanButton(Composite parent) { + projectCleanCheckBox = new Button(parent, SWT.CHECK); + projectCleanCheckBox.setText("Clean project"); + projectCleanCheckBox.setSelection(false); + projectCleanCheckBox.setFont(font); + projectCleanCheckBox.addSelectionListener(new SelectionAdapter() { + + /** + * {@inheritDoc} + */ + @Override + public void widgetSelected(SelectionEvent event) { + setDirty(true); + updateLaunchConfigurationDialog(); + } + }); + GridDataFactory.swtDefaults().applyTo(projectCleanCheckBox); + + Label emptyColumnLabel = new Label(parent, SWT.NONE); + GridDataFactory.swtDefaults().applyTo(emptyColumnLabel); + } /** * Returns the default start parameters. diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java index 120863ee..62480973 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java @@ -45,13 +45,13 @@ public void launch(ISelection selection, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), - e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), + e, true); return; } @@ -75,13 +75,13 @@ public void launch(IEditorPart part, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), - e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT), + e, true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java index 909acc62..01dc5313 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java @@ -45,13 +45,13 @@ public void launch(ISelection selection, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, - true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, + true); return; } @@ -75,13 +75,13 @@ public void launch(IEditorPart part, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, - true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT), e, + true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java index 30c910de..96215b5f 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java @@ -45,13 +45,13 @@ public void launch(ISelection selection, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, - true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, + true); return; } @@ -75,13 +75,13 @@ public void launch(IEditorPart part, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, - true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT), e, + true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java index 96fbcaf2..04335c62 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java @@ -45,12 +45,12 @@ public void launch(ISelection selection, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); return; } @@ -74,12 +74,12 @@ public void launch(IEditorPart part, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS), e, true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java index 647e20ed..b4158578 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java @@ -49,12 +49,12 @@ public void launch(ISelection selection, String mode) { run(iProject, mode); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); } if (Trace.isEnabled()) { @@ -77,12 +77,12 @@ public void launch(IEditorPart part, String mode) { run(iProject, mode); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START), e, true); } if (Trace.isEnabled()) { @@ -94,7 +94,7 @@ public void launch(IEditorPart part, String mode) { * Processes the start shortcut action. * * @param iProject The project to process. - * @param mode The operation mode type. Run or debug. + * @param mode The operation mode type. Run or debug. * * @throws Exception */ diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java index 0449c6ff..de55b3c7 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java @@ -59,12 +59,12 @@ public void launch(ISelection selection, String mode) { run(iProject, mode); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); return; } @@ -88,12 +88,12 @@ public void launch(IEditorPart part, String mode) { run(iProject, mode); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG), e, true); return; } @@ -106,7 +106,7 @@ public void launch(IEditorPart part, String mode) { * Processes the start... shortcut action. * * @param iProject The project to process. - * @param mode The operation mode type. Run or debug. + * @param mode The operation mode type. Run or debug. * * @throws Exception */ diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java index 6b258c51..0316a8f0 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java @@ -49,12 +49,12 @@ public void launch(ISelection selection, String mode) { run(iProject, mode); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); return; } @@ -78,12 +78,12 @@ public void launch(IEditorPart part, String mode) { run(iProject, mode); } catch (Exception e) { String msg = "An error was detected when the \"" - + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER + "\" launch shortcut was processed."; + + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER), e, true); return; } @@ -95,9 +95,9 @@ public void launch(IEditorPart part, String mode) { /** * Processes the start in container shortcut action. * - * @param iProject The project to process. + * @param iProject The project to process. * @param iConfiguration The configuration associated with the project. - * @param mode The configuration mode. + * @param mode The configuration mode. * * @throws Exception */ diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java index 1aaf3c00..e3ddab79 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java @@ -45,12 +45,12 @@ public void launch(ISelection selection, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); return; } @@ -74,12 +74,12 @@ public void launch(IEditorPart part, String mode) { run(iProject); } catch (Exception e) { String msg = "An error was detected when the \"" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP - + "\" launch shortcut was processed."; + + "\" launch shortcut was processed."; if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, msg, e); } ErrorHandler.processErrorMessage( - NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); + NLS.bind(Messages.launch_shortcut_error, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP), e, true); return; } diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java index 19b949a6..9d0791ba 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/preferences/LibertyToolsPreferencePage.java @@ -53,7 +53,7 @@ public void init(IWorkbench workbench) { // second parameter is typically the plug-in id setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, "io.openliberty.tools.eclipse.ui")); setDescription( - "Use the Browse buttons to specify the Maven and Gradle installation locations to be used for starting the application in dev mode, which will be used if no mvnw/gradlew wrapper is found."); + "Use the Browse buttons to specify the Maven and Gradle installation locations to be used for starting the application in dev mode, which will be used if no mvnw/gradlew wrapper is found."); } @Override diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/ErrorHandler.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/ErrorHandler.java index 2fa22ee8..ce986ee8 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/ErrorHandler.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/ErrorHandler.java @@ -33,7 +33,7 @@ public class ErrorHandler { /** * Logs a message to the platform log. * - * @param message The message to display. + * @param message The message to display. * @param throwable The Throwable object. */ public static void processErrorMessage(String message, Throwable throwable) { @@ -44,8 +44,8 @@ public static void processErrorMessage(String message, Throwable throwable) { /** * Logs a message to the platform log and opens the error dialog, if indicated. * - * @param message The message to log/display. - * @param throwable The Throwable object. + * @param message The message to log/display. + * @param throwable The Throwable object. * @param displayDialog The indicator to open a dialog. */ public static void processErrorMessage(String message, Throwable throwable, boolean displayDialog) { @@ -71,7 +71,7 @@ public static void processErrorMessage(String message) { /** * Logs a message to the platform log and opens the error dialog, if indicated. * - * @param message The message to display. + * @param message The message to display. * @param displayDialog The indicator to open a dialog. */ public static void processErrorMessage(String message, boolean displayDialog) { @@ -103,9 +103,9 @@ public static void rawErrorMessageDialog(String message) { /** * Logs a message to the platform log and opens the error dialog, if indicated. * - * @param message The message to display. + * @param message The message to display. * @param displayDialog The indicator to open a dialog. - * @param buttonLabels The array of button labels to be display on the dialog. + * @param buttonLabels The array of button labels to be display on the dialog. * @param defaultButton The index number representing the button to be selected as default. * * @return The index number representing the button that the user selected. @@ -127,7 +127,7 @@ public static Integer processWarningMessage(String message, boolean displayDialo /** * Logs a message to the platform log. * - * @param message The message to display. + * @param message The message to display. * @param throwable The Throwable object. */ public static void processWarningMessage(String message, Throwable throwable) { @@ -138,8 +138,8 @@ public static void processWarningMessage(String message, Throwable throwable) { /** * Logs a message to the platform log and opens the error dialog, if indicated. * - * @param message The message to log/display. - * @param throwable The Throwable object. + * @param message The message to log/display. + * @param throwable The Throwable object. * @param displayDialog The indicator to open a dialog. */ public static void processWarningMessage(String message, Throwable throwable, boolean displayDialog) { @@ -165,7 +165,7 @@ public static void processWarningMessage(String message) { /** * Logs a message to the platform log and opens the error dialog, if indicated. * - * @param message The message to display. + * @param message The message to display. * @param displayDialog The indicator to open a dialog. */ public static void processWarningMessage(String message, boolean displayDialog) { @@ -182,7 +182,7 @@ public static void processWarningMessage(String message, boolean displayDialog) /** * Logs a message to the platform log and opens the error dialog, if indicated. * - * @param message The message to display. + * @param message The message to display. * @param displayDialog The indicator to open a dialog. */ public static void processPreferenceErrorMessage(String message, boolean displayDialog) { @@ -190,8 +190,7 @@ public static void processPreferenceErrorMessage(String message, boolean display if (displayDialog) { Shell shell = Display.getCurrent().getActiveShell(); - LibertyToolsMessageDialog ltdialog = new LibertyToolsMessageDialog(shell, TITLE, null, message, MessageDialog.ERROR, - new String[] { "OK" }, 0); + LibertyToolsMessageDialog ltdialog = new LibertyToolsMessageDialog(shell, TITLE, null, message, MessageDialog.ERROR, new String[] { "OK" }, 0); ltdialog.open(); } } @@ -199,7 +198,7 @@ public static void processPreferenceErrorMessage(String message, boolean display /** * Returns the input message with the input suffix appended. * - * @param msg The message. + * @param msg The message. * @param suffix The suffix to add to message. * * @return The input message with the input suffix appended. diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyPrefDirectoryFieldEditor.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyPrefDirectoryFieldEditor.java index d9eedb96..6a116b49 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyPrefDirectoryFieldEditor.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyPrefDirectoryFieldEditor.java @@ -17,7 +17,7 @@ import org.eclipse.swt.widgets.Composite; public class LibertyPrefDirectoryFieldEditor extends DirectoryFieldEditor { - + /* * A class to provide keystroke validation when typing in location of * maven and gradle executables. @@ -25,11 +25,10 @@ public class LibertyPrefDirectoryFieldEditor extends DirectoryFieldEditor { * Need to subclass the DirectoryFieldEditor class in order to set the validation strategy to * VALIDATE_ON_KEY_STROKE */ - - public LibertyPrefDirectoryFieldEditor(String name, String labelText, Composite parent){ + + public LibertyPrefDirectoryFieldEditor(String name, String labelText, Composite parent) { init(name, labelText); - setErrorMessage(JFaceResources - .getString("DirectoryFieldEditor.errorMessage"));//$NON-NLS-1$ + setErrorMessage(JFaceResources.getString("DirectoryFieldEditor.errorMessage"));//$NON-NLS-1$ setChangeButtonText(JFaceResources.getString("openBrowse"));//$NON-NLS-1$ setValidateStrategy(VALIDATE_ON_KEY_STROKE); createControl(parent); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java index ec7edb2b..16ab4240 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/LibertyToolsMessageDialog.java @@ -27,7 +27,7 @@ public class LibertyToolsMessageDialog extends MessageDialog { public LibertyToolsMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, - int dialogImageType, String[] dialogButtonLabels, int defaultIndex) { + int dialogImageType, String[] dialogButtonLabels, int defaultIndex) { super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, defaultIndex, dialogButtonLabels); } @@ -35,12 +35,12 @@ public LibertyToolsMessageDialog(Shell parentShell, String dialogTitle, Image di protected Control createCustomArea(Composite parent) { Link link = new Link(parent, SWT.WRAP); link.setText( - "To fix: either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var"); + "To fix: either generate wrapper for project, or set the executable in Liberty Preferences, or on the PATH env var"); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, "io.openliberty.tools.eclipse.ui.preferences.page", - new String[] { "io.openliberty.tools.eclipse.ui.preferences.page" }, null); + new String[] { "io.openliberty.tools.eclipse.ui.preferences.page" }, null); dialog.open(); } }); diff --git a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java index c4814d6e..d8bc9dad 100644 --- a/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java +++ b/bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/utils/Utils.java @@ -73,7 +73,7 @@ public static boolean isWindows() { * Returns a org.eclipse.swt.graphics.Image object representing the image under the input path. * * @param device The device display. - * @param path The path to the image. + * @param path The path to the image. * * @return A org.eclipse.swt.graphics.Image object representing the Open Liberty image. */ @@ -299,7 +299,7 @@ public static Throwable findRootCause(Throwable t) { * @param project * @param launch * @param debugModeHandler - * @param preRestartTime - The current time prior to restarting the server + * @param preRestartTime - The current time prior to restarting the server */ public static void restartDebugger(Project project, ILaunch launch, DebugModeHandler debugModeHandler, Instant preRestartTime) { @@ -380,13 +380,13 @@ public static void disableAppMonitoring(Project project) { } else { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, - "File '" + fileNameTofind + "' not found in the 'usr'folder."); + "File '" + fileNameTofind + "' not found in the 'usr'folder."); } } } catch (Exception e) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, "Error encountered while adding xml file in the configDropins.", - e); + e); } } } @@ -411,7 +411,7 @@ public static void reEnableAppMonitoring(Project project) { } catch (Exception e) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, "Error encountered while removing xml file from configDropins.", - e); + e); } } } @@ -423,8 +423,7 @@ private static File findFileByName(File rootDir, String targetFileName) { } try (Stream paths = Files.walk(rootDir.toPath())) { - Optional match = paths.filter(Files::isRegularFile) - .filter(path -> path.getFileName().toString().equals(targetFileName)).findFirst(); + Optional match = paths.filter(Files::isRegularFile).filter(path -> path.getFileName().toString().equals(targetFileName)).findFirst(); return match.map(Path::toFile).orElse(null); } catch (IOException e) { if (Trace.isEnabled()) { @@ -480,7 +479,7 @@ private static void validateProjectIsGradleOrMaven(Project project) throws Excep if (project.getBuildType() == Project.BuildType.UNKNOWN) { if (Trace.isEnabled()) { Trace.getTracer().trace(Trace.TRACE_UI, "Unexpected project build type: " + project.getBuildType() - + ". " + "Project does not appear to be a Maven or Gradle built project."); + + ". " + "Project does not appear to be a Maven or Gradle built project."); return; } } diff --git a/tests/.settings/org.eclipse.core.resources.prefs b/tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/tests/.settings/org.eclipse.jdt.core.prefs b/tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..288b4a92 --- /dev/null +++ b/tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,284 @@ +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.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 +org.eclipse.jdt.core.compiler.compliance=21 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=21 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=18 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=2 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=2 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=2 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=18 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=18 +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=18 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=20 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=4 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0 +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=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=false +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=180 +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.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=4 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4 +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=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=8 +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_member=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_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_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=do not 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=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +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=180 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false +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=true +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.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/.settings/org.eclipse.jdt.ui.prefs b/tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..4962123f --- /dev/null +++ b/tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,114 @@ +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=true +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=true +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=false +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=false +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=false +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=false +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +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_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=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 +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java index 14de3727..f95d38f2 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java @@ -67,10 +67,10 @@ public abstract class AbstractLibertyPluginSWTBotTest { /** * Gradle distribution that supports Java 21. - * Gradle version 8.4+ supports Java 21. + * Gradle version 8.4+ supports Java 21. */ private static String GRADLE_DISTRIBUTION_VERISION = "8.8"; - + protected static String getMvnCmdFilename() { return LibertyPluginTestUtils.onWindows() ? "mvn.cmd" : "mvn"; } @@ -129,7 +129,7 @@ public AbstractLibertyPluginSWTBotTest() { @BeforeEach public void beforeEach(TestInfo info) { System.out.println( - "INFO: Test " + this.getClass().getSimpleName() + "#" + info.getDisplayName() + " entry: " + java.time.LocalDateTime.now()); + "INFO: Test " + this.getClass().getSimpleName() + "#" + info.getDisplayName() + " entry: " + java.time.LocalDateTime.now()); if (isMvnLogFile()) { // Turn on config to log dev mode output to file @@ -140,7 +140,7 @@ public void beforeEach(TestInfo info) { @AfterEach public void afterEach(TestInfo info) { System.out.println( - "INFO: Test " + this.getClass().getSimpleName() + "#" + info.getDisplayName() + " exit: " + java.time.LocalDateTime.now()); + "INFO: Test " + this.getClass().getSimpleName() + "#" + info.getDisplayName() + " exit: " + java.time.LocalDateTime.now()); } protected static void cleanupProject(String projectPathStr) { @@ -159,7 +159,7 @@ protected static void cleanupProject(String projectPathStr) { * Imports the specified list of projects. * * @param workspaceRoot The workspace root location. - * @param folders The list of folders containing the projects to install. + * @param folders The list of folders containing the projects to install. * * @throws InterruptedException * @throws CoreException @@ -209,15 +209,12 @@ public static void importGradleApplications(ArrayList projectsToInstall) t // is downloaded and used by the Gradle build. Gradle 8.1.1 does not support Java 21. // This causes runtime issues during the synchronization step (Unsupported class file major // version 65), which are not reported back to the caller. - // To workaround this issue, specify a Java 21 compatible Gradle version that the + // To workaround this issue, specify a Java 21 compatible Gradle version that the // tooling can use (i.e. 8.4+). Note that since it is preferable to use the default version // provided by the tooling API, setting the version can be revised at a later time. for (File projectFile : projectsToInstall) { - IPath projectLocation = org.eclipse.core.runtime.Path - .fromOSString(Paths.get(projectFile.getPath()).toAbsolutePath().toString()); - BuildConfiguration configuration = BuildConfiguration.forRootProjectDirectory(projectLocation.toFile()) - .gradleDistribution(GradleDistribution.forVersion(GRADLE_DISTRIBUTION_VERISION)) - .overrideWorkspaceConfiguration(true).build(); + IPath projectLocation = org.eclipse.core.runtime.Path.fromOSString(Paths.get(projectFile.getPath()).toAbsolutePath().toString()); + BuildConfiguration configuration = BuildConfiguration.forRootProjectDirectory(projectLocation.toFile()).gradleDistribution(GradleDistribution.forVersion(GRADLE_DISTRIBUTION_VERISION)).overrideWorkspaceConfiguration(true).build(); GradleWorkspace workspace = GradleCore.getWorkspace(); GradleBuild newBuild = workspace.createBuild(configuration); newBuild.synchronize(new NullProgressMonitor()); diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotDebuggerTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotDebuggerTest.java index 5e13a847..aec7db51 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotDebuggerTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotDebuggerTest.java @@ -35,7 +35,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import io.openliberty.tools.eclipse.DevModeOperations; import io.openliberty.tools.eclipse.test.it.utils.LibertyPluginTestUtils; import io.openliberty.tools.eclipse.ui.dashboard.DashboardView; @@ -173,7 +172,7 @@ public void testConnectDebuggerMenuCommand_enabledAfterDebuggerDisconnect() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, projectPath.toAbsolutePath().toString() + - "/target/liberty"); + "/target/liberty"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -190,7 +189,7 @@ public void testConnectDebuggerMenuCommand_enabledAfterDebuggerDisconnect() { // Validate button enabled Assertions.assertTrue(getDebuggerConnectMenuForDebugObject(launch).isEnabled()); } - + /** * Tests the "Enhanced debug monitoring", that the XML file is added in the * overrides directory during the debug mode. @@ -198,30 +197,29 @@ public void testConnectDebuggerMenuCommand_enabledAfterDebuggerDisconnect() { */ @Test public void testEnhancedDebugMode_configXmlFilePresentOnDebugMode() { - // Start dev mode. - launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_DEBUG); + // Start dev mode. + launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_DEBUG); - // Validate application is up and running. - LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, - projectPath.toAbsolutePath().toString() + "/target/liberty"); + // Validate application is up and running. + LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, + projectPath.toAbsolutePath().toString() + "/target/liberty"); - // If there are issues with the workspace, close the error dialog. - pressWorkspaceErrorDialogProceedButton(bot); + // If there are issues with the workspace, close the error dialog. + pressWorkspaceErrorDialogProceedButton(bot); - // Validate app monitoring is disabled by checking the xml file is present in - // the overrides directory. - Path pathToXmlFile = LibertyPluginTestUtils.getMavenXmlFilePathInOverridesDirectory(projectPath.toString()); - boolean isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); + // Validate app monitoring is disabled by checking the xml file is present in + // the overrides directory. + Path pathToXmlFile = LibertyPluginTestUtils.getMavenXmlFilePathInOverridesDirectory(projectPath.toString()); + boolean isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); - if (!isExist) { - Assertions.fail("Xml file not found on " + pathToXmlFile + "."); - } - // Stop dev mode. - launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); + if (!isExist) { + Assertions.fail("Xml file not found on " + pathToXmlFile + "."); + } + // Stop dev mode. + launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); - // Validate application stopped. - LibertyPluginTestUtils - .validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/target/liberty"); + // Validate application stopped. + LibertyPluginTestUtils.validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/target/liberty"); } @@ -232,37 +230,36 @@ public void testEnhancedDebugMode_configXmlFilePresentOnDebugMode() { */ @Test public void testEnhancedDebugMode_onStopRemoveXmlFile() { - boolean isExist = false; - // Start dev mode. - launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_DEBUG); - - // Validate application is up and running. - LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, - projectPath.toAbsolutePath().toString() + "/target/liberty"); - - // If there are issues with the workspace, close the error dialog. - pressWorkspaceErrorDialogProceedButton(bot); - - // Validate app monitoring is disabled by checking the xml file is present in - // the overrides directory. - Path pathToXmlFile = LibertyPluginTestUtils.getMavenXmlFilePathInOverridesDirectory(projectPath.toString()); - isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); - - if (!isExist) { - Assertions.fail("Xml file not found on " + pathToXmlFile + "."); - } - // Stop dev mode. - launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); - - // Validate application stopped. - LibertyPluginTestUtils - .validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/target/liberty"); - - isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); - if (isExist) { - Assertions.fail("Xml file " + pathToXmlFile - + " is not removed from overrides directory on disconnecting debugger."); - } + boolean isExist = false; + // Start dev mode. + launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_DEBUG); + + // Validate application is up and running. + LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, + projectPath.toAbsolutePath().toString() + "/target/liberty"); + + // If there are issues with the workspace, close the error dialog. + pressWorkspaceErrorDialogProceedButton(bot); + + // Validate app monitoring is disabled by checking the xml file is present in + // the overrides directory. + Path pathToXmlFile = LibertyPluginTestUtils.getMavenXmlFilePathInOverridesDirectory(projectPath.toString()); + isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); + + if (!isExist) { + Assertions.fail("Xml file not found on " + pathToXmlFile + "."); + } + // Stop dev mode. + launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); + + // Validate application stopped. + LibertyPluginTestUtils.validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/target/liberty"); + + isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); + if (isExist) { + Assertions.fail("Xml file " + pathToXmlFile + + " is not removed from overrides directory on disconnecting debugger."); + } } /** @@ -271,46 +268,45 @@ public void testEnhancedDebugMode_onStopRemoveXmlFile() { */ @Test public void testEnhancedDebugMode_disconnectDebuggerRemoveXmlFile() { - boolean isExist = false; - - // Start dev mode. - launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_DEBUG); - - // Validate application is up and running. - LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, - projectPath.toAbsolutePath().toString() + "/target/liberty"); - - // If there are issues with the workspace, close the error dialog. - pressWorkspaceErrorDialogProceedButton(bot); - - // Validate app monitoring is disabled by checking the xml file is present in - // the overrides directory. - Path pathToXmlFile = LibertyPluginTestUtils.getMavenXmlFilePathInOverridesDirectory(projectPath.toString()); - isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); - if (!isExist) { - Assertions.fail("Xml file not found on " + pathToXmlFile + "."); - } - - // Verify button is disabled - Object launch = getObjectInDebugView(MVN_APP_NAME + " [Liberty]"); - SWTBotMenu connectDebuggerMenu = getDebuggerConnectMenuForDebugObject(launch); - Assertions.assertFalse(connectDebuggerMenu.isEnabled()); - - // Disconnected Debugger - Object debugTarget = getObjectInDebugView("Liberty Application Debug"); - disconnectDebugTarget(debugTarget); - - isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); - if (isExist) { - Assertions.fail("Xml file " + pathToXmlFile - + " is not removed from overrides directory on disconnecting debugger."); - } - // Stop dev mode. - launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); - - // Validate application stopped. - LibertyPluginTestUtils - .validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/target/liberty"); + boolean isExist = false; + + // Start dev mode. + launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_DEBUG); + + // Validate application is up and running. + LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, + projectPath.toAbsolutePath().toString() + "/target/liberty"); + + // If there are issues with the workspace, close the error dialog. + pressWorkspaceErrorDialogProceedButton(bot); + + // Validate app monitoring is disabled by checking the xml file is present in + // the overrides directory. + Path pathToXmlFile = LibertyPluginTestUtils.getMavenXmlFilePathInOverridesDirectory(projectPath.toString()); + isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); + if (!isExist) { + Assertions.fail("Xml file not found on " + pathToXmlFile + "."); + } + + // Verify button is disabled + Object launch = getObjectInDebugView(MVN_APP_NAME + " [Liberty]"); + SWTBotMenu connectDebuggerMenu = getDebuggerConnectMenuForDebugObject(launch); + Assertions.assertFalse(connectDebuggerMenu.isEnabled()); + + // Disconnected Debugger + Object debugTarget = getObjectInDebugView("Liberty Application Debug"); + disconnectDebugTarget(debugTarget); + + isExist = LibertyPluginTestUtils.appMonitorDisabledXmlExists(pathToXmlFile); + if (isExist) { + Assertions.fail("Xml file " + pathToXmlFile + + " is not removed from overrides directory on disconnecting debugger."); + } + // Stop dev mode. + launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); + + // Validate application stopped. + LibertyPluginTestUtils.validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/target/liberty"); } } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleTest.java index 5803ab9a..6ccdac95 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleTest.java @@ -25,6 +25,7 @@ import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getDefaultSourceLookupTreeItemNoBot; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getLibertyTreeItem; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getLibertyTreeItemNoBot; +import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getObjectInDebugView; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getRunConfigurationsShell; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchCustomDebugFromDashboard; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchCustomRunFromDashboard; @@ -45,6 +46,7 @@ import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.refreshDashboard; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.refreshProjectUsingExplorerView; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.setBuildCmdPathInPreferences; +import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.terminateLaunch; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.unsetBuildCmdPathInPreferences; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -89,9 +91,6 @@ import io.openliberty.tools.eclipse.ui.dashboard.DashboardView; import io.openliberty.tools.eclipse.ui.launch.LaunchConfigurationDelegateLauncher; -import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getObjectInDebugView; -import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.terminateLaunch; - /** * Tests Open Liberty Eclipse plugin functions. */ @@ -128,26 +127,26 @@ public class LibertyPluginSWTBotGradleTest extends AbstractLibertyPluginSWTBotTe * Expected menu items. */ static String[] gradleMenuItems = new String[] { DashboardView.APP_MENU_ACTION_START, DashboardView.APP_MENU_ACTION_START_CONFIG, - DashboardView.APP_MENU_ACTION_START_IN_CONTAINER, DashboardView.APP_MENU_ACTION_DEBUG, - DashboardView.APP_MENU_ACTION_DEBUG_CONFIG, DashboardView.APP_MENU_ACTION_DEBUG_IN_CONTAINER, - DashboardView.APP_MENU_ACTION_STOP, DashboardView.APP_MENU_ACTION_RUN_TESTS, - DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT }; + DashboardView.APP_MENU_ACTION_START_IN_CONTAINER, DashboardView.APP_MENU_ACTION_DEBUG, + DashboardView.APP_MENU_ACTION_DEBUG_CONFIG, DashboardView.APP_MENU_ACTION_DEBUG_IN_CONTAINER, + DashboardView.APP_MENU_ACTION_STOP, DashboardView.APP_MENU_ACTION_RUN_TESTS, + DashboardView.APP_MENU_ACTION_VIEW_GRADLE_TEST_REPORT }; /** * Run As configuration menu items. */ static String[] runAsShortcuts = new String[] { LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT }; + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT }; /** * Debug As configuration menu items. */ static String[] debugAsShortcuts = new String[] { LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER }; + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER }; /** * Setup. @@ -276,16 +275,16 @@ public static final void validateBeforeTestRun() { // Check that the menu for the expected application contains the required actions. List menuItems = getDashboardItemMenuActions(GRADLE_APP_NAME); Assertions.assertTrue(menuItems.size() == gradleMenuItems.length, () -> "Gradle application " + GRADLE_APP_NAME - + " does not contain the expected number of menu items: " + gradleMenuItems.length); + + " does not contain the expected number of menu items: " + gradleMenuItems.length); Assertions.assertTrue(menuItems.containsAll(Arrays.asList(gradleMenuItems)), - () -> "Gradle application " + GRADLE_APP_NAME + " does not contain the expected menu items: " + gradleMenuItems); + () -> "Gradle application " + GRADLE_APP_NAME + " does not contain the expected menu items: " + gradleMenuItems); // Check that the Run As menu contains the expected shortcut SWTBotMenu runAsMenu = getAppRunAsMenu(bot, GRADLE_APP_NAME); Assertions.assertTrue(runAsMenu != null, "The runAs menu associated with project: " + GRADLE_APP_NAME + " is null."); List runAsMenuItems = runAsMenu.menuItems(); Assertions.assertTrue(runAsMenuItems != null && !runAsMenuItems.isEmpty(), - "The runAs menu associated with project: " + GRADLE_APP_NAME + " is null or empty."); + "The runAs menu associated with project: " + GRADLE_APP_NAME + " is null or empty."); int foundRunAsItems = 0; for (String expectedItem : runAsShortcuts) { @@ -298,16 +297,16 @@ public static final void validateBeforeTestRun() { } Assertions.assertTrue(foundRunAsItems == runAsShortcuts.length, - "The runAs menu associated with project: " + GRADLE_APP_NAME - + " does not contain one or more expected entries. Expected number of entries: " + runAsShortcuts.length - + "Found entry count: " + foundRunAsItems + ". Found menu entries: " + runAsMenuItems); + "The runAs menu associated with project: " + GRADLE_APP_NAME + + " does not contain one or more expected entries. Expected number of entries: " + runAsShortcuts.length + + "Found entry count: " + foundRunAsItems + ". Found menu entries: " + runAsMenuItems); // Check that the Debug As menu contains the expected shortcut SWTBotMenu debugAsMenu = getAppDebugAsMenu(bot, GRADLE_APP_NAME); Assertions.assertTrue(debugAsMenu != null, "The debugAs menu associated with project: " + GRADLE_APP_NAME + " is null."); List debugAsMenuItems = debugAsMenu.menuItems(); Assertions.assertTrue(debugAsMenuItems != null && !debugAsMenuItems.isEmpty(), - "The debugAs menu associated with project: " + GRADLE_APP_NAME + " is null or empty."); + "The debugAs menu associated with project: " + GRADLE_APP_NAME + " is null or empty."); int foundDebugAsItems = 0; for (String expectedItem : debugAsShortcuts) { @@ -320,9 +319,10 @@ public static final void validateBeforeTestRun() { } Assertions.assertTrue(foundDebugAsItems == debugAsShortcuts.length, - "The debugAs menu associated with project: " + GRADLE_APP_NAME - + " does not contain one or more expected entries. Expected number of entries: " + debugAsShortcuts.length - + "Found entry count: " + foundDebugAsItems + ". Found menu entries: " + debugAsMenuItems); + "The debugAs menu associated with project: " + GRADLE_APP_NAME + + " does not contain one or more expected entries. Expected number of entries: " + + debugAsShortcuts.length + + "Found entry count: " + foundDebugAsItems + ". Found menu entries: " + debugAsMenuItems); // Check that the Run As -> Run Configurations ... contains the Liberty entry in the menu. Shell configShell = launchRunConfigurationsDialogFromAppRunAs(GRADLE_APP_NAME); @@ -565,28 +565,26 @@ public void testAddingProjectToDashboardManually() throws Exception { Project.removeNature(iProject, LibertyNature.NATURE_ID); // Rename the server.xml file. - Path originalPath = Paths - .get("resources", "applications", "gradle", "liberty-gradle-test-app", "src", "main", "liberty", "config", "server.xml") - .toAbsolutePath(); + Path originalPath = Paths.get("resources", "applications", "gradle", "liberty-gradle-test-app", "src", "main", "liberty", "config", "server.xml").toAbsolutePath(); Path renamedPath = Paths.get("resources", "applications", "gradle", "liberty-gradle-test-app", "src", "main", "liberty", "config", - "server.xml.renamed").toAbsolutePath(); + "server.xml.renamed").toAbsolutePath(); File originalFile = originalPath.toFile(); Assertions.assertTrue(originalFile.exists(), () -> "The server.xml for project " + projectName - + " should exist, but it could not be found at this location: " + originalPath); + + " should exist, but it could not be found at this location: " + originalPath); Files.copy(originalPath, renamedPath, java.nio.file.StandardCopyOption.REPLACE_EXISTING); Files.delete(originalPath); File renamedFile = renamedPath.toFile(); Assertions.assertTrue(renamedFile.exists(), () -> "The server.xml for project " + projectName - + " should have been renamed to server.xml.renamed. The renamed file does not exist at this location: " + renamedPath); + + " should have been renamed to server.xml.renamed. The renamed file does not exist at this location: " + renamedPath); Assertions.assertTrue(!originalFile.exists(), () -> "The server.xml for project " + projectName - + " should no longer exist because it was renamed. File still exists at this location: " + originalPath); + + " should no longer exist because it was renamed. File still exists at this location: " + originalPath); Assertions.assertTrue(iProject.getDescription().hasNature(LibertyNature.NATURE_ID) == false, - () -> "The nature ID should have been removed, but it is still present."); + () -> "The nature ID should have been removed, but it is still present."); try { // Refresh the project through the explorer view to pick up the nature removal. @@ -634,9 +632,9 @@ public void testAddingProjectToDashboardManually() throws Exception { // Files.move(renamedPath, originalPath, java.nio.file.StandardCopyOption.REPLACE_EXISTING); Assertions.assertTrue(!renamedFile.exists(), () -> "File server.xml.renamed for project " + projectName - + " should have been renamed to server.xml, but it was found at this location: " + renamedPath); + + " should have been renamed to server.xml, but it was found at this location: " + renamedPath); Assertions.assertTrue(originalFile.exists(), () -> "The server.xml for project " + projectName - + " should exist, but it could not be found at this location: " + originalPath); + + " should exist, but it could not be found at this location: " + originalPath); } } @@ -877,15 +875,15 @@ public void testDefaultJRECompliance() { String buildPathJRE = LibertyPluginTestUtils.getJREFromBuildpath(testAppPath); Assertions.assertTrue(buildPathJRE != null, - () -> "Unable to find the JRE configured in the project's build path (.classpath)."); + () -> "Unable to find the JRE configured in the project's build path (.classpath)."); SWTBotCombo comboJREBox = getComboTextBoxWithTextPrefix(bot, buildPathJRE); Assertions.assertTrue(comboJREBox != null, - () -> "The java installation shown on the Liberty run configurations JRE tab does not contain the Java installation configured on project's the build path (claspath):" - + buildPathJRE); + () -> "The java installation shown on the Liberty run configurations JRE tab does not contain the Java installation configured on project's the build path (claspath):" + + buildPathJRE); Assertions.assertTrue(comboJREBox.isEnabled(), - () -> "The JRE tab box showing Java installation \" + buildPathJRE + \" is not selected."); + () -> "The JRE tab box showing Java installation \" + buildPathJRE + \" is not selected."); } finally { go("Close", configShell); } @@ -928,7 +926,7 @@ public void testDebugSourceLookupContent() { // Validate dependency projects are in source lookup list Assertions.assertTrue(jarEntryFound, "The dependency project, " + MVN_SHARED_LIB_NAME - + ", was not listed in the source lookup list for project " + GRADLE_APP_NAME); + + ", was not listed in the source lookup list for project " + GRADLE_APP_NAME); } } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleWithSpaceTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleWithSpaceTest.java index 89286daa..635cae7f 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleWithSpaceTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotGradleWithSpaceTest.java @@ -18,11 +18,13 @@ import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.setBuildCmdPathInPreferences; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.terminateLaunch; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.unsetBuildCmdPathInPreferences; + import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; + import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; @@ -38,7 +40,7 @@ */ public class LibertyPluginSWTBotGradleWithSpaceTest extends AbstractLibertyPluginSWTBotTest { - /** + /** * Application name. */ static final String GRADLE_APP_NAME = "liberty-gradle-test-app-with-spaces"; @@ -53,11 +55,11 @@ public class LibertyPluginSWTBotGradleWithSpaceTest extends AbstractLibertyPlugi /** * Test app relative path. */ - + static final Path projectPath = Paths.get("resources", "applications", "apps with spaces", "liberty-gradle-test-app-with-spaces"); static final Path wrapperProjectPath = Paths.get("resources", "applications", "apps with spaces", "liberty-gradle-test-wrapper-app-with-spaces"); static ArrayList projectPaths = new ArrayList(); - + /** * Setup. * @@ -69,7 +71,7 @@ public static void setup() throws Exception { commonSetup(); File mainProject = projectPath.toFile(); File wrapperProject = wrapperProjectPath.toFile(); - + projectsToInstall.add(mainProject); projectsToInstall.add(wrapperProject); @@ -81,7 +83,6 @@ public static void setup() throws Exception { importGradleApplications(projectsToInstall); - // set the preferences setBuildCmdPathInPreferences(bot, "Gradle"); LibertyPluginTestUtils.validateLibertyToolsPreferencesSet(); @@ -98,7 +99,7 @@ public void afterEach(TestInfo info) { super.afterEach(info); } - + @AfterAll public static void cleanup() throws IOException { for (String p : projectPaths) { @@ -106,8 +107,7 @@ public static void cleanup() throws IOException { } unsetBuildCmdPathInPreferences(bot, "Gradle"); } - - + /** * Tests the start menu action on a dashboard listed application for wrapper project. */ @@ -119,7 +119,7 @@ public void testDashboardStartActionWithWrapper() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(GRADLE_WRAPPER_APP_NAME, true, - wrapperProjectPath.toAbsolutePath().toString() + "/build"); + wrapperProjectPath.toAbsolutePath().toString() + "/build"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -130,7 +130,7 @@ public void testDashboardStartActionWithWrapper() { // Validate application stopped. LibertyPluginTestUtils.validateLibertyServerStopped(wrapperProjectPath.toAbsolutePath().toString() + "/build"); } - + /** * Tests the debug menu action on a dashboard listed application for wrapper project. */ @@ -151,8 +151,7 @@ public void testDashboardDebugActionWrapper() { // Validate application stopped. LibertyPluginTestUtils.validateLibertyServerStopped(wrapperProjectPath.toAbsolutePath().toString() + "/build"); } - - + /** * Tests the start menu action on a dashboard listed application. */ @@ -164,7 +163,7 @@ public void testDashboardStartActionProject() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(GRADLE_APP_NAME, true, - projectPath.toAbsolutePath().toString() + "/build"); + projectPath.toAbsolutePath().toString() + "/build"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -172,10 +171,10 @@ public void testDashboardStartActionProject() { // Stop dev mode. launchDashboardAction(GRADLE_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); - // Validate application stopped. + // Validate application stopped. LibertyPluginTestUtils.validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/build"); } - + /** * Tests the debug menu action on a dashboard listed application. */ @@ -193,7 +192,7 @@ public void testDashboardDebugActionProject() { // Stop dev mode. launchDashboardAction(GRADLE_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); - // Validate application stopped. + // Validate application stopped. LibertyPluginTestUtils.validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/build"); } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenTest.java index 5980a99c..b687effd 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenTest.java @@ -26,6 +26,7 @@ import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getDefaultSourceLookupTreeItemNoBot; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getLibertyTreeItem; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getLibertyTreeItemNoBot; +import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getObjectInDebugView; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getRunConfigurationsShell; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchCustomDebugFromDashboard; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchCustomRunFromDashboard; @@ -47,6 +48,7 @@ import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.openSourceTab; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.pressWorkspaceErrorDialogProceedButton; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.setBuildCmdPathInPreferences; +import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.terminateLaunch; import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.unsetBuildCmdPathInPreferences; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -86,9 +88,6 @@ import io.openliberty.tools.eclipse.ui.dashboard.DashboardView; import io.openliberty.tools.eclipse.ui.launch.LaunchConfigurationDelegateLauncher; -import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.getObjectInDebugView; -import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.terminateLaunch; - /** * Tests Open Liberty Eclipse plugin functions. */ @@ -140,27 +139,27 @@ public class LibertyPluginSWTBotMavenTest extends AbstractLibertyPluginSWTBotTes * Expected menu items. */ static String[] mvnMenuItems = new String[] { DashboardView.APP_MENU_ACTION_START, DashboardView.APP_MENU_ACTION_START_CONFIG, - DashboardView.APP_MENU_ACTION_START_IN_CONTAINER, DashboardView.APP_MENU_ACTION_DEBUG, - DashboardView.APP_MENU_ACTION_DEBUG_CONFIG, DashboardView.APP_MENU_ACTION_DEBUG_IN_CONTAINER, - DashboardView.APP_MENU_ACTION_STOP, DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT, - DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }; + DashboardView.APP_MENU_ACTION_START_IN_CONTAINER, DashboardView.APP_MENU_ACTION_DEBUG, + DashboardView.APP_MENU_ACTION_DEBUG_CONFIG, DashboardView.APP_MENU_ACTION_DEBUG_IN_CONTAINER, + DashboardView.APP_MENU_ACTION_STOP, DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT, + DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }; /** * Run As configuration menu items. */ static String[] runAsShortcuts = new String[] { LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT, }; + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT, }; /** * Debug As configuration menu items. */ static String[] debugAsShortcuts = new String[] { LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER }; + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONFIG, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER }; /** * Setup. @@ -262,16 +261,16 @@ public static final void validateBeforeTestRun() { // Check that the menu that the application in the dashboard contains the required actions. List menuItems = getDashboardItemMenuActions(MVN_APP_NAME); Assertions.assertTrue(menuItems.size() == mvnMenuItems.length, - () -> "Maven application " + MVN_APP_NAME + " does not contain the expected number of menu items: " + mvnMenuItems.length); + () -> "Maven application " + MVN_APP_NAME + " does not contain the expected number of menu items: " + mvnMenuItems.length); Assertions.assertTrue(menuItems.containsAll(Arrays.asList(mvnMenuItems)), - () -> "Maven application " + MVN_APP_NAME + " does not contain the expected menu items: " + mvnMenuItems); + () -> "Maven application " + MVN_APP_NAME + " does not contain the expected menu items: " + mvnMenuItems); // Check that the Run As menu contains the expected shortcut SWTBotMenu runAsMenu = getAppRunAsMenu(bot, MVN_APP_NAME); Assertions.assertTrue(runAsMenu != null, "The runAs menu associated with project: " + MVN_APP_NAME + " is null."); List runAsMenuItems = runAsMenu.menuItems(); Assertions.assertTrue(runAsMenuItems != null && !runAsMenuItems.isEmpty(), - "The runAs menu associated with project: " + MVN_APP_NAME + " is null or empty."); + "The runAs menu associated with project: " + MVN_APP_NAME + " is null or empty."); int foundItems = 0; for (String expectedItem : runAsShortcuts) { @@ -284,16 +283,16 @@ public static final void validateBeforeTestRun() { } Assertions.assertTrue(foundItems == runAsShortcuts.length, - "The runAs menu associated with project: " + MVN_APP_NAME - + " does not contain one or more expected entries. Expected number of entries: " + runAsShortcuts.length - + "Found entry count: " + foundItems + ". Found menu entries: " + runAsMenuItems); + "The runAs menu associated with project: " + MVN_APP_NAME + + " does not contain one or more expected entries. Expected number of entries: " + runAsShortcuts.length + + "Found entry count: " + foundItems + ". Found menu entries: " + runAsMenuItems); // Check that the Debug As menu contains the expected shortcut SWTBotMenu debugAsMenu = getAppDebugAsMenu(bot, MVN_APP_NAME); Assertions.assertTrue(debugAsMenu != null, "The debugAs menu associated with project: " + MVN_APP_NAME + " is null."); List debugAsMenuItems = debugAsMenu.menuItems(); Assertions.assertTrue(debugAsMenuItems != null && !debugAsMenuItems.isEmpty(), - "The debugAs menu associated with project: " + MVN_APP_NAME + " is null or empty."); + "The debugAs menu associated with project: " + MVN_APP_NAME + " is null or empty."); int foundDebugAsItems = 0; for (String expectedItem : debugAsShortcuts) { @@ -306,9 +305,10 @@ public static final void validateBeforeTestRun() { } Assertions.assertTrue(foundDebugAsItems == debugAsShortcuts.length, - "The debugAs menu associated with project: " + MVN_APP_NAME - + " does not contain one or more expected entries. Expected number of entries: " + debugAsShortcuts.length - + "Found entry count: " + foundDebugAsItems + ". Found menu entries: " + debugAsMenuItems); + "The debugAs menu associated with project: " + MVN_APP_NAME + + " does not contain one or more expected entries. Expected number of entries: " + + debugAsShortcuts.length + + "Found entry count: " + foundDebugAsItems + ". Found menu entries: " + debugAsMenuItems); // Check that the Run As -> Run Configurations... contains the Liberty entry in the menu. Shell configShell = launchRunConfigurationsDialogFromAppRunAs(MVN_APP_NAME); @@ -357,9 +357,9 @@ public void testMavenCommandAssembly() throws IOException, InterruptedException, String projPath = iProject.getLocation().toOSString(); String opaqueMvnCmd = CommandBuilder.getMavenCommandLine(projPath, "io.openliberty.tools:liberty-maven-plugin:dev -f " + projPath, - System.getenv("PATH")); + System.getenv("PATH")); Assertions.assertTrue(opaqueMvnCmd.contains(getMvnCmdFilename() + " io.openliberty.tools:liberty-maven-plugin:dev"), - "Expected cmd to contain 'mvn io.openliberty.tools...' but cmd = " + opaqueMvnCmd); + "Expected cmd to contain 'mvn io.openliberty.tools...' but cmd = " + opaqueMvnCmd); } @Test @@ -368,7 +368,7 @@ public void testMavenWrapperCommandAssembly() throws IOException, InterruptedExc String projPath = iProject.getLocation().toOSString(); String opaqueMvnwCmd = CommandBuilder.getMavenCommandLine(projPath, "io.openliberty.tools:liberty-maven-plugin:dev -f " + projPath, - System.getenv("PATH")); + System.getenv("PATH")); Assertions.assertTrue(opaqueMvnwCmd.contains("mvnw"), "Expected cmd to contain 'mvnw' but cmd = " + opaqueMvnwCmd); } @@ -383,7 +383,7 @@ public void testDashboardStartActionWithWrapper() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(MVN_WRAPPER_APP_NAME, true, - wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); + wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -431,7 +431,7 @@ public void testDashboardStopExternalServer() throws CommandNotFoundException, I // Doing a 'clean' first in case server was started previously and terminated abruptly. App tests may fail, // making it look like an "outer", actual test is failing, so we skip the tests. String cmd = CommandBuilder.getMavenCommandLine(projAbsolutePath.toString(), - "clean io.openliberty.tools:liberty-maven-plugin:dev -DskipITs=true", null); + "clean io.openliberty.tools:liberty-maven-plugin:dev -DskipITs=true", null); if (LibertyPluginTestUtils.onWindows()) { cmd = "cmd.exe /c" + cmd; @@ -446,7 +446,7 @@ public void testDashboardStopExternalServer() throws CommandNotFoundException, I // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(MVN_WRAPPER_APP_NAME, true, - wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); + wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); // Stop dev mode. launchDashboardAction(MVN_WRAPPER_APP_NAME, DashboardView.APP_MENU_ACTION_STOP); @@ -810,7 +810,7 @@ public void testStartWithWrapperAndNoPreferencesSet() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(MVN_WRAPPER_APP_NAME, true, - wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); + wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -867,15 +867,15 @@ public void testDefaultJRECompliance() { String buildPathJRE = LibertyPluginTestUtils.getJREFromBuildpath(projectPath.toString()); Assertions.assertTrue(buildPathJRE != null, - () -> "Unable to find the JRE configured in the project's build path (.classpath)."); + () -> "Unable to find the JRE configured in the project's build path (.classpath)."); SWTBotCombo comboJREBox = getComboTextBoxWithTextPrefix(bot, buildPathJRE); Assertions.assertTrue(comboJREBox != null, - () -> "The java installation shown on the Liberty run configurations JRE tab does not contain the Java installation configured on project's the build path (claspath):" - + buildPathJRE); + () -> "The java installation shown on the Liberty run configurations JRE tab does not contain the Java installation configured on project's the build path (claspath):" + + buildPathJRE); Assertions.assertTrue(comboJREBox.isEnabled(), - () -> "The JRE tab box showing Java installation \" + buildPathJRE + \" is not selected."); + () -> "The JRE tab box showing Java installation \" + buildPathJRE + \" is not selected."); } finally { go("Close", configShell); } @@ -1014,7 +1014,7 @@ public void testRunCleanProjectCheckbox() { // Reads the text from the console output tab String consoleText = LibertyPluginTestUtils.getConsoleOutput(); Assertions.assertTrue(consoleText.contains("clean io.openliberty.tools:liberty-maven-plugin:dev"), - "Console text should contain 'clean io.openliberty.tools:liberty-maven-plugin:dev'"); + "Console text should contain 'clean io.openliberty.tools:liberty-maven-plugin:dev'"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -1062,7 +1062,7 @@ public void testDebugSourceLookupContent() { // Validate dependency projects are in source lookup list Assertions.assertTrue(jarEntryFound, "The dependency project, " + MVN_SHARED_LIB_NAME - + ", was not listed in the source lookup list for project " + MVN_APP_NAME); + + ", was not listed in the source lookup list for project " + MVN_APP_NAME); } } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenWithSpaceTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenWithSpaceTest.java index 25405875..4895e3d1 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenWithSpaceTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMavenWithSpaceTest.java @@ -93,7 +93,7 @@ public void afterEach(TestInfo info) { super.afterEach(info); } - + @AfterAll public static void cleanup() throws IOException { for (String p : projectPaths) { @@ -101,7 +101,7 @@ public static void cleanup() throws IOException { } unsetBuildCmdPathInPreferences(bot, "Maven"); } - + /** * Tests the start menu action on a dashboard listed application for wrapper project. */ @@ -113,7 +113,7 @@ public void testDashboardStartActionWithWrapper() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(MVN_WRAPPER_APP_NAME, true, - wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); + wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -124,7 +124,7 @@ public void testDashboardStartActionWithWrapper() { // Validate application stopped. LibertyPluginTestUtils.validateLibertyServerStopped(wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); } - + /** * Tests the debug menu action on a dashboard listed application for wrapper project. */ @@ -145,8 +145,7 @@ public void testDashboardDebugActionWrapper() { // Validate application stopped. LibertyPluginTestUtils.validateLibertyServerStopped(wrapperProjectPath.toAbsolutePath().toString() + "/target/liberty"); } - - + /** * Tests the start menu action on a dashboard listed application. */ @@ -158,7 +157,7 @@ public void testDashboardStartActionProject() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcome(MVN_APP_NAME, true, - projectPath.toAbsolutePath().toString() + "/target/liberty"); + projectPath.toAbsolutePath().toString() + "/target/liberty"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -169,7 +168,7 @@ public void testDashboardStartActionProject() { // Validate application stopped. LibertyPluginTestUtils.validateLibertyServerStopped(projectPath.toAbsolutePath().toString() + "/target/liberty"); } - + /** * Tests the debug menu action on a dashboard listed application. */ diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMultiModMavenTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMultiModMavenTest.java index 169d51a2..be3efaa3 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMultiModMavenTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotMultiModMavenTest.java @@ -90,19 +90,19 @@ public class LibertyPluginSWTBotMultiModMavenTest extends AbstractLibertyPluginS * Expected menu items. */ static String[] mvnMenuItems = new String[] { DashboardView.APP_MENU_ACTION_START, DashboardView.APP_MENU_ACTION_START_CONFIG, - DashboardView.APP_MENU_ACTION_START_IN_CONTAINER, DashboardView.APP_MENU_ACTION_DEBUG, - DashboardView.APP_MENU_ACTION_DEBUG_CONFIG, DashboardView.APP_MENU_ACTION_DEBUG_IN_CONTAINER, - DashboardView.APP_MENU_ACTION_STOP, DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT, - DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }; + DashboardView.APP_MENU_ACTION_START_IN_CONTAINER, DashboardView.APP_MENU_ACTION_DEBUG, + DashboardView.APP_MENU_ACTION_DEBUG_CONFIG, DashboardView.APP_MENU_ACTION_DEBUG_IN_CONTAINER, + DashboardView.APP_MENU_ACTION_STOP, DashboardView.APP_MENU_ACTION_RUN_TESTS, DashboardView.APP_MENU_ACTION_VIEW_MVN_IT_REPORT, + DashboardView.APP_MENU_ACTION_VIEW_MVN_UT_REPORT }; /** * Run As configuration menu items. */ static String[] runAsShortcuts = new String[] { LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT, - LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT, }; + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START_CONTAINER, LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT, + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT, }; static File workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(); @@ -181,16 +181,16 @@ public static final void validateBeforeTestRun() { // Check that the menu that the application in the dashboard contains the required actions. List menuItems = getDashboardItemMenuActions(MVN_APP_NAME); Assertions.assertTrue(menuItems.size() == mvnMenuItems.length, - () -> "Maven application " + MVN_APP_NAME + " does not contain the expected number of menu items: " + mvnMenuItems.length); + () -> "Maven application " + MVN_APP_NAME + " does not contain the expected number of menu items: " + mvnMenuItems.length); Assertions.assertTrue(menuItems.containsAll(Arrays.asList(mvnMenuItems)), - () -> "Maven application " + MVN_APP_NAME + " does not contain the expected menu items: " + mvnMenuItems); + () -> "Maven application " + MVN_APP_NAME + " does not contain the expected menu items: " + mvnMenuItems); // Check that the Run As menu contains the expected shortcut SWTBotMenu runAsMenu = SWTBotPluginOperations.getAppRunAsMenu(bot, MVN_APP_NAME); Assertions.assertTrue(runAsMenu != null, "The runAs menu associated with project: " + MVN_APP_NAME + " is null."); List runAsMenuItems = runAsMenu.menuItems(); Assertions.assertTrue(runAsMenuItems != null && !runAsMenuItems.isEmpty(), - "The runAs menu associated with project: " + MVN_APP_NAME + " is null or empty."); + "The runAs menu associated with project: " + MVN_APP_NAME + " is null or empty."); int foundItems = 0; for (String expectedItem : runAsShortcuts) { @@ -203,9 +203,9 @@ public static final void validateBeforeTestRun() { } Assertions.assertTrue(foundItems == runAsShortcuts.length, - "The runAs menu associated with project: " + MVN_APP_NAME - + " does not contain one or more expected entries. Expected number of entries: " + runAsShortcuts.length - + "Found entry count: " + foundItems + ". Found menu entries: " + runAsMenuItems); + "The runAs menu associated with project: " + MVN_APP_NAME + + " does not contain one or more expected entries. Expected number of entries: " + runAsShortcuts.length + + "Found entry count: " + foundItems + ". Found menu entries: " + runAsMenuItems); // Check that the Run As -> Run Configurations... contains the Liberty entry in the menu. Shell configShell = launchRunConfigurationsDialogFromAppRunAs(MVN_APP_NAME); @@ -233,9 +233,9 @@ public void testDashboardStartAction() { SWTBotPluginOperations.launchDashboardAction(MVN_APP_NAME, DashboardView.APP_MENU_ACTION_START); LibertyPluginTestUtils.validateApplicationOutcomeCustom("http://localhost:9080/converter1/heights.jsp?heightCm=10", true, - "Height in feet and inches", serverModule1Path + "/target/liberty"); + "Height in feet and inches", serverModule1Path + "/target/liberty"); LibertyPluginTestUtils.validateApplicationOutcomeCustom("http://localhost:9080/converter2/heights.jsp?heightCm=20", true, - "Height in feet and inches", serverModule1Path + "/target/liberty"); + "Height in feet and inches", serverModule1Path + "/target/liberty"); // If there are issues with the workspace, close the error dialog. SWTBotPluginOperations.pressWorkspaceErrorDialogProceedButton(bot); @@ -268,7 +268,7 @@ public void testStartWithDefaultRunAsConfig() { // Validate application is up and running. LibertyPluginTestUtils.validateApplicationOutcomeCustom("http://localhost:9080/converter1/heights.jsp?heightCm=30", true, - "Height in feet and inches", serverModule1Path + "/target/liberty"); + "Height in feet and inches", serverModule1Path + "/target/liberty"); // If there are issues with the workspace, close the error dialog. pressWorkspaceErrorDialogProceedButton(bot); @@ -324,9 +324,9 @@ public void testDebugSourceLookupContentSiblingModule() { // Validate dependency projects are in source lookup list Assertions.assertTrue(jarEntryFound, - "The sibling module project, " + MVN_JAR_NAME + ", was not listed in the source lookup list for project " + MVN_APP_NAME); + "The sibling module project, " + MVN_JAR_NAME + ", was not listed in the source lookup list for project " + MVN_APP_NAME); Assertions.assertTrue(warEntryFound, - "The sibling module project, " + MVN_WAR_NAME + ", was not listed in the source lookup list for project " + MVN_APP_NAME); + "The sibling module project, " + MVN_WAR_NAME + ", was not listed in the source lookup list for project " + MVN_APP_NAME); } @@ -372,9 +372,9 @@ public void testDebugSourceLookupContentParentModule() { // Validate dependency projects are in source lookup list Assertions.assertTrue(jarEntryFound, - "The child module project, " + MVN_JAR_NAME + ", was not listed in the source lookup list for project " + MVN_PARENT_NAME); + "The child module project, " + MVN_JAR_NAME + ", was not listed in the source lookup list for project " + MVN_PARENT_NAME); Assertions.assertTrue(warEntryFound, - "The child module project, " + MVN_WAR_NAME + ", was not listed in the source lookup list for project " + MVN_PARENT_NAME); + "The child module project, " + MVN_WAR_NAME + ", was not listed in the source lookup list for project " + MVN_PARENT_NAME); } } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisableOnMacCondition.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisableOnMacCondition.java index 3c10c18e..9d87b85d 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisableOnMacCondition.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisableOnMacCondition.java @@ -17,17 +17,18 @@ import org.junit.jupiter.api.extension.ExtensionContext; public class DisableOnMacCondition implements ExecutionCondition { - - /* This class introduces a JUNIT5 mecahnism for turning off individual testcases if running on MacOS + + /** + * This class introduces a JUNIT5 mechanism for turning off individual test cases if running on MacOS * via an annotation. See DisabledOnMac for the annotation class which uses this class */ @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { - String osName = System.getProperty("os.name"); - if(osName.equalsIgnoreCase("Mac OS X")) { - return ConditionEvaluationResult.disabled("Test disabled on mac"); - } else { - return ConditionEvaluationResult.enabled("Test enabled"); - } + String osName = System.getProperty("os.name"); + if (osName.equalsIgnoreCase("Mac OS X")) { + return ConditionEvaluationResult.disabled("Test disabled on mac"); + } else { + return ConditionEvaluationResult.enabled("Test enabled"); + } } - } \ No newline at end of file +} \ No newline at end of file diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisabledOnMac.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisabledOnMac.java index 26a804f1..b63a7461 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisabledOnMac.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/DisabledOnMac.java @@ -19,10 +19,9 @@ import org.junit.jupiter.api.extension.ExtendWith; -/* +/** * Annotation for turning off an individual JUnit5 testcase if running on MacOS */ - @Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @ExtendWith(DisableOnMacCondition.class) diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/LibertyPluginTestUtils.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/LibertyPluginTestUtils.java index 993cfd85..1470745f 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/LibertyPluginTestUtils.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/LibertyPluginTestUtils.java @@ -14,11 +14,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IConsoleManager; -import org.eclipse.ui.console.TextConsole; - import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -44,6 +39,10 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.browser.IWorkbenchBrowserSupport; +import org.eclipse.ui.console.ConsolePlugin; +import org.eclipse.ui.console.IConsole; +import org.eclipse.ui.console.IConsoleManager; +import org.eclipse.ui.console.TextConsole; import org.junit.jupiter.api.Assertions; import org.osgi.service.prefs.Preferences; @@ -55,9 +54,9 @@ public class LibertyPluginTestUtils { /** * Validates the state of the application (active/inactive) based on the expectation of success (true/false). * - * @param ctxRoot The applications context root. + * @param ctxRoot The applications context root. * @param expectSuccess True for success. False for failure. - * @param testAppPath The base path to the liberty installation. + * @param testAppPath The base path to the liberty installation. */ public static void validateApplicationOutcome(String ctxRoot, boolean expectSuccess, String testAppPath) { String expectedResponse = "Hello! How are you today?"; @@ -107,10 +106,10 @@ public static void validateLibertyServerStopped(String testAppPath) { /** * Validates the state of the application (active/inactive) based on the expectation of success (true/false). * - * @param appUrl The application URL. - * @param expectSuccess True to check for success. False to check for failure. + * @param appUrl The application URL. + * @param expectSuccess True to check for success. False to check for failure. * @param expectedResponse The expected application response payload. - * @param testAppPath The base path to the liberty installation. + * @param testAppPath The base path to the liberty installation. */ public static void validateApplicationOutcomeCustom(String appUrl, boolean expectSuccess, String expectedResponse, String testAppPath) { int retryCountLimit = 60; @@ -172,7 +171,7 @@ public static void validateApplicationOutcomeCustom(String appUrl, boolean expec } catch (Exception e) { if (expectSuccess) { System.out.println( - "INFO: Retrying application connection: Response code: " + status + ". Error message: " + e.getMessage()); + "INFO: Retrying application connection: Response code: " + status + ". Error message: " + e.getMessage()); try { Thread.sleep(reryIntervalSecs * 1000); } catch (Exception ee) { @@ -276,7 +275,7 @@ public static boolean appMonitorDisabledXmlExists(Path xmlFilePath) { /** * Validates that a wrapper is found at the the input path. * - * @param isExpected to indicate the wrapper should or should not exist + * @param isExpected to indicate the wrapper should or should not exist * @param pathToWrapper The path to the wrapper file in question. */ public static void validateWrapperInProject(boolean isExpected, String pathToWrapper) { @@ -301,10 +300,10 @@ public static void validateLibertyToolsPreferencesSet() { assertNotNull(preferences, "preferences file not found for Liberty Tools"); } } - /** - * Reads and returns the text from the console output tab + * Reads and returns the text from the console output tab + * * @return */ public static String getConsoleOutput() { @@ -420,7 +419,7 @@ private static boolean deleteDirectory(File file) { * Updates browser configuration preferences. * * @param useInternal Determines whether an internal or external browser setting is set. If true, the internal browser setting is - * set. If false the external browser setting is set. + * set. If false the external browser setting is set. * * @return True if the browser settings were updated successfully or if it already contains the desired value. False, otherwise. */ @@ -511,8 +510,7 @@ public static String getJREFromBuildpath(String testAppPath) { String[] jreParts = line.split("path="); if (jreParts.length == 2) { String jrePathRaw = jreParts[1]; - String jrePath = (jrePathRaw.endsWith("/>")) ? jrePathRaw.substring(1, jrePathRaw.length() - 3) - : jrePathRaw.substring(1, jrePathRaw.length() - 2); + String jrePath = (jrePathRaw.endsWith("/>")) ? jrePathRaw.substring(1, jrePathRaw.length() - 3) : jrePathRaw.substring(1, jrePathRaw.length() - 2); jrePath = (jrePath.endsWith("/")) ? jrePath.substring(0, jrePath.length() - 1) : jrePath; String[] jrePathParts = jrePath.split("/"); @@ -529,19 +527,19 @@ public static String getJREFromBuildpath(String testAppPath) { return jre; } - /** - * Returns the path of the xml file containing app monitoring configuration. - * - * @param projectPath The project's path. - * - * @return The custom path of the xml file containing the config to - * enable/disable app monitoring. - */ - public static Path getMavenXmlFilePathInOverridesDirectory(String projectPath) { - - Path path = Paths.get(projectPath, "target", "liberty", "wlp", "usr", "servers", "defaultServer", - "configDropins", "overrides", "disableApplicationMonitor.xml"); - - return path; - } + /** + * Returns the path of the xml file containing app monitoring configuration. + * + * @param projectPath The project's path. + * + * @return The custom path of the xml file containing the config to + * enable/disable app monitoring. + */ + public static Path getMavenXmlFilePathInOverridesDirectory(String projectPath) { + + Path path = Paths.get(projectPath, "target", "liberty", "wlp", "usr", "servers", "defaultServer", + "configDropins", "overrides", "disableApplicationMonitor.xml"); + + return path; + } } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/MagicWidgetFinder.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/MagicWidgetFinder.java index 47cff8bb..e36fb2d6 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/MagicWidgetFinder.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/MagicWidgetFinder.java @@ -560,8 +560,7 @@ public static void go(Object o) { public static void go(Object o, Option options) { if (o == null) { - throw new IllegalArgumentException( - "Object param may not be null; this likely means a widget could not be found in a previous step."); + throw new IllegalArgumentException("Object param may not be null; this likely means a widget could not be found in a previous step."); } boolean recognized = true; @@ -641,16 +640,16 @@ public void run() { SWTBotCTabItem cti = new SWTBotCTabItem((CTabItem) o); cti.show(); } else if (o instanceof ToolItem) { - ToolItem ti = (ToolItem)o; - if (SWTUtils.hasStyle((ToolItem)o, SWT.PUSH)) { - SWTBotToolbarPushButton sb = new SWTBotToolbarPushButton(ti); + ToolItem ti = (ToolItem) o; + if (SWTUtils.hasStyle((ToolItem) o, SWT.PUSH)) { + SWTBotToolbarPushButton sb = new SWTBotToolbarPushButton(ti); long expireTimeInNanos = System.nanoTime() + TimeUnit.NANOSECONDS.convert(30, TimeUnit.SECONDS); while (!sb.isEnabled() && System.nanoTime() < expireTimeInNanos) { System.out.println("Waiting for button enabled."); pause(1000); } sb.click(); - } + } } else { logErr("Unrecognized tester item (3): " + o.getClass().getName(), options); recognized = false; @@ -719,29 +718,24 @@ private static String padInt(int x) { } - - - - public static Shell activeShell() { - - final Shell shell[] = new Shell[1]; - Display.getDefault().syncExec(new Runnable() { - public void run() { - shell[0] = Display.getDefault().getActiveShell(); - - if(shell[0] == null) { - Shell[] shells = Display.getDefault().getShells(); - if(shells.length == 1) { - shell[0] = shells[1]; - } - } - - } - }); - return shell[0]; - } - - + public static Shell activeShell() { + + final Shell shell[] = new Shell[1]; + Display.getDefault().syncExec(new Runnable() { + public void run() { + shell[0] = Display.getDefault().getActiveShell(); + + if (shell[0] == null) { + Shell[] shells = Display.getDefault().getShells(); + if (shells.length == 1) { + shell[0] = shells[1]; + } + } + + } + }); + return shell[0]; + } public static void debugDumpNodes(Node n, int depth, OutputStream s) throws IOException { for (int x = 0; x < depth; x++) { @@ -794,7 +788,7 @@ public void run() { result[0] = ti.getParent().getShell(); } else { logErr("shell(...) called on object w/o a shell." + widget + " " + widget.getClass().getName(), - Option.getGlobalOptions()); + Option.getGlobalOptions()); } } @@ -974,9 +968,9 @@ public void run() { Magic.visitQueue(neighbour, name, parent, shellConstraint, matches, new HashMap(), options); logOut("* Magic.visitQueue time: [" + name + "]: " - + ((double) TimeUnit.MILLISECONDS.convert(System.nanoTime() - startTimeInNanos, TimeUnit.NANOSECONDS)) - / 1000d, - options); + + ((double) TimeUnit.MILLISECONDS.convert(System.nanoTime() - startTimeInNanos, TimeUnit.NANOSECONDS)) + / 1000d, + options); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { @@ -1128,7 +1122,7 @@ static boolean utilIsNodeAMatch(Node n, String matchingText, List matches, } } - + // Added for Liberty Tools Eclipse if (itemInfo.getTooltipText() != null) { String text = itemInfo.getTooltipText().replace("&", ""); @@ -1211,9 +1205,7 @@ public static class Option { private boolean logOut = true; // whether to log non-errors - private static final Option DEFAULT = (new Builder()).setDelayAfterActionInMsecs(500).setRetryAttempts(5) - .setUnrestrictedSearch(false).setMatcher(null).setUseContains(false).setWidgetClass(null).setThrowExceptionOnNotFound(true) - .build(); + private static final Option DEFAULT = (new Builder()).setDelayAfterActionInMsecs(500).setRetryAttempts(5).setUnrestrictedSearch(false).setMatcher(null).setUseContains(false).setWidgetClass(null).setThrowExceptionOnNotFound(true).build(); private static Option globalOptions = DEFAULT; @@ -1457,19 +1449,19 @@ public void run() { if (d == Direction.NORTH && diffY <= 5) { result.add(new Object[] { current.getItem(), Math.sqrt(Math.pow(diffX * 2, 2) + Math.pow(diffY, 2)), - new Point(diffX, diffY) }); + new Point(diffX, diffY) }); } if (d == Direction.SOUTH && diffY >= 5) { result.add(new Object[] { current.getItem(), Math.sqrt(Math.pow(diffX * 2, 2) + Math.pow(diffY, 2)), - new Point(diffX, diffY) }); + new Point(diffX, diffY) }); } if (d == Direction.EAST && diffX > 5) { result.add(new Object[] { current.getItem(), Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY * 2, 2)), - new Point(diffX, diffY) }); + new Point(diffX, diffY) }); } if (d == Direction.WEST && diffX < 5) { result.add(new Object[] { current.getItem(), Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY * 2, 2)), - new Point(diffX, diffY) }); + new Point(diffX, diffY) }); } } @@ -1677,7 +1669,7 @@ private static void addToQueue(QueueObj obj, Queue queue) { } private static void addObjectFieldsQ(Queue queue, Object obj, Node currNode, QueueObj currQueueObj, Option options, - List visitedObjects) throws IllegalArgumentException, IllegalAccessException { + List visitedObjects) throws IllegalArgumentException, IllegalAccessException { List farr = Magic.getAllFields(obj.getClass()); @@ -1700,11 +1692,11 @@ private static void addObjectFieldsQ(Queue queue, Object obj, Node cur String fieldObjectClassName = fieldObject.getClass().getName(); if (fieldObjectClassName.contains("org.eclipse.osgi.internal") || fieldObjectClassName.contains("java.lang.reflect") - || fieldObjectClassName.contains("org.eclipse.core.internal") - || fieldObjectClassName.contains("org.eclipse.e4.ui.workbench.renderers.swt.") - || fieldObjectClassName.equals("org.eclipse.swt.widgets.Event") || fieldObjectClassName.contains("ClassLoader") - || fieldObjectClassName.contains("org.eclipse.wst.common.frameworks.internal.ui.ValidationStatus") - || fieldObjectClassName.contains("org.eclipse.ui.internal.contexts.") || fieldObject instanceof Class) { + || fieldObjectClassName.contains("org.eclipse.core.internal") + || fieldObjectClassName.contains("org.eclipse.e4.ui.workbench.renderers.swt.") + || fieldObjectClassName.equals("org.eclipse.swt.widgets.Event") || fieldObjectClassName.contains("ClassLoader") + || fieldObjectClassName.contains("org.eclipse.wst.common.frameworks.internal.ui.ValidationStatus") + || fieldObjectClassName.contains("org.eclipse.ui.internal.contexts.") || fieldObject instanceof Class) { continue; } @@ -1720,7 +1712,7 @@ private static void addObjectFieldsQ(Queue queue, Object obj, Node cur for (int i = 0; i < length; i++) { Object arrayElement = Array.get(fieldObject, i); if (arrayElement != null && !arrayElement.getClass().isPrimitive() - && Magic.isUIObject(arrayElement, options)) { + && Magic.isUIObject(arrayElement, options)) { toVisit.add(arrayElement); visitedObjects.add(arrayElement); } @@ -1750,7 +1742,7 @@ private static void addObjectFieldsQ(Queue queue, Object obj, Node cur } public static void addMiscFieldsQ(final Object uiObject, final Node thisNode, final QueueObj currQueueObj, - final List visitedObjects, final Queue queue) { + final List visitedObjects, final Queue queue) { if (uiObject instanceof CommonNavigator) { CommonNavigator cn = (CommonNavigator) uiObject; @@ -1813,8 +1805,7 @@ public static void addMiscFieldsQ(final Object uiObject, final Node thisNode, fi } public static void visitQueue(final Object initialObject, String matchingText, final Node parent, final Shell shellConstraint, - List matches, final HashMap allSeen, final Option options) - throws IllegalArgumentException, IllegalAccessException { + List matches, final HashMap allSeen, final Option options) throws IllegalArgumentException, IllegalAccessException { if (initialObject == null) { return; } @@ -1923,10 +1914,10 @@ public static boolean isUIObject(Object o, Option options) { String className = o.getClass().getName(); if (className.equals(String.class.getName()) || className.equals(Boolean.class.getName()) - || className.equals(Long.class.getName()) || className.equals(Byte.class.getName()) - || className.equals(Integer.class.getName()) || className.equals(Double.class.getName()) - || className.equals(Short.class.getName()) || className.equals(Float.class.getName()) - || className.equals(Integer.class.getName()) || className.equals(Character.class.getName())) { + || className.equals(Long.class.getName()) || className.equals(Byte.class.getName()) + || className.equals(Integer.class.getName()) || className.equals(Double.class.getName()) + || className.equals(Short.class.getName()) || className.equals(Float.class.getName()) + || className.equals(Integer.class.getName()) || className.equals(Character.class.getName())) { return false; } @@ -1944,9 +1935,9 @@ public static boolean isUIObject(Object o, Option options) { do { if (curr.getName().contains("org.eclipse.e4") || curr.getName().contains("org.eclipse.swt") - || curr.getName().contains("org.eclipse.ui.") || curr.getName().contains("org.eclipse.jface") - || (curr.getName().contains("com.ibm.etools.") /* && curr.getName().contains(".ui.") */ ) // slick ui : | - || o instanceof Reference) { + || curr.getName().contains("org.eclipse.ui.") || curr.getName().contains("org.eclipse.jface") + || (curr.getName().contains("com.ibm.etools.") /* && curr.getName().contains(".ui.") */ ) // slick ui : | + || o instanceof Reference) { foundEclipse = true; } @@ -2096,8 +2087,7 @@ public void run() { } if (o == null) { - throw new IllegalArgumentException( - "param must not be null. This likely means a widget from a previous step could not be located."); + throw new IllegalArgumentException("param must not be null. This likely means a widget from a previous step could not be located."); } info.setRecognized(true); @@ -2284,8 +2274,8 @@ private static IWorkbench getWorkbench() { * Gets the active {@link IWorkbenchWindow}. * * @param activate If activate is true and no workbench window is active then a visible workbench window - * will be activated. If activate is false and no workbench window is active then no workbench - * window will be activated and null will be returned. + * will be activated. If activate is false and no workbench window is active then no workbench + * window will be activated and null will be returned. * * @return the active workbench window or null */ diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java index 2667a1dc..bf66bf58 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java @@ -27,8 +27,6 @@ import java.util.Iterator; import java.util.List; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; @@ -259,7 +257,7 @@ public void run() { } result = MagicWidgetFinder.find(objectName, debugView, - Option.factory().useContains(true).setThrowExceptionOnNotFound(false).widgetClass(TreeItem.class).build()); + Option.factory().useContains(true).setThrowExceptionOnNotFound(false).widgetClass(TreeItem.class).build()); } if (result == null) { @@ -377,9 +375,9 @@ public static List getDashboardContent() { /** * Returns a list of menu actions associated with the input application item. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param dashboard An instance representing the Open Liberty dashboard view. - * @param item The application name to select. + * @param item The application name to select. * * @return A list of menu actions for the input application item. */ @@ -415,7 +413,7 @@ public static void refreshProjectUsingExplorerView(String appName) { * Launches a dashboard action for the specified application name. * * @param appName The application name to select. - * @param action The action to select + * @param action The action to select */ public static void launchDashboardAction(String appName, String action) { openDashboardUsingToolbar(); @@ -429,7 +427,7 @@ public static void launchDashboardAction(String appName, String action) { /** * Returns the object representing the active project matching the input project name. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param item The application name. * * @return The object representing the active project matching the input project name. @@ -453,7 +451,7 @@ public static SWTBotTreeItem getInstalledProjectItem(SWTWorkbenchBot bot, String /** * Returns the object representing the explorer->project->right-click->Run As menu. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param item The application name. * * @return The object representing the Run As menu. @@ -475,7 +473,7 @@ public static SWTBotMenu getAppRunAsMenu(SWTWorkbenchBot bot, String item) { /** * Returns the object representing the explorer->project->right-click->Debug As menu. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param item The application name. * * @return The object representing the Debug As menu. @@ -499,7 +497,7 @@ public static SWTBotMenu getAppDebugAsMenu(SWTWorkbenchBot bot, String item) { * Sets the absolute path to the maven and gradle executables that should be used for build into the Liberty Tools Plugin * Preferences page * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param buildTool the build tool to be used (Maven or Gradle) */ public static void setBuildCmdPathInPreferences(SWTWorkbenchBot bot, String buildTool) { @@ -510,9 +508,7 @@ public static void setBuildCmdPathInPreferences(SWTWorkbenchBot bot, String buil String finalGradleExecutableLoc = AbstractLibertyPluginSWTBotTest.getGradleCmdPath(); // Get the preference store for the Liberty Tools plugin - org.eclipse.jface.preference.IPreferenceStore prefStore = new org.eclipse.ui.preferences.ScopedPreferenceStore( - org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE, - "io.openliberty.tools.eclipse.ui"); + org.eclipse.jface.preference.IPreferenceStore prefStore = new org.eclipse.ui.preferences.ScopedPreferenceStore(org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE, "io.openliberty.tools.eclipse.ui"); if ("Maven".equals(buildTool)) { prefStore.setValue("MVNPATH", finalMvnExecutableLoc); @@ -536,9 +532,7 @@ public static void unsetBuildCmdPathInPreferences(SWTWorkbenchBot bot, String bu // This avoids issues with menu accessibility in headless CI environments // Get the preference store for the Liberty Tools plugin - org.eclipse.jface.preference.IPreferenceStore prefStore = new org.eclipse.ui.preferences.ScopedPreferenceStore( - org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE, - "io.openliberty.tools.eclipse.ui"); + org.eclipse.jface.preference.IPreferenceStore prefStore = new org.eclipse.ui.preferences.ScopedPreferenceStore(org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE, "io.openliberty.tools.eclipse.ui"); // Reset to default values (empty strings) if ("Maven".equals(buildTool)) { @@ -629,7 +623,7 @@ public static SWTBotTreeItem getLibertyToolsConfigMenuItem(Shell shell) { /** * Deletes Liberty run configuration entries. * - * @param bot The SWTWorkbenchBot instance.. + * @param bot The SWTWorkbenchBot instance.. * @param appName The application name. */ public static void deleteLibertyToolsRunConfigEntriesFromAppRunAs(String appName) { @@ -655,7 +649,7 @@ public static void deleteLibertyToolsRunConfigEntriesFromAppRunAs(String appName /** * Deletes Liberty debug configuration entries. * - * @param bot The SWTWorkbenchBot instance.. + * @param bot The SWTWorkbenchBot instance.. * @param appName The application name. */ public static void deleteLibertyToolsDebugConfigEntriesFromMenu() { @@ -698,7 +692,7 @@ public static void launchStartWithDefaultRunConfigFromAppRunAs(String appName) { * Launches dev mode with parms using a new Liberty configuration: project -> Run As -> Run Configurations -> Liberty -> New * configuration (default) -> update parms -> Run. Note that the changes are not saved. * - * @param appName The application name. + * @param appName The application name. * @param customParms The parameter(s) to pass to the dev mode start action. */ public static void launchStartWithNewCustomRunConfig(String appName, String customParms) { @@ -711,7 +705,7 @@ public static void launchStartWithNewCustomRunConfig(String appName, String cust * Launches dev mode with parms using a new Liberty configuration: project -> Debug As -> Debug Configurations -> Liberty -> New * configuration (default) -> update parms -> Debug. Note that the changes are not saved. * - * @param appName The application name. + * @param appName The application name. * @param customParms The parameter(s) to pass to the dev mode start action. */ public static void launchStartWithNewCustomDebugConfig(String appName, String customParms) { @@ -757,7 +751,7 @@ public static void setCustomStartParmsFromShell(Shell shell, String runDebugConf Object libertyConfigTree = getLibertyTreeItem(shell); Object appConfigEntry = find(runDebugConfigName, libertyConfigTree, - Option.factory().useContains(true).widgetClass(TreeItem.class).build()); + Option.factory().useContains(true).widgetClass(TreeItem.class).build()); go(appConfigEntry); Object parmLabel = find("Start parameters:", appConfigEntry, Option.factory().widgetClass(Label.class).build()); @@ -770,7 +764,7 @@ public static void checkRunInContainerCheckBox(Shell shell, String runDebugConfi Object libertyConfigTree = getLibertyTreeItem(shell); Object appConfigEntry = find(runDebugConfigName, libertyConfigTree, - Option.factory().useContains(true).widgetClass(TreeItem.class).build()); + Option.factory().useContains(true).widgetClass(TreeItem.class).build()); go(appConfigEntry); Object button = find("Run in Container", appConfigEntry, Option.factory().widgetClass(Button.class).build()); @@ -788,7 +782,7 @@ public static void checkRunCleanProjectCheckBox(Shell shell, String runDebugConf Object libertyConfigTree = getLibertyTreeItem(shell); Object appConfigEntry = find(runDebugConfigName, libertyConfigTree, - Option.factory().useContains(true).widgetClass(TreeItem.class).build()); + Option.factory().useContains(true).widgetClass(TreeItem.class).build()); go(appConfigEntry); Object button = find("Clean project", appConfigEntry, Option.factory().widgetClass(Button.class).build()); @@ -804,39 +798,39 @@ public static Object getAppInPackageExplorerTree(String appName) { Object project = MagicWidgetFinder.find(appName, peView, Option.factory().useContains(true).widgetClass(TreeItem.class).build()); go(project); - + // Add pause to ensure UI is fully ready after selection // This helps prevent race conditions where TreeItem data isn't fully initialized // particularly on Windows in headless CI environments where selection events // can trigger cascading calls to getSelectedDashboardProject() before the // selection is fully resolved, causing infinite loops - MagicWidgetFinder.pause(5000); - + MagicWidgetFinder.pause(5000); + return project; } /** * Launches the start action using the debug as configuration shortcut. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param appName The application name. */ public static void launchStartWithDebugAsShortcut(String appName) { Object project = getAppInPackageExplorerTree(appName); MagicWidgetFinder.context(project, "Debug As", - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START + ".*")); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START + ".*")); } /** * Launches the start action using the run as configuration shortcut. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param appName The application name. */ public static void launchStartWithRunAsShortcut(String appName) { Object project = getAppInPackageExplorerTree(appName); MagicWidgetFinder.context(project, "Run As", - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START + ".*")); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_START + ".*")); } /** @@ -847,7 +841,7 @@ public static void launchStartWithRunAsShortcut(String appName) { public static void launchStopWithRunAsShortcut(String appName) { Object project = getAppInPackageExplorerTree(appName); MagicWidgetFinder.context(project, "Run As", - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP + ".*")); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_STOP + ".*")); } /** @@ -858,7 +852,7 @@ public static void launchStopWithRunAsShortcut(String appName) { public static void launchRunTestsWithRunAsShortcut(String appName) { Object project = getAppInPackageExplorerTree(appName); MagicWidgetFinder.context(project, "Run As", - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS + ".*")); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS + ".*")); } /** @@ -869,20 +863,20 @@ public static void launchRunTestsWithRunAsShortcut(String appName) { public static void launchRunTestsWithDebugAsShortcut(String appName) { Object project = getAppInPackageExplorerTree(appName); MagicWidgetFinder.context(project, "Debug As", - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS + ".*")); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_RUN_TESTS + ".*")); } /** * Launches the view (Maven) integration test report action using the run/debug as configuration shortcut. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param item The application name. */ public static void launchViewITReportWithRunDebugAsShortcut(SWTWorkbenchBot bot, String item) { SWTBotMenu runAsMenu = SWTBotPluginOperations.getAppRunAsMenu(bot, item); SWTBotMenu stopShortcut = runAsMenu.menu( - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT + ".*"), false, - 0); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_IT_REPORT + ".*"), false, + 0); stopShortcut.setFocus(); stopShortcut.click(); @@ -892,14 +886,14 @@ public static void launchViewITReportWithRunDebugAsShortcut(SWTWorkbenchBot bot, /** * Launches the view (Maven) unit test report action using the run/debug as configuration shortcut. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param item The application name. */ public static void launchViewUTReportWithRunDebugAsShortcut(SWTWorkbenchBot bot, String item) { SWTBotMenu runAsMenu = SWTBotPluginOperations.getAppRunAsMenu(bot, item); SWTBotMenu stopShortcut = runAsMenu.menu( - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT + ".*"), false, - 0); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_MVN_VIEW_UT_REPORT + ".*"), false, + 0); stopShortcut.setFocus(); stopShortcut.click(); @@ -909,14 +903,14 @@ public static void launchViewUTReportWithRunDebugAsShortcut(SWTWorkbenchBot bot, /** * Launches the view (Gradle) test report action using the run/debug as configuration shortcut. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param item The application name. */ public static void launchViewTestReportWithRunDebugAsShortcut(SWTWorkbenchBot bot, String item) { SWTBotMenu runAsMenu = SWTBotPluginOperations.getAppRunAsMenu(bot, item); SWTBotMenu stopShortcut = runAsMenu.menu( - WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT + ".*"), - false, 0); + WidgetMatcherFactory.withRegex(".*" + LaunchConfigurationDelegateLauncher.LAUNCH_SHORTCUT_GRADLE_VIEW_TEST_REPORT + ".*"), + false, 0); stopShortcut.setFocus(); stopShortcut.click(); @@ -938,7 +932,7 @@ public static void enableLibertyTools(String appName) { /** * Get the content of a text editor view obtained associated with the input title name. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param title The complete title view name. * * @return The content of a text editor view obtained associated with the input title name. @@ -953,7 +947,7 @@ public static String getTextEditorContentByTitle(SWTWorkbenchBot bot, String tit /** * Searches for the text editor that contains the complete or partial input title name. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param titleContent The complete or partial title name. * * @return The text editor object associated with input title name. @@ -974,10 +968,10 @@ public static SWTBotEditor searchForEditor(SWTWorkbenchBot bot, String titleCont /** * Returns the content of the file associated with the the input file name under the input application name. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param appViewTitle The title of the view (i.e. Project Explorer) where to look. - * @param appName The application where to find the file. - * @param fileName The name of the file from which to retrieve content. + * @param appName The application where to find the file. + * @param fileName The name of the file from which to retrieve content. * * @return The content of the file associated with the the input file name under the input application name. */ @@ -1007,9 +1001,9 @@ public static String getAppFileContent(SWTWorkbenchBot bot, String appViewTitle, /** * Writes the input content to a text editor view. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param titleContent The title or part of the title of the text editor view to update. - * @param content The content with which the text editor view is updated. + * @param content The content with which the text editor view is updated. */ public static void setEditorText(SWTWorkbenchBot bot, String titleContent, String content) { SWTBotEditor editor = searchForEditor(bot, titleContent); @@ -1022,7 +1016,7 @@ public static void setEditorText(SWTWorkbenchBot bot, String titleContent, Strin /** * Returns the content to a text editor view. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param titleContent The title or part of the title of the text editor view. * * @return The content to a text editor view. @@ -1154,7 +1148,7 @@ public static void pressWorkspaceErrorDialogProceedButton(SWTWorkbenchBot bot) { /** * Returns a SWTBotToolbarButton instance representing the toolbar button with the input tooltip prefix. * - * @param bot The SWTWorkbenchBot instance. + * @param bot The SWTWorkbenchBot instance. * @param toolTipPrefix The tooltip prefix. * * @return A SWTBotToolbarButton instance representing the toolbar button with the input tooltip prefix. @@ -1170,8 +1164,7 @@ public static SWTBotToolbarButton getToolbarButtonWithToolTipPrefix(SWTWorkbench } } - throw new RuntimeException( - "toolbar button of type ToolItem, with style push, and tooltip prefix of " + toolTipPrefix + " was not found."); + throw new RuntimeException("toolbar button of type ToolItem, with style push, and tooltip prefix of " + toolTipPrefix + " was not found."); } @SuppressWarnings("unchecked") diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotTestCondition.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotTestCondition.java index 07b9bcda..ff9b53ef 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotTestCondition.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotTestCondition.java @@ -32,7 +32,7 @@ public class SWTBotTestCondition { /** * Returns true if the view is active. False, otherwise. * - * @param view The view to check. + * @param view The view to check. * @param viewName The name of the view. * * @return True if the view is active. False, otherwise. @@ -55,7 +55,7 @@ public String getFailureMessage() { /** * Returns true if the view is active. False, otherwise. * - * @param view The view to check. + * @param view The view to check. * @param viewName The name of the view. * * @return True if the view is active. False, otherwise. @@ -190,7 +190,7 @@ public String getFailureMessage() { /** * Returns true if the editor containing the input name is active. False, otherwise. * - * @param wbbot The Workbench bot instance. + * @param wbbot The Workbench bot instance. * @param fileName The editor title or a subset of the title name. * * @return True if the editor containing the input name is active. False, otherwise. diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginTychoOnlyUnitTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginTychoOnlyUnitTest.java index 9af5c010..3a17ff16 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginTychoOnlyUnitTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginTychoOnlyUnitTest.java @@ -61,28 +61,28 @@ public void afterEach(TestInfo info) { System.out.println("INFO: Test " + info.getDisplayName() + " exit: " + java.time.LocalDateTime.now()); } - - /** - * Test that run configs with similar attributes (project name, local vs. container), are reused by {@link LaunchConfigurationHelper#getLaunchConfiguration(IProject, String, RuntimeEnv)} + * Test that run configs with similar attributes (project name, local vs. container), are reused by + * {@link LaunchConfigurationHelper#getLaunchConfiguration(IProject, String, RuntimeEnv)} * - * Perhaps ideally the filter method called within would be separately tested. But this test would've been enough to catch https://github.com/OpenLiberty/liberty-tools-eclipse/issues/357 + * Perhaps ideally the filter method called within would be separately tested. But this test would've been enough to catch + * https://github.com/OpenLiberty/liberty-tools-eclipse/issues/357 * * @throws Exception */ @Test public void testGetLaunchConfiguration() throws Exception { - + DevModeOperations devModeOps = mock(DevModeOperations.class); WorkspaceProjectsModel projModel = mock(WorkspaceProjectsModel.class); - try( MockedStatic devModeOpsMock = mockStatic(DevModeOperations.class); - MockedStatic jreTabMock = mockStatic(JRETab.class)) { + try (MockedStatic devModeOpsMock = mockStatic(DevModeOperations.class); + MockedStatic jreTabMock = mockStatic(JRETab.class)) { devModeOpsMock.when(DevModeOperations::getInstance).thenReturn(devModeOps); - jreTabMock.when(()-> JRETab.getDefaultJavaFromBuildPath(any())).thenReturn("mock-build-path"); + jreTabMock.when(() -> JRETab.getDefaultJavaFromBuildPath(any())).thenReturn("mock-build-path"); when(devModeOps.getProjectModel()).thenReturn(projModel); - when (projModel.getDefaultStartParameters(any())).thenReturn(""); + when(projModel.getDefaultStartParameters(any())).thenReturn(""); LaunchConfigurationHelper launchConfigHelper = LaunchConfigurationHelper.getInstance(); ILaunchConfiguration cfg1 = launchConfigHelper.getLaunchConfiguration(mockIProject("getLaunchConfiguration"), "run", RuntimeEnv.LOCAL); @@ -92,23 +92,23 @@ public void testGetLaunchConfiguration() throws Exception { ILaunchConfiguration cfg5 = launchConfigHelper.getLaunchConfiguration(mockIProject("getLaunchConfiguration"), "run", RuntimeEnv.CONTAINER); ILaunchConfiguration cfg6 = launchConfigHelper.getLaunchConfiguration(mockIProject("getLaunchConfiguration"), "run", RuntimeEnv.CONTAINER); ILaunchConfiguration cfg7 = launchConfigHelper.getLaunchConfiguration(mockIProject("getLaunchConfiguration"), "run", RuntimeEnv.LOCAL); - Set uniqueConfigNames = new HashSet(); - ILaunchConfiguration[] configs = {cfg1, cfg2, cfg3, cfg4, cfg5, cfg6, cfg7}; + Set uniqueConfigNames = new HashSet(); + ILaunchConfiguration[] configs = { cfg1, cfg2, cfg3, cfg4, cfg5, cfg6, cfg7 }; for (ILaunchConfiguration config : configs) { uniqueConfigNames.add(config.getName()); } - - Assertions.assertFalse(cfg1.getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER,(boolean)true), "Expecting local config for cfg1"); - Assertions.assertTrue(cfg2.getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, (boolean)false), "Expecting container config for cfg2"); + + Assertions.assertFalse(cfg1.getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, (boolean) true), "Expecting local config for cfg1"); + Assertions.assertTrue(cfg2.getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, (boolean) false), "Expecting container config for cfg2"); Assertions.assertEquals(2, uniqueConfigNames.size(), - "Expecting only two unique configs, one for local, one for container"); + "Expecting only two unique configs, one for local, one for container"); } } - + public static IProject mockIProject(String projectName) throws CoreException { IProject mockProject = mock(IProject.class); - when (mockProject.getName()).thenReturn(projectName); + when(mockProject.getName()).thenReturn(projectName); return mockProject; } } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginUnitTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginUnitTest.java index 24d73427..579c3f5e 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginUnitTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/ut/LibertyPluginUnitTest.java @@ -126,28 +126,29 @@ public void testConfigFiltering() throws Exception { List rawCfgList = getDefaultConfigurationList(); // Test 1. Normal run. - List filteredListDev = launchConfigHelper - .filterLaunchConfigurations(rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", RuntimeEnv.LOCAL); + List filteredListDev = launchConfigHelper.filterLaunchConfigurations(rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", + RuntimeEnv.LOCAL); Assertions.assertTrue(filteredListDev.size() == 3, - "The resulting list should have contained 3 entries. List size: " + filteredListDev.size()); + "The resulting list should have contained 3 entries. List size: " + filteredListDev.size()); Assertions.assertTrue(filteredListDev.get(0).getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, true) == false, - "The run in container value associated with config entry[0] was not false."); + "The run in container value associated with config entry[0] was not false."); Assertions.assertTrue(filteredListDev.get(1).getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, true) == false, - "The run in container value associated with config entry[1] was not false."); + "The run in container value associated with config entry[1] was not false."); Assertions.assertTrue(filteredListDev.get(2).getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, true) == false, - "The run in container value associated with config entry[2] was not false."); + "The run in container value associated with config entry[2] was not false."); // test 2. Container run. List filteredListDevc = launchConfigHelper.filterLaunchConfigurations( - rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", RuntimeEnv.CONTAINER); + rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", + RuntimeEnv.CONTAINER); Assertions.assertTrue(filteredListDevc.size() == 3, - "The resulting list should have contained 3 entries. Found: " + filteredListDevc.size() + ". List: " + filteredListDevc); + "The resulting list should have contained 3 entries. Found: " + filteredListDevc.size() + ". List: " + filteredListDevc); Assertions.assertTrue(filteredListDevc.get(0).getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, false) == true, - "The run in container value associated with config entry[0] was not true."); + "The run in container value associated with config entry[0] was not true."); Assertions.assertTrue(filteredListDevc.get(1).getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, false) == true, - "The run in container value associated with config entry[1] was not true."); + "The run in container value associated with config entry[1] was not true."); Assertions.assertTrue(filteredListDevc.get(2).getAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, false) == true, - "The run in container value associated with config entry[2] was not true."); + "The run in container value associated with config entry[2] was not true."); } /** @@ -159,10 +160,10 @@ public void testConfigFiltering() throws Exception { public void testRetrieveLastRunConfig() throws Exception { LaunchConfigurationHelper launchConfigHelper = LaunchConfigurationHelper.getInstance(); List rawCfgList = getDefaultConfigurationList(); - List filteredListDev = launchConfigHelper - .filterLaunchConfigurations(rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", RuntimeEnv.LOCAL); + List filteredListDev = launchConfigHelper.filterLaunchConfigurations(rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", + RuntimeEnv.LOCAL); Assertions.assertTrue(filteredListDev.size() == 3, - "The resulting list should have contained 3 entries. List size: " + filteredListDev.size()); + "The resulting list should have contained 3 entries. List size: " + filteredListDev.size()); // Test 1. Normal run. ILaunchConfiguration lastRunConfigDev = launchConfigHelper.getLastRunConfiguration(filteredListDev); @@ -170,71 +171,74 @@ public void testRetrieveLastRunConfig() throws Exception { String cfgNameFoundDev = lastRunConfigDev.getName(); String expectedCfgNameDev = "test2"; Assertions.assertTrue(expectedCfgNameDev.equals(cfgNameFoundDev), - "The expected configuration of " + expectedCfgNameDev + " was not returned. Configuration returned:: " + cfgNameFoundDev); + "The expected configuration of " + expectedCfgNameDev + " was not returned. Configuration returned:: " + cfgNameFoundDev); long expectedTimeDev = 1000000000003L; long timeFoundDev = Long.valueOf(lastRunConfigDev.getAttribute(StartTab.PROJECT_RUN_TIME, "0")); Assertions.assertTrue(timeFoundDev == expectedTimeDev, - "The configuration found does not contain the expected value of " + expectedTimeDev + ". Time found: " + timeFoundDev); + "The configuration found does not contain the expected value of " + expectedTimeDev + ". Time found: " + timeFoundDev); // Test 2. Container run. List filteredListDevc = launchConfigHelper.filterLaunchConfigurations( - rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", RuntimeEnv.CONTAINER); + rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", + RuntimeEnv.CONTAINER); Assertions.assertTrue(filteredListDevc.size() == 3, - "The resulting list should have contained 3 entries. List size: " + filteredListDevc.size()); + "The resulting list should have contained 3 entries. List size: " + filteredListDevc.size()); ILaunchConfiguration lastRunConfigDevc = launchConfigHelper.getLastRunConfiguration(filteredListDevc); String cfgNameFoundDevc = lastRunConfigDevc.getName(); String expectedCfgNameDevc = "test6"; Assertions.assertTrue(expectedCfgNameDevc.equals(cfgNameFoundDevc), - "The expected configuration of " + expectedCfgNameDevc + " was not returned. Configuration returned:: " + cfgNameFoundDevc); + "The expected configuration of " + expectedCfgNameDevc + " was not returned. Configuration returned:: " + cfgNameFoundDevc); long expectedTimeDevc = 1000000000006L; long timeFoundDevc = Long.valueOf(lastRunConfigDevc.getAttribute(StartTab.PROJECT_RUN_TIME, "0")); Assertions.assertTrue(timeFoundDevc == expectedTimeDevc, - "The configuration found does not contain the expected value of " + expectedTimeDevc + ". Time found: " + timeFoundDevc); + "The configuration found does not contain the expected value of " + expectedTimeDevc + ". Time found: " + timeFoundDevc); // Test 3: Normal run. Configurations with equal minimum time. Configuration with max time expected. - List filteredListT3Dev = launchConfigHelper - .filterLaunchConfigurations(rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project2", RuntimeEnv.LOCAL); + List filteredListT3Dev = launchConfigHelper.filterLaunchConfigurations(rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project2", + RuntimeEnv.LOCAL); Assertions.assertTrue(filteredListT3Dev.size() == 3, - "The resulting list should have contained 3 entries. List size: " + filteredListT3Dev.size()); + "The resulting list should have contained 3 entries. List size: " + filteredListT3Dev.size()); ILaunchConfiguration lastRunConfigT3Dev = launchConfigHelper.getLastRunConfiguration(filteredListT3Dev); String cfgNameFoundT3Dev = lastRunConfigT3Dev.getName(); String expectedCfgNameT3Dev = "test11"; Assertions.assertTrue(expectedCfgNameT3Dev.equals(cfgNameFoundT3Dev), "The expected configuration of " + expectedCfgNameT3Dev - + " was not returned. Configuration returned:: " + cfgNameFoundT3Dev); + + " was not returned. Configuration returned:: " + cfgNameFoundT3Dev); // Test 4: Container run. Configurations with equal max time. One of the max times is returned. // In this particular case, is the second entry after the entries are sorted. List filteredListT4Devc = launchConfigHelper.filterLaunchConfigurations( - rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project3", RuntimeEnv.CONTAINER); + rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project3", + RuntimeEnv.CONTAINER); Assertions.assertTrue(filteredListT4Devc.size() == 3, - "The resulting list should have contained 3 entries. List size: " + filteredListT4Devc.size()); + "The resulting list should have contained 3 entries. List size: " + filteredListT4Devc.size()); ILaunchConfiguration lastRunConfigT4Devc = launchConfigHelper.getLastRunConfiguration(filteredListT4Devc); String cfgNameFoundT4Devc = lastRunConfigT4Devc.getName(); String expectedCfgNameT4Devc = "test16"; Assertions.assertTrue(expectedCfgNameT4Devc.equals(cfgNameFoundT4Devc), "The expected configuration of " + expectedCfgNameT4Devc - + " was not returned. Configuration returned:: " + cfgNameFoundT4Devc); + + " was not returned. Configuration returned:: " + cfgNameFoundT4Devc); // Test 5: This is the start... case where we do not really know the runtime environment to be used to run dev mode. // In this case, it is expected that the configuration that ran last irrespective of runtime environment should be returned. List filteredListT5Dev = launchConfigHelper.filterLaunchConfigurations( - rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", RuntimeEnv.UNKNOWN); + rawCfgList.toArray(new ILaunchConfiguration[rawCfgList.size()]), "project1", + RuntimeEnv.UNKNOWN); Assertions.assertTrue(filteredListT5Dev.size() == 6, - "The resulting list should have contained 6 entries. List size: " + filteredListT5Dev.size()); + "The resulting list should have contained 6 entries. List size: " + filteredListT5Dev.size()); ILaunchConfiguration lastRunConfigT5Dev = launchConfigHelper.getLastRunConfiguration(filteredListT5Dev); String cfgNameFoundT5Dev = lastRunConfigT5Dev.getName(); String expectedCfgNameT5Dev = "test6"; Assertions.assertTrue(expectedCfgNameT5Dev.equals(cfgNameFoundT5Dev), "The expected configuration of " + expectedCfgNameT5Dev - + " was not returned. Configuration returned:: " + cfgNameFoundT5Dev); + + " was not returned. Configuration returned:: " + cfgNameFoundT5Dev); } /** @@ -247,31 +251,31 @@ public void testRetrieveLastRunConfig() throws Exception { private List getDefaultConfigurationList() throws CoreException { ArrayList configList = new ArrayList(); configList.add(mockLaunchConfiguration(Map.of("name", "test1", StartTab.PROJECT_NAME, "project1", StartTab.PROJECT_RUN_TIME, - "1000000000001", StartTab.PROJECT_RUN_IN_CONTAINER, false))); + "1000000000001", StartTab.PROJECT_RUN_IN_CONTAINER, false))); configList.add(mockLaunchConfiguration(Map.of("name", "test2", StartTab.PROJECT_NAME, "project1", StartTab.PROJECT_RUN_TIME, - "1000000000003", StartTab.PROJECT_RUN_IN_CONTAINER, false))); + "1000000000003", StartTab.PROJECT_RUN_IN_CONTAINER, false))); configList.add(mockLaunchConfiguration(Map.of("name", "test3", StartTab.PROJECT_NAME, "project1", StartTab.PROJECT_RUN_TIME, - "1000000000002", StartTab.PROJECT_RUN_IN_CONTAINER, false))); + "1000000000002", StartTab.PROJECT_RUN_IN_CONTAINER, false))); configList.add(mockLaunchConfiguration(Map.of("name", "test4", StartTab.PROJECT_NAME, "project1", StartTab.PROJECT_RUN_TIME, - "1000000000004", StartTab.PROJECT_RUN_IN_CONTAINER, true))); + "1000000000004", StartTab.PROJECT_RUN_IN_CONTAINER, true))); configList.add(mockLaunchConfiguration(Map.of("name", "test5", StartTab.PROJECT_NAME, "project1", StartTab.PROJECT_RUN_TIME, - "1000000000005", StartTab.PROJECT_RUN_IN_CONTAINER, true))); + "1000000000005", StartTab.PROJECT_RUN_IN_CONTAINER, true))); configList.add(mockLaunchConfiguration(Map.of("name", "test6", StartTab.PROJECT_NAME, "project1", StartTab.PROJECT_RUN_TIME, - "1000000000006", StartTab.PROJECT_RUN_IN_CONTAINER, true))); + "1000000000006", StartTab.PROJECT_RUN_IN_CONTAINER, true))); configList.add(mockLaunchConfiguration(Map.of("name", "test10", StartTab.PROJECT_NAME, "project2", StartTab.PROJECT_RUN_TIME, - "1000000000010", StartTab.PROJECT_RUN_IN_CONTAINER, false))); + "1000000000010", StartTab.PROJECT_RUN_IN_CONTAINER, false))); configList.add(mockLaunchConfiguration(Map.of("name", "test11", StartTab.PROJECT_NAME, "project2", StartTab.PROJECT_RUN_TIME, - "1000000000011", StartTab.PROJECT_RUN_IN_CONTAINER, false))); + "1000000000011", StartTab.PROJECT_RUN_IN_CONTAINER, false))); configList.add(mockLaunchConfiguration(Map.of("name", "test12", StartTab.PROJECT_NAME, "project2", StartTab.PROJECT_RUN_TIME, - "1000000000010", StartTab.PROJECT_RUN_IN_CONTAINER, false))); + "1000000000010", StartTab.PROJECT_RUN_IN_CONTAINER, false))); configList.add(mockLaunchConfiguration(Map.of("name", "test15", StartTab.PROJECT_NAME, "project3", StartTab.PROJECT_RUN_TIME, - "1000000000011", StartTab.PROJECT_RUN_IN_CONTAINER, true))); + "1000000000011", StartTab.PROJECT_RUN_IN_CONTAINER, true))); configList.add(mockLaunchConfiguration(Map.of("name", "test16", StartTab.PROJECT_NAME, "project3", StartTab.PROJECT_RUN_TIME, - "1000000000011", StartTab.PROJECT_RUN_IN_CONTAINER, true))); + "1000000000011", StartTab.PROJECT_RUN_IN_CONTAINER, true))); configList.add(mockLaunchConfiguration(Map.of("name", "test17", StartTab.PROJECT_NAME, "project3", StartTab.PROJECT_RUN_TIME, - "1000000000010", StartTab.PROJECT_RUN_IN_CONTAINER, true))); + "1000000000010", StartTab.PROJECT_RUN_IN_CONTAINER, true))); return configList; } @@ -289,10 +293,8 @@ public static ILaunchConfiguration mockLaunchConfiguration(Map a ILaunchConfiguration config = mock(ILaunchConfiguration.class); when(config.getName()).thenReturn((String) attributes.get("name")); when(config.getAttribute(eq(StartTab.PROJECT_NAME), anyString())).thenReturn(((String) attributes.get(StartTab.PROJECT_NAME))); - when(config.getAttribute(eq(StartTab.PROJECT_RUN_TIME), anyString())) - .thenReturn(((String) attributes.get(StartTab.PROJECT_RUN_TIME))); - when(config.getAttribute(eq(StartTab.PROJECT_RUN_IN_CONTAINER), anyBoolean())) - .thenReturn(((Boolean) attributes.get(StartTab.PROJECT_RUN_IN_CONTAINER)).booleanValue()); + when(config.getAttribute(eq(StartTab.PROJECT_RUN_TIME), anyString())).thenReturn(((String) attributes.get(StartTab.PROJECT_RUN_TIME))); + when(config.getAttribute(eq(StartTab.PROJECT_RUN_IN_CONTAINER), anyBoolean())).thenReturn(((Boolean) attributes.get(StartTab.PROJECT_RUN_IN_CONTAINER)).booleanValue()); return config; }