diff --git a/dev/io.openliberty.checkpoint_fat_faces/.classpath b/dev/io.openliberty.checkpoint_fat_faces/.classpath new file mode 100644 index 000000000000..81a45f7249fa --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/.project b/dev/io.openliberty.checkpoint_fat_faces/.project new file mode 100644 index 000000000000..402905dce376 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/.project @@ -0,0 +1,34 @@ + + + io.openliberty.checkpoint_fat_faces + + + + + + org.eclipse.jdt.core.javabuilder + + + + + bndtools.core.bndbuilder + + + + + + org.eclipse.jdt.core.javanature + bndtools.core.bndnature + + + + 1744220855508 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/.settings/bndtools.core.prefs b/dev/io.openliberty.checkpoint_fat_faces/.settings/bndtools.core.prefs new file mode 100644 index 000000000000..789fa99991ac --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/.settings/bndtools.core.prefs @@ -0,0 +1,2 @@ +compileErrorAction=build +eclipse.preferences.version=1 diff --git a/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.core.resources.prefs b/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000000..25d9425fe34e --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +#Ant properties +#Automatically generated by the ant prepare.settings.files task +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.jdt.core.prefs b/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000000..ee1e988d5eb9 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,294 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=ignore +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.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=8 +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=80 +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/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.jdt.ui.prefs b/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000000..c0003634609f --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,60 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +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.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_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=false +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/dev/io.openliberty.checkpoint_fat_faces/bnd.bnd b/dev/io.openliberty.checkpoint_fat_faces/bnd.bnd new file mode 100644 index 000000000000..cfd5b0601055 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/bnd.bnd @@ -0,0 +1,69 @@ +#******************************************************************************* +# Copyright (c) 2025 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +#******************************************************************************* +-include= ~../cnf/resources/bnd/bundle.props +bVersion=1.0 + +src: \ + fat/src,\ + test-applications/CDIIntegrationTest.war/src, \ + test-applications/CDIManagedProperty.war/src, \ + test-applications/ConvertDateTime.war/src, \ + test-applications/ConverterValidatorBehaviorInjectionTarget.war/src, \ + test-applications/ELImplicitObjectsViaCDI.war/src, \ + test-applications/ELImplicitObjectsViaCDI.war/src, \ + test-applications/ELImplicitObjectsViaCDIErrorApp.war/src, \ + test-applications/UIRepeatConditionCheck.war/src, \ + test-applications/PostRenderViewEvent.war/src + +fat.project: true + +tested.features: \ + beanvalidation-2.0,\ + beanvalidation-3.0,\ + cdi-2.0,\ + cdi-3.0,\ + cdi-4.0,\ + cdi-4.1,\ + checkpoint,\ + expressionlanguage-4.0,\ + expressionlanguage-5.0,\ + expressionlanguage-6.0,\ + faces-3.0,\ + faces-4.0,\ + faces-4.1,\ + jsf-2.3,\ + pages-3.0,\ + pages-3.1,\ + servlet-4.0,\ + servlet-5.0,\ + servlet-6.0,\ + servlet-6.1,\ + validation-3.1 + + +-buildpath: \ + com.ibm.websphere.javaee.annotation.1.2;version=latest,\ + com.ibm.ws.org.apache.httpcomponents;version=latest, \ + net.sourceforge.htmlunit:htmlunit;version=2.44.0,\ + net.sourceforge.htmlunit:webdriver;version=2.6,\ + net.sourceforge.htmlunit:neko-htmlunit;strategy=exact;version=2.44.0,\ + org.seleniumhq.webdriver:webdriver-common;version=0.9.7376,\ + org.brotli:dec;version=0.1.2,\ + net.sourceforge.htmlunit:htmlunit-cssparser;version=1.6.0,\ + xml-apis:xml-apis;version=1.4.01,\ + com.ibm.websphere.appserver.thirdparty.jsf-2.3;version=latest, \ + com.ibm.ws.org.apache.myfaces.2.3;version=latest, \ + com.ibm.websphere.javaee.cdi.2.0;version=latest,\ + com.ibm.websphere.javaee.jsf.2.3;version=latest,\ + com.ibm.websphere.javaee.servlet.4.0;version=latest,\ + com.ibm.websphere.javaee.el.3.0;version=latest,\ + io.openliberty.org.apache.commons.logging;version=latest,\ + io.openliberty.org.apache.commons.codec;version=latest,\ + io.openliberty.org.apache.xercesImpl;version=latest diff --git a/dev/io.openliberty.checkpoint_fat_faces/build.gradle b/dev/io.openliberty.checkpoint_fat_faces/build.gradle new file mode 100644 index 000000000000..c48b5b945bed --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/build.gradle @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2025 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +dependencies { + requiredLibs 'net.sourceforge.htmlunit:htmlunit-cssparser:1.6.0', + 'net.sourceforge.htmlunit:htmlunit:2.44.0', + 'net.sourceforge.htmlunit:htmlunit-core-js:2.44.0', + 'net.sourceforge.htmlunit:neko-htmlunit:2.44.0', + 'net.sourceforge.htmlunit:webdriver:2.6', + 'org.seleniumhq.webdriver:webdriver-common:0.9.7376', + 'org.brotli:dec:0.1.2', + 'org.apache.commons:commons-lang3:3.8', + project(':com.ibm.ws.org.apache.commons.io'), + project(':io.openliberty.org.apache.commons.codec'), + 'org.apache.httpcomponents:httpmime:4.5.3', + project(':com.ibm.ws.org.apache.httpcomponents'), + 'org.eclipse.jetty:jetty-io:9.2.15.v20160210', + 'org.eclipse.jetty:jetty-websocket:8.2.0.v20160908', + 'org.eclipse.jetty.websocket:websocket-client:9.2.15.v20160210', + 'org.eclipse.jetty.websocket:websocket-api:9.2.15.v20160210', + 'org.eclipse.jetty.websocket:websocket-common:9.2.15.v20160210', + 'org.eclipse.jetty:jetty-websocket:8.2.0.v20160908', + 'org.eclipse.jetty:jetty-util:9.2.15.v20160210', + 'org.eclipse.jetty:jetty-http:9.4.9.v20180320', + 'org.eclipse.birt.runtime:org.w3c.css.sac:1.3.1.v200903091627', + project(':io.openliberty.org.apache.commons.codec'), + project(':io.openliberty.org.apache.commons.logging'), + 'org.apache.commons:commons-text:1.9', + project(':io.openliberty.org.apache.xercesImpl'), + 'xalan:xalan:2.7.2', + 'xml-apis:xml-apis:1.4.01' + } + +addRequiredLibraries.dependsOn addJakartaTransformer diff --git a/dev/io.openliberty.checkpoint_fat_faces/cognitiveMetadata.yml b/dev/io.openliberty.checkpoint_fat_faces/cognitiveMetadata.yml new file mode 100644 index 000000000000..36285657b71e --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/cognitiveMetadata.yml @@ -0,0 +1,6 @@ +--- +# YML metadata file made use of by the Cognitive Ecosystem. +# Reference Cognitive Metadata is available at: https://github.com/OpenLiberty/open-liberty/tree/integration/dev/build.example_fat/cognitiveMetadata.yml +# description: Uncomment this field and add a description to give some notes about this bucket. +# triageNotes: Uncomment this field if there are some short notes you would like Pipeline Monitors to see when triaging this bucket. +functionalArea: InstantOn diff --git a/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/FATSuite.java b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/FATSuite.java new file mode 100644 index 000000000000..83ee008ce15f --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/FATSuite.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2025 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package io.openliberty.checkpoint.fat; + +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; + +import com.ibm.ws.fat.util.FatLogHandler; + +import componenttest.custom.junit.runner.FATRunner; + +import componenttest.custom.junit.runner.AlwaysPassesTest; +import componenttest.topology.impl.LibertyServer; + +import componenttest.rules.repeater.EmptyAction; +import componenttest.rules.repeater.FeatureReplacementAction; +import componenttest.rules.repeater.RepeatTests; + +@RunWith(Suite.class) +@SuiteClasses({ + AlwaysPassesTest.class, + JSF23CDIGeneralTests.class, + JSF23UIRepeatConditionTests.class +}) + +public class FATSuite { + + @ClassRule + public static RepeatTests repeat; + + static { + repeat = RepeatTests.with(new EmptyAction().fullFATOnly()) + .andWith(FeatureReplacementAction.EE9_FEATURES().conditionalFullFATOnly(FeatureReplacementAction.GREATER_THAN_OR_EQUAL_JAVA_11)) + .andWith(FeatureReplacementAction.EE10_FEATURES().conditionalFullFATOnly(FeatureReplacementAction.GREATER_THAN_OR_EQUAL_JAVA_17)) + .andWith(FeatureReplacementAction.EE11_FEATURES()); + } + + /** + * @see {@link FatLogHandler#generateHelpFile()} + */ + @BeforeClass + public static void generateHelpFile() { + FatLogHandler.generateHelpFile(); + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSF23CDIGeneralTests.java b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSF23CDIGeneralTests.java new file mode 100644 index 000000000000..9700d4b7cb6e --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSF23CDIGeneralTests.java @@ -0,0 +1,537 @@ +/******************************************************************************* + * Copyright (c) 2017, 2025 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package io.openliberty.checkpoint.fat; + +import static componenttest.annotation.SkipForRepeat.EE10_OR_LATER_FEATURES; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.net.URL; +import java.util.Arrays; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.AfterClass; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; +import org.junit.runner.RunWith; + +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlForm; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; +import com.gargoylesoftware.htmlunit.html.HtmlTextInput; +import com.ibm.websphere.simplicity.ShrinkHelper; +import com.ibm.websphere.simplicity.ShrinkHelper.DeployOptions; +import com.ibm.websphere.simplicity.log.Log; +import io.openliberty.checkpoint.fat.JSFUtils; + +import io.openliberty.checkpoint.spi.CheckpointPhase; +import componenttest.annotation.CheckpointTest; +import componenttest.annotation.ExpectedFFDC; +import componenttest.annotation.Server; +import componenttest.annotation.SkipForRepeat; +import componenttest.custom.junit.runner.FATRunner; +import componenttest.custom.junit.runner.Mode; +import componenttest.custom.junit.runner.Mode.TestMode; +import componenttest.rules.repeater.JakartaEEAction; +import componenttest.topology.impl.LibertyServer; +import junit.framework.Assert; + +import io.openliberty.checkpoint.spi.CheckpointPhase; +import componenttest.annotation.CheckpointTest; + +/** + * General JSF 2.3 test cases the also require CDI. + * + * Copied from com.ibm.ws.jsf.2.3_fat.2 + */ +@CheckpointTest +@RunWith(FATRunner.class) +public class JSF23CDIGeneralTests { + + protected static final Class c = JSF23CDIGeneralTests.class; + + private static boolean isEE10; + + static final String PostRenderViewEvent_APP_NAME = "PostRenderViewEvent"; + static final String CDIManagedProperty_APP_NAME = "CDIManagedProperty"; + static final String ConvertDateTime_APP_NAME = "ConvertDateTime"; + static final String ConverterValidatorBehaviorInjectionTarget_APP_NAME = "ConverterValidatorBehaviorInjectionTarget"; + static final String CDIIntegrationTest_APP_NAME = "CDIIntegrationTest"; + + @Rule + public TestName name = new TestName(); + + @Server("jsf23CDIGeneralServer") + public static LibertyServer server; + + @BeforeClass + public static void setup() throws Exception { + isEE10 = JakartaEEAction.isEE10OrLaterActive(); + + ShrinkHelper.defaultDropinApp(server, "PostRenderViewEvent.war", "com.ibm.ws.jsf23.fat.postrenderview.events"); + ShrinkHelper.defaultDropinApp(server, "CDIManagedProperty.war", "com.ibm.ws.jsf23.fat.cdi.managedproperty"); + ShrinkHelper.defaultDropinApp(server, "ConvertDateTime.war", "com.ibm.ws.jsf23.fat.convertdatetime.beans"); + ShrinkHelper.defaultDropinApp(server, "ConverterValidatorBehaviorInjectionTarget.war", "com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans"); + ShrinkHelper.defaultDropinApp(server, "CDIIntegrationTest.war", + "com.ibm.ws.jsf23.fat.cdi.integration.application", + "com.ibm.ws.jsf23.fat.cdi.integration.beans", + "com.ibm.ws.jsf23.fat.cdi.integration.viewhandler"); + + WebArchive elImplicitObjectsViaCDIApp = ShrinkWrap.create(WebArchive.class, "ELImplicitObjectsViaCDI.war"); + elImplicitObjectsViaCDIApp.addPackage("com.ibm.ws.jsf23.fat.elimplicit.cdi.beans"); + ShrinkHelper.addDirectory(elImplicitObjectsViaCDIApp, "test-applications/" + "ELImplicitObjectsViaCDI.war" + "/resources"); + ShrinkHelper.addDirectory(elImplicitObjectsViaCDIApp, + "test-applications/" + "ELImplicitObjectsViaCDI.war" + (isEE10 ? "/resourcesFaces40" : "/resourcesJSF23")); + ShrinkHelper.exportDropinAppToServer(server, elImplicitObjectsViaCDIApp); + + server.setCheckpoint(CheckpointPhase.AFTER_APP_START, false, + server -> { + assertNotNull("'SRVE0169I: Loading Web Module: " + PostRenderViewEvent_APP_NAME + "' message not found in log before rerstore", + server.waitForStringInLogUsingMark("SRVE0169I: .*" + PostRenderViewEvent_APP_NAME, 0)); + assertNotNull("'CWWKZ0001I: Application " + PostRenderViewEvent_APP_NAME + " started' message not found in log.", + server.waitForStringInLogUsingMark("CWWKZ0001I: .*" + PostRenderViewEvent_APP_NAME, 0)); + + assertNotNull("'SRVE0169I: Loading Web Module: " + CDIManagedProperty_APP_NAME + "' message not found in log before rerstore", + server.waitForStringInLogUsingMark("SRVE0169I: .*" + CDIManagedProperty_APP_NAME, 0)); + assertNotNull("'CWWKZ0001I: Application " + CDIManagedProperty_APP_NAME + " started' message not found in log.", + server.waitForStringInLogUsingMark("CWWKZ0001I: .*" + CDIManagedProperty_APP_NAME, 0)); + + assertNotNull("'SRVE0169I: Loading Web Module: " + ConvertDateTime_APP_NAME + "' message not found in log before rerstore", + server.waitForStringInLogUsingMark("SRVE0169I: .*" + ConvertDateTime_APP_NAME, 0)); + assertNotNull("'CWWKZ0001I: Application " + ConvertDateTime_APP_NAME + " started' message not found in log.", + server.waitForStringInLogUsingMark("CWWKZ0001I: .*" + ConvertDateTime_APP_NAME, 0)); + + assertNotNull("'SRVE0169I: Loading Web Module: " + ConverterValidatorBehaviorInjectionTarget_APP_NAME + "' message not found in log before rerstore", + server.waitForStringInLogUsingMark("SRVE0169I: .*" + ConverterValidatorBehaviorInjectionTarget_APP_NAME, 0)); + assertNotNull("'CWWKZ0001I: Application " + ConverterValidatorBehaviorInjectionTarget_APP_NAME + " started' message not found in log.", + server.waitForStringInLogUsingMark("CWWKZ0001I: .*" + ConverterValidatorBehaviorInjectionTarget_APP_NAME, 0)); + + assertNotNull("'SRVE0169I: Loading Web Module: " + CDIIntegrationTest_APP_NAME + "' message not found in log before rerstore", + server.waitForStringInLogUsingMark("SRVE0169I: .*" + CDIIntegrationTest_APP_NAME, 0)); + assertNotNull("'CWWKZ0001I: Application " + CDIIntegrationTest_APP_NAME + " started' message not found in log.", + server.waitForStringInLogUsingMark("CWWKZ0001I: .*" + CDIIntegrationTest_APP_NAME, 0)); + }); + + server.startServer(c.getSimpleName() + ".log"); + + server.checkpointRestore(); + } + + @Before + public void startServer() throws Exception { + if (server != null && !server.isStarted()) { + server.startServer(c.getSimpleName() + ".log"); + } + } + + @AfterClass + public static void tearDown() throws Exception { + // Stop the server + if (server != null && server.isStarted()) { + server.stopServer(); + } + } + + /** + * This test case drives a request to an application that has a PhaseListener that will + * log a message before and after the RENDER_RESPONSE phase of the JSF lifecycle. + * + * During the RENDER_RESSPONE phase the PreRenderView and PostRenderView events should + * be fired in order. We check the trace log to ensure that the logged messages are output + * in the correct order. + * + * @throws Exception + */ + @Test + public void testPostRenderViewEvent() throws Exception { + String contextRoot = "PostRenderViewEvent"; + try (WebClient webClient = new WebClient()) { + + // Construct the URL for the test + URL url = JSFUtils.createHttpUrl(server, contextRoot, ""); + + HtmlPage page = (HtmlPage) webClient.getPage(url); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), page.asText()); + Log.info(c, name.getMethodName(), page.asXml()); + + // Ensure the messages are output in the correct order to verify the events are fired + // in the correct order. + String beforeRenderResponse = "Before Render Response Phase"; + String afterRenderResponse = "After Render Response Phase"; + String preRenderView = "Processing PreRenderViewEvent"; + String postRenderView = "Processing PostRenderViewEvent"; + + assertNotNull("The following String was not found in the trace log: " + beforeRenderResponse, + server.waitForStringInTraceUsingLastOffset(beforeRenderResponse)); + + assertNotNull("The following String was not found in the trace log: " + preRenderView, + server.waitForStringInTraceUsingLastOffset(preRenderView)); + + assertNotNull("The following String was not found in the trace log: " + postRenderView, + server.waitForStringInTraceUsingLastOffset(postRenderView)); + + assertNotNull("The following String was not found in the trace log: " + afterRenderResponse, + server.waitForStringInTraceUsingLastOffset(afterRenderResponse)); + } + + } + + /** + * This test is run on a server that has an application deployed that contains a + * faces-config.xml with a version element of 2.3. The PostRenderViewEvent.war + * has a faces-config.xml in it with the 2.3 version. + * + * This test will ensure the application with the faces-config.xml we are testing + * has been started. + * + * The test will ensure that the following exception is not found in the trace.log: + * + * CWWKC2262E: The server is unable to process the 2.3 version and the + * http://xmlns.jcp.org/xml/ns/javaee namespace in the /WEB-INF/faces-config.xml + * deployment descriptor on line 5 + * + * @throws Exception + */ + @Test + public void testFacesConfigVersion23() throws Exception { + String appStarted = server.waitForStringInLog("CWWKZ0001I.*" + "Application PostRenderViewEvent", server.getConsoleLogFile()); + + assertTrue("The PostRenderViewEvent application did not start.", appStarted != null); + assertTrue("The CWWKC2262E exception was found in the trace.log when it should not have been.", + server.findStringsInTrace("CWWKC2262E").isEmpty()); + } + + /** + * This is a test for the CDI @ManagedProperty. The test drives a request to a page + * and ensures that the proper initial values are found. + * + * Then the values are updated and the test checks to ensure we get the proper + * updated values. + * + * The beans that are used are testing that @ManagedPropery works for multiple different + * types including arrays, parameterized List, and primitive + * + * See the CDIManagedProperty.war for more details. + * + * @throws Exception + */ + @Test + public void testCDIManagedProperty() throws Exception { + String contextRoot = "CDIManagedProperty"; + try (WebClient webClient = new WebClient()) { + + String initalValue = "numberManagedProperty = 0 textManagedProperty = zero " + + "listManagedProperty = zero stringArrayManagedProperty = " + + "zero bean = com.ibm.ws.jsf23.fat.cdi.managedproperty.TestBean"; + + String finalValue = "numberManagedProperty = 1 textManagedProperty = 2 " + + "listManagedProperty = 3 stringArrayManagedProperty = 4 bean = " + + "com.ibm.ws.jsf23.fat.cdi.managedproperty.TestBean"; + + // Construct the URL for the test + URL url = JSFUtils.createHttpUrl(server, contextRoot, ""); + + HtmlPage page = (HtmlPage) webClient.getPage(url); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), page.asText()); + Log.info(c, name.getMethodName(), page.asXml()); + + HtmlTextInput input1 = (HtmlTextInput) page.getElementById("in1"); + HtmlTextInput input2 = (HtmlTextInput) page.getElementById("in2"); + HtmlTextInput input3 = (HtmlTextInput) page.getElementById("in3"); + HtmlTextInput input4 = (HtmlTextInput) page.getElementById("in4"); + + String output = page.getElementById("out1").asText(); + + // Assert the initial values of out1. + assertTrue("The initial values were not correct. One or more of the @ManagedProperty injections failed.", + output.substring(0, output.indexOf("@")).equals(initalValue)); + + // Now fill in the new values into the input fields + input1.setValueAttribute("1"); + input2.setValueAttribute("2"); + input3.setValueAttribute("3"); + input4.setValueAttribute("4"); + + // Now click the submit button + page = page.getElementById("button1").click(); + + Log.info(c, name.getMethodName(), page.asText()); + + output = page.getElementById("out1").asText(); + + // Assert the updated values of out1 + assertTrue("The updated values were not correct. One or more of the @ManagedProperty injections failed.", + output.substring(0, output.indexOf("@")).equals(finalValue)); + } + } + + /** + * Test to ensure that the EL Resolution of implicit objects works as expected + * when CDI is being used. + * + * @throws Exception + */ + @Test + public void testELResolutionImplicitObjects() throws Exception { + try (WebClient webClient = new WebClient()) { + + // Add a message to the header map. + // Tested was changed to check for User-Agent in order to be consistent with Selenium Test above + // webClient.addRequestHeader("headerMessage", "This is a test"); + + // Construct the URL for the test + String contextRoot = "ELImplicitObjectsViaCDI"; + URL url = JSFUtils.createHttpUrl(server, contextRoot, "implicit_objects.xhtml?message=Hello World"); + + HtmlPage testELResolutionImplicitObjectsPage = (HtmlPage) webClient.getPage(url); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), testELResolutionImplicitObjectsPage.asText()); + Log.info(c, name.getMethodName(), testELResolutionImplicitObjectsPage.asXml()); + + // Verify that the page contains the expected messages. + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("JSF 2.3 EL resolution of implicit objects using CDI")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Bean: com.ibm.ws.jsf23.fat.elimplicit.cdi.beans.ELImplicitObjectBean")); + + // MYFACES-4559 + if (isEE10) { + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Application name: JSF23ELImplicitObjectsViaCDI")); + } else { + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Application project stage: Production")); + } + + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("ApplicationScope application name: ELImplicitObjectsViaCDI")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Component getStyle: font-weight:bold")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("CompositeComponent label: Hello World")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("FacesContext project stage: Production")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Flash isRedirect: false")); + //Updated to check for User Agent + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Header: Mozilla")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("HeaderValues: Mozilla")); + + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("InitParam: ELImplicitObjectsViaCDI")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Param: Hello World")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("ParamValues: Hello World")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("View viewId: /implicit_objects.xhtml ")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("ViewScope isEmpty: true")); + // See https://issues.apache.org/jira/projects/MYFACES/issues/MYFACES-4432 + // Note: The request & session objects are not resolved by CDI, but via ImplicitObjectResolver + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("Request contextPath: /ELImplicitObjectsViaCDI")); + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("HttpSession isNew: true")); + // Additional Requirement (See section 5.6.3) + assertTrue(testELResolutionImplicitObjectsPage.asText().contains("ExternalContext getApplicationContextPath: /ELImplicitObjectsViaCDI")); + + } + } + + /** + * Test the EL Resolution of implicit object #{flowScope} + * + * @throws Exception + */ + @Test + public void testELResolutionOfFlowScope() throws Exception { + try (WebClient webClient = new WebClient()) { + + // Construct the URL for the test + String contextRoot = "ELImplicitObjectsViaCDI"; + URL url = JSFUtils.createHttpUrl(server, contextRoot, "flow_index.xhtml"); + + HtmlPage testELResolutionOfFlowScopePage = (HtmlPage) webClient.getPage(url); + + // Verify that the page contains the expected messages. + assertTrue(testELResolutionOfFlowScopePage.asText().contains("This flow tests a basic configuration with a @FlowScoped bean. The flow is defined via simple-flow.xml")); + + // Get the form that we are dealing with + HtmlForm form = testELResolutionOfFlowScopePage.getFormByName("form1"); + + // Get the submit button to click + HtmlSubmitInput submitButton = form.getInputByName("form1:simpleBean"); + + // Now click the button and get the resulting page. + HtmlPage resultPage = submitButton.click(); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), resultPage.asText()); + Log.info(c, name.getMethodName(), resultPage.asXml()); + + // Verify that the page contains the expected messages. + assertTrue(resultPage.asText().contains("FlowScope isEmpty: true")); + assertTrue(resultPage.asText().contains("Flow map isEmpty: true")); + } + } + + /** + * Test that a FacesConverter, a FacesValidator and a FacesBehavior can be injected in a Managed Bean + * + * @throws Exception + */ + @Test + public void testConverterValidatorBehaviorObjectInjection() throws Exception { + try (WebClient webClient = new WebClient()) { + + // Construct the URL for the test + String contextRoot = "ConverterValidatorBehaviorInjectionTarget"; + URL url = JSFUtils.createHttpUrl(server, contextRoot, "JSFArtifactsInjection.xhtml"); + + HtmlPage page = (HtmlPage) webClient.getPage(url); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), page.asText()); + Log.info(c, name.getMethodName(), page.asXml()); + + // Verify that the page contains the expected response. + // TestConverter, TestValidator and TestBehavior objects should have been injected + assertTrue(page.asText().contains("JSF 2.3 support injection of JSF Managed Objects: FacesConverter, FacesValidator, FacesBehavior")); + assertTrue(page.asText().contains("com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans.TestConverter")); + + assertTrue(page.asText().contains("com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans.TestValidator")); + assertTrue(page.asText().contains("com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans.TestBehavior")); + } + } + + /** + * Test the Java Time Support by using f:convertDateTime element. + * + * Test the old types "date", "time" and "both" along with the new Java 8 types "localDate", + * "localTime", "localDateTime", "offsetTime". "offsetDateTime" and "zonedDateTime". + * + * Verify that the response contains the expected messages with the correct date/time pattern. + * + * @throws Exception + */ + @Test + public void testJavaTimeSupport() throws Exception { + try (WebClient webClient = new WebClient()) { + + // Construct the URL for the test + String contextRoot = "ConvertDateTime"; + URL url = JSFUtils.createHttpUrl(server, contextRoot, ""); + + HtmlPage page = (HtmlPage) webClient.getPage(url); + + String pageText = page.asText(); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), pageText); + Log.info(c, name.getMethodName(), page.asXml()); + + // Verify that the page contains the expected messages. + assertTrue(pageText.contains("JSF 2.3 Java Time Support - f:convertDateTime")); + + // Get the form that we are dealing with + HtmlForm form = page.getFormByName("form1"); + + // Get the input text + HtmlTextInput inputText = (HtmlTextInput) form.getInputByName("form1:input1"); + + // Verify that the response contains the expected messages with the correct date/time + assertTrue("Unexpected value in the input field", + inputText.getValueAttribute().equals("2017-06-01 10:30:45")); + assertTrue(pageText.contains("Type date, dateStyle short: 6/1/17")); + assertTrue(pageText.contains("Type date, dateStyle medium: Jun 1, 2017")); + assertTrue(pageText.contains("Type date, dateStyle long: June 1, 2017")); + assertTrue(pageText.contains("Type date, dateStyle full: Thursday, June 1, 2017")); + assertTrue(pageText.contains("Type date, pattern MM-dd-yyyy: 06-01-2017")); + + assertTrue(pageText.contains("Type localDate, dateStyle short: 6/1/17")); + assertTrue(pageText.contains("Type localDate, dateStyle medium: Jun 1, 2017")); + assertTrue(pageText.contains("Type localDate, dateStyle long: June 1, 2017")); + assertTrue(pageText.contains("Type localDate, dateStyle full: Thursday, June 1, 2017")); + assertTrue(pageText.contains("Type localDate, pattern MM-dd-yyyy: 06-01-2017")); + assertTrue(pageText.contains("Type localTime, pattern HH:mm:ss: 10:35:45")); + + assertTrue(pageText.contains("Type localDateTime, pattern MM-dd-yyyy HH:mm:ss: 06-01-2017 10:30:45")); + assertTrue(pageText.contains("Type offsetTime: 10:30:45.5-07:00")); + assertTrue(pageText.contains("Type offsetTime, pattern HH:mm:ss:SSS ZZZZ: 10:30:45:500 GMT-07:00")); + assertTrue(pageText.contains("Type offsetDateTime: 2017-06-01T10:30:45.5-07:00")); + assertTrue(pageText.contains("Type offsetDateTime, pattern MM-dd-yyyy HH:mm:ss:SSS ZZZZ: 06-01-2017 10:30:45:500 GMT-07:00")); + assertTrue(pageText.contains("Type zonedDateTime: 2017-06-01T10:30:45.5-07:00[America/Los_Angeles] ")); + assertTrue(pageText.contains("Type zonedDateTime, pattern MM-dd-yyyy HH:mm:ss ZZZZ z: 06-01-2017 10:30:45:500 GMT-07:00 PDT")); + + // JAVA 20 Checks -- https://github.com/OpenLiberty/open-liberty/issues/24009 + char space = '\u0020'; + if (componenttest.topology.impl.JavaInfo.JAVA_VERSION >= 20) { + space = '\u202F'; + } + + assertTrue(pageText.contains("Type time, timeStyle short: 10:30" + space + "AM")); + assertTrue(pageText.contains("Type time, timeStyle medium: 10:30:45" + space + "AM")); + assertTrue(pageText.contains("Type time, timeStyle long: 10:30:45" + space + "AM GMT")); + assertTrue(pageText.contains("Type time, timeStyle full: 10:30:45" + space + "AM GMT") || + pageText.contains("Type time, timeStyle full: 10:30:45" + space + "AM Greenwich Mean Time")); + assertTrue(pageText.contains("Type both, dateStyle full, timeStyle medium: Thursday, June 1, 2017 10:30:45" + space + "AM") || + pageText.contains("Type both, dateStyle full, timeStyle medium: Thursday, June 1, 2017, 10:30:45" + space + "AM")); + + assertTrue(pageText.contains("Type localTime, timeStyle short: 10:35" + space + "AM")); + assertTrue(pageText.contains("Type localTime, timeStyle medium: 10:35:45" + space + "AM")); + + assertTrue(pageText.contains("Type localDateTime, dateStyle short, timeStyle short: 6/1/17 10:30" + space + "AM") || + pageText.contains("Type localDateTime, dateStyle short, timeStyle short: 6/1/17, 10:30" + space + "AM")); + assertTrue(pageText.contains("Type localDateTime, dateStyle medium, timeStyle medium: Jun 1, 2017 10:30:45" + space + "AM") || + pageText.contains("Type localDateTime, dateStyle medium, timeStyle medium: Jun 1, 2017, 10:30:45" + space + "AM")); + + } + } + + /** + * Test the CDI-JSF integration. + * + * In this test we want make sure that a custom ViewHandler + * and a custom Application can be used in an app. + * + * Also, make sure that the IBMViewHandler is used + * when CDI is enabled. + * + * @throws Exception + */ + @Test + public void testCDIIntegration() throws Exception { + try (WebClient webClient = new WebClient()) { + + // Construct the URL for the test + String contextRoot = "CDIIntegrationTest"; + URL url = JSFUtils.createHttpUrl(server, contextRoot, "index.xhtml"); + + HtmlPage page = (HtmlPage) webClient.getPage(url); + + String responseText = page.asText(); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), responseText); + Log.info(c, name.getMethodName(), page.asXml()); + + assertTrue("Page does not contain expected response.", responseText.contains("CDI Integration Test")); + + assertTrue("The Custom ApplicationFactory was not invoked.", + !server.findStringsInTrace("CustomApplicationFactory was invoked!").isEmpty()); + + assertTrue("The Custom Application was not invoked.", + !server.findStringsInTrace("CustomApplication was invoked!").isEmpty()); + + assertTrue("The Custom ViewHandler was not invoked.", + !server.findStringsInTrace("CustomViewHandler was invoked!").isEmpty()); + + assertTrue("The IBMViewHandler was not used.", + !server.findStringsInTrace("set ViewHandler =.*IBMViewHandler").isEmpty()); + } + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSF23UIRepeatConditionTests.java b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSF23UIRepeatConditionTests.java new file mode 100644 index 000000000000..5ae9671eb5fe --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSF23UIRepeatConditionTests.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright (c) 2017, 2025 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package io.openliberty.checkpoint.fat; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertNotNull; + +import java.net.URL; +import java.util.Arrays; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; +import org.junit.runner.RunWith; + +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlTextInput; +import com.ibm.websphere.simplicity.ShrinkHelper; +import com.ibm.websphere.simplicity.log.Log; +import io.openliberty.checkpoint.fat.JSFUtils; + +import componenttest.annotation.ExpectedFFDC; +import componenttest.annotation.Server; +import componenttest.custom.junit.runner.FATRunner; +import componenttest.custom.junit.runner.Mode; +import componenttest.custom.junit.runner.Mode.TestMode; +import componenttest.topology.impl.LibertyServer; + +import io.openliberty.checkpoint.spi.CheckpointPhase; +import componenttest.annotation.CheckpointTest; + +/** + * These test are to test the functionality of the begin and end attributes + * new to JSF 2.3. + * + */ +@CheckpointTest +@RunWith(FATRunner.class) +public class JSF23UIRepeatConditionTests { + + private static final Class c = JSF23UIRepeatConditionTests.class; + + static final String APP_NAME = "UIRepeatConditionCheck"; + + @Rule + public TestName name = new TestName(); + + @Server("jsf23UIRepeatConditionServer") + public static LibertyServer server; + + @BeforeClass + public static void setup() throws Exception { + ShrinkHelper.defaultDropinApp(server, APP_NAME+".war", "com.ibm.ws.jsf23.fat.uirepeat"); + + server.setCheckpoint(CheckpointPhase.AFTER_APP_START, false, + server -> { + assertNotNull("'SRVE0169I: Loading Web Module: " + APP_NAME + "' message not found in log before rerstore", + server.waitForStringInLogUsingMark("SRVE0169I: .*" + APP_NAME, 0)); + assertNotNull("'CWWKZ0001I: Application " + APP_NAME + " started' message not found in log.", + server.waitForStringInLogUsingMark("CWWKZ0001I: .*" + APP_NAME, 0)); + }); + + // Start the server and use the class name so we can find logs easily. + // Many tests use the same server. + server.startServer(c.getSimpleName() + ".log"); + server.checkpointRestore(); + } + + @AfterClass + public static void tearDown() throws Exception { + // Stop the server + if (server != null && server.isStarted()) { + server.stopServer(); + } + } + + /** + * A test to ensure that UIRepeat supports the begin and end attributes + * + * @throws Exception + */ + @Test + public void testUIRepeatCondition() throws Exception { + String contextRoot = "UIRepeatConditionCheck"; + try (WebClient webClient = new WebClient()) { + + // The initial value expected + String expected = "0123456789"; + + // Construct the URL for the test + URL url = JSFUtils.createHttpUrl(server, contextRoot, "UIRepeatBeginEnd.jsf"); + + HtmlPage page = (HtmlPage) webClient.getPage(url); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), page.asText()); + Log.info(c, name.getMethodName(), page.asXml()); + + HtmlTextInput beginInput = (HtmlTextInput) page.getElementById("beginInput"); + HtmlTextInput endInput = (HtmlTextInput) page.getElementById("endInput"); + HtmlTextInput stepInput = (HtmlTextInput) page.getElementById("stepInput"); + + String output = page.getElementById("panel1").getTextContent().replaceAll("\\s", ""); + + // Test the initial output for the default values of begin = 0, end = 9 and step = 1 + assertTrue("The output should have been: " + expected + " but was: " + output, output.equals(expected)); + + // Set step = 2 and ensure we get the proper output + expected = "02468"; + stepInput.setValueAttribute("2"); + + // Now click the submit button + page = page.getElementById("button1").click(); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), page.asText()); + Log.info(c, name.getMethodName(), page.asXml()); + + output = page.getElementById("panel1").getTextContent().replaceAll("\\s", ""); + + // Ensure that the resulting output is correct + assertTrue("The output should have been: " + expected + " but was: " + output, output.equals(expected)); + + // Set step = 1, begin = 4 and end = 6 and ensure we get the proper output + expected = "456"; + beginInput = (HtmlTextInput) page.getElementById("beginInput"); + endInput = (HtmlTextInput) page.getElementById("endInput"); + stepInput = (HtmlTextInput) page.getElementById("stepInput"); + + stepInput.setValueAttribute("1"); + beginInput.setValueAttribute("4"); + endInput.setValueAttribute("6"); + + // Now click the submit button + page = page.getElementById("button1").click(); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), page.asText()); + Log.info(c, name.getMethodName(), page.asXml()); + + output = page.getElementById("panel1").getTextContent().replaceAll("\\s", ""); + + // Ensure that the resulting output is correct + assertTrue("The output should have been: " + expected + " but was: " + output, output.equals(expected)); + } + } + + /** + * Test to ensure that if end is specified to be too large an error occurs. + * + * @throws Exception + */ + @Test + @ExpectedFFDC({ "javax.servlet.ServletException" }) + public void testUIRepeatConditionErrorEndTooLarge() throws Exception { + String contextRoot = "UIRepeatConditionCheck"; + String errorText = "end cannot be greater than collection size"; + + try (WebClient webClient = new WebClient()) { + + // Ensure the test does not fail due to the error condition we are creating + webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); + server.addIgnoredErrors(Arrays.asList("SRVE0777E:.*", "SRVE0315E:.*")); + + // Construct the URL for the test + URL url = JSFUtils.createHttpUrl(server, contextRoot, "UIRepeatEndTooLarge.jsf"); + + HtmlPage page = (HtmlPage) webClient.getPage(url); + + // Log the page for debugging if necessary in the future. + Log.info(c, name.getMethodName(), page.asText()); + Log.info(c, name.getMethodName(), page.asXml()); + + assertTrue("The following error was not found on the page: " + errorText, page.asText().contains(errorText)); + } + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSFUtils.java b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSFUtils.java new file mode 100644 index 000000000000..f3302ed8b61e --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/fat/src/io/openliberty/checkpoint/fat/JSFUtils.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2015, 2023 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package io.openliberty.checkpoint.fat; + +import java.net.URL; + +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.ibm.websphere.simplicity.log.Log; + +import componenttest.topology.impl.LibertyServer; + +/** + * A utility class for JSF tests. + */ +public class JSFUtils { + + protected static final Class c = JSFUtils.class; + + /** + * Construct a URL for a test case so a request can be made. + * + * @param server - The server that is under test, this is used to get the port and host name. + * @param contextRoot - The context root of the application + * @param path - Additional path information for the request. + * @return - A fully formed URL. + * @throws Exception + */ + public static URL createHttpUrl(LibertyServer server, String contextRoot, String path) throws Exception { + return new URL(createHttpUrlString(server, contextRoot, path)); + } + + /** + * Construct a URL for a test case so a request can be made. + * + * @param server - The server that is under test, this is used to get the port and host name. + * @param contextRoot - The context root of the application + * @param path - Additional path information for the request. + * @return - A fully formed URL string. + * @throws Exception + */ + public static String createHttpUrlString(LibertyServer server, String contextRoot, String path) { + + StringBuilder sb = new StringBuilder(); + sb.append("http://") + .append(server.getHostname()) + .append(":") + .append(server.getHttpDefaultPort()) + .append("/") + .append(contextRoot) + .append("/") + .append(path); + + return sb.toString(); + } + + /** + * Construct a URL for for the testcontainer selenium docker image. Relies on 'host.testcontainers.internal' address + * + * @param server - The server that is under test, this is used to get the port and host name. + * @param contextRoot - The context root of the application + * @param path - Additional path information for the request. + * @return - A fully formed URL string. + * @throws Exception + */ + public static String createSeleniumURLString(LibertyServer server, String contextRoot, String path) { + + StringBuilder sb = new StringBuilder(); + sb.append("http://") + .append("host.testcontainers.internal") + .append(":") + .append(server.getHttpDefaultPort()) + .append("/") + .append(contextRoot) + .append("/") + .append(path); + + return sb.toString(); + } + + /** + * Create a custom wait mechanism that waits for any background JavaScript to finish + * and verifies a message in the page response. + * + * @param page The current HtmlPage + * @return A boolean value indicating if the response message was found + * @throws InterruptedException + */ + public static boolean waitForPageResponse(HtmlPage page, String responseMessage) throws InterruptedException { + int i = 0; + boolean isTextFound = false; + while (!isTextFound && i < 5) { + isTextFound = page.asText().contains(responseMessage); + i++; + Thread.sleep(1000); + Log.info(c, "waitForPageResponse", "Waiting for: " + responseMessage + " isTextFound: " + isTextFound + " i: " + i); + } + return isTextFound; + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/.gitignore b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/.gitignore new file mode 100644 index 000000000000..f3f483d82c07 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/.gitignore @@ -0,0 +1 @@ +/dropins diff --git a/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/bootstrap.properties b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/bootstrap.properties new file mode 100644 index 000000000000..3881694fb0f4 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/bootstrap.properties @@ -0,0 +1,16 @@ +############################################################################### +# Copyright (c) 2017, 2022 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### +bootstrap.include=../testports.properties +osgi.console=7777 +com.ibm.ws.logging.trace.specification=*=info=enabled:com.ibm.ws.app.manager.*=all:org.apache.myfaces.*=all:com.ibm.ws.jsf*=all:com.ibm.ws.runtime.update.*=all:logservice=detail +com.ibm.ws.logging.max.file.size=20 +com.ibm.ws.logging.max.files=10 +com.ibm.ws.logging.trace.format=BASIC +ds.lock.timeout.milliseconds=30000 diff --git a/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/server.xml b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/server.xml new file mode 100644 index 000000000000..11b65270981c --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23CDIGeneralServer/server.xml @@ -0,0 +1,17 @@ + + + + + + jsf-2.3 + cdi-2.0 + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/.gitignore b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/.gitignore new file mode 100644 index 000000000000..f3f483d82c07 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/.gitignore @@ -0,0 +1 @@ +/dropins diff --git a/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/bootstrap.properties b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/bootstrap.properties new file mode 100644 index 000000000000..71f424f48ad4 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/bootstrap.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 2017, 2022 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +############################################################################### +bootstrap.include=../testports.properties +osgi.console=7777 +com.ibm.ws.logging.trace.specification=*=info=enabled:com.ibm.ws.app.manager.*=all:org.apache.myfaces.*=all:com.ibm.ws.jsf*=all:com.ibm.ws.runtime.update.*=all:logservice=detail +com.ibm.ws.logging.max.file.size=20 +com.ibm.ws.logging.max.files=10 +com.ibm.ws.logging.trace.format=BASIC diff --git a/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/server.xml b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/server.xml new file mode 100644 index 000000000000..5c16f80982ec --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/publish/servers/jsf23UIRepeatConditionServer/server.xml @@ -0,0 +1,15 @@ + + + + + + jsf-2.3 + cdi-2.0 + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/WEB-INF/faces-config.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/WEB-INF/faces-config.xml new file mode 100644 index 000000000000..6ca5efa79086 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/WEB-INF/faces-config.xml @@ -0,0 +1,25 @@ + + + + + + com.ibm.ws.jsf23.fat.cdi.integration.viewhandler.CustomViewHandler + + + + com.ibm.ws.jsf23.fat.cdi.integration.application.CustomApplicationFactory + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..9a450b18e9e0 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/WEB-INF/web.xml @@ -0,0 +1,28 @@ + + + + + CDIIntegrationTest + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.xhtml + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/index.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/index.xhtml new file mode 100644 index 000000000000..873d28c4dfcd --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/resources/index.xhtml @@ -0,0 +1,22 @@ + + + + + + CDI Integration Test + + + CDI Integration Test +
+ +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/application/CustomApplication.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/application/CustomApplication.java new file mode 100644 index 000000000000..1daca51c7066 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/application/CustomApplication.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.cdi.integration.application; + +import javax.faces.application.Application; +import javax.faces.application.ApplicationWrapper; +import javax.faces.application.ViewHandler; + +/** + * Custom application + */ +public class CustomApplication extends ApplicationWrapper { + + private final Application delegate; + + /** + * Constructor that wraps an {@link Application} instance. + * + * @param wrapped The {@link Appplication} to be wrapped. + */ + public CustomApplication(Application delegate) { + this.delegate = delegate; + System.out.println("CustomApplication was invoked!"); + } + + /** + * {@inheritDoc} + */ + @Override + public Application getWrapped() { + return delegate; + } + + @Override + public void setViewHandler(ViewHandler viewHandler) { + System.out.println("CustomApplication setViewHandler: " + viewHandler); + delegate.setViewHandler(viewHandler); + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/application/CustomApplicationFactory.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/application/CustomApplicationFactory.java new file mode 100644 index 000000000000..306cab79f2b8 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/application/CustomApplicationFactory.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.cdi.integration.application; + +import javax.faces.application.Application; +import javax.faces.application.ApplicationFactory; + +/** + * Custom Application Factory + */ +public class CustomApplicationFactory extends ApplicationFactory { + + private final ApplicationFactory factory; + private Application application; + + public CustomApplicationFactory(ApplicationFactory factory) { + this.factory = factory; + System.out.println("CustomApplicationFactory was invoked!"); + } + + /* + * (non-Javadoc) + * + * @see javax.faces.application.ApplicationFactory#getApplication() + */ + @Override + public Application getApplication() { + if (application == null) { + application = new CustomApplication(factory.getApplication()); + } + return application; + } + + /* + * (non-Javadoc) + * + * @see javax.faces.application.ApplicationFactory#setApplication(javax.faces.application.Application) + */ + @Override + public void setApplication(Application application) { + factory.setApplication(application); + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/beans/TestBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/beans/TestBean.java new file mode 100644 index 000000000000..8aeec40a0ada --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/beans/TestBean.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.cdi.integration.beans; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; + +/** + * Simple application scope CDI managed bean to activate the BeanManager + */ +@Named +@ApplicationScoped +public class TestBean { + + private String message; + + @PostConstruct + private void init() { + message = "Hello World"; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/viewhandler/CustomViewHandler.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/viewhandler/CustomViewHandler.java new file mode 100644 index 000000000000..0bf4cbdd30c6 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIIntegrationTest.war/src/com/ibm/ws/jsf23/fat/cdi/integration/viewhandler/CustomViewHandler.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.cdi.integration.viewhandler; + +import javax.faces.application.ViewHandler; +import javax.faces.application.ViewHandlerWrapper; + +/** + * Custom View Handler to make sure it is possible to use it + * in an application. + */ +public class CustomViewHandler extends ViewHandlerWrapper { + + private final ViewHandler wrapped; + + public CustomViewHandler(ViewHandler viewHandler) { + wrapped = viewHandler; + System.out.println("CustomViewHandler was invoked!"); + } + + @Override + public ViewHandler getWrapped() { + return wrapped; + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..fbcac9809978 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/resources/WEB-INF/web.xml @@ -0,0 +1,32 @@ + + + + + CDIManagedProperty + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.jsf + + + + index.jsf + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/resources/index.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/resources/index.xhtml new file mode 100644 index 000000000000..f2078e51dd04 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/resources/index.xhtml @@ -0,0 +1,34 @@ + + + + + + CDIManagedProperty Test + + + + + CDIManagedProperty Test +

+ Number: + Text: + List: + String[]: +

+ +

+ +

+ + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/src/com/ibm/ws/jsf23/fat/cdi/managedproperty/ManagedPropertyBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/src/com/ibm/ws/jsf23/fat/cdi/managedproperty/ManagedPropertyBean.java new file mode 100644 index 000000000000..2f1b4f7a6e42 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/src/com/ibm/ws/jsf23/fat/cdi/managedproperty/ManagedPropertyBean.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.cdi.managedproperty; + +import java.util.List; + +import javax.enterprise.context.RequestScoped; +import javax.faces.annotation.ManagedProperty; +import javax.inject.Inject; +import javax.inject.Named; + +/** + * A CDI Bean used to test ManagedProperty injection. + * + */ +@Named +@RequestScoped +public class ManagedPropertyBean { + + @Inject + @ManagedProperty("#{testBean.number}") + private int numberManagedProperty; + + @Inject + @ManagedProperty("#{testBean.text}") + private String textManagedProperty; + + @Inject + @ManagedProperty("#{testBean.list}") + private List listManagedProperty; + + @Inject + @ManagedProperty("#{testBean.stringArray}") + private String[] stringArrayManagedProperty; + + @Inject + @ManagedProperty("#{testBean}") + private TestBean bean; + + public String test() { + + return "numberManagedProperty = " + numberManagedProperty + + " textManagedProperty = " + textManagedProperty + + " listManagedProperty = " + listManagedProperty.get(0) + + " stringArrayManagedProperty = " + stringArrayManagedProperty[0] + + " bean = " + bean.toString(); + + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/src/com/ibm/ws/jsf23/fat/cdi/managedproperty/TestBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/src/com/ibm/ws/jsf23/fat/cdi/managedproperty/TestBean.java new file mode 100644 index 000000000000..6728f28b688a --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/CDIManagedProperty.war/src/com/ibm/ws/jsf23/fat/cdi/managedproperty/TestBean.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.cdi.managedproperty; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Named; + +/** + * A CDI bean that will be used for injection in ManagedPropertyBean.java. + * + * There are multiple values being tested to ensure @ManagedProperty injection works + * with an assortment of types. + * + */ +@Named +@RequestScoped +public class TestBean { + private int number = 0; + private String text = "zero"; + private List list = new ArrayList(Arrays.asList("zero")); + private String[] stringArray = new String[] { "zero" }; + private String listValue = "zero"; + private String stringArrayValue = "zero"; + + public void setNumber(int number) { + this.number = number; + } + + public int getNumber() { + return this.number; + } + + public void setText(String text) { + this.text = text; + } + + public String getText() { + return this.text; + } + + public void setList(List list) { + this.list = list; + } + + public List getList() { + return this.list; + } + + public void setStringArray(String[] stringArray) { + this.stringArray = stringArray; + } + + public String[] getStringArray() { + return this.stringArray; + } + + public void setListValue(String listValue) { + this.listValue = listValue; + } + + public String getListValue() { + return this.listValue; + } + + public void setStringArrayValue(String stringArrayValue) { + this.stringArrayValue = stringArrayValue; + } + + public String getStringArrayValue() { + return this.stringArrayValue; + } + + public void addValues() { + list.add(0, getListValue()); + stringArray[0] = getStringArrayValue(); + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..0859935d79bc --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/resources/WEB-INF/web.xml @@ -0,0 +1,32 @@ + + + + + JSF23ConvertDateTime + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.xhtml + + + + index.xhtml + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/resources/index.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/resources/index.xhtml new file mode 100644 index 000000000000..99fc5aa586dd --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/resources/index.xhtml @@ -0,0 +1,176 @@ + + + + + + + + + + JSF 2.3 Java Time Support + + + JSF 2.3 Java Time Support - f:convertDateTime +
+ + + + + + +

Date

+ Type date, dateStyle short: + + + +
+ Type date, dateStyle medium: + + + +
+ Type date, dateStyle long: + + + +
+ Type date, dateStyle full: + + + +
+ Type date, pattern MM-dd-yyyy: + + + + +

Time

+ Type time, timeStyle short: + + + +
+ Type time, timeStyle medium: + + + +
+ Type time, timeStyle long: + + + +
+ Type time, timeStyle full: + + + + +

Both

+ Type both, dateStyle full, timeStyle medium: + + + + +

LocalDate

+ Type localDate, dateStyle short: + + + +
+ Type localDate, dateStyle medium: + + + +
+ Type localDate, dateStyle long: + + + +
+ Type localDate, dateStyle full: + + + +
+ Type localDate, pattern MM-dd-yyyy: + + + + +

LocalTime

+ Type localTime, timeStyle short: + + + +
+ Type localTime, timeStyle medium: + + + +
+ Type localTime, pattern HH:mm:ss: + + + + +

LocalDateTime

+ Type localDateTime, dateStyle short, timeStyle short: + + + +
+ Type localDateTime, dateStyle medium, timeStyle medium: + + + +
+ Type localDateTime, pattern MM-dd-yyyy HH:mm:ss: + + + + +

OffsetTime

+ Type offsetTime: + + + +
+ Type offsetTime, pattern HH:mm:ss:SSS ZZZZ: + + + + +

OffsetDateTime

+ Type offsetDateTime: + + + +
+ Type offsetDateTime, pattern MM-dd-yyyy HH:mm:ss:SSS ZZZZ: + + + + +

ZonedDateTime

+ Type zonedDateTime: + + + +
+ Type zonedDateTime, pattern MM-dd-yyyy HH:mm:ss ZZZZ z: + + + + +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/src/com/ibm/ws/jsf23/fat/convertdatetime/beans/DateTimeBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/src/com/ibm/ws/jsf23/fat/convertdatetime/beans/DateTimeBean.java new file mode 100644 index 000000000000..2ada3cd50ca1 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConvertDateTime.war/src/com/ibm/ws/jsf23/fat/convertdatetime/beans/DateTimeBean.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.convertdatetime.beans; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.OffsetDateTime; +import java.time.OffsetTime; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.util.Date; +import java.util.TimeZone; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Named; + +/** + * RequestScoped bean to test Java time support + */ +@Named +@RequestScoped +public class DateTimeBean implements Serializable { + + /** */ + private static final long serialVersionUID = 1L; + + private Date date; + private final LocalDate localDate; + private final LocalTime localTime; + private final LocalDateTime localDateTime; + private final OffsetTime offsetTime; + private final OffsetDateTime offsetDateTime; + private final ZonedDateTime zonedDateTime; + + public DateTimeBean() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); + String testDate = "2017-06-01 10:30:45"; + + try { + date = sdf.parse(testDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + localDate = LocalDate.of(2017, 06, 01); + localTime = LocalTime.of(10, 35, 45, 500000000); + localDateTime = LocalDateTime.of(2017, 06, 01, 10, 30, 45); + offsetTime = OffsetTime.of(10, 30, 45, 500000000, ZoneOffset.ofHours(-7)); + offsetDateTime = OffsetDateTime.of(2017, 06, 01, 10, 30, 45, 500000000, ZoneOffset.ofHours(-7)); + zonedDateTime = ZonedDateTime.of(2017, 06, 01, 10, 30, 45, 500000000, ZoneId.of("America/Los_Angeles")); + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } + + public LocalDate getLocalDate() { + return localDate; + } + + public LocalTime getLocalTime() { + return localTime; + } + + public LocalDateTime getLocalDateTime() { + return localDateTime; + } + + public OffsetTime getOffsetTime() { + return offsetTime; + } + + public OffsetDateTime getOffsetDateTime() { + return offsetDateTime; + } + + public ZonedDateTime getZonedDateTime() { + return zonedDateTime; + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/JSFArtifactsInjection.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/JSFArtifactsInjection.xhtml new file mode 100644 index 000000000000..d39818a02ae4 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/JSFArtifactsInjection.xhtml @@ -0,0 +1,26 @@ + + + + + + JSF 2.3 support injection of JSF Managed Objects + + + JSF 2.3 support injection of JSF Managed Objects: FacesConverter, FacesValidator, FacesBehavior +
+ +
+ +
+ +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/beans.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/beans.xml new file mode 100644 index 000000000000..81e20aad78c6 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/beans.xml @@ -0,0 +1,16 @@ + + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/taglib.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/taglib.xml new file mode 100644 index 000000000000..2cd8b3e38b82 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/taglib.xml @@ -0,0 +1,23 @@ + + + + + http://custom.tags/jsf/message + + message + + testBehavior + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..057099bc1e55 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/WEB-INF/web.xml @@ -0,0 +1,37 @@ + + + + + ConverterValidatorBehaviorInjectionTarget + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.xhtml + + + + index.xhtml + + + + javax.faces.FACELETS_LIBRARIES + /WEB-INF/taglib.xml + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/index.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/index.xhtml new file mode 100644 index 000000000000..e31d6a29fbe8 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/resources/index.xhtml @@ -0,0 +1,34 @@ + + + + + + JSF 2.3 support for injection into JSF Managed Objects + + + JSF 2.3 support for injection into JSF Managed Objects +
+ + Enter text that contains the word 'World': + + + + + + +
+ +
+ +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/JSFArtifactsInjectionBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/JSFArtifactsInjectionBean.java new file mode 100644 index 000000000000..fd6da35c071a --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/JSFArtifactsInjectionBean.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2017, 2020 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans; + +import javax.enterprise.context.ApplicationScoped; +import javax.faces.component.behavior.ClientBehaviorBase; +import javax.faces.component.behavior.FacesBehavior; +import javax.faces.convert.Converter; +import javax.faces.convert.FacesConverter; +import javax.faces.validator.FacesValidator; +import javax.faces.validator.Validator; +import javax.inject.Inject; +import javax.inject.Named; + +/** + * Simple ApplicationScoped bean to test injection of FacesConverter, FacesValidator and FacesBehavior objects + */ +@Named("jsfArtifactsInjectionBean") +@ApplicationScoped +public class JSFArtifactsInjectionBean { + + @Inject + @FacesConverter(value = "testConverter", managed = true) + private Converter converter; + + @Inject + @FacesValidator(value = "testValidator", managed = true) + private Validator validator; + + @Inject + @FacesBehavior(value = "testBehavior", managed = true) + private ClientBehaviorBase behavior; + + public Converter getConverter() { + return converter; + } + + public Validator getValidator() { + return validator; + } + + public ClientBehaviorBase getBehavior() { + return behavior; + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestBehavior.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestBehavior.java new file mode 100644 index 000000000000..5200f4c455b3 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestBehavior.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans; + +import javax.faces.component.behavior.ClientBehaviorBase; +import javax.faces.component.behavior.ClientBehaviorContext; +import javax.faces.component.behavior.FacesBehavior; +import javax.inject.Inject; + +/** + * + */ +@FacesBehavior(value = "testBehavior", managed = true) +public class TestBehavior extends ClientBehaviorBase { + + @Inject + private TestCDIBean testBean; + + @Override + public String getScript(ClientBehaviorContext behaviorContext) { + return "alert('Hello " + testBean.getWorld() + "')"; + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestCDIBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestCDIBean.java new file mode 100644 index 000000000000..0c55ba71edb6 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestCDIBean.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans; + +import java.io.Serializable; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; + +/** + * Simple ApplicationScoped bean + */ +@Named +@ApplicationScoped +public class TestCDIBean implements Serializable { + + /** */ + private static final long serialVersionUID = 1L; + + private String testValue; + private final String earth = "Earth"; + private final String world = "World"; + + public String getEarth() { + return earth; + } + + public String getWorld() { + return world; + } + + public String getTestValue() { + return testValue; + } + + public void setTestValue(String testValue) { + this.testValue = testValue; + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestConverter.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestConverter.java new file mode 100644 index 000000000000..31d8c7bfd4cf --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestConverter.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2017, 2020 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.ConverterException; +import javax.faces.convert.FacesConverter; +import javax.inject.Inject; + +/** + * Converter that supports Injection. + * + * Added use of generics to this Converter to test MYFACES-4311. + */ +@FacesConverter(value = "testConverter", managed = true) +public class TestConverter implements Converter { + + @Inject + private TestCDIBean testBean; + + /* + * (non-Javadoc) + * + * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String) + */ + @Override + public String getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException { + int index = value.indexOf(testBean.getWorld()); + if (index != -1) { + value = value.substring(0, index) + testBean.getEarth(); + } + return value; + } + + /* + * (non-Javadoc) + * + * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String) + */ + @Override + public String getAsString(FacesContext context, UIComponent component, String value) throws ConverterException { + if (value == null) { + return ""; + } + return value; + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestValidator.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestValidator.java new file mode 100644 index 000000000000..39f221f6f788 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ConverterValidatorBehaviorInjectionTarget.war/src/com/ibm/ws/jsf23/fat/converter/validator/behavior/injection/beans/TestValidator.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2017, 2020 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.converter.validator.behavior.injection.beans; + +import javax.faces.application.FacesMessage; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.validator.FacesValidator; +import javax.faces.validator.Validator; +import javax.faces.validator.ValidatorException; +import javax.inject.Inject; + +/** + * Validator that supports Injection + */ +@FacesValidator(value = "testValidator", managed = true) +public class TestValidator implements Validator { + + @Inject + private TestCDIBean testBean; + + /* + * (non-Javadoc) + * + * @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String) + */ + @Override + public void validate(FacesContext context, UIComponent component, String value) throws ValidatorException { + if (!value.contains(testBean.getEarth())) { + FacesMessage msg = new FacesMessage("Text validation failed. Text does not contain '" + testBean.getWorld() + "' or '" + testBean.getEarth() + "'."); + throw new ValidatorException(msg); + } + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/WEB-INF/resources/test/compositeTest.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/WEB-INF/resources/test/compositeTest.xhtml new file mode 100644 index 000000000000..110265ac5ec8 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/WEB-INF/resources/test/compositeTest.xhtml @@ -0,0 +1,21 @@ + + + + + + + + + + #{cc.attrs.label} + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..7ccedbb284ea --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/WEB-INF/web.xml @@ -0,0 +1,37 @@ + + + + + JSF23ELImplicitObjectsViaCDI + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.xhtml + + + + index.xhtml + + + + javax.faces.WEBAPP_RESOURCES_DIRECTORY + WEB-INF/resources + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/flow_index.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/flow_index.xhtml new file mode 100644 index 000000000000..cf95819387de --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/flow_index.xhtml @@ -0,0 +1,25 @@ + + + + + JSF 2.3 (CDI) Faces Flows Test Page + + + In flow ? #{null != facesContext.application.flowHandler.currentFlow}
+ Flow Id: #{empty facesContext.application.flowHandler.currentFlow.id ? "no flow ID" : facesContext.application.flowHandler.currentFlow.id}

+ + This flow tests a basic configuration with a @FlowScoped bean. The flow is defined via simple-flow.xml
+
+
+
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/index.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/index.xhtml new file mode 100644 index 000000000000..f6874791d41e --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/index.xhtml @@ -0,0 +1,30 @@ + + + + + + JSF 2.3 EL implicit objects using CDI + + + JSF 2.3 EL implicit objects using CDI +
+ + + + + + + + +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/simpleBean/simpleBean-flow.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/simpleBean/simpleBean-flow.xml new file mode 100644 index 000000000000..48c5e575741f --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/simpleBean/simpleBean-flow.xml @@ -0,0 +1,25 @@ + + + + + + + + /simpleBean/simpleBean.xhtml + + + /flow_index + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/simpleBean/simpleBean.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/simpleBean/simpleBean.xhtml new file mode 100644 index 000000000000..01896cc95b89 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resources/simpleBean/simpleBean.xhtml @@ -0,0 +1,27 @@ + + + + + + Test flowScope EL Implicit Object + + + 'Simple' flow page 1
+ In flow ? #{null != facesContext.application.flowHandler.currentFlow}
+ Flow Id: #{empty facesContext.application.flowHandler.currentFlow.id ? "no flow ID" : facesContext.application.flowHandler.currentFlow.id}
+ #{testBean.test()} + +
+ FlowScope isEmpty: #{flowScope.isEmpty()} + +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resourcesFaces40/implicit_objects.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resourcesFaces40/implicit_objects.xhtml new file mode 100644 index 000000000000..76be0fe56205 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resourcesFaces40/implicit_objects.xhtml @@ -0,0 +1,72 @@ + + + + + + JSF 2.3 EL resolution of implicit objects using CDI + + + JSF 2.3 EL resolution of implicit objects using CDI +
+ Bean: #{elImplicitObjectBean} +
+
+ Application name: +
+
+ ApplicationScope application name: +
+
+ Component getStyle: +
+
+ CompositeComponent label: +
+
+ FacesContext project stage: +
+
+ Flash isRedirect: +
+
+ Header: +
+
+ HeaderValues: +
+
+ InitParam: +
+
+ Param: +
+
+ ParamValues: +
+
+ HttpSession isNew: +
+
+ View viewId: +
+
+ ViewScope isEmpty: +
+
+ Request contextPath: +
+
+ ExternalContext getApplicationContextPath: +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resourcesJSF23/implicit_objects.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resourcesJSF23/implicit_objects.xhtml new file mode 100644 index 000000000000..9a35411c4820 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/resourcesJSF23/implicit_objects.xhtml @@ -0,0 +1,72 @@ + + + + + + JSF 2.3 EL resolution of implicit objects using CDI + + + JSF 2.3 EL resolution of implicit objects using CDI +
+ Bean: #{elImplicitObjectBean} +
+
+ Application project stage: +
+
+ ApplicationScope application name: +
+
+ Component getStyle: +
+
+ CompositeComponent label: +
+
+ FacesContext project stage: +
+
+ Flash isRedirect: +
+
+ Header: +
+
+ HeaderValues: +
+
+ InitParam: +
+
+ Param: +
+
+ ParamValues: +
+
+ HttpSession isNew: +
+
+ View viewId: +
+
+ ViewScope isEmpty: +
+
+ Request contextPath: +
+
+ ExternalContext getApplicationContextPath: +
+ diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/beans/ELImplicitObjectBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/beans/ELImplicitObjectBean.java new file mode 100644 index 000000000000..b28cda154cf7 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/beans/ELImplicitObjectBean.java @@ -0,0 +1,181 @@ +/******************************************************************************* + * Copyright (c) 2017, 2023 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.elimplicit.cdi.beans; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.enterprise.context.RequestScoped; +import javax.faces.annotation.ApplicationMap; +import javax.faces.annotation.FacesConfig; +import javax.faces.annotation.FlowMap; +import javax.faces.annotation.HeaderMap; +import javax.faces.annotation.HeaderValuesMap; +import javax.faces.annotation.InitParameterMap; +import javax.faces.annotation.RequestCookieMap; +import javax.faces.annotation.RequestMap; +import javax.faces.annotation.RequestParameterMap; +import javax.faces.annotation.RequestParameterValuesMap; +import javax.faces.annotation.SessionMap; +import javax.faces.annotation.ViewMap; +import javax.faces.application.FacesMessage; +import javax.faces.application.ResourceHandler; +import javax.faces.component.UIViewRoot; +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; +import javax.faces.context.Flash; +import javax.inject.Inject; +import javax.inject.Named; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpSession; +import javax.servlet.http.HttpServletRequest; + +/** + * Bean that tests if EL implicit objects are injectable + */ +@Named("elImplicitObjectBean") +@RequestScoped +@FacesConfig +public class ELImplicitObjectBean implements Serializable { + + /** */ + private static final long serialVersionUID = 1L; + + private static Logger LOGGER = Logger.getLogger(ELImplicitObjectBean.class.getName()); + + @Inject + private FacesContext facesContext; // #{facesContext} + + @Inject + private ExternalContext externalContext; // #{externalContext} + + @Inject + private UIViewRoot viewRoot; // #{view} + + @Inject + private ServletContext servletContext; // #{application} + + @Inject + private Flash flash; // #{flash} + + @Inject + private HttpSession httpSession; // #{session} + + @Inject + private HttpServletRequest httpServletRequest; // #{request} + + @Inject + @ApplicationMap + private Map applicationMap; // #{applicationScope} + + @Inject + @SessionMap + private Map sessionMap; // #{sessionScope} + + @Inject + @ViewMap + private Map viewMap; // #{viewScope} + + @Inject + @RequestMap + private Map requestMap; // #{requestScope} + + @Inject + @FlowMap + private Map flowMap; // #{flowScope} + + @Inject + @HeaderMap + private Map headerMap; // #{header} + + @Inject + @RequestCookieMap + private Map cookieMap; // #{cookie} + + @Inject + @InitParameterMap + private Map initParameterMap; // #{initParam} + + @Inject + @RequestParameterMap + private Map requestParameterMap; // #{param} + + @Inject + @RequestParameterValuesMap + private Map requestParameterValuesMap; // #{paramValues} + + @Inject + @HeaderValuesMap + private Map headerValuesMap; // #{headerValues} + + @Inject + private ResourceHandler resourceHandler; // #{"resource"} + + public void execute() { + if (facesContext == null) { + LOGGER.log(Level.INFO, "FacesContext was not initialized -> {0}", facesContext); + } else { + facesContext.addMessage(null, new FacesMessage("FacesContext project stage: " + facesContext.getApplication().getProjectStage())); + + facesContext.addMessage(null, new FacesMessage("ServletContext context path: " + servletContext.getContextPath())); + + facesContext.addMessage(null, new FacesMessage("ExternalContext app context path: " + externalContext.getApplicationContextPath())); + + facesContext.addMessage(null, new FacesMessage("UIViewRoot viewId: " + viewRoot.getViewId())); + + facesContext.addMessage(null, new FacesMessage("Flash isRedirect: " + flash.isRedirect())); + + facesContext.addMessage(null, new FacesMessage("HttpSession isNew: " + httpSession.isNew())); + + facesContext.addMessage(null, new FacesMessage("Request contextPath: " + httpServletRequest.getContextPath())); + + facesContext.addMessage(null, new FacesMessage("Application name from ApplicationMap: " + applicationMap.get("com.ibm.websphere.servlet.enterprise.application.name"))); + + // handle jakarta/javax namespace switch + Object charset = sessionMap.get("javax.faces.request.charset"); + + // handle jakarta/javax namespace switch + if(charset == null){ + charset = sessionMap.get("jakarta.faces.request.charset"); + } + + facesContext.addMessage(null, new FacesMessage("Char set from SessionMap: " + charset )); + + facesContext.addMessage(null, new FacesMessage("ViewMap isEmpty: " + viewMap.isEmpty())); + + facesContext.addMessage(null, new FacesMessage("URI from RequestMap: " + requestMap.get("com.ibm.websphere.servlet.uri_non_decoded"))); + + try { + facesContext.addMessage(null, new FacesMessage("Flow map isEmpty: " + flowMap.isEmpty())); + } catch (Exception e) { + facesContext.addMessage(null, new FacesMessage("Flow map object is null: Exception: " + e.getMessage())); + } + + facesContext.addMessage(null, new FacesMessage("Message from HeaderMap: " + headerMap.get("User-Agent"))); + + facesContext.addMessage(null, new FacesMessage("Cookie object from CookieMap: " + cookieMap.get("JSESSIONID"))); + + facesContext.addMessage(null, new FacesMessage("WELD_CONTEXT_ID_KEY from InitParameterMap: " + initParameterMap.get("WELD_CONTEXT_ID_KEY"))); + + facesContext.addMessage(null, new FacesMessage("Message from RequestParameterMap: " + requestParameterMap.get("message"))); + + facesContext.addMessage(null, new FacesMessage("Message from RequestParameterValuesMap: " + Arrays.toString(requestParameterValuesMap.get("message")))); + + facesContext.addMessage(null, new FacesMessage("Message from HeaderValuesMap: " + Arrays.toString(headerValuesMap.get("User-Agent")))); + + facesContext.addMessage(null, new FacesMessage("Resource handler JSF_SCRIPT_LIBRARY_NAME constant: " + resourceHandler.JSF_SCRIPT_LIBRARY_NAME)); + + } + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/beans/TestBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/beans/TestBean.java new file mode 100644 index 000000000000..8910e5aacb50 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDI.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/beans/TestBean.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.elimplicit.cdi.beans; + +import java.io.Serializable; +import java.util.Map; + +import javax.faces.annotation.FacesConfig; +import javax.faces.annotation.FlowMap; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.flow.FlowScoped; +import javax.inject.Inject; +import javax.inject.Named; + +/** + * A simple FlowScoped bean used to test basic functionality. + */ +@Named(value = "testBean") +@FlowScoped(value = "simpleBean") +@FacesConfig +public class TestBean implements Serializable { + + private static final long serialVersionUID = 1L; + + @Inject + private FacesContext facesContext; // #{facesContext} + + @Inject + @FlowMap + private Map flowMap; // #{flowScope} + + public void test() { + facesContext.addMessage(null, new FacesMessage("Flow map isEmpty: " + flowMap.isEmpty())); + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDIErrorApp.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDIErrorApp.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..110b1a78ff09 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDIErrorApp.war/resources/WEB-INF/web.xml @@ -0,0 +1,28 @@ + + + + + JSF23ELImplicitObjectsViaCDIErrorApp + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.xhtml + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDIErrorApp.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/error/beans/ELImplicitObjectInjectionWithNoFacesConfig.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDIErrorApp.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/error/beans/ELImplicitObjectInjectionWithNoFacesConfig.java new file mode 100644 index 000000000000..85845aee6664 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/ELImplicitObjectsViaCDIErrorApp.war/src/com/ibm/ws/jsf23/fat/elimplicit/cdi/error/beans/ELImplicitObjectInjectionWithNoFacesConfig.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.elimplicit.cdi.error.beans; + +import java.io.Serializable; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.enterprise.context.RequestScoped; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.inject.Inject; +import javax.inject.Named; + +/** + * Bean that tests that EL implicit objects cannot be injected if annotation @FacesConfig is not present. + */ +@Named("elImplicitObjectWithNoFacesConfigBean") +@RequestScoped +public class ELImplicitObjectInjectionWithNoFacesConfig implements Serializable { + + /** */ + private static final long serialVersionUID = 1L; + + private static Logger LOGGER = Logger.getLogger(ELImplicitObjectInjectionWithNoFacesConfig.class.getName()); + + @Inject + private FacesContext facesContext; // #{facesContext} + + public void execute() { + if (facesContext == null) { + LOGGER.log(Level.INFO, "FacesContext was not initialized -> {0}", facesContext); + } else { + facesContext.addMessage(null, new FacesMessage("FacesContext object: " + facesContext.toString())); + + } + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/WEB-INF/faces-config.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/WEB-INF/faces-config.xml new file mode 100644 index 000000000000..a0b32992f423 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/WEB-INF/faces-config.xml @@ -0,0 +1,23 @@ + + + + + PostRenderViewEvent + + + com.ibm.ws.jsf23.fat.postrenderview.events.RenderResponsePhaseListener + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..ac48571174b7 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/WEB-INF/web.xml @@ -0,0 +1,32 @@ + + + + + PostRenderViewEvent + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.jsf + + + + index.jsf + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/index.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/index.xhtml new file mode 100644 index 000000000000..0690463281be --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/resources/index.xhtml @@ -0,0 +1,27 @@ + + + + + + PostRenderViewEvent Test + + + + + + + + PostRenderViewEvent Test + + + \ No newline at end of file diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/src/com/ibm/ws/jsf23/fat/postrenderview/events/RenderResponsePhaseListener.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/src/com/ibm/ws/jsf23/fat/postrenderview/events/RenderResponsePhaseListener.java new file mode 100644 index 000000000000..0922ad0f91b8 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/src/com/ibm/ws/jsf23/fat/postrenderview/events/RenderResponsePhaseListener.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.postrenderview.events; + +import javax.faces.event.PhaseEvent; +import javax.faces.event.PhaseId; +import javax.faces.event.PhaseListener; + +/** + * A simple PhaseListener to log messages before and after the RENDER_RESPONSE phase + * of the JSF lifecycle. + */ +public class RenderResponsePhaseListener implements PhaseListener { + + /** */ + private static final long serialVersionUID = 1L; + + /* + * (non-Javadoc) + * + * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent) + */ + @Override + public void afterPhase(PhaseEvent event) { + event.getFacesContext().getExternalContext().log("After Render Response Phase"); + + } + + /* + * (non-Javadoc) + * + * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent) + */ + @Override + public void beforePhase(PhaseEvent event) { + event.getFacesContext().getExternalContext().log("Before Render Response Phase"); + + } + + /* + * (non-Javadoc) + * + * @see javax.faces.event.PhaseListener#getPhaseId() + */ + @Override + public PhaseId getPhaseId() { + return PhaseId.RENDER_RESPONSE; + } + +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/src/com/ibm/ws/jsf23/fat/postrenderview/events/RenderViewEventsBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/src/com/ibm/ws/jsf23/fat/postrenderview/events/RenderViewEventsBean.java new file mode 100644 index 000000000000..8cb088eb5275 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/PostRenderViewEvent.war/src/com/ibm/ws/jsf23/fat/postrenderview/events/RenderViewEventsBean.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.postrenderview.events; + +import javax.enterprise.context.RequestScoped; +import javax.faces.context.FacesContext; +import javax.inject.Named; + +/** + * A bean that has two methods. One that is invoked when the PostRenderViewEvent is fired + * and another that is to be invoked when the PreRenderViewEvent is fired. + * + */ +@Named +@RequestScoped +public class RenderViewEventsBean { + + /** + * Log some information when the PostRenderViewEvent is fired. + */ + public void processPostRenderView() { + FacesContext.getCurrentInstance().getExternalContext().log("Processing PostRenderViewEvent"); + } + + /** + * Log some information when the PreRenderViewEvent is fired. + */ + public void processPreRenderView() { + FacesContext.getCurrentInstance().getExternalContext().log("Processing PreRenderViewEvent"); + } +} diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/UIRepeatBeginEnd.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/UIRepeatBeginEnd.xhtml new file mode 100644 index 000000000000..68ca49dd4c15 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/UIRepeatBeginEnd.xhtml @@ -0,0 +1,38 @@ + + + + + + ui:repeat constraint test + + + + + uiRepeat constraint test +

+ begin: + end: + step: +

+ + + #{x} + + +

+ + + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/UIRepeatEndTooLarge.xhtml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/UIRepeatEndTooLarge.xhtml new file mode 100644 index 000000000000..5326f84bd383 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/UIRepeatEndTooLarge.xhtml @@ -0,0 +1,32 @@ + + + + + + ui:repeat constraint test - end too large + + + + + uiRepeat constraint test - end too large +

+ + + #{x} + + +

+ + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/WEB-INF/web.xml b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/WEB-INF/web.xml new file mode 100644 index 000000000000..641ba7fd38aa --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/resources/WEB-INF/web.xml @@ -0,0 +1,28 @@ + + + + + UIRepeatConditionCheck + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + + Faces Servlet + *.jsf + + + diff --git a/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/src/com/ibm/ws/jsf23/fat/uirepeat/IterationBean.java b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/src/com/ibm/ws/jsf23/fat/uirepeat/IterationBean.java new file mode 100644 index 000000000000..36101febb1b6 --- /dev/null +++ b/dev/io.openliberty.checkpoint_fat_faces/test-applications/UIRepeatConditionCheck.war/src/com/ibm/ws/jsf23/fat/uirepeat/IterationBean.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2017, 2018 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package com.ibm.ws.jsf23.fat.uirepeat; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Named; + +/** + * A simple request scoped bean for use with the constraint test. + */ +@Named +@RequestScoped +public class IterationBean implements Serializable { + + /** */ + private static final long serialVersionUID = 1L; + + private int begin = 0; + private int step = 1; + private int end = 9; + private List testList = new ArrayList(Arrays.asList(new Integer(0), + new Integer(1), + new Integer(2), + new Integer(3), + new Integer(4), + new Integer(5), + new Integer(6), + new Integer(7), + new Integer(8), + new Integer(9))); + + public int getBegin() { + return begin; + } + + public void setBegin(int begin) { + this.begin = begin; + } + + public int getStep() { + return step; + } + + public void setStep(int step) { + this.step = step; + } + + public int getEnd() { + return end; + } + + public void setEnd(int end) { + this.end = end; + } + + public List getTestList() { + return testList; + } + + public void setTestList(List testList) { + this.testList = testList; + } +}