summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-06-07 07:31:18 -0400
committerAlexander Kurtakov2018-06-07 07:31:18 -0400
commitd85db3fc0b6f37cbcbb3216bec9396a51e7e93d3 (patch)
treec086588b3fc0f21abc6a9a3b4ded9c3d98259e16
parent269a2c076c086071f1d8ac61748d451bc96b9a1d (diff)
downloadrt.equinox.p2-d85db3fc0b6f37cbcbb3216bec9396a51e7e93d3.zip
rt.equinox.p2-d85db3fc0b6f37cbcbb3216bec9396a51e7e93d3.tar.gz
rt.equinox.p2-d85db3fc0b6f37cbcbb3216bec9396a51e7e93d3.tar.xz
Bug 535636 - Update bundles to Java 1.8
Take care of p2.tests.discovery. Bump BREE code updates and move to JUnit 4. Change-Id: I033137b0b994357f169f399801f730e6d4760a1e Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/.classpath8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.core.prefs130
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.ui.prefs26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryRemoteTest.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryTest.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/DirectoryParserTest.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogCategoryComparatorTest.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogConnectorComparatorTest.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java20
14 files changed, 296 insertions, 162 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/.classpath b/bundles/org.eclipse.equinox.p2.tests.discovery/.classpath
index c5eb0e9..c552bdb 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/.classpath
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/.classpath
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
<accessrule kind="accessible" pattern="**/internal/**"/>
</accessrules>
</classpathentry>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.core.prefs
index c65423d..c28a106 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Wed Feb 17 14:07:15 PST 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -8,15 +7,26 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.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.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
@@ -28,6 +38,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -35,6 +46,7 @@ org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -42,7 +54,9 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
@@ -50,29 +64,48 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
@@ -80,6 +113,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
@@ -89,11 +123,15 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
@@ -102,17 +140,25 @@ org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
+org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
@@ -132,26 +178,36 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true
+org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=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
@@ -161,9 +217,18 @@ 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.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
@@ -171,7 +236,7 @@ org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do no
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
@@ -182,7 +247,7 @@ 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_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
@@ -211,10 +276,11 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=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
@@ -229,12 +295,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
@@ -243,7 +311,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_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
@@ -258,11 +326,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=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=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
@@ -285,6 +354,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -313,6 +383,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
@@ -322,6 +393,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -331,19 +403,37 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=800
+org.eclipse.jdt.core.formatter.lineSplit=120
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.ui.prefs
index 8f3db4a..3c6d1b0 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/.settings/org.eclipse.jdt.ui.prefs
@@ -1,8 +1,7 @@
-#Wed Feb 17 14:07:15 PST 2010
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_core
-formatter_settings_version=11
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=14
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=;
org.eclipse.jdt.ui.ondemandthreshold=3
@@ -12,22 +11,29 @@ 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.convert_functional_interfaces=true
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=true
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=false
+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
@@ -35,12 +41,14 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=
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=false
+sp_cleanup.remove_redundant_modifiers=true
+sp_cleanup.remove_redundant_type_arguments=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=false
-sp_cleanup.remove_unused_imports=false
+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
@@ -48,8 +56,10 @@ 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_anonymous_class_creation=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
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
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF
index 7e7e4dc..154242c 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.equinox.p2.tests.discovery;singleton:=true
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Vendor: %Bundle-Provider
Bundle-Localization: plugin
Export-Package: org.eclipse.equinox.p2.discovery.tests;x-internal:=true,
@@ -15,6 +15,6 @@ Require-Bundle: org.eclipse.equinox.p2.discovery;bundle-version="1.0.0",
org.junit;bundle-version="3.8.0",
org.eclipse.core.runtime;bundle-version="3.1.0",
org.eclipse.ui;bundle-version="3.1.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Eclipse-BundleShape: dir
Automatic-Module-Name: org.eclipse.equinox.p2.tests.discovery
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/pom.xml b/bundles/org.eclipse.equinox.p2.tests.discovery/pom.xml
index e18f6b4..2b5da74 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/pom.xml
@@ -9,7 +9,7 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.tests.discovery</artifactId>
- <version>1.1.200-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
index 3eb3845..0b9316d 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 Tasktop Technologies and others.
+ * Copyright (c) 2009, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,25 +11,21 @@
package org.eclipse.equinox.p2.discovery.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
import org.eclipse.equinox.p2.discovery.tests.core.*;
import org.eclipse.equinox.p2.discovery.tests.core.util.TransportUtilTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
/**
* @author Steffen Pingel
*/
+@RunWith(Suite.class)
+@SuiteClasses({ ConnectorDiscoveryTest.class, DirectoryParserTest.class, BundleDiscoveryStrategyTest.class,
+ TransportUtilTest.class })
public class AllDiscoveryTests {
- public static Test suite() {
- TestSuite suite = new TestSuite("Tests for org.eclipse.equinox.p2.discovery.tests"); //$NON-NLS-1$
- suite.addTestSuite(ConnectorDiscoveryTest.class);
- suite.addTestSuite(DirectoryParserTest.class);
- suite.addTestSuite(BundleDiscoveryStrategyTest.class);
- //suite.addTestSuite(RemoteBundleDiscoveryStrategyTest.class);
- //suite.addTestSuite(ConnectorDiscoveryRemoteTest.class);
- suite.addTestSuite(TransportUtilTest.class);
- return suite;
- }
+ // suite.addTestSuite(RemoteBundleDiscoveryStrategyTest.class);
+ // suite.addTestSuite(ConnectorDiscoveryRemoteTest.class);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java
index 19b4882..9246468 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Tasktop Technologies and others.
+ * Copyright (c) 2009, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,33 +11,35 @@
package org.eclipse.equinox.p2.discovery.tests.core;
+import static org.junit.Assert.*;
+
import java.util.*;
-import junit.framework.TestCase;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.discovery.Policy;
import org.eclipse.equinox.internal.p2.discovery.model.*;
import org.eclipse.equinox.p2.discovery.tests.core.mock.MockBundleDiscoveryStrategy;
+import org.junit.Before;
+import org.junit.Test;
/**
* @author David Green
* @author Steffen Pingel
*/
-public class BundleDiscoveryStrategyTest extends TestCase {
+public class BundleDiscoveryStrategyTest {
private MockBundleDiscoveryStrategy discoveryStrategy;
- private final List<CatalogCategory> categories = new ArrayList<CatalogCategory>();
+ private final List<CatalogCategory> categories = new ArrayList<>();
- private final List<CatalogItem> connectors = new ArrayList<CatalogItem>();
+ private final List<CatalogItem> connectors = new ArrayList<>();
- private final List<Certification> certifications = new ArrayList<Certification>();
+ private final List<Certification> certifications = new ArrayList<>();
- private final List<Tag> tags = new ArrayList<Tag>();
+ private final List<Tag> tags = new ArrayList<>();
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
discoveryStrategy = new MockBundleDiscoveryStrategy();
discoveryStrategy.setPolicy(new Policy(true));
discoveryStrategy.setCategories(categories);
@@ -46,6 +48,7 @@ public class BundleDiscoveryStrategyTest extends TestCase {
discoveryStrategy.setTags(tags);
}
+ @Test
public void testDiscovery() throws CoreException {
discoveryStrategy.performDiscovery(new NullProgressMonitor());
@@ -59,14 +62,16 @@ public class BundleDiscoveryStrategyTest extends TestCase {
assertNotNull(certification);
}
+ @Test
public void testCustomTag() throws CoreException {
discoveryStrategy.performDiscovery(new NullProgressMonitor());
CatalogItem connector = findConnectorById("org.eclipse.mylyn.discovery.test.tagged"); //$NON-NLS-1$
- assertEquals(new HashSet<Tag>(Arrays.asList(new Tag("Custom", "Custom"))), connector.getTags()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(new HashSet<>(Arrays.asList(new Tag("Custom", "Custom"))), connector.getTags()); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals(Arrays.asList(new Tag("task", "Tasks"), new Tag("Custom", "Custom")), discoveryStrategy.getTags()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
}
+ @Test
public void testDiscoveryNoCategoriesPolicy() throws CoreException {
discoveryStrategy.setPolicy(new Policy(false));
discoveryStrategy.performDiscovery(new NullProgressMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryRemoteTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryRemoteTest.java
index d0636cd..826c75b 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryRemoteTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryRemoteTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Tasktop Technologies and others.
+ * Copyright (c) 2009, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,25 +11,27 @@
package org.eclipse.equinox.p2.discovery.tests.core;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertFalse;
+
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.discovery.Catalog;
import org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy;
import org.eclipse.equinox.p2.discovery.tests.DiscoveryTestConstants;
+import org.junit.Before;
+import org.junit.Test;
/**
- * A test that uses the real discovery directory and verifies that it works, and that all referenced update sites appear
- * to be available.
- *
+ * A test that uses the real discovery directory and verifies that it works, and
+ * that all referenced update sites appear to be available.
+ *
* @author David Green
*/
-public class ConnectorDiscoveryRemoteTest extends TestCase {
+public class ConnectorDiscoveryRemoteTest {
private Catalog connectorDiscovery;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
connectorDiscovery = new Catalog();
connectorDiscovery.setVerifyUpdateSiteAvailability(false);
@@ -39,6 +41,7 @@ public class ConnectorDiscoveryRemoteTest extends TestCase {
connectorDiscovery.getDiscoveryStrategies().add(remoteStrategy);
}
+ @Test
public void testRemoteDirectory() {
connectorDiscovery.performDiscovery(new NullProgressMonitor());
@@ -46,38 +49,4 @@ public class ConnectorDiscoveryRemoteTest extends TestCase {
assertFalse(connectorDiscovery.getItems().isEmpty());
}
- // public void testVerifyAvailability() throws CoreException {
- // connectorDiscovery.performDiscovery(new NullProgressMonitor());
- // for (CatalogItem connector : connectorDiscovery.getConnectors()) {
- // assertNull(connector.getAvailable());
- // }
- // connectorDiscovery.verifySiteAvailability(new NullProgressMonitor());
- //
- // assertFalse(connectorDiscovery.getConnectors().isEmpty());
- //
- // int unavailableCount = 0;
- // for (CatalogItem connector : connectorDiscovery.getConnectors()) {
- // assertNotNull(connector.getAvailable());
- // if (!connector.getAvailable()) {
- // ++unavailableCount;
- // }
- // }
- // if (unavailableCount > 0) {
- // fail(String.format("%s unavailable: %s", unavailableCount, computeUnavailableConnetorDescriptorNames()));
- // }
- // }
-
- // private String computeUnavailableConnetorDescriptorNames() {
- // String message = "";
- // for (CatalogItem connector : connectorDiscovery.getItems()) {
- // if (!connector.getAvailable()) {
- // if (message.length() > 0) {
- // message += ", ";
- // }
- // message += connector.getName();
- // }
- // }
- // return message;
- // }
-
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryTest.java
index a9734c3..fb7e436 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/ConnectorDiscoveryTest.java
@@ -1,46 +1,50 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Tasktop Technologies and others.
+ * Copyright (c) 2009, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.p2.discovery.tests.core;
+import static org.junit.Assert.*;
+
import java.util.*;
-import junit.framework.TestCase;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.discovery.Catalog;
import org.eclipse.equinox.internal.p2.discovery.model.CatalogItem;
import org.eclipse.equinox.p2.discovery.tests.core.mock.CatalogItemMockFactory;
import org.eclipse.equinox.p2.discovery.tests.core.mock.MockDiscoveryStrategy;
+import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.Version;
/**
* @author David Green
*/
-public class ConnectorDiscoveryTest extends TestCase {
+public class ConnectorDiscoveryTest {
private Catalog connectorDiscovery;
private MockDiscoveryStrategy mockDiscoveryStrategy;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
connectorDiscovery = new Catalog();
mockDiscoveryStrategy = new MockDiscoveryStrategy();
connectorDiscovery.getDiscoveryStrategies().add(mockDiscoveryStrategy);
}
+ @Test
public void testPlatformFilter_None() {
connectorDiscovery.performDiscovery(new NullProgressMonitor());
assertEquals(mockDiscoveryStrategy.getConnectorCount(), connectorDiscovery.getItems().size());
}
+ @Test
public void testPlatformFilter_NegativeMatch() {
mockDiscoveryStrategy.setConnectorMockFactory(new CatalogItemMockFactory() {
@Override
@@ -59,6 +63,7 @@ public class ConnectorDiscoveryTest extends TestCase {
assertTrue(connectorDiscovery.getItems().isEmpty());
}
+ @Test
public void testPlatformFilter_PositiveMatch() {
mockDiscoveryStrategy.setConnectorMockFactory(new CatalogItemMockFactory() {
@Override
@@ -79,6 +84,7 @@ public class ConnectorDiscoveryTest extends TestCase {
assertEquals(mockDiscoveryStrategy.getConnectorCount(), connectorDiscovery.getItems().size());
}
+ @Test
public void testFeatureFilter_PositiveMatch() {
mockDiscoveryStrategy.setConnectorMockFactory(new CatalogItemMockFactory() {
@Override
@@ -87,7 +93,7 @@ public class ConnectorDiscoveryTest extends TestCase {
featureFilter("com.foo.bar.feature", "[1.0,2.0)"); //$NON-NLS-1$ //$NON-NLS-2$
}
});
- Map<String, Version> featureToVersion = new HashMap<String, Version>();
+ Map<String, Version> featureToVersion = new HashMap<>();
featureToVersion.put("com.foo.bar.feature", new Version("1.1")); //$NON-NLS-1$ //$NON-NLS-2$
connectorDiscovery.setFeatureToVersion(featureToVersion);
connectorDiscovery.performDiscovery(new NullProgressMonitor());
@@ -96,6 +102,7 @@ public class ConnectorDiscoveryTest extends TestCase {
assertEquals(mockDiscoveryStrategy.getConnectorCount(), connectorDiscovery.getItems().size());
}
+ @Test
public void testFeatureFilter_NegativeMatch_VersionMismatch() {
mockDiscoveryStrategy.setConnectorMockFactory(new CatalogItemMockFactory() {
@Override
@@ -104,7 +111,7 @@ public class ConnectorDiscoveryTest extends TestCase {
featureFilter("com.foo.bar.feature", "[1.2,2.0)"); //$NON-NLS-1$ //$NON-NLS-2$
}
});
- Map<String, Version> featureToVersion = new HashMap<String, Version>();
+ Map<String, Version> featureToVersion = new HashMap<>();
featureToVersion.put("com.foo.bar.feature", new Version("1.1")); //$NON-NLS-1$ //$NON-NLS-2$
connectorDiscovery.setFeatureToVersion(featureToVersion);
connectorDiscovery.performDiscovery(new NullProgressMonitor());
@@ -112,6 +119,7 @@ public class ConnectorDiscoveryTest extends TestCase {
assertTrue(connectorDiscovery.getItems().isEmpty());
}
+ @Test
public void testFeatureFilter_NegativeMatch_NotPresent() {
mockDiscoveryStrategy.setConnectorMockFactory(new CatalogItemMockFactory() {
@Override
@@ -120,13 +128,14 @@ public class ConnectorDiscoveryTest extends TestCase {
featureFilter("com.foo.bar.feature", "[1.2,2.0)"); //$NON-NLS-1$ //$NON-NLS-2$
}
});
- Map<String, Version> featureToVersion = new HashMap<String, Version>();
+ Map<String, Version> featureToVersion = new HashMap<>();
connectorDiscovery.setFeatureToVersion(featureToVersion);
connectorDiscovery.performDiscovery(new NullProgressMonitor());
assertTrue(connectorDiscovery.getItems().isEmpty());
}
+ @Test
public void testCategorization() {
connectorDiscovery.performDiscovery(new NullProgressMonitor());
assertTrue(!connectorDiscovery.getItems().isEmpty());
@@ -139,6 +148,7 @@ public class ConnectorDiscoveryTest extends TestCase {
}
}
+ @Test
public void testMultipleStrategies() {
MockDiscoveryStrategy strategy = new MockDiscoveryStrategy();
strategy.setConnectorMockFactory(mockDiscoveryStrategy.getConnectorMockFactory());
@@ -147,7 +157,9 @@ public class ConnectorDiscoveryTest extends TestCase {
connectorDiscovery.performDiscovery(new NullProgressMonitor());
- assertEquals(mockDiscoveryStrategy.getConnectorMockFactory().getCreatedCount(), connectorDiscovery.getItems().size());
- assertEquals(mockDiscoveryStrategy.getCategoryMockFactory().getCreatedCount(), connectorDiscovery.getCategories().size());
+ assertEquals(mockDiscoveryStrategy.getConnectorMockFactory().getCreatedCount(),
+ connectorDiscovery.getItems().size());
+ assertEquals(mockDiscoveryStrategy.getCategoryMockFactory().getCreatedCount(),
+ connectorDiscovery.getCategories().size());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/DirectoryParserTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/DirectoryParserTest.java
index 8fa3457..0386966 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/DirectoryParserTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/DirectoryParserTest.java
@@ -1,6 +1,6 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
+ * Copyright (c) 2009, 2018 Tasktop Technologies and others.
+ * All rights reserved. This pro8gram and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
@@ -11,94 +11,116 @@
package org.eclipse.equinox.p2.discovery.tests.core;
+import static org.junit.Assert.*;
+
import java.io.IOException;
import java.io.StringReader;
-import junit.framework.TestCase;
import org.eclipse.equinox.internal.p2.discovery.compatibility.Directory;
import org.eclipse.equinox.internal.p2.discovery.compatibility.DirectoryParser;
+import org.junit.Before;
+import org.junit.Test;
/**
* @author David Green
*/
-public class DirectoryParserTest extends TestCase {
+public class DirectoryParserTest {
private DirectoryParser parser;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() {
parser = new DirectoryParser();
}
+ @Test
public void testParse() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory>")); //$NON-NLS-1$
+ Directory directory = parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals("http://foo.bar.nodomain/baz.jar", directory.getEntries().get(0).getLocation()); //$NON-NLS-1$
}
+ @Test
public void testParseBadFormat() {
try {
- parser.parse(new StringReader("<directory2 xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory2>")); //$NON-NLS-1$
+ parser.parse(new StringReader(
+ "<directory2 xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory2>")); //$NON-NLS-1$
fail("Expected exception"); //$NON-NLS-1$
} catch (IOException e) {
// expected
}
}
+ @Test
public void testParseMalformed() {
try {
- parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\">")); //$NON-NLS-1$
+ parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\">")); //$NON-NLS-1$
fail("Expected exception"); //$NON-NLS-1$
} catch (IOException e) {
// expected
}
}
+ @Test
public void testParseUnexpectedElementsAndAttributes() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" id=\"asdf\"><baz/></entry><foo/></directory>")); //$NON-NLS-1$
+ Directory directory = parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" id=\"asdf\"><baz/></entry><foo/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals("http://foo.bar.nodomain/baz.jar", directory.getEntries().get(0).getLocation()); //$NON-NLS-1$
}
+ @Test
public void testParseNoNS() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory>")); //$NON-NLS-1$
+ Directory directory = parser
+ .parse(new StringReader("<directory><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals("http://foo.bar.nodomain/baz.jar", directory.getEntries().get(0).getLocation()); //$NON-NLS-1$
}
+ @Test
public void testParsePermitCategoriesTrue() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"true\"/></directory>")); //$NON-NLS-1$
+ Directory directory = parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"true\"/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals(true, directory.getEntries().get(0).isPermitCategories());
}
+ @Test
public void testParsePermitCategoriesFalse() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"false\"/></directory>")); //$NON-NLS-1$
+ Directory directory = parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"false\"/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals(false, directory.getEntries().get(0).isPermitCategories());
}
+ @Test
public void testParsePermitCategoriesNotSpecified() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory>")); //$NON-NLS-1$
+ Directory directory = parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\"/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals(false, directory.getEntries().get(0).isPermitCategories());
}
+ @Test
public void testParsePermitCategoriesSpecifiedBadly() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"\"/></directory>")); //$NON-NLS-1$
+ Directory directory = parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"\"/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals(false, directory.getEntries().get(0).isPermitCategories());
}
+ @Test
public void testParsePermitCategoriesSpecifiedBadly2() throws IOException {
- Directory directory = parser.parse(new StringReader("<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"asdf\"/></directory>")); //$NON-NLS-1$
+ Directory directory = parser.parse(new StringReader(
+ "<directory xmlns=\"http://www.eclipse.org/mylyn/discovery/directory/\"><entry url=\"http://foo.bar.nodomain/baz.jar\" permitCategories=\"asdf\"/></directory>")); //$NON-NLS-1$
assertNotNull(directory);
assertEquals(1, directory.getEntries().size());
assertEquals(false, directory.getEntries().get(0).isPermitCategories());
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java
index 6735c06..c69f4e0 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java
@@ -1,35 +1,39 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Tasktop Technologies and others.
+ * Copyright (c) 2009, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.p2.discovery.tests.core;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
-import junit.framework.TestCase;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy;
import org.eclipse.equinox.internal.p2.discovery.model.*;
import org.eclipse.equinox.p2.discovery.tests.DiscoveryTestConstants;
+import org.junit.Before;
+import org.junit.Test;
/**
* @author David Green
*/
-public class RemoteBundleDiscoveryStrategyTest extends TestCase {
+public class RemoteBundleDiscoveryStrategyTest {
private RemoteBundleDiscoveryStrategy discoveryStrategy;
- @Override
- protected void setUp() throws Exception {
+ @Before
+ public void setUp() throws Exception {
discoveryStrategy = new RemoteBundleDiscoveryStrategy();
discoveryStrategy.setDirectoryUrl(DiscoveryTestConstants.DISCOVERY_URL);
discoveryStrategy.setCategories(new ArrayList<CatalogCategory>());
@@ -38,32 +42,36 @@ public class RemoteBundleDiscoveryStrategyTest extends TestCase {
discoveryStrategy.setTags(new ArrayList<Tag>());
}
+ @Test
public void testPerformDiscovery() throws CoreException, IOException {
discoveryStrategy.performDiscovery(new NullProgressMonitor());
assertFalse(discoveryStrategy.getCategories().isEmpty());
for (CatalogCategory category : discoveryStrategy.getCategories()) {
- // System.out.println(String.format("%s: %s: %s", category.getId(), category.getName(),
- // category.getDescription()));
+ // System.out.println(String.format("%s: %s: %s", category.getId(),
+ // category.getName(),
+ // category.getDescription()));
assertNotNull(category.getId());
assertNotNull(category.getName());
assertNotNull(category.getDescription());
}
assertFalse(discoveryStrategy.getItems().isEmpty());
for (CatalogItem connector : discoveryStrategy.getItems()) {
- // System.out.println(String.format("%s: %s: %s", connector.getId(), connector.getName(),
- // connector.getDescription()));
+ // System.out.println(String.format("%s: %s: %s", connector.getId(),
+ // connector.getName(),
+ // connector.getDescription()));
assertNotNull(connector.getId());
assertNotNull(connector.getTags());
assertNotNull(connector.getName());
assertNotNull(connector.getDescription());
- // we _know_ that the bundle must have a plugin.xml... so verify that the source is working correctly
+ // we _know_ that the bundle must have a plugin.xml... so verify that the source
+ // is working correctly
assertNotNull(connector.getSource());
URL pluginXmlUrl = connector.getSource().getResource("plugin.xml"); //$NON-NLS-1$
- // System.out.println("URL: " + pluginXmlUrl);
- InputStream in = pluginXmlUrl.openStream();
- assertNotNull(in);
- in.close();
+ // System.out.println("URL: " + pluginXmlUrl);
+ try (InputStream in = pluginXmlUrl.openStream()) {
+ assertNotNull(in);
+ }
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogCategoryComparatorTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogCategoryComparatorTest.java
index fb77951..38910a1 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogCategoryComparatorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogCategoryComparatorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * Copyright (c) 2004, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,11 +11,14 @@
package org.eclipse.equinox.p2.discovery.tests.core.util;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+
import org.eclipse.equinox.internal.p2.discovery.model.CatalogCategory;
import org.eclipse.equinox.internal.p2.discovery.util.CatalogCategoryComparator;
+import org.junit.Before;
+import org.junit.Test;
-public class CatalogCategoryComparatorTest extends TestCase {
+public class CatalogCategoryComparatorTest {
private CatalogCategoryComparator comparator;
@@ -23,14 +26,14 @@ public class CatalogCategoryComparatorTest extends TestCase {
private CatalogCategory category2;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() {
comparator = new CatalogCategoryComparator();
category1 = new CatalogCategory();
category2 = new CatalogCategory();
}
+ @Test
public void testSortByRelevanceInequal() {
category1.setRelevance("100"); //$NON-NLS-1$
category2.setRelevance("50"); //$NON-NLS-1$
@@ -38,12 +41,14 @@ public class CatalogCategoryComparatorTest extends TestCase {
assertEquals(1, comparator.compare(category2, category1));
}
+ @Test
public void testSortByRelevanceOneNotSpecified() {
category1.setRelevance("10"); //$NON-NLS-1$
assertEquals(-1, comparator.compare(category1, category2));
assertEquals(1, comparator.compare(category2, category1));
}
+ @Test
public void testSortByRelevanceSame() {
category1.setRelevance("10"); //$NON-NLS-1$
category1.setName("test"); //$NON-NLS-1$
@@ -55,6 +60,7 @@ public class CatalogCategoryComparatorTest extends TestCase {
assertEquals(0, comparator.compare(category2, category1));
}
+ @Test
public void testSortByRelevanceSameIdsDiffer() {
category1.setRelevance("10"); //$NON-NLS-1$
category1.setName("test"); //$NON-NLS-1$
@@ -66,6 +72,7 @@ public class CatalogCategoryComparatorTest extends TestCase {
assertEquals(1, comparator.compare(category2, category1));
}
+ @Test
public void testSortByRelevanceSameNamesDiffer() {
category1.setRelevance("10"); //$NON-NLS-1$
category1.setName("a"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogConnectorComparatorTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogConnectorComparatorTest.java
index 47e0f8c..94fc480 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogConnectorComparatorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/CatalogConnectorComparatorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * Copyright (c) 2004, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,19 +11,21 @@
package org.eclipse.equinox.p2.discovery.tests.core.util;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+
import org.eclipse.equinox.internal.p2.discovery.model.*;
import org.eclipse.equinox.internal.p2.discovery.util.CatalogItemComparator;
+import org.junit.Before;
+import org.junit.Test;
-public class CatalogConnectorComparatorTest extends TestCase {
+public class CatalogConnectorComparatorTest {
private CatalogCategory category;
private CatalogItemComparator comparator;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
category = new CatalogCategory();
comparator = new CatalogItemComparator();
}
@@ -45,6 +47,7 @@ public class CatalogConnectorComparatorTest extends TestCase {
return connector;
}
+ @Test
public void testOrderByGroup() {
addGroup("1"); //$NON-NLS-1$
addGroup("2"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java
index 7255817..4ab526e 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Tasktop Technologies and others.
+ * Copyright (c) 2013, 2018 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,27 +10,35 @@
*******************************************************************************/
package org.eclipse.equinox.p2.discovery.tests.core.util;
-import junit.framework.TestCase;
-import org.eclipse.equinox.internal.p2.discovery.compatibility.util.TransportUtil;
+import static org.junit.Assert.assertEquals;
-public class TransportUtilTest extends TestCase {
+import org.eclipse.equinox.internal.p2.discovery.compatibility.util.TransportUtil;
+import org.junit.Test;
+public class TransportUtilTest {
+ @Test
public void testGetFileNameForJar() throws Exception {
assertEquals("lib_1.0.jar", TransportUtil.getFileNameFor("lib-1.0.jar")); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test
public void testGetFileNameForUrl() throws Exception {
- assertEquals("lib_1.0.jar", TransportUtil.getFileNameFor("http://www.eclipse.org/downloads/download.php?file=/discovery/lib-1.0.jar")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("lib_1.0.jar", TransportUtil //$NON-NLS-1$
+ .getFileNameFor("http://www.eclipse.org/downloads/download.php?file=/discovery/lib-1.0.jar")); //$NON-NLS-1$
}
+ @Test
public void testGetFileNameForUrlWithQuery() throws Exception {
- assertEquals("lib_1.0.jar_r_1_protocol_http", TransportUtil.getFileNameFor("http://www.eclipse.org/downloads/download.php?file=/discovery/lib-1.0.jar&r=1&protocol=http")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("lib_1.0.jar_r_1_protocol_http", TransportUtil.getFileNameFor( //$NON-NLS-1$
+ "http://www.eclipse.org/downloads/download.php?file=/discovery/lib-1.0.jar&r=1&protocol=http")); //$NON-NLS-1$
}
+ @Test
public void testGetFileNameForUrlEndingWithSlash() throws Exception {
assertEquals("a.jar", TransportUtil.getFileNameFor("a.jar/")); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test
public void testGetFileNameForUrlWithFilesystemReservedCharacters() throws Exception {
assertEquals("1_2_3_4_5_6_7_8_9_", TransportUtil.getFileNameFor("1<2>3:4\"5\\6|7?8*9+")); //$NON-NLS-1$ //$NON-NLS-2$
}