This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit bffccb8d867a327934af286a344982e2bec04327 Author: Guillaume Nodet <gno...@gmail.com> AuthorDate: Fri Jun 12 08:41:06 2020 +0200 [CAMEL-14578] Add auto formatting --- .../src/main/resources/camel-checkstyle.xml | 5 +- .../resources/camel-eclipse-formatter-config.xml | 383 +++++++++++++++++++++ .../xtokenizer/XMLTokenExpressionIteratorTest.java | 222 ++++++------ parent/pom.xml | 96 ++++-- pom.xml | 2 + 5 files changed, 588 insertions(+), 120 deletions(-) diff --git a/buildingtools/src/main/resources/camel-checkstyle.xml b/buildingtools/src/main/resources/camel-checkstyle.xml index 3f2e34a..8a2f679 100644 --- a/buildingtools/src/main/resources/camel-checkstyle.xml +++ b/buildingtools/src/main/resources/camel-checkstyle.xml @@ -181,6 +181,7 @@ lengths, if/try depths, etc... <!-- Checks for whitespace --> <!-- See http://checkstyle.sf.net/config_whitespace.html --> + <!-- <module name="EmptyForIteratorPad"/> <module name="EmptyForInitializerPad"/> <module name="MethodParamPad"/> @@ -196,8 +197,8 @@ lengths, if/try depths, etc... </module> <module name="WhitespaceAround"> <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN,TYPE_ [...] - <!-- <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR [...] </module> + --> <!-- <module name="GenericWhitespace"/> @@ -374,9 +375,11 @@ lengths, if/try depths, etc... <!--<module name="UncommentedMain"/>--> <!--module name="TrailingComment"/--> + <!-- <module name="Indentation"> <property name="lineWrappingIndentation" value="0"/> </module> + --> <!--<module name="RequiredRegexp">--> <module name="SuppressionCommentFilter"> <property name="offCommentFormat" value="CHECKSTYLE\:OFF"/> diff --git a/buildingtools/src/main/resources/camel-eclipse-formatter-config.xml b/buildingtools/src/main/resources/camel-eclipse-formatter-config.xml new file mode 100644 index 0000000..6213a10 --- /dev/null +++ b/buildingtools/src/main/resources/camel-eclipse-formatter-config.xml @@ -0,0 +1,383 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<profiles version="8"> + <profile name="Camel Java Conventions" version="8" kind="CodeFormatterProfile"> + <setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/> + <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="16"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="17"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="82"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="2"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="8"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="16"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="18"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/> + <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/> + <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> + <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> + <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="CHECKSTYLE:OFF"/> + <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="CHECKSTYLE:ON"/> + <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> + <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/> + <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="128"/> + <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/> + <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> + <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/> + <setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/> + <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/> + <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/> + </profile> +</profiles> diff --git a/core/camel-xml-jaxp/src/test/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIteratorTest.java b/core/camel-xml-jaxp/src/test/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIteratorTest.java index 5a1d131..deb23de 100644 --- a/core/camel-xml-jaxp/src/test/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIteratorTest.java +++ b/core/camel-xml-jaxp/src/test/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIteratorTest.java @@ -84,37 +84,43 @@ public class XMLTokenExpressionIteratorTest { + "</grandparent>" + "</g:greatgrandparent>").getBytes(); + private static final String RESULTS_CW1 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" + + "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='a' anotherAttr='a'></c:child>" + + "</c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CW2 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" + + "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='b' anotherAttr='b'/>" + + "</c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CW3 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" + + "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='c' anotherAttr='c'></c:child>" + + "</c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CW4 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" + + "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='d' anotherAttr='d'/>" + + "</c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CW5 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" + + "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='e' anotherAttr='e'></c:child>" + + "</c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CW6 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" + + "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='f' anotherAttr='f'/>" + + "</c:parent></grandparent></g:greatgrandparent>"; private static final String[] RESULTS_CHILD_WRAPPED = { - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" - + "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='a' anotherAttr='a'></c:child>" - + "</c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" - + "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='b' anotherAttr='b'/>" - + "</c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" - + "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='c' anotherAttr='c'></c:child>" - + "</c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" - + "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='d' anotherAttr='d'/>" - + "</c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" - + "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='e' anotherAttr='e'></c:child>" - + "</c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" - + "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='f' anotherAttr='f'/>" - + "</c:parent></grandparent></g:greatgrandparent>" + RESULTS_CW1, + RESULTS_CW2, + RESULTS_CW3, + RESULTS_CW4, + RESULTS_CW5, + RESULTS_CW6 }; private static final String[] RESULTS_CHILD_MIXED = { @@ -124,19 +130,27 @@ public class XMLTokenExpressionIteratorTest { "<c:child some_attr='d' anotherAttr='d' xmlns:g=\"urn:g\" xmlns:c=\"urn:c\"/>" }; + private static final String RESULTS_CMW1 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" + + "<child some_attr='a' anotherAttr='a'></child></parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CMW2 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" + + "<x:child xmlns:x='urn:c' some_attr='b' anotherAttr='b'/></parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CMW3 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<c:parent some_attr='2' xmlns:c='urn:c'>" + + "<child some_attr='c' anotherAttr='c' xmlns='urn:c'></child></c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CMW4 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<c:parent some_attr='2' xmlns:c='urn:c'>" + + "<c:child some_attr='d' anotherAttr='d'/></c:parent></grandparent></g:greatgrandparent>"; private static final String[] RESULTS_CHILD_MIXED_WRAPPED = { - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" - + "<child some_attr='a' anotherAttr='a'></child></parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" - + "<x:child xmlns:x='urn:c' some_attr='b' anotherAttr='b'/></parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<c:parent some_attr='2' xmlns:c='urn:c'>" - + "<child some_attr='c' anotherAttr='c' xmlns='urn:c'></child></c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<c:parent some_attr='2' xmlns:c='urn:c'>" - + "<c:child some_attr='d' anotherAttr='d'/></c:parent></grandparent></g:greatgrandparent>" + RESULTS_CMW1, + RESULTS_CMW2, + RESULTS_CMW3, + RESULTS_CMW4 }; private static final String[] RESULTS_CHILD = { @@ -153,14 +167,18 @@ public class XMLTokenExpressionIteratorTest { "<child some_attr='c' anotherAttr='c' xmlns:g=\"urn:g\" xmlns:c=\"urn:c\"></child>", }; + private static final String RESULT_CNNMW1 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" + + "<child some_attr='a' anotherAttr='a' xmlns=''></child></parent></grandparent></g:greatgrandparent>"; + private static final String RESULT_CNNMW2 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<c:parent some_attr='2' xmlns:c='urn:c'>" + + "<child some_attr='c' anotherAttr='c'></child></c:parent></grandparent></g:greatgrandparent>"; // note that there is no preceding sibling to the extracted child private static final String[] RESULTS_CHILD_NO_NS_MIXED_WRAPPED = { - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" - + "<child some_attr='a' anotherAttr='a' xmlns=''></child></parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<c:parent some_attr='2' xmlns:c='urn:c'>" - + "<child some_attr='c' anotherAttr='c'></child></c:parent></grandparent></g:greatgrandparent>", + RESULT_CNNMW1, + RESULT_CNNMW2, }; private static final String[] RESULTS_CHILD_NS_MIXED = { @@ -168,63 +186,75 @@ public class XMLTokenExpressionIteratorTest { "<c:child some_attr='d' anotherAttr='d' xmlns:g=\"urn:g\" xmlns:c=\"urn:c\"/>" }; + private static final String RESULTS_CNMW1 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" + + "<child some_attr='a' anotherAttr='a' xmlns=''></child>" + + "<x:child xmlns:x='urn:c' some_attr='b' anotherAttr='b'/></parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_CNMW2 + = "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" + + "<c:parent some_attr='2' xmlns:c='urn:c'>" + + "<child some_attr='c' anotherAttr='c'></child>" + + "<c:child some_attr='d' anotherAttr='d'/></c:parent></grandparent></g:greatgrandparent>"; // note that there is a preceding sibling to the extracted child private static final String[] RESULTS_CHILD_NS_MIXED_WRAPPED = { - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<parent some_attr='1' xmlns:c='urn:c' xmlns=\"urn:c\">" - + "<child some_attr='a' anotherAttr='a' xmlns=''></child>" - + "<x:child xmlns:x='urn:c' some_attr='b' anotherAttr='b'/></parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?><g:greatgrandparent xmlns:g='urn:g'><grandparent>" - + "<c:parent some_attr='2' xmlns:c='urn:c'>" - + "<child some_attr='c' anotherAttr='c'></child>" - + "<c:child some_attr='d' anotherAttr='d'/></c:parent></grandparent></g:greatgrandparent>" + RESULTS_CNMW1, + RESULTS_CNMW2 }; + private static final String RESULTS_PW1 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" + + "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='a' anotherAttr='a'></c:child>" + + "<c:child some_attr='b' anotherAttr='b'/>" + + "</c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_PW2 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" + + "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='c' anotherAttr='c'></c:child>" + + "<c:child some_attr='d' anotherAttr='d'/>" + + "</c:parent></grandparent></g:greatgrandparent>"; + private static final String RESULTS_PW3 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" + + "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\">" + + "<c:child some_attr='e' anotherAttr='e'></c:child>" + + "<c:child some_attr='f' anotherAttr='f'/>" + + "</c:parent></grandparent></g:greatgrandparent>"; private static final String[] RESULTS_PARENT_WRAPPED = { - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" - + "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='a' anotherAttr='a'></c:child>" - + "<c:child some_attr='b' anotherAttr='b'/>" - + "</c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" - + "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='c' anotherAttr='c'></c:child>" - + "<c:child some_attr='d' anotherAttr='d'/>" - + "</c:parent></grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" - + "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\">" - + "<c:child some_attr='e' anotherAttr='e'></c:child>" - + "<c:child some_attr='f' anotherAttr='f'/>" - + "</c:parent></grandparent></g:greatgrandparent>", + RESULTS_PW1, + RESULTS_PW2, + RESULTS_PW3, }; - + + private static final String RESULTS_P1 = "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\" xmlns:g='urn:g'>" + + "<c:child some_attr='a' anotherAttr='a'></c:child>" + + "<c:child some_attr='b' anotherAttr='b'/>" + + "</c:parent>"; + private static final String RESULTS_P2 = "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\" xmlns:g='urn:g'>" + + "<c:child some_attr='c' anotherAttr='c'></c:child>" + + "<c:child some_attr='d' anotherAttr='d'/>" + + "</c:parent>"; + private static final String RESULTS_P3 = "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\" xmlns:g='urn:g'>" + + "<c:child some_attr='e' anotherAttr='e'></c:child>" + + "<c:child some_attr='f' anotherAttr='f'/>" + + "</c:parent>"; private static final String[] RESULTS_PARENT = { - "<c:parent some_attr='1' xmlns:c='urn:c' xmlns:d=\"urn:d\" xmlns:g='urn:g'>" - + "<c:child some_attr='a' anotherAttr='a'></c:child>" - + "<c:child some_attr='b' anotherAttr='b'/>" - + "</c:parent>", - "<c:parent some_attr='2' xmlns:c='urn:c' xmlns:d=\"urn:d\" xmlns:g='urn:g'>" - + "<c:child some_attr='c' anotherAttr='c'></c:child>" - + "<c:child some_attr='d' anotherAttr='d'/>" - + "</c:parent>", - "<c:parent some_attr='3' xmlns:c='urn:c' xmlns:d=\"urn:d\" xmlns:g='urn:g'>" - + "<c:child some_attr='e' anotherAttr='e'></c:child>" - + "<c:child some_attr='f' anotherAttr='f'/>" - + "</c:parent>", + RESULTS_P1, + RESULTS_P2, + RESULTS_P3, }; - + + private static final String RESULTS_AW1 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" + + "</grandparent></g:greatgrandparent>"; + private static final String RESULTS_AW2 = "<?xml version='1.0' encoding='UTF-8'?>" + + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" + + "</grandparent></g:greatgrandparent>"; private static final String[] RESULTS_AUNT_WRAPPED = { - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle/><aunt>emma</aunt>" - + "</grandparent></g:greatgrandparent>", - "<?xml version='1.0' encoding='UTF-8'?>" - + "<g:greatgrandparent xmlns:g='urn:g'><grandparent><uncle>ben</uncle><aunt/>" - + "</grandparent></g:greatgrandparent>" - }; - + RESULTS_AW1, + RESULTS_AW2 + }; + private static final String[] RESULTS_AUNT = { "<aunt xmlns:g=\"urn:g\">emma</aunt>", "<aunt xmlns:g=\"urn:g\"/>" diff --git a/parent/pom.xml b/parent/pom.xml index 960165b..27ba879 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -4250,7 +4250,52 @@ </execution> </executions> </plugin> - + <plugin> + <groupId>net.revelc.code</groupId> + <artifactId>impsort-maven-plugin</artifactId> + <version>${impsort-maven-plugin-version}</version> + <configuration> + <groups>java.,javax.,org.w3c.,org.xml.,junit.,*</groups> + <excludes>**/package-info.java</excludes> + <staticAfter>true</staticAfter> + <removeUnused>true</removeUnused> + </configuration> + <executions> + <execution> + <id>sort-imports</id> + <phase>process-sources</phase> + <goals> + <goal>sort</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + <version>${formatter-maven-plugin.version}</version> + <configuration> + <configFile>camel-eclipse-formatter-config.xml</configFile> + <skip>${format.skip}</skip> + <skipHtmlFormatting>true</skipHtmlFormatting> + <cachedir>${basedir}/target</cachedir> + </configuration> + <dependencies> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-buildtools</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + <executions> + <execution> + <id>format</id> + <goals> + <goal>format</goal> + </goals> + </execution> + </executions> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -4363,26 +4408,43 @@ </profile> <profile> - <id>impsort</id> + <id>sourcecheck</id> <build> <plugins> <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + </plugin> + <plugin> + <groupId>net.revelc.code.formatter</groupId> + <artifactId>formatter-maven-plugin</artifactId> + <executions> + <execution> + <id>format</id> + <phase /> + </execution> + <execution> + <id>validate</id> + <goals> + <goal>validate</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> <groupId>net.revelc.code</groupId> <artifactId>impsort-maven-plugin</artifactId> - <version>${impsort-maven-plugin-version}</version> <executions> <execution> <id>sort-imports</id> + <phase /> + </execution> + <execution> + <id>check</id> + <phase>validate</phase> <goals> - <goal>sort</goal> + <goal>check</goal> </goals> - <phase>process-sources</phase> - <configuration> - <groups>java.,javax.,org.w3c.,org.xml.,junit.,*</groups> - <excludes>**/package-info.java</excludes> - <staticAfter>true</staticAfter> - <removeUnused>true</removeUnused> - </configuration> </execution> </executions> </plugin> @@ -4391,18 +4453,6 @@ </profile> <profile> - <id>sourcecheck</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> - </profile> - - <profile> <id>revapi</id> <build> <plugins> diff --git a/pom.xml b/pom.xml index 1b97c5e..4190dd3 100644 --- a/pom.xml +++ b/pom.xml @@ -119,6 +119,8 @@ <maven-surefire-plugin-version>3.0.0-M4</maven-surefire-plugin-version> <!-- we need to override the version inherited from Apache POM for modules that use this POM as parent --> <surefire.version>${maven-surefire-plugin-version}</surefire.version> + <formatter-maven-plugin.version>2.12.1</formatter-maven-plugin.version> + <impsort-maven-plugin.version>1.3.2</impsort-maven-plugin.version> <!-- eclipse plugin need the jaxb in this pom.xml file --> <!-- Make sure to keep JAXB version up to date in parent/pom.xml in the bottom of the file -->