Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-01-15 20:47:42 +0000
committerMarkus Keller2015-01-15 20:47:42 +0000
commit01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7 (patch)
treeeb33aee33f34987851b7cb19c74abafa56f2b28f /org.eclipse.ua.tests
parenta8649f0ddf43acb7b6b732a1c8e5d2c5eeda5a87 (diff)
downloadeclipse.platform.ua-01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7.tar.gz
eclipse.platform.ua-01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7.tar.xz
eclipse.platform.ua-01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7.zip
Diffstat (limited to 'org.eclipse.ua.tests')
-rw-r--r--org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs50
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java4
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java8
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java1
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java5
-rw-r--r--org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java1
-rw-r--r--org.eclipse.ua.tests/build.properties3
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCheatSheetManagerEvents.java3
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCompositeParser.java5
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestPersistence.java8
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestState.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestTaskEvents.java2
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/ActionWithParameters.java2
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/CommandHandler.java10
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/FailingAction.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/NegateIntegerHandler.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/SimpleAction.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestActionExecution.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestCommandExecution.java5
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestVariableSubstitution.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCategories.java22
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCollection.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetManager.java16
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestStatePersistence.java11
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidCheatsheet.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/NoError.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java1
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java27
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java8
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/MockTaskEditor.java4
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java2
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/StatusCheck.java4
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/TestTaskEditor.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/CriteriaUtilitiesTest.java12
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseTocWithCriteria.java56
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaDefinitionProvider.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaProvider.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/TestCriteriaProvider.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java13
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextLinkSorter.java7
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/DocumentReaderTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexEntryTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexSeeTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ResourceTest.java12
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/TopicTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserContext.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteria.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinition.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinitionContribution.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionDefinition.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionValueDefinition.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndex.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexEntry.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSee.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSubpath.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc2.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic2.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java8
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/BookmarksTest.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/HelpDataTest.java31
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/ProductPreferencesTest.java35
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContentServletTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContextServletTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContentUsingRemoteHelp.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContextUsingRemoteHelp.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/IndexServletTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/JettyTestServer.java7
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadIndexUsingRemoteHelp.java8
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadTocUsingRemoteHelp.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContentServlet.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContextServlet.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockIndexServlet.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockSearchServlet.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockTocServlet.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchServletTest.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchUsingRemote.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemotePreferenceTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java2
-rwxr-xr-xorg.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchServletTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchUsingRemoteHelp.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocManagerTest.java31
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocServletTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/scope/MockScope.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AnalyzerTest.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java50
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/EnabledTopicTest.java10
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/HelpData.java10
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocAssemblerTest.java19
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocProviderTest.java9
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java28
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/UaTestTocProvider.java9
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ParallelTestSupport.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ProducerSerializerTest.java10
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java8
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializerTest.java19
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilter.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterOne.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterThree.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterTwo.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/FilterExtensionTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java9
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java69
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletResponse.java37
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ParallelServerAccessTest.java4
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/RestrictedTopicParameter.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/TocZipTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/AdvancedSearchServiceTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContentServiceTest.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContextServiceTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ExtensionServiceTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexFragmentServiceTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexServiceTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/SearchServiceTest.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocFragmentServiceTest.java12
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocServiceTest.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestFrame.java5
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestHelpToolbarFrame.java8
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchButton.java6
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchData.java12
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchView.java8
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/anchors/ExtensionReorderingTest.java10
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java16
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java33
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java2
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java60
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java31
148 files changed, 778 insertions, 367 deletions
diff --git a/org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs
index 7dd04dded..8ce0943ea 100644
--- a/org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.ua.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,54 +1,96 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
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=error
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=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=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=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=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
index ac7056114..3335e6aca 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation 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
@@ -63,7 +63,7 @@ public class FileUtil {
out.write(buffer, 0, num);
}
String result = new String(out.toByteArray(), "UTF-8");
- if (result != null) {
+ if (result.length() > 0) {
// filter windows-specific newline
result = result.replaceAll("\r", "");
}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
index 43b1aebab..7cb43adb7 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
@@ -64,15 +64,15 @@ public class ResourceFinder {
private static URL[] findFiles(File[] files, String suffix, boolean recursive) {
List<URL> list = new ArrayList<URL>();
if (files != null) {
- for (int i=0;i<files.length;++i) {
- if (files[i].isDirectory()) {
+ for (File file : files) {
+ if (file.isDirectory()) {
if (recursive) {
- list.addAll(Arrays.asList(findFiles(files[i].listFiles(), suffix, recursive)));
+ list.addAll(Arrays.asList(findFiles(file.listFiles(), suffix, recursive)));
}
}
else {
try {
- URL url = files[i].toURI().toURL();
+ URL url = file.toURI().toURL();
if (url.toString().endsWith(suffix)) {
list.add(url);
}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java
index ddf428f2a..c81b7c4c2 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java
@@ -20,6 +20,7 @@ import org.eclipse.help.internal.util.URLCoder;
public class UATestContentProducer implements IHelpContentProducer {
+ @Override
public InputStream getInputStream(String pluginId, String href,
Locale locale) {
if (href.startsWith("generated/")) {
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
index 1dd3cba09..ec2f86480 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
@@ -73,6 +73,7 @@ public class XMLUtil extends Assert {
/* (non-Javadoc)
* @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
*/
+ @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
buf.append('<');
buf.append(qName);
@@ -98,6 +99,7 @@ public class XMLUtil extends Assert {
/* (non-Javadoc)
* @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
*/
+ @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
buf.append('<');
buf.append('/');
@@ -108,6 +110,7 @@ public class XMLUtil extends Assert {
/* (non-Javadoc)
* @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
*/
+ @Override
public void characters(char[] ch, int start, int length) throws SAXException {
buf.append(ch, start, length);
}
@@ -118,6 +121,7 @@ public class XMLUtil extends Assert {
*
* @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String, java.lang.String)
*/
+ @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
try {
return entityResolver.resolveEntity(publicId, systemId);
@@ -126,6 +130,7 @@ public class XMLUtil extends Assert {
}
}
+ @Override
public String toString() {
return buf.toString();
}
diff --git a/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java b/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java
index 836c2885f..cb385bdba 100644
--- a/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java
+++ b/org.eclipse.ua.tests/browser/org/eclipse/ua/tests/browser/servlet/CounterServlet.java
@@ -34,6 +34,7 @@ public class CounterServlet extends HttpServlet {
private static final String XHTML_3 = "</body>\n</html>"; //$NON-NLS-1$
private static int counter = 0;
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.setCharacterEncoding("UTF-8"); //$NON-NLS-1$
diff --git a/org.eclipse.ua.tests/build.properties b/org.eclipse.ua.tests/build.properties
index dee69179c..74abeb4e3 100644
--- a/org.eclipse.ua.tests/build.properties
+++ b/org.eclipse.ua.tests/build.properties
@@ -28,4 +28,5 @@ source.ua-tests.jar = base/,\
cheatsheet/,\
help/,\
intro/
-javacWarnings.ua-tests.jar=-raw
+javacWarnings.ua-tests.jar=-unavoidableGenericProblems
+
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCheatSheetManagerEvents.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCheatSheetManagerEvents.java
index 4103e88bb..1753b182b 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCheatSheetManagerEvents.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCheatSheetManagerEvents.java
@@ -26,17 +26,20 @@ public class TestCheatSheetManagerEvents extends TestCase {
private int handler2Calls;
private class Handler1 extends CheatSheetListener {
+ @Override
public void cheatSheetEvent(ICheatSheetEvent event) {
handler1Calls++;
}
}
private class Handler2 extends CheatSheetListener {
+ @Override
public void cheatSheetEvent(ICheatSheetEvent event) {
handler2Calls++;
}
}
+ @Override
protected void setUp() throws Exception {
element = new CheatSheetElement("Name");
manager = new CheatSheetManager(element);
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCompositeParser.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCompositeParser.java
index eb29d7b4c..6e35cb4b5 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCompositeParser.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestCompositeParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation 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
@@ -31,6 +31,7 @@ public class TestCompositeParser extends TestCase {
private static final String COMPOSITES_FOLDER = "data/cheatsheet/composite/";
private CompositeCheatSheetParser parser;
+ @Override
protected void setUp() throws Exception {
parser = new CompositeCheatSheetParser();
}
@@ -99,7 +100,7 @@ public class TestCompositeParser extends TestCase {
CompositeCheatSheetModel model = parseTestFile("ValidParameter.xml");
assertNotNull(model);
assertTrue(parser.getStatus().isOK());
- Dictionary params = model.getRootTask().getParameters();
+ Dictionary<String, String> params = model.getRootTask().getParameters();
assertEquals(1, params.size());
assertEquals("b", params.get("a"));
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestPersistence.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestPersistence.java
index 21e1e1f98..c0f842d78 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestPersistence.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestPersistence.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation 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
@@ -95,7 +95,7 @@ public class TestPersistence extends TestCase {
helper.saveCompositeState(model, null);
createCompositeCheatSheet();
- model.loadState(new Hashtable());
+ model.loadState(new Hashtable<String, String>());
assertEquals(ICompositeCheatSheetTask.IN_PROGRESS, task1.getState());
assertEquals(ICompositeCheatSheetTask.COMPLETED, task2.getState());
}
@@ -124,7 +124,7 @@ public class TestPersistence extends TestCase {
helper.saveCompositeState(model, null);
createCompositeCheatSheet();
- model.loadState(new Hashtable());
+ model.loadState(new Hashtable<String, String>());
editor1.setInput(task1, model.getTaskMemento(task1.getId()));
editor2.setInput(task2, model.getTaskMemento(task2.getId()));
assertEquals(value1, editor1.getValue());
@@ -140,7 +140,7 @@ public class TestPersistence extends TestCase {
values.put("One", "1");
values.put("Two", "2");
helper.saveCompositeState(model, values);
- Map restoredValues = new Hashtable();
+ Map<String, String> restoredValues = new Hashtable<String, String>();
createCompositeCheatSheet();
model.loadState(restoredValues);
assertEquals(2, restoredValues.size());
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestState.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestState.java
index 99bdcf5da..f29225236 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestState.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestState.java
@@ -29,6 +29,7 @@ public class TestState extends TestCase {
private CompositeCheatSheetModel model;
+ @Override
protected void setUp() throws Exception {
model = new CompositeCheatSheetModel("name", "description", "explorerId");
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestTaskEvents.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestTaskEvents.java
index 7b2a19e2a..6b645d9d6 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestTaskEvents.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestTaskEvents.java
@@ -76,6 +76,7 @@ public class TestTaskEvents extends TestCase {
}
public class ModelObserver implements Observer {
+ @Override
public void update(Observable o, Object arg) {
taskMap.put((ICompositeCheatSheetTask)arg);
}
@@ -123,6 +124,7 @@ public class TestTaskEvents extends TestCase {
group2.addSubtask(task2B);
}
+ @Override
protected void setUp() throws Exception {
resetTaskMap();
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/ActionWithParameters.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/ActionWithParameters.java
index 069f68a6e..ab25fa2b9 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/ActionWithParameters.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/ActionWithParameters.java
@@ -28,10 +28,12 @@ public class ActionWithParameters extends Action implements ICheatSheetAction {
/**
* Should never be called
*/
+ @Override
public void run() {
Assert.fail("Should not call this version of run");
}
+ @Override
public void run(String[] params, ICheatSheetManager manager) {
ActionEnvironment.setParams(params);
ActionEnvironment.actionCompleted();
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/CommandHandler.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/CommandHandler.java
index 86f533cbb..64c89854b 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/CommandHandler.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/CommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation 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
@@ -26,7 +26,7 @@ public class CommandHandler extends AbstractHandler {
public static final String RESULT_TO_STRING = "RESULT_TO_STRING";
- private static Map params;
+ private static Map<String, String> params;
private static int timesCompleted;
private static boolean throwException;
@@ -36,14 +36,14 @@ public class CommandHandler extends AbstractHandler {
throwException = false;
}
- @SuppressWarnings("unchecked")
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (throwException) {
throw new RuntimeException();
}
// Copy all the parameters
- params = new HashMap();
+ params = new HashMap<String, String>();
params.putAll(event.getParameters());
timesCompleted++;
@@ -51,7 +51,7 @@ public class CommandHandler extends AbstractHandler {
return RESULT_TO_STRING;
}
- public static Map getParams() {
+ public static Map<String, String> getParams() {
return params;
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/FailingAction.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/FailingAction.java
index c74769eea..150dbd8b1 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/FailingAction.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/FailingAction.java
@@ -19,6 +19,7 @@ import org.eclipse.jface.action.Action;
public class FailingAction extends Action {
+ @Override
public void run() {
// Return a failure status
notifyResult(false);
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/NegateIntegerHandler.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/NegateIntegerHandler.java
index 87980ecb2..42009134c 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/NegateIntegerHandler.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/NegateIntegerHandler.java
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionException;
public class NegateIntegerHandler extends AbstractHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Integer val = (Integer)event.getObjectParameterForExecution("number");
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/SimpleAction.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/SimpleAction.java
index 0c1f5ed0e..31eb17cff 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/SimpleAction.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/SimpleAction.java
@@ -19,6 +19,7 @@ import org.eclipse.jface.action.Action;
public class SimpleAction extends Action {
+ @Override
public void run() {
if (ActionEnvironment.shouldThrowException()) {
throw new RuntimeException();
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestActionExecution.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestActionExecution.java
index fe6ff19fa..4d581af26 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestActionExecution.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestActionExecution.java
@@ -33,6 +33,7 @@ public class TestActionExecution extends TestCase {
private static final String ACTION_WITH_PARAMETERS_CLASS =
ACTION_PACKAGE + ".ActionWithParameters"; //$NON-NLS-1$
+ @Override
protected void setUp() throws Exception {
ActionEnvironment.reset();
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestCommandExecution.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestCommandExecution.java
index 73f239928..a65dd6f6b 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestCommandExecution.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestCommandExecution.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation 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
@@ -51,6 +51,7 @@ public class TestCommandExecution extends TestCase {
private static final String RETURN_STORE = "retData";
private static final String PARENT_RETURN_STORE = "parent.retData";
+ @Override
protected void setUp() throws Exception {
CommandHandler.reset();
}
@@ -108,7 +109,7 @@ public class TestCommandExecution extends TestCase {
private void checkCommandExecution() {
assertTrue(CommandHandler.getTimesCompleted() == 1);
- Map params = CommandHandler.getParams();
+ Map<?, ?> params = CommandHandler.getParams();
assertEquals(2, params.size());
assertTrue(params.containsKey(PARAM1_ID));
assertEquals(PARAM1_VALUE, params.get(PARAM1_ID));
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestVariableSubstitution.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestVariableSubstitution.java
index 64100aad9..b8513153a 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestVariableSubstitution.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/execution/TestVariableSubstitution.java
@@ -24,6 +24,7 @@ import junit.framework.TestCase;
public class TestVariableSubstitution extends TestCase {
private CheatSheetManager manager;
+ @Override
protected void setUp() throws Exception {
manager = new CheatSheetManager(new CheatSheetElement("name"));
manager.setData("p1", "one");
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCategories.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCategories.java
index 8cd83ceb4..45c900a3e 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCategories.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCategories.java
@@ -23,16 +23,16 @@ public class TestCheatSheetCategories extends TestCase {
public void testForCollection() {
CheatSheetCollectionElement cheatSheets =
- (CheatSheetCollectionElement)CheatSheetRegistryReader.getInstance().getCheatSheets();
+ CheatSheetRegistryReader.getInstance().getCheatSheets();
Object[] subCategories = cheatSheets.getChildren();
- for (int i = 0; i < subCategories.length; i++) {
- assertTrue(subCategories[i] instanceof CheatSheetCollectionElement);
+ for (Object subCategorie : subCategories) {
+ assertTrue(subCategorie instanceof CheatSheetCollectionElement);
}
}
public void testFindTestCategory() {
CheatSheetCollectionElement cheatSheets =
- (CheatSheetCollectionElement)CheatSheetRegistryReader.getInstance().getCheatSheets();
+ CheatSheetRegistryReader.getInstance().getCheatSheets();
CheatSheetCollectionElement testCat = findChildCategory(cheatSheets, TEST_CATEGORY);
assertNotNull("Cannot find category org.eclipse.ua.tests.cheatsheet.cheatSheetsTestCat",
testCat);
@@ -40,7 +40,7 @@ public class TestCheatSheetCategories extends TestCase {
public void testFindQualifiedSubcategory() {
CheatSheetCollectionElement cheatSheets =
- (CheatSheetCollectionElement)CheatSheetRegistryReader.getInstance().getCheatSheets();
+ CheatSheetRegistryReader.getInstance().getCheatSheets();
CheatSheetCollectionElement testCat = findChildCategory(cheatSheets, TEST_CATEGORY);
CheatSheetCollectionElement subCat = findChildCategory(testCat,
"org.eclipse.ua.tests.subcategory");
@@ -49,7 +49,7 @@ public class TestCheatSheetCategories extends TestCase {
public void testFindCsInUnqualifiedSubcategory() {
CheatSheetCollectionElement cheatSheets =
- (CheatSheetCollectionElement)CheatSheetRegistryReader.getInstance().getCheatSheets();
+ CheatSheetRegistryReader.getInstance().getCheatSheets();
CheatSheetCollectionElement testCat = findChildCategory(cheatSheets, TEST_CATEGORY);
CheatSheetCollectionElement subCat = findChildCategory(testCat,
"org.eclipse.ua.tests.subcategory");
@@ -60,7 +60,7 @@ public class TestCheatSheetCategories extends TestCase {
public void testFindCsInQualifiedSubcategory() {
CheatSheetCollectionElement cheatSheets =
- (CheatSheetCollectionElement)CheatSheetRegistryReader.getInstance().getCheatSheets();
+ CheatSheetRegistryReader.getInstance().getCheatSheets();
CheatSheetCollectionElement testCat = findChildCategory(cheatSheets, TEST_CATEGORY);
CheatSheetCollectionElement subCat = findChildCategory(testCat,
"org.eclipse.ua.tests.subcategory");
@@ -72,8 +72,8 @@ public class TestCheatSheetCategories extends TestCase {
private CheatSheetCollectionElement findChildCategory(
CheatSheetCollectionElement collection, String id) {
Object[] subCategories = collection.getChildren();
- for (int i = 0; i < subCategories.length; i++) {
- CheatSheetCollectionElement child = (CheatSheetCollectionElement)subCategories[i];
+ for (Object subCategorie : subCategories) {
+ CheatSheetCollectionElement child = (CheatSheetCollectionElement)subCategorie;
if (child.getId().equals(id)) {
return child;
}
@@ -83,8 +83,8 @@ public class TestCheatSheetCategories extends TestCase {
private CheatSheetElement findCheatsheet(
CheatSheetCollectionElement collection, String id) {
Object[] cheatSheets = collection.getCheatSheets();
- for (int i = 0; i < cheatSheets.length; i++) {
- CheatSheetElement child = (CheatSheetElement)cheatSheets[i];
+ for (Object cheatSheet : cheatSheets) {
+ CheatSheetElement child = (CheatSheetElement)cheatSheet;
if (child.getID().equals(id)) {
return child;
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCollection.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCollection.java
index 6eba26d22..b3df20055 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCollection.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetCollection.java
@@ -28,6 +28,7 @@ public class TestCheatSheetCollection extends TestCase {
private CheatSheetCollectionElement c11;
private CheatSheetCollectionElement c12;
+ @Override
protected void setUp() throws Exception {
root = new CheatSheetCollectionElement("rootPlugin", "rootId", "rootName", root);
csA = new CheatSheetElement("A");
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetManager.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetManager.java
index 06e11848a..ec1d7d854 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetManager.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestCheatSheetManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation 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
@@ -13,11 +13,11 @@ package org.eclipse.ua.tests.cheatsheet.other;
import java.util.Set;
+import junit.framework.TestCase;
+
import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
import org.eclipse.ui.internal.cheatsheets.views.CheatSheetManager;
-import junit.framework.TestCase;
-
public class TestCheatSheetManager extends TestCase {
private static final String CHEATSHEET_ID = "RandomId0234";
@@ -56,7 +56,7 @@ public class TestCheatSheetManager extends TestCase {
assertEquals(VALUE_A, manager.getDataQualified(KEY1));
assertEquals(VALUE_B, manager.getData(PARENT_KEY1));
assertEquals(VALUE_B, manager.getDataQualified(PARENT_KEY1));
- Set keys = manager.getKeySet();
+ Set<?> keys = manager.getKeySet();
assertEquals(keys.size(), 2);
assertTrue(keys.contains(KEY1));
assertTrue(keys.contains(PARENT_KEY1));
@@ -76,12 +76,12 @@ public class TestCheatSheetManager extends TestCase {
assertEquals(VALUE_A, manager.getDataQualified(KEY1));
assertNull(manager.getData(PARENT_KEY1));
assertEquals(VALUE_B, manager.getDataQualified(PARENT_KEY1));
- Set keys = manager.getKeySet();
+ Set<?> keys = manager.getKeySet();
assertEquals(keys.size(), 1);
assertTrue(keys.contains(KEY1));
assertFalse(keys.contains(PARENT_KEY1));
- Set parentKeys = parentManager.getKeySet();
+ Set<?> parentKeys = parentManager.getKeySet();
assertEquals(parentKeys.size(), 1);
assertTrue(parentKeys.contains(KEY1));
assertFalse(parentKeys.contains(PARENT_KEY1));
@@ -100,12 +100,12 @@ public class TestCheatSheetManager extends TestCase {
assertEquals(VALUE_A, manager.getDataQualified(KEY1));
assertNull(manager.getDataQualified(PARENT_KEY1));
assertEquals(VALUE_B, manager.getData(PARENT_KEY1));
- Set keys = manager.getKeySet();
+ Set<?> keys = manager.getKeySet();
assertEquals(keys.size(), 2);
assertTrue(keys.contains(KEY1));
assertTrue(keys.contains(PARENT_KEY1));
- Set parentKeys = parentManager.getKeySet();
+ Set<?> parentKeys = parentManager.getKeySet();
assertEquals(parentKeys.size(), 0);
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestStatePersistence.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestStatePersistence.java
index f3274a024..cd71999f7 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestStatePersistence.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/other/TestStatePersistence.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation 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
@@ -20,13 +20,13 @@ import java.util.Hashtable;
import java.util.List;
import java.util.Properties;
+import junit.framework.TestCase;
+
import org.eclipse.ui.internal.cheatsheets.data.CheatSheetSaveHelper;
import org.eclipse.ui.internal.cheatsheets.data.IParserTags;
import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
import org.eclipse.ui.internal.cheatsheets.views.CheatSheetManager;
-import junit.framework.TestCase;
-
public class TestStatePersistence extends TestCase {
private static final String VALUE2 = "value2";
@@ -57,6 +57,7 @@ public class TestStatePersistence extends TestCase {
* Initialize the properties that will be saved. Individual tests will modify
* the properties which apply to a particular test.
*/
+ @Override
protected void setUp() throws Exception {
propsToSave = new PropertySet();
propsToSave.button = 1;
@@ -96,7 +97,7 @@ public class TestStatePersistence extends TestCase {
private PropertySet restore(String id) {
PropertySet result = new PropertySet();
Properties restored = helper.loadState(id);
- result.id = (String)restored.getProperty(IParserTags.ID);
+ result.id = restored.getProperty(IParserTags.ID);
result.button = Integer.parseInt(restored.getProperty(IParserTags.BUTTON));
result.currentItem = Integer.parseInt(restored.getProperty(IParserTags.CURRENT));
result.completed = (ArrayList<String>) restored.get(IParserTags.COMPLETED);
@@ -105,7 +106,7 @@ public class TestStatePersistence extends TestCase {
result.expandRestore = (ArrayList<String>) restored.get(IParserTags.EXPANDRESTORE);
result.subItemCompleted = (Hashtable<String, String>) restored.get(IParserTags.SUBITEMCOMPLETED);
result.subItemSkipped = (Hashtable<String, String>) restored.get(IParserTags.SUBITEMSKIPPED);
- Hashtable managerData = (Hashtable) restored.get(IParserTags.MANAGERDATA);
+ Hashtable<String, String> managerData = (Hashtable<String, String>) restored.get(IParserTags.MANAGERDATA);
CheatSheetElement csElement = new CheatSheetElement(id);
result.manager = new CheatSheetManager(csElement);
result.manager.setData(managerData);
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidCheatsheet.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidCheatsheet.java
index 470a867c0..329dd0612 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidCheatsheet.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/InvalidCheatsheet.java
@@ -27,6 +27,7 @@ public class InvalidCheatsheet extends TestCase {
private static final String INVALID_CHEATSHEET_FOLDER = "data/cheatsheet/invalid/";
private CheatSheetParser parser;
+ @Override
protected void setUp() throws Exception {
parser = new CheatSheetParser();
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/NoError.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/NoError.java
index 3e93eadc5..ca86efedd 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/NoError.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/parser/NoError.java
@@ -31,6 +31,7 @@ public class NoError extends TestCase {
private CheatSheetParser parser;
+ @Override
protected void setUp() throws Exception {
parser = new CheatSheetParser();
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java
index dfffdc238..c633667d4 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java
@@ -32,6 +32,7 @@ public class OpenCheatSheetTest extends PerformanceTestCase {
return new TestSuite(OpenCheatSheetTest.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
OpenIntroTest.closeIntro();
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java
index 4e2171092..730396423 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation 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
@@ -178,7 +178,6 @@ public class CheatSheetModelSerializer {
/*
* Serializes the given array with the specified indentation.
*/
- @SuppressWarnings("unchecked")
public static String serialize(Object[] array, String indent) {
StringBuffer buf = new StringBuffer();
if (array == null) {
@@ -189,21 +188,20 @@ public class CheatSheetModelSerializer {
}
else {
buf.append(indent + "<array>\n");
- for (int i=0;i<array.length;++i) {
- Object obj = array[i];
+ for (Object obj : array) {
if (obj != null) {
- Class c = obj.getClass();
+ Class<?> c = obj.getClass();
/*
* Find a serializer method that knows how to serialize this
* object.
*/
boolean found = false;
Method[] methods = CheatSheetModelSerializer.class.getMethods();
- for (int j=0;j<methods.length;++j) {
- Class[] params = methods[j].getParameterTypes();
+ for (Method method : methods) {
+ Class<?>[] params = method.getParameterTypes();
if (params.length == 2 && params[0].isAssignableFrom(c) && params[1].equals(String.class)) {
try {
- buf.append(methods[j].invoke(null, new Object[] {obj, indent + " "}));
+ buf.append(method.invoke(null, new Object[] {obj, indent + " "}));
}
catch(Exception e) {
buf.append(indent + " " + e + ", cause: " + e.getCause());
@@ -229,8 +227,7 @@ public class CheatSheetModelSerializer {
/*
* Serializes the given List with the specified indentation.
*/
- @SuppressWarnings("unchecked")
- public static String serialize(List list, String indent) {
+ public static String serialize(List<?> list, String indent) {
StringBuffer buf = new StringBuffer();
if (list == null) {
buf.append(indent + "<nullList/>\n");
@@ -240,22 +237,22 @@ public class CheatSheetModelSerializer {
}
else {
buf.append(indent + "<list>\n");
- Iterator iter = list.iterator();
+ Iterator<?> iter = list.iterator();
while (iter.hasNext()) {
Object obj = iter.next();
if (obj != null) {
- Class c = obj.getClass();
+ Class<?> c = obj.getClass();
/*
* Find a serializer method that knows how to serialize this
* object.
*/
boolean found = false;
Method[] methods = CheatSheetModelSerializer.class.getMethods();
- for (int i=0;i<methods.length;++i) {
- Class[] params = methods[i].getParameterTypes();
+ for (Method method : methods) {
+ Class<?>[] params = method.getParameterTypes();
if (params.length == 2 && params[0].isAssignableFrom(c) && params[1].equals(String.class)) {
try {
- buf.append(methods[i].invoke(null, new Object[] {obj, indent + " "}));
+ buf.append(method.invoke(null, new Object[] {obj, indent + " "}));
}
catch(Exception e) {
buf.append(indent + " " + e + ", cause: " + e.getCause());
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java
index b64cf3f8d..cdd2d0d43 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/CheatSheetModelSerializerTest.java
@@ -57,12 +57,12 @@ public class CheatSheetModelSerializerTest extends TestCase {
public void testRunSerializer() throws IOException {
URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), "data/cheatsheet/valid", ".xml", true);
Assert.assertTrue("Unable to find sample cheat sheets to test parser", urls.length > 0);
- for (int i=0;i<urls.length;++i) {
+ for (URL url : urls) {
CheatSheetParser parser = new CheatSheetParser();
- CheatSheet sheet = (CheatSheet)parser.parse(urls[i], UserAssistanceTestPlugin.getPluginId(), CheatSheetParser.ANY);
- Assert.assertNotNull("Tried parsing a valid cheat sheet but parser returned null: " + urls[i], sheet);
+ CheatSheet sheet = (CheatSheet)parser.parse(url, UserAssistanceTestPlugin.getPluginId(), CheatSheetParser.ANY);
+ Assert.assertNotNull("Tried parsing a valid cheat sheet but parser returned null: " + url, sheet);
- PrintWriter out = new PrintWriter(new FileOutputStream(FileUtil.getResultFile(urls[i].toString().substring("file:/".length()))));
+ PrintWriter out = new PrintWriter(new FileOutputStream(FileUtil.getResultFile(url.toString().substring("file:/".length()))));
out.print(CheatSheetModelSerializer.serialize(sheet));
out.close();
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/MockTaskEditor.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/MockTaskEditor.java
index b30900cab..d794f9a71 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/MockTaskEditor.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/MockTaskEditor.java
@@ -28,11 +28,13 @@ public class MockTaskEditor extends TaskEditor {
private static final String KEY = "key";
+ @Override
public Control getControl() {
// Not used by tests
return null;
}
+ @Override
public void setInput(IEditableTask task, IMemento memento) {
if (memento == null) {
setValue(NO_MEMENTO);
@@ -41,10 +43,12 @@ public class MockTaskEditor extends TaskEditor {
}
}
+ @Override
public void saveState(IMemento memento) {
memento.putString(KEY, getValue());
}
+ @Override
public void createControl(Composite parent, FormToolkit toolkit) {
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java
index f706ab87c..a1f353289 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/NavigateAction.java
@@ -22,6 +22,7 @@ public class NavigateAction extends Action implements ICheatSheetAction {
final String finalNewSheet = newSheet;
try {
Display.getCurrent().asyncExec( new Runnable() {
+ @Override
public void run() {
OpenCheatSheetAction csAction = new OpenCheatSheetAction( finalNewSheet );
csAction.run();
@@ -33,6 +34,7 @@ public class NavigateAction extends Action implements ICheatSheetAction {
}
}
+ @Override
public void run( String[] params, ICheatSheetManager manager ) {
go( params[ 0 ] );
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/StatusCheck.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/StatusCheck.java
index 5f0fb8d4c..9a152979c 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/StatusCheck.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/StatusCheck.java
@@ -32,8 +32,8 @@ public class StatusCheck {
public static void assertMultiStatusContains(IStatus status, String text) {
Assert.assertTrue(status instanceof MultiStatus);
IStatus[] children = status.getChildren();
- for (int i = 0; i < children.length; i++) {
- if (children[i].getMessage().indexOf(text) >= 0) {
+ for (IStatus element : children) {
+ if (element.getMessage().indexOf(text) >= 0) {
return;
}
}
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/TestTaskEditor.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/TestTaskEditor.java
index 4223c121c..6d373fce4 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/TestTaskEditor.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/util/TestTaskEditor.java
@@ -31,6 +31,7 @@ public class TestTaskEditor extends TaskEditor {
private Composite control;
+ @Override
public void createControl(Composite parent, FormToolkit toolkit) {
control = new Composite(parent, SWT.NULL);
control.setLayout(new GridLayout());
@@ -39,14 +40,17 @@ public class TestTaskEditor extends TaskEditor {
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
+ @Override
public Control getControl() {
return control;
}
+ @Override
public void setInput(IEditableTask task, IMemento memento) {
// Do nothing
}
+ @Override
public void saveState(IMemento memento) {
// Do nothing
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/CriteriaUtilitiesTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/CriteriaUtilitiesTest.java
index 8b3b0e7b0..22c98730d 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/CriteriaUtilitiesTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/CriteriaUtilitiesTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2015 IBM Corporation 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
@@ -19,31 +19,31 @@ import org.eclipse.help.internal.base.util.CriteriaUtilities;
public class CriteriaUtilitiesTest extends TestCase {
public void testNullValues() {
- List values = CriteriaUtilities.getCriteriaValues(null);
+ List<String> values = CriteriaUtilities.getCriteriaValues(null);
assertEquals(0, values.size());
}
public void testSingleValue() {
- List values = CriteriaUtilities.getCriteriaValues("1.0");
+ List<String> values = CriteriaUtilities.getCriteriaValues("1.0");
assertEquals(1, values.size());
assertEquals("1.0", values.get(0));
}
public void testSingleValueWithWhitespace() {
- List values = CriteriaUtilities.getCriteriaValues(" 1.0 ");
+ List<String> values = CriteriaUtilities.getCriteriaValues(" 1.0 ");
assertEquals(1, values.size());
assertEquals("1.0", values.get(0));
}
public void testMultipleValues() {
- List values = CriteriaUtilities.getCriteriaValues(" 1.0, 2.0 ");
+ List<String> values = CriteriaUtilities.getCriteriaValues(" 1.0, 2.0 ");
assertEquals(2, values.size());
assertEquals("1.0", values.get(0));
assertEquals("2.0", values.get(1));
}
public void testUppercaseValue() {
- List values = CriteriaUtilities.getCriteriaValues("LINUX");
+ List<String> values = CriteriaUtilities.getCriteriaValues("LINUX");
assertEquals(1, values.size());
assertNotSame("linux", values.get(0));
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java
index c38c891cf..1345a9b6b 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseCriteriaDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
+ * Copyright (c) 2010, 2015 IBM Corporation 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
@@ -43,8 +43,7 @@ public class ParseCriteriaDefinition extends TestCase {
CriteriaDefinitionContribution result_a_b = parser.parse(new CriteriaDefinitionFile(UserAssistanceTestPlugin.getPluginId(), "data/help/criteria/criteria_definition/result_a_b.xml", "en"));
CriteriaDefinitionAssembler assembler = new CriteriaDefinitionAssembler();
- @SuppressWarnings("unchecked")
- List contributions = new ArrayList(Arrays.asList(new Object[] { a, b }));
+ List<CriteriaDefinitionContribution> contributions = new ArrayList<CriteriaDefinitionContribution>(Arrays.asList(a, b));
CriteriaDefinition assembled = assembler.assemble(contributions);
String expected = serialize((UAElement)result_a_b.getCriteriaDefinition());
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseTocWithCriteria.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseTocWithCriteria.java
index fa3d5b2fe..e97706995 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseTocWithCriteria.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/ParseTocWithCriteria.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
+ * Copyright (c) 2010, 2015 IBM Corporation 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
@@ -65,19 +65,17 @@ public class ParseTocWithCriteria extends TestCase {
Map<String, Set<String>> criteria = new HashMap<String, Set<String>>();
CriteriaUtilities.addCriteriaToMap(criteria, toc.getCriteria());
assertEquals(2, criteria.size());
- Object versions = criteria.get("version");
+ Set<String> versions = criteria.get("version");
assertNotNull(versions);
- Set versionSet = (Set)versions;
- assertEquals(2, versionSet.size());
- assertTrue(versionSet.contains("1.0"));
- assertTrue(versionSet.contains("2.0"));
+ assertEquals(2, versions.size());
+ assertTrue(versions.contains("1.0"));
+ assertTrue(versions.contains("2.0"));
- Object platforms = criteria.get("platform");
+ Set<String> platforms = criteria.get("platform");
assertNotNull(platforms);
- Set platformSet = (Set)platforms;
- assertEquals(2, platformSet.size());
- assertTrue(platformSet.contains("linux"));
- assertTrue(platformSet.contains("win32"));
+ assertEquals(2, platforms.size());
+ assertTrue(platforms.contains("linux"));
+ assertTrue(platforms.contains("win32"));
}
public void testCopyTocWithCriteria() throws Exception {
@@ -86,36 +84,33 @@ public class ParseTocWithCriteria extends TestCase {
Map<String, Set<String>> criteria = new HashMap<String, Set<String>>();
CriteriaUtilities.addCriteriaToMap(criteria, toc.getCriteria());
assertEquals(2, criteria.size());
- Object versions = criteria.get("version");
+ Set<String> versions = criteria.get("version");
assertNotNull(versions);
- Set versionSet = (Set)versions;
- assertEquals(2, versionSet.size());
- assertTrue(versionSet.contains("1.0"));
- assertTrue(versionSet.contains("2.0"));
+ assertEquals(2, versions.size());
+ assertTrue(versions.contains("1.0"));
+ assertTrue(versions.contains("2.0"));
- Object platforms = criteria.get("platform");
+ Set<String> platforms = criteria.get("platform");
assertNotNull(platforms);
- Set platformSet = (Set)platforms;
- assertEquals(2, platformSet.size());
- assertTrue(platformSet.contains("linux"));
- assertTrue(platformSet.contains("win32"));
+ assertEquals(2, platforms.size());
+ assertTrue(platforms.contains("linux"));
+ assertTrue(platforms.contains("win32"));
}
public void testTopicWithCriteria() throws Exception {
IToc toc = parseToc("data/help/criteria/c1.xml");
- ITopic[] topics = (ITopic[]) toc.getTopics();
+ ITopic[] topics = toc.getTopics();
assertEquals(topics.length, 2);
// First topic
Map<String, Set<String>> criteria = new HashMap<String, Set<String>>();
assertTrue(topics[0] instanceof ITopic2);
CriteriaUtilities.addCriteriaToMap(criteria, ((ITopic2)topics[0]).getCriteria());
assertEquals(2, criteria.size());
- Object versions = criteria.get("version");
+ Set<String> versions = criteria.get("version");
assertNotNull(versions);
- Set versionSet = (Set)versions;
- assertEquals(1, versionSet.size());
- assertTrue(versionSet.contains("1.0"));
- assertFalse(versionSet.contains("2.0"));
+ assertEquals(1, versions.size());
+ assertTrue(versions.contains("1.0"));
+ assertFalse(versions.contains("2.0"));
// Second topic
@@ -124,10 +119,9 @@ public class ParseTocWithCriteria extends TestCase {
CriteriaUtilities.addCriteriaToMap(criteria, ((ITopic2)topics[1]).getCriteria());
versions = criteria.get("version");
assertNotNull(versions);
- versionSet = (Set)versions;
- assertEquals(1, versionSet.size());
- assertTrue(versionSet.contains("2.0"));
- assertFalse(versionSet.contains("1.0"));
+ assertEquals(1, versions.size());
+ assertTrue(versions.contains("2.0"));
+ assertFalse(versions.contains("1.0"));
}
public void testCriteriaScoping1() throws Exception {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaDefinitionProvider.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaDefinitionProvider.java
index 591b04ebc..795c52d6f 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaDefinitionProvider.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaDefinitionProvider.java
@@ -21,6 +21,7 @@ import org.eclipse.ua.tests.help.other.UserCriterionValueDefinition;
public class SampleCriteriaDefinitionProvider extends
AbstractCriteriaDefinitionProvider {
+ @Override
public ICriteriaDefinitionContribution[] getCriteriaDefinitionContributions(
String locale) {
if (locale.startsWith("es")) {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaProvider.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaProvider.java
index 8e81967bb..673097355 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaProvider.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/SampleCriteriaProvider.java
@@ -23,10 +23,12 @@ public class SampleCriteriaProvider extends AbstractCriteriaProvider {
public static final String CONTAINS_LETTER = "containsLetter";
+ @Override
public ICriteria[] getCriteria(ITopic topic) {
return getCriteriaFromLabel(topic.getLabel());
}
+ @Override
public ICriteria[] getCriteria(IToc toc) {
return getCriteriaFromLabel(toc.getLabel());
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/TestCriteriaProvider.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/TestCriteriaProvider.java
index 9396c1c71..d3727b523 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/TestCriteriaProvider.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/criteria/TestCriteriaProvider.java
@@ -92,8 +92,8 @@ public class TestCriteriaProvider extends TestCase {
private boolean containsCriterion(ICriteria[] allCriteria,
String name, String value) {
- for (int i = 0; i < allCriteria.length; i++) {
- if (allCriteria[i].getName().equals(name) && allCriteria[i].getValue().equals(value)) {
+ for (ICriteria element : allCriteria) {
+ if (element.getName().equals(name) && element.getValue().equals(value)) {
return true;
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java
index 863c8899c..89d8953a1 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java
@@ -38,6 +38,7 @@ public class DynamicXHTMLProcessorTest extends TestCase {
return new TestSuite(DynamicXHTMLProcessorTest.class);
}
+ @Override
protected void setUp() throws Exception {
// activate the UI plug-in for UI filtering ability
HelpUIPlugin.getDefault();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java
index 6c905bf8c..1b75f5bec 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java
@@ -39,6 +39,7 @@ public class XMLProcessorTest extends TestCase {
return new TestSuite(XMLProcessorTest.class);
}
+ @Override
protected void setUp() throws Exception {
// activate the UI plug-in for UI filtering ability
HelpUIPlugin.getDefault();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java
index d2760d799..0698f5b50 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation 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
@@ -53,8 +53,7 @@ public class IndexAssemblerTest extends TestCase {
IndexContribution result_a_b_c = parser.parse(new IndexFile(UserAssistanceTestPlugin.getPluginId(), "data/help/index/assembler/result_a_b_c.xml", "en"));
IndexAssembler assembler = new IndexAssembler();
- @SuppressWarnings("unchecked")
- List contributions = new ArrayList(Arrays.asList(new Object[] { a, b, c }));
+ List<IndexContribution> contributions = new ArrayList<IndexContribution>(Arrays.asList(a, b, c));
Index assembled = assembler.assemble(contributions, Platform.getNL());
String expected = serialize((UAElement)result_a_b_c.getIndex());
@@ -66,10 +65,9 @@ public class IndexAssemblerTest extends TestCase {
IndexFileParser parser = new IndexFileParser();
IndexContribution contrib = parser.parse(new IndexFile(UserAssistanceTestPlugin.getPluginId(), "data/help/index/assembler/d.xml", "en"));
IndexAssembler assembler = new IndexAssembler();
- @SuppressWarnings("unchecked")
- List contributions = new ArrayList(Arrays.asList(new Object[] { contrib }));
+ List<IndexContribution> contributions = new ArrayList<IndexContribution>(Arrays.asList(contrib));
Index index = assembler.assemble(contributions, Platform.getNL());
- IIndexEntry[] children = (IIndexEntry[]) index.getEntries();
+ IIndexEntry[] children = index.getEntries();
assertEquals(2,children.length);
IIndexEntry eclipseEntry = children[0];
assertEquals("eclipse", eclipseEntry.getKeyword());
@@ -94,8 +92,7 @@ public class IndexAssemblerTest extends TestCase {
IndexFileParser parser = new IndexFileParser();
IndexContribution contrib = parser.parse(new IndexFile(UserAssistanceTestPlugin.getPluginId(), "data/help/index/assembler/hasTitle.xml", "en"));
IndexAssembler assembler = new IndexAssembler();
- @SuppressWarnings("unchecked")
- List contributions = new ArrayList(Arrays.asList(new Object[] { contrib }));
+ List<IndexContribution> contributions = new ArrayList<IndexContribution>(Arrays.asList(contrib));
Index index = assembler.assemble(contributions, Platform.getNL());
IIndexEntry[] children = index.getEntries();
assertEquals(1,children.length);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java
index 0a8d0e00e..494e5ec70 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ConcurrentTocAccess.java
@@ -72,6 +72,7 @@ public class ConcurrentTocAccess extends TestCase {
this.toc = toc;
}
+ @Override
public void run() {
try {
int result = traverseToc(toc);
@@ -148,8 +149,8 @@ public class ConcurrentTocAccess extends TestCase {
private int computeNumberOfLeafTopics(int[] dimensions) {
int expectedLeaves = 1;
- for (int dim = 0; dim < dimensions.length; dim++) {
- expectedLeaves = expectedLeaves * dimensions[dim];
+ for (int dimension : dimensions) {
+ expectedLeaves = expectedLeaves * dimension;
}
return expectedLeaves;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextLinkSorter.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextLinkSorter.java
index 1c337ece0..5ea4d2f91 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextLinkSorter.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextLinkSorter.java
@@ -33,10 +33,12 @@ public class ContextLinkSorter extends TestCase {
this.label = label;
}
+ @Override
public String getHref() {
return href;
}
+ @Override
public String getLabel() {
return label;
}
@@ -49,6 +51,7 @@ public class ContextLinkSorter extends TestCase {
private class TestContext implements IContext2 {
+ @Override
public String getCategory(IHelpResource topic) {
if (topic instanceof TestResource) {
return ((TestResource)topic).getCategory();
@@ -56,18 +59,22 @@ public class ContextLinkSorter extends TestCase {
return null;
}
+ @Override
public String getStyledText() {
return null;
}
+ @Override
public String getTitle() {
return null;
}
+ @Override
public IHelpResource[] getRelatedTopics() {
return null;
}
+ @Override
public String getText() {
return null;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextTest.java
index 26b262357..5f571eb4c 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ContextTest.java
@@ -53,6 +53,7 @@ public class ContextTest extends TestCase {
return new TestSuite(ContextTest.class);
}
+ @Override
protected void setUp() throws Exception {
// Required for isEnabled() to work correctly
BaseHelpSystem.setMode(BaseHelpSystem.MODE_WORKBENCH);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/DocumentReaderTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/DocumentReaderTest.java
index 927e2efea..a17f311b8 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/DocumentReaderTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/DocumentReaderTest.java
@@ -75,6 +75,7 @@ public class DocumentReaderTest extends TestCase {
}
public int status = RUNNING;
+ @Override
public void run() {
try {
for (int i = 0; i < 10; i++) {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexEntryTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexEntryTest.java
index cbea6f7cd..789157c24 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexEntryTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexEntryTest.java
@@ -71,6 +71,7 @@ public class IndexEntryTest extends TestCase {
return new TestSuite(IndexEntryTest.class);
}
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.setMode(BaseHelpSystem.MODE_WORKBENCH);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexSeeTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexSeeTest.java
index c2355f78b..eef4cc91e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexSeeTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/IndexSeeTest.java
@@ -48,6 +48,7 @@ public class IndexSeeTest extends TestCase {
return new TestSuite(IndexSeeTest.class);
}
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.setMode(BaseHelpSystem.MODE_WORKBENCH);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ResourceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ResourceTest.java
index fcb4ee64d..97732e3a4 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ResourceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/ResourceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation 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
@@ -38,16 +38,16 @@ public class ResourceTest extends TestCase {
checkFields(org.eclipse.ui.internal.intro.universal.Messages.class);
}
- private void checkFields(Class messages) throws IllegalAccessException {
+ private void checkFields(Class<?> messages) throws IllegalAccessException {
Field[] fields = messages.getFields();
- for (int i = 0; i < fields.length; i++) {
- int modifiers = fields[i].getModifiers();
+ for (Field field : fields) {
+ int modifiers = field.getModifiers();
if (Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers)) {
- Object value = fields[i].get(null);
+ Object value = field.get(null);
if (value instanceof String) {
String stringValue = (String)value;
if (stringValue.startsWith("NLS missing message")) {
- fail("Missing resource for " + fields[i].getName());
+ fail("Missing resource for " + field.getName());
}
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/TopicTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/TopicTest.java
index feb4408c8..ec26997e2 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/TopicTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/TopicTest.java
@@ -63,6 +63,7 @@ public class TopicTest extends TestCase {
return new TestSuite(TopicTest.class);
}
+ @Override
protected void setUp() throws Exception {
// Required for isEnabled() to work correctly
BaseHelpSystem.setMode(BaseHelpSystem.MODE_WORKBENCH);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserContext.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserContext.java
index 2f5e7113d..00ff25515 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserContext.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserContext.java
@@ -34,26 +34,32 @@ public class UserContext implements IContext3 {
this.text = text;
}
+ @Override
public ICommandLink[] getRelatedCommands() {
return new ICommandLink[0];
}
+ @Override
public String getCategory(IHelpResource topic) {
return null;
}
+ @Override
public String getStyledText() {
return getText();
}
+ @Override
public String getTitle() {
return title;
}
+ @Override
public IHelpResource[] getRelatedTopics() {
return children.toArray(new IHelpResource[0]);
}
+ @Override
public String getText() {
return text;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteria.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteria.java
index f7d1172a7..5a8e3bc08 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteria.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteria.java
@@ -26,18 +26,22 @@ public class UserCriteria implements ICriteria {
this.enabled = enabled;
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return enabled;
}
+ @Override
public IUAElement[] getChildren() {
return null;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public String getValue() {
return value;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinition.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinition.java
index 6bb087f80..82ece43f6 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinition.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinition.java
@@ -23,10 +23,12 @@ public class UserCriteriaDefinition implements ICriteriaDefinition {
private List<ICriterionDefinition> children = new ArrayList<ICriterionDefinition>();
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return true;
}
+ @Override
public ICriterionDefinition[] getCriterionDefinitions() {
return children.toArray(new ICriterionDefinition[0]);
}
@@ -35,6 +37,7 @@ public class UserCriteriaDefinition implements ICriteriaDefinition {
children.add(definition);
}
+ @Override
public IUAElement[] getChildren() {
return getCriterionDefinitions();
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinitionContribution.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinitionContribution.java
index cd2167f4e..ffb97a999 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinitionContribution.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriteriaDefinitionContribution.java
@@ -29,6 +29,7 @@ public class UserCriteriaDefinitionContribution implements ICriteriaDefinitionCo
this.criteriaDefinition = criteriaDefinition;
}
+ @Override
public ICriteriaDefinition getCriteriaDefinition() {
return criteriaDefinition;
}
@@ -37,6 +38,7 @@ public class UserCriteriaDefinitionContribution implements ICriteriaDefinitionCo
this.id = id;
}
+ @Override
public String getId() {
return id;
}
@@ -45,6 +47,7 @@ public class UserCriteriaDefinitionContribution implements ICriteriaDefinitionCo
this.locale = locale;
}
+ @Override
public String getLocale() {
return locale;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionDefinition.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionDefinition.java
index 3fe7a1bd8..228b9582d 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionDefinition.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionDefinition.java
@@ -30,6 +30,7 @@ public class UserCriterionDefinition implements ICriterionDefinition {
this.name = name;
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return true;
}
@@ -38,6 +39,7 @@ public class UserCriterionDefinition implements ICriterionDefinition {
this.id = id;
}
+ @Override
public String getId() {
return id;
}
@@ -46,14 +48,17 @@ public class UserCriterionDefinition implements ICriterionDefinition {
this.name = name;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public IUAElement[] getChildren() {
return getCriterionValueDefinitions();
}
+ @Override
public ICriterionValueDefinition[] getCriterionValueDefinitions() {
return children.toArray(new ICriterionValueDefinition[0]);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionValueDefinition.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionValueDefinition.java
index 557d7cef2..b868b23c7 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionValueDefinition.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserCriterionValueDefinition.java
@@ -25,18 +25,22 @@ public class UserCriterionValueDefinition implements ICriterionValueDefinition {
this.name = name;
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return true;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public IUAElement[] getChildren() {
return new IUAElement[0];
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndex.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndex.java
index ff1cea384..aad3d535f 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndex.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndex.java
@@ -32,6 +32,7 @@ public class UserIndex implements IIndex {
this.enabled = true;
}
+ @Override
public IUAElement[] getChildren() {
return getEntries();
}
@@ -40,10 +41,12 @@ public class UserIndex implements IIndex {
entries.add(child);
}
+ @Override
public IIndexEntry[] getEntries() {
return entries.toArray(new IIndexEntry[0]);
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return enabled;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexEntry.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexEntry.java
index 153cb0d73..22a531cc1 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexEntry.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexEntry.java
@@ -33,6 +33,7 @@ public class UserIndexEntry implements IIndexEntry2 {
private boolean isEnabled;
private String keyword;
+ @Override
public IUAElement[] getChildren() {
IUAElement[] subentries = getSubentries();
IUAElement[] sees = getSees();
@@ -44,6 +45,7 @@ public class UserIndexEntry implements IIndexEntry2 {
return result;
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return isEnabled;
}
@@ -65,18 +67,22 @@ public class UserIndexEntry implements IIndexEntry2 {
this.isEnabled = isEnabled;
}
+ @Override
public IIndexSee[] getSees() {
return sees.toArray(new IIndexSee[0]);
}
+ @Override
public String getKeyword() {
return keyword;
}
+ @Override
public IIndexEntry[] getSubentries() {
return subentries.toArray(new IIndexEntry[0]);
}
+ @Override
public ITopic[] getTopics() {
return topics.toArray(new ITopic[0]);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSee.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSee.java
index e6dbbba13..eb33d6ba8 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSee.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSee.java
@@ -25,10 +25,12 @@ public class UserIndexSee implements IIndexSee {
private boolean isEnabled;
private String keyword;
+ @Override
public IUAElement[] getChildren() {
return getSubpathElements();
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return isEnabled;
}
@@ -42,14 +44,17 @@ public class UserIndexSee implements IIndexSee {
this.isEnabled = isEnabled;
}
+ @Override
public String getKeyword() {
return keyword;
}
+ @Override
public IIndexSubpath[] getSubpathElements() {
return children.toArray(new IIndexSubpath[0]);
}
+ @Override
public boolean isSeeAlso() {
return false;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSubpath.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSubpath.java
index d1d578ab3..15daf770d 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSubpath.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserIndexSubpath.java
@@ -25,14 +25,17 @@ public class UserIndexSubpath implements IIndexSubpath {
}
+ @Override
public String getKeyword() {
return keyword;
}
+ @Override
public IUAElement[] getChildren() {
return new IUAElement[0];
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return true;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc.java
index 4b88be2c3..3385a05ca 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc.java
@@ -34,14 +34,17 @@ public class UserToc implements IToc {
/*
* Not exercised by any test so return of null is OK for now
*/
+ @Override
public ITopic getTopic(String href) {
return null;
}
+ @Override
public ITopic[] getTopics() {
return children.toArray(new ITopic[0]);
}
+ @Override
public IUAElement[] getChildren() {
return getTopics();
}
@@ -50,14 +53,17 @@ public class UserToc implements IToc {
children.add(child);
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return isEnabled;
}
+ @Override
public String getHref() {
return href;
}
+ @Override
public String getLabel() {
return label;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc2.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc2.java
index 5ba01f56e..fff009650 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc2.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserToc2.java
@@ -26,6 +26,7 @@ public class UserToc2 extends UserToc implements IToc2 {
private List<ICriteria> criteria = new ArrayList<ICriteria>();
+ @Override
public IUAElement[] getChildren() {
IUAElement[] criteriaElements = getCriteria();
IUAElement[] topics = getTopics();
@@ -39,14 +40,17 @@ public class UserToc2 extends UserToc implements IToc2 {
criteria.add(child);
}
+ @Override
public ICriteria[] getCriteria() {
return criteria.toArray(new ICriteria[0]);
}
+ @Override
public String getIcon() {
return null;
}
+ @Override
public boolean isSorted() {
return false;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic.java
index a73a93610..c10c16ee8 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic.java
@@ -29,22 +29,27 @@ public class UserTopic implements ITopic {
private String href;
private String label;
+ @Override
public ITopic[] getSubtopics() {
return children.toArray(new ITopic[0]);
}
+ @Override
public IUAElement[] getChildren() {
return getSubtopics();
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return isEnabled;
}
+ @Override
public String getHref() {
return href;
}
+ @Override
public String getLabel() {
return label;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic2.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic2.java
index a7aeb1ce4..82df19c89 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic2.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/other/UserTopic2.java
@@ -22,6 +22,7 @@ public class UserTopic2 extends UserTopic implements ITopic2 {
private List<ICriteria> criteria = new ArrayList<ICriteria>();
+ @Override
public IUAElement[] getChildren() {
IUAElement[] criteriaElements = getCriteria();
IUAElement[] topics = getSubtopics();
@@ -39,14 +40,17 @@ public class UserTopic2 extends UserTopic implements ITopic2 {
criteria.add(child);
}
+ @Override
public ICriteria[] getCriteria() {
return criteria.toArray(new ICriteria[0]);
}
+ @Override
public String getIcon() {
return null;
}
+ @Override
public boolean isSorted() {
return false;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java
index 37d4fe0da..aba09efd2 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java
@@ -44,6 +44,7 @@ public class BuildHtmlSearchIndex extends PerformanceTestCase {
return new TestSuite(BuildHtmlSearchIndex.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
TocManager tocManager = HelpPlugin.getTocManager();
@@ -58,6 +59,7 @@ public class BuildHtmlSearchIndex extends PerformanceTestCase {
analyzerDesc = new AnalyzerDescriptor("en-us");
}
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
TocManager tocManager = HelpPlugin.getTocManager();
@@ -145,6 +147,7 @@ public class BuildHtmlSearchIndex extends PerformanceTestCase {
}
private static class TestTocFileProvider extends TocFileProvider {
+ @Override
protected TocFile[] getTocFiles(String locale) {
String id = UserAssistanceTestPlugin.getPluginId();
String nl = Platform.getNL();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java
index 9d7e71e04..2e612e34e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java
@@ -31,10 +31,12 @@ public class HelpServerTest extends PerformanceTestCase {
return new TestSuite(HelpServerTest.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
}
+ @Override
protected void tearDown() throws Exception {
LoadServletUtil.stopServer();
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java
index e5701f92a..e4dbe6afd 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation 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
@@ -40,6 +40,7 @@ public class IndexAssemblePerformanceTest extends PerformanceTestCase {
return new TestSuite(IndexAssemblePerformanceTest.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
}
@@ -72,8 +73,7 @@ public class IndexAssemblePerformanceTest extends PerformanceTestCase {
IndexContribution b = parser.parse(new IndexFile(UserAssistanceTestPlugin.getPluginId(), "data/help/performance/index/index2.xml", "en"));
IndexContribution c = parser.parse(new IndexFile(UserAssistanceTestPlugin.getPluginId(), "data/help/performance/index/index3.xml", "en"));
IndexAssembler assembler = new IndexAssembler();
- @SuppressWarnings("unchecked")
- List contributions = new ArrayList(Arrays.asList(new Object[] { a, b, c }));
+ List<IndexContribution> contributions = new ArrayList<IndexContribution>(Arrays.asList(a, b, c));
Index assembled = assembler.assemble(contributions, Platform.getNL());
assertEquals(100, assembled.getChildren().length);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java
index a9ec5c998..447e339a9 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java
@@ -31,10 +31,12 @@ public class LowIterationHelpServerTest extends PerformanceTestCase {
return new TestSuite(LowIterationHelpServerTest.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
}
+ @Override
protected void tearDown() throws Exception {
LoadServletUtil.stopServer();
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java
index dfc112785..4a6ba51b3 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java
@@ -48,6 +48,7 @@ public class OpenHelpTest extends PerformanceTestCase {
return new TestSuite(OpenHelpTest.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
TocManager tocManager = HelpPlugin.getTocManager();
@@ -61,6 +62,7 @@ public class OpenHelpTest extends PerformanceTestCase {
indexManager.clearCache();
}
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
TocManager tocManager = HelpPlugin.getTocManager();
@@ -109,6 +111,7 @@ public class OpenHelpTest extends PerformanceTestCase {
final boolean[] done = new boolean[] { false };
final String url = "http://" + WebappManager.getHost() + ":" + WebappManager.getPort() + "/help/index.jsp";
browser.addLocationListener(new LocationAdapter() {
+ @Override
public void changed(LocationEvent event) {
if (url.equals(event.location)) {
done[0] = true;
@@ -141,6 +144,7 @@ public class OpenHelpTest extends PerformanceTestCase {
}
private static class TestTocFileProvider extends TocFileProvider {
+ @Override
protected TocFile[] getTocFiles(String locale) {
String id = UserAssistanceTestPlugin.getPluginId();
String nl = Platform.getNL();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java
index c125887de..6fcac6c90 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation 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
@@ -39,6 +39,7 @@ public class TocAssemblePerformanceTest extends PerformanceTestCase {
return new TestSuite(TocAssemblePerformanceTest.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
}
@@ -48,7 +49,6 @@ public class TocAssemblePerformanceTest extends PerformanceTestCase {
return parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), tocFile, true, "en", null, null));
}
- @SuppressWarnings("unchecked")
public void assembleToc() throws Exception {
TocFileParser parser = new TocFileParser();
List<TocContribution> contributions = new ArrayList<TocContribution>();
@@ -69,8 +69,8 @@ public class TocAssemblePerformanceTest extends PerformanceTestCase {
private int countTopics(ITopic[] topics) {
int result = topics.length;
- for (int i = 0; i < topics.length; i++) {
- result = result + countTopics(topics[i].getSubtopics());
+ for (ITopic topic : topics) {
+ result = result + countTopics(topic.getSubtopics());
}
return result;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/BookmarksTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/BookmarksTest.java
index 4eb5ea0a5..fded5519c 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/BookmarksTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/BookmarksTest.java
@@ -38,6 +38,7 @@ public class BookmarksTest extends TestCase {
public Object arg;
public int eventCount = 0;
+ @Override
public void update(Observable o, Object arg) {
++eventCount;
this.o = o;
@@ -53,6 +54,7 @@ public class BookmarksTest extends TestCase {
private BookmarkManager manager;
private BookmarkObserver observer;
+ @Override
protected void setUp() throws Exception {
manager = new BookmarkManager();
manager.removeAllBookmarks();
@@ -60,6 +62,7 @@ public class BookmarksTest extends TestCase {
manager.addObserver(observer);
}
+ @Override
protected void tearDown() throws Exception {
manager = null;
observer = null;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/HelpDataTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/HelpDataTest.java
index 045ee09c2..914795c85 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/HelpDataTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/HelpDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation 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
@@ -20,15 +20,13 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.junit.Assert;
-
-import org.eclipse.help.internal.HelpData;
-import org.eclipse.help.internal.HelpPlugin;
-import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
-
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.help.internal.HelpData;
+import org.eclipse.help.internal.HelpPlugin;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.junit.Assert;
/*
* Tests the help data ordering of tocs and hiding tocs, indexes, etc.
@@ -53,6 +51,7 @@ public class HelpDataTest extends TestCase {
private String ignoredIndexesPreference;
+ @Override
protected void setUp() throws Exception {
baseTocsPreference = Platform.getPreferencesService().getString
(HelpPlugin.PLUGIN_ID, HelpPlugin.BASE_TOCS_KEY, "", null);
@@ -65,6 +64,7 @@ public class HelpDataTest extends TestCase {
setIgnoredIndexes("");
}
+ @Override
protected void tearDown() throws Exception {
setBaseTocs(baseTocsPreference);
setIgnoredTocs(ignoredTocsPreference);
@@ -87,14 +87,11 @@ public class HelpDataTest extends TestCase {
}
public void testHelpData() {
- for (int i=0;i<TEST_DATA.length;++i) {
- String[][] entry = (String[][])TEST_DATA[i];
+ for (String[][] entry : TEST_DATA) {
String file = entry[0][0];
- List expectedTocOrder = Arrays.asList(entry[1]);
- @SuppressWarnings("unchecked")
- Set expectedHiddenTocs = new HashSet(Arrays.asList(entry[2]));
- @SuppressWarnings("unchecked")
- Set expectedHiddenIndexes = new HashSet(Arrays.asList(entry[3]));
+ List<String> expectedTocOrder = Arrays.asList(entry[1]);
+ Set<String> expectedHiddenTocs = new HashSet<String>(Arrays.asList(entry[2]));
+ Set<String> expectedHiddenIndexes = new HashSet<String>(Arrays.asList(entry[3]));
URL url = UserAssistanceTestPlugin.getDefault().getBundle().getEntry(file);
HelpData data = new HelpData(url);
Assert.assertEquals("Did not get the expected toc order from help data file " + file, expectedTocOrder, data.getTocOrder());
@@ -114,7 +111,7 @@ public class HelpDataTest extends TestCase {
public void testNullUrlWithBaseTocs() {
HelpData data = new HelpData(null);
setBaseTocs("/a/b.xml,/c/d.xml");
- List tocOrder = data.getTocOrder();
+ List<?> tocOrder = data.getTocOrder();
assertEquals(2, tocOrder.size());
assertEquals("/a/b.xml", tocOrder.get(0));
assertEquals("/c/d.xml", tocOrder.get(1));
@@ -127,7 +124,7 @@ public class HelpDataTest extends TestCase {
HelpData data = new HelpData(null);
setIgnoredTocs("/a/b.xml,/c/d.xml");
assertEquals(0, data.getTocOrder().size());
- Set hiddenTocs = data.getHiddenTocs();
+ Set<?> hiddenTocs = data.getHiddenTocs();
assertEquals(2, hiddenTocs.size());
assertTrue(hiddenTocs.contains("/a/b.xml"));
assertTrue(hiddenTocs.contains("/c/d.xml"));
@@ -140,7 +137,7 @@ public class HelpDataTest extends TestCase {
setIgnoredIndexes("/a/b.xml,/c/d.xml");
assertEquals(0, data.getTocOrder().size());
assertEquals(0, data.getHiddenTocs().size());
- Set hiddenIndexes = data.getHiddenIndexes();
+ Set<?> hiddenIndexes = data.getHiddenIndexes();
assertEquals(2, hiddenIndexes.size());
assertTrue(hiddenIndexes.contains("/a/b.xml"));
assertTrue(hiddenIndexes.contains("/c/d.xml"));
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/ProductPreferencesTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/ProductPreferencesTest.java
index 0dd7bea7d..c0a415ecf 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/ProductPreferencesTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/preferences/ProductPreferencesTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation 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
@@ -20,10 +20,9 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.junit.Assert;
-
import org.eclipse.help.internal.util.ProductPreferences;
import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.junit.Assert;
/*
* Tests the products preferences utility
@@ -145,24 +144,23 @@ public class ProductPreferencesTest extends TestCase {
}
public void testGetOrderedList() {
- for (int i=0;i<GET_ORDERED_LIST_DATA.length;++i) {
- String[] data = GET_ORDERED_LIST_DATA[i];
- List items = ProductPreferences.tokenize(data[0]);
- List expectedOrder = ProductPreferences.tokenize(data[1]);
- List primaryOrdering = ProductPreferences.tokenize(data[2]);
- List[] secondaryOrderings = new List[data.length - 3];
+ for (String[] data : GET_ORDERED_LIST_DATA) {
+ List<String> items = ProductPreferences.tokenize(data[0]);
+ List<String> expectedOrder = ProductPreferences.tokenize(data[1]);
+ List<String> primaryOrdering = ProductPreferences.tokenize(data[2]);
+ @SuppressWarnings("unchecked")
+ List<String>[] secondaryOrderings = (List<String>[]) new List<?>[data.length - 3];
for (int j=0;j<secondaryOrderings.length;++j) {
secondaryOrderings[j] = ProductPreferences.tokenize(data[j + 3]);
}
- List actualOrder = ProductPreferences.getOrderedList(items, primaryOrdering, secondaryOrderings, null);
+ List<String> actualOrder = ProductPreferences.getOrderedList(items, primaryOrdering, secondaryOrderings, null);
Assert.assertEquals("Items in list were not ordered as expected", expectedOrder, actualOrder);
}
}
public void testGetPropertiesFile() {
- for (int i=0;i<GET_PROPERTIES_FILE_DATA.length;++i) {
- String[] data = GET_PROPERTIES_FILE_DATA[i];
+ for (String[] data : GET_PROPERTIES_FILE_DATA) {
String path = "data/help/preferences/" + data[0];
Properties properties = ProductPreferences.loadPropertiesFile(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName(), path);
@@ -173,18 +171,16 @@ public class ProductPreferencesTest extends TestCase {
StringTokenizer tok = new StringTokenizer(data[j], "=");
String key = tok.nextToken();
String expectedValue = tok.nextToken();
- String actualValue = (String)properties.getProperty(key);
+ String actualValue = properties.getProperty(key);
Assert.assertEquals("One of the properties files' keys did not match the expected value: file=" + path + ", key=" + key, expectedValue, actualValue);
}
}
}
public void testGetValue() {
- for (int i=0;i<GET_VALUE_DATA.length;++i) {
- String[] data = GET_VALUE_DATA[i];
+ for (String[] data : GET_VALUE_DATA) {
String key = data[0];
- @SuppressWarnings("unchecked")
- Set allowableValues = new HashSet(ProductPreferences.tokenize(data[1]));
+ Set<String> allowableValues = new HashSet<String>(ProductPreferences.tokenize(data[1]));
Properties primary = ProductPreferences.loadPropertiesFile(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName(), "data/help/preferences/" + data[2]);
Properties[] secondary = new Properties[data.length - 3];
for (int j=0;j<secondary.length;++j) {
@@ -202,10 +198,9 @@ public class ProductPreferencesTest extends TestCase {
}
public void testTokenize() {
- for (int i=0;i<TOKENIZE_DATA.length;++i) {
- String[] data = TOKENIZE_DATA[i];
+ for (String[] data : TOKENIZE_DATA) {
String input = data[0];
- List output = ProductPreferences.tokenize(input);
+ List<String> output = ProductPreferences.tokenize(input);
Assert.assertNotNull("The tokenized output was unexpectedly null for: " + input, output);
Assert.assertEquals("The number of tokens did not match the expected result for: " + input, data.length - 1, output.size());
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContentServletTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContentServletTest.java
index 1ad0dd1be..b6aa0acb6 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContentServletTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContentServletTest.java
@@ -21,12 +21,14 @@ public class ContentServletTest extends TestCase {
private static final String UA_TESTS = "org.eclipse.ua.tests";
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContextServletTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContextServletTest.java
index 16bb41b58..f6d22f2f9 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContextServletTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ContextServletTest.java
@@ -39,12 +39,14 @@ public class ContextServletTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContentUsingRemoteHelp.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContentUsingRemoteHelp.java
index f806b9326..57d3958dc 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContentUsingRemoteHelp.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContentUsingRemoteHelp.java
@@ -40,6 +40,7 @@ public class GetContentUsingRemoteHelp extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
@@ -50,6 +51,7 @@ public class GetContentUsingRemoteHelp extends TestCase {
HelpPlugin.getTocManager().getTocs("en");
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
BaseHelpSystem.setMode(mode);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContextUsingRemoteHelp.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContextUsingRemoteHelp.java
index 2a6cc2dce..b4154052f 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContextUsingRemoteHelp.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/GetContextUsingRemoteHelp.java
@@ -23,6 +23,7 @@ public class GetContextUsingRemoteHelp extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
RemotePreferenceStore.savePreferences();
mode = BaseHelpSystem.getMode();
@@ -30,6 +31,7 @@ public class GetContextUsingRemoteHelp extends TestCase {
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
BaseHelpSystem.setMode(mode);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/IndexServletTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/IndexServletTest.java
index 2f4c41d79..3e9f66a9b 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/IndexServletTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/IndexServletTest.java
@@ -34,12 +34,14 @@ public class IndexServletTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/JettyTestServer.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/JettyTestServer.java
index e09bbeb21..c1c58b5d0 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/JettyTestServer.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/JettyTestServer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2015 IBM Corporation 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
@@ -20,10 +20,12 @@ import org.osgi.framework.ServiceReference;
public class JettyTestServer extends JettyHelpServer {
+ @Override
protected String getOtherInfo() {
return "org.eclipse.ua.tests";
}
+ @Override
protected int getPortParameter() {
return AUTO_SELECT_JETTY_PORT;
}
@@ -32,6 +34,7 @@ public class JettyTestServer extends JettyHelpServer {
* Ensures that the bundle with the specified name and the highest available
* version is started and reads the port number
*/
+ @Override
protected void checkBundle() throws InvalidSyntaxException, BundleException {
Bundle bundle = Platform.getBundle("org.eclipse.equinox.http.registry"); //$NON-NLS-1$if (bundle != null) {
if (bundle.getState() == Bundle.RESOLVED) {
@@ -39,7 +42,7 @@ public class JettyTestServer extends JettyHelpServer {
}
if (port == -1) {
// Jetty selected a port number for us
- ServiceReference[] reference = bundle.getBundleContext().getServiceReferences("org.osgi.service.http.HttpService", "(other.info=" + getOtherInfo() + ')'); //$NON-NLS-1$ //$NON-NLS-2$
+ ServiceReference<?>[] reference = bundle.getBundleContext().getServiceReferences("org.osgi.service.http.HttpService", "(other.info=" + getOtherInfo() + ')'); //$NON-NLS-1$ //$NON-NLS-2$
Object assignedPort = reference[reference.length - 1].getProperty("http.port"); //$NON-NLS-1$
port = Integer.parseInt((String)assignedPort);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadIndexUsingRemoteHelp.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadIndexUsingRemoteHelp.java
index 7715a6982..4c33b7993 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadIndexUsingRemoteHelp.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadIndexUsingRemoteHelp.java
@@ -25,12 +25,14 @@ public class LoadIndexUsingRemoteHelp extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
RemotePreferenceStore.savePreferences();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
BaseHelpSystem.setMode(mode);
@@ -72,9 +74,9 @@ public class LoadIndexUsingRemoteHelp extends TestCase {
private IIndexEntry[] matchingEntries(IIndex index, String keyword) {
List<IIndexEntry> matches = new ArrayList<IIndexEntry>();
IIndexEntry[] entries = index.getEntries();
- for (int i = 0; i < entries.length; i++) {
- if (keyword.equals(entries[i].getKeyword())) {
- matches.add(entries[i]);
+ for (IIndexEntry entrie : entries) {
+ if (keyword.equals(entrie.getKeyword())) {
+ matches.add(entrie);
}
}
return matches.toArray(new IIndexEntry[matches.size()]);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadTocUsingRemoteHelp.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadTocUsingRemoteHelp.java
index 764102076..44bb38ac6 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadTocUsingRemoteHelp.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/LoadTocUsingRemoteHelp.java
@@ -21,11 +21,13 @@ public class LoadTocUsingRemoteHelp extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
RemotePreferenceStore.savePreferences();
mode = BaseHelpSystem.getMode();
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
BaseHelpSystem.setMode(mode);
@@ -80,8 +82,8 @@ public class LoadTocUsingRemoteHelp extends TestCase {
*/
private int matchingTocs(Toc[] tocs, String label) {
int result = 0;
- for (int i = 0; i < tocs.length; i++) {
- if (label.equals(tocs[i].getLabel())) {
+ for (Toc toc : tocs) {
+ if (label.equals(toc.getLabel())) {
result += 1;
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContentServlet.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContentServlet.java
index b07248ee7..87683db5a 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContentServlet.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContentServlet.java
@@ -29,6 +29,7 @@ public class MockContentServlet extends HttpServlet {
* Return a create page based on the path and locale unless the path
* starts with "/invalid" in which case return an I/O error
*/
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String locale = UrlUtil.getLocale(req, resp);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContextServlet.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContextServlet.java
index 49100a4fb..795e56e26 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContextServlet.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockContextServlet.java
@@ -21,6 +21,7 @@ public class MockContextServlet extends ContextServlet {
private static final String ORG_ECLIPSE_UA_TESTS_TEST = "org.eclipse.ua.tests.test";
private static final long serialVersionUID = 3615294041471900830L;
+ @Override
protected IContext getContext(String locale, String id) {
if (id.startsWith(ORG_ECLIPSE_UA_TESTS_TEST)) {
String suffix = id.substring(ORG_ECLIPSE_UA_TESTS_TEST.length());
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockIndexServlet.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockIndexServlet.java
index 6f7d67605..299166c85 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockIndexServlet.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockIndexServlet.java
@@ -30,6 +30,7 @@ public class MockIndexServlet extends IndexServlet {
private static final long serialVersionUID = -930969620357059313L;
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String locale = UrlUtil.getLocale(req, resp);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockSearchServlet.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockSearchServlet.java
index e38d6227c..7e13964ca 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockSearchServlet.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockSearchServlet.java
@@ -28,6 +28,7 @@ public class MockSearchServlet extends HttpServlet {
private static final long serialVersionUID = -5115067950875335923L;
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String phrase = req.getParameter("phrase");
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockTocServlet.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockTocServlet.java
index d9f1b211d..70ff37ea7 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockTocServlet.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/MockTocServlet.java
@@ -29,6 +29,7 @@ public class MockTocServlet extends TocServlet {
private static final long serialVersionUID = 2934062693291854845L;
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String locale = UrlUtil.getLocale(req, resp);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchServletTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchServletTest.java
index e8219d8dc..01857aae7 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchServletTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchServletTest.java
@@ -38,12 +38,14 @@ public class ParallelSearchServletTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
@@ -57,6 +59,7 @@ public class ParallelSearchServletTest extends TestCase {
this.expectedHits = expectedHits;
}
+ @Override
public String runTest() throws Exception {
Node[] hits = getSearchHitsFromServlet(phrase);
if (hits.length != expectedHits) {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchUsingRemote.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchUsingRemote.java
index e8eaa315c..5d4ab8ef5 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchUsingRemote.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/ParallelSearchUsingRemote.java
@@ -22,6 +22,7 @@ public class ParallelSearchUsingRemote extends TestCase {
private class Searcher implements ParallelTestSupport.ITestCase {
private int count = 0;
+ @Override
public String runTest() throws Exception {
count++;
return SearchTestUtils.searchForExpectedResults
@@ -37,11 +38,13 @@ public class ParallelSearchUsingRemote extends TestCase {
new String[] { "/org.eclipse.ua.tests/data/help/search/test1.xhtml" }
};
+ @Override
protected void setUp() throws Exception {
RemotePreferenceStore.savePreferences();
mode = BaseHelpSystem.getMode();
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
BaseHelpSystem.setMode(mode);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemotePreferenceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemotePreferenceTest.java
index 59320f1fd..e33874ea1 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemotePreferenceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemotePreferenceTest.java
@@ -27,10 +27,12 @@ public class RemotePreferenceTest extends TestCase {
prefs.put(name, value);
}
+ @Override
protected void setUp() throws Exception {
RemotePreferenceStore.savePreferences();
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java
index e9f9c3fde..9bb23b494 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchIndexCreation.java
@@ -27,6 +27,7 @@ public class SearchIndexCreation extends TestCase {
private int mode;
private AnalyzerDescriptor analyzerDesc;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
@@ -38,6 +39,7 @@ public class SearchIndexCreation extends TestCase {
analyzerDesc = new AnalyzerDescriptor("en-us");
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
BaseHelpSystem.setMode(mode);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchServletTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchServletTest.java
index 4cc36c1dc..b724b326a 100755
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchServletTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchServletTest.java
@@ -38,12 +38,14 @@ public class SearchServletTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchUsingRemoteHelp.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchUsingRemoteHelp.java
index 017a457df..cf1296749 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchUsingRemoteHelp.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/SearchUsingRemoteHelp.java
@@ -20,11 +20,13 @@ public class SearchUsingRemoteHelp extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
RemotePreferenceStore.savePreferences();
mode = BaseHelpSystem.getMode();
}
+ @Override
protected void tearDown() throws Exception {
RemotePreferenceStore.restorePreferences();
BaseHelpSystem.setMode(mode);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocManagerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocManagerTest.java
index 31b829c01..d9f9ac50e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocManagerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocManagerTest.java
@@ -24,6 +24,7 @@ public class TocManagerTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
@@ -31,6 +32,7 @@ public class TocManagerTest extends TestCase {
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
RemotePreferenceStore.restorePreferences();
@@ -59,13 +61,12 @@ public class TocManagerTest extends TestCase {
RemotePreferenceStore.setMockLocalPriority();
HelpPlugin.getTocManager().clearCache();
AbstractTocProvider [] tocProviders = HelpPlugin.getTocManager().getTocProviders();
- for(int i=0;i<tocProviders.length;i++)
- {
- if(tocProviders[i] instanceof TocFileProvider)
- localPriority = tocProviders[i].getPriority();
+ for (AbstractTocProvider tocProvider : tocProviders) {
+ if(tocProvider instanceof TocFileProvider)
+ localPriority = tocProvider.getPriority();
- if(tocProviders[i] instanceof RemoteTocProvider)
- remotePriority = tocProviders[i].getPriority();
+ if(tocProvider instanceof RemoteTocProvider)
+ remotePriority = tocProvider.getPriority();
}
assertTrue(localPriority<remotePriority);
@@ -79,13 +80,12 @@ public class TocManagerTest extends TestCase {
int localPriority=0,remotePriority=0;
AbstractTocProvider [] tocProviders = HelpPlugin.getTocManager().getTocProviders();
- for(int i=0;i<tocProviders.length;i++)
- {
- if(tocProviders[i] instanceof TocFileProvider)
- localPriority = tocProviders[i].getPriority();
+ for (AbstractTocProvider tocProvider : tocProviders) {
+ if(tocProvider instanceof TocFileProvider)
+ localPriority = tocProvider.getPriority();
- if(tocProviders[i] instanceof RemoteTocProvider)
- remotePriority = tocProviders[i].getPriority();
+ if(tocProvider instanceof RemoteTocProvider)
+ remotePriority = tocProvider.getPriority();
}
assertTrue(remotePriority<localPriority);
@@ -95,12 +95,11 @@ public class TocManagerTest extends TestCase {
{
HashSet<String> contributionsFound = new HashSet<String>();
- for(int i=0;i<tocContributions.length;i++)
- {
- if(contributionsFound.contains(tocContributions[i].getId()))
+ for (TocContribution tocContribution : tocContributions) {
+ if(contributionsFound.contains(tocContribution.getId()))
return true;
else
- contributionsFound.add(tocContributions[i].getId());
+ contributionsFound.add(tocContribution.getId());
}
return false;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocServletTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocServletTest.java
index bd1fe780a..3ff00b139 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocServletTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/TocServletTest.java
@@ -34,12 +34,14 @@ public class TocServletTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/scope/MockScope.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/scope/MockScope.java
index 9409b0901..d05fd1175 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/scope/MockScope.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/scope/MockScope.java
@@ -33,22 +33,27 @@ public class MockScope extends AbstractHelpScope {
this.isHierarchical = isHierarchical;
}
+ @Override
public boolean inScope(IToc toc) {
return testForInScope(toc.getLabel());
}
+ @Override
public boolean inScope(ITopic topic) {
return testForInScope(topic.getLabel());
}
+ @Override
public boolean inScope(IIndexEntry entry) {
return testForInScope(entry.getKeyword());
}
+ @Override
public boolean inScope(IIndexSee see) {
return true;
}
+ @Override
public String getName(Locale locale) {
return null;
}
@@ -57,6 +62,7 @@ public class MockScope extends AbstractHelpScope {
return label.indexOf(letter) >= 0;
}
+ @Override
public boolean isHierarchicalScope() {
return isHierarchical;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AnalyzerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AnalyzerTest.java
index d07469784..12a76cd62 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AnalyzerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AnalyzerTest.java
@@ -89,8 +89,7 @@ public class AnalyzerTest extends TestCase {
private void checkAnalyzer(String language, String analyzerKind) {
AnalyzerDescriptor an = new AnalyzerDescriptor(language);
- for (int i = 0; i < supportedLanguages.length; i++) {
- String nextLocale = supportedLanguages[i];
+ for (String nextLocale : supportedLanguages) {
AnalyzerDescriptor expected = new AnalyzerDescriptor(nextLocale);
String analyzerClassName = expected.getAnalyzerClassName();
if (nextLocale.equals(analyzerKind)) {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java
index ace37d534..73ab02490 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/ExtraDirTest.java
@@ -151,8 +151,8 @@ public class ExtraDirTest extends TestCase {
SearchResults collector = new SearchResults(workingSets, 500, Platform.getNL());
BaseHelpSystem.getSearchManager().search(query, collector, new NullProgressMonitor());
SearchHit[] hits = collector.getSearchHits();
- for (int j=0;j<hits.length;++j) {
- String href = hits[j].getHref();
+ for (SearchHit hit : hits) {
+ String href = hit.getHref();
// ignore query params
int index = href.indexOf('?');
if (index != -1) {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
index 5a370475c..34e8c314e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
@@ -278,8 +278,8 @@ public class InfocenterWorkingSetManagerTest extends TestCase {
private int cookieLength(Cookie[] cookies) {
int total = 0;
- for (int i = 0; i < cookies.length; i++) {
- total += cookies[i].getValue().length();
+ for (Cookie cookie : cookies) {
+ total += cookie.getValue().length();
}
return total;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java
index fd4464fd4..aef84f639 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipant.java
@@ -26,6 +26,7 @@ public class MockSearchParticipant extends SearchParticipant {
private static final String DOC_1 = "/org.eclipse.ua.tests/participant1.xml";
private static final String DOC_2 = "/org.eclipse.ua.tests/participant2.xml";
+ @Override
public Set<String> getAllDocuments(String locale) {
HashSet<String> set = new HashSet<String>();
set.add(DOC_1);
@@ -33,6 +34,7 @@ public class MockSearchParticipant extends SearchParticipant {
return set;
}
+ @Override
public IStatus addDocument(IHelpSearchIndex index, String pluginId,
String name, URL url, String id, ISearchDocument doc) {
boolean isDoc1 = url.getPath().equals(DOC_1) ;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java
index 42cbb9532..0f3d552f6 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MockSearchParticipantXML.java
@@ -22,6 +22,7 @@ public class MockSearchParticipantXML extends SearchParticipantXML {
public static final String DOC_1 = "/org.eclipse.ua.tests/data/help/search/participant_xml_1.xml";
public static final String DOC_2 = "/org.eclipse.ua.tests/data/help/search/participant_xml_2.xml";
+ @Override
public Set<String> getAllDocuments(String locale) {
HashSet<String> set = new HashSet<String>();
set.add(DOC_1 + "?id=xml1" + "?id=xml2");
@@ -29,12 +30,14 @@ public class MockSearchParticipantXML extends SearchParticipantXML {
return set;
}
+ @Override
public Set<String> getContributingPlugins() {
Set<String> result = new HashSet<String>();
result.add("org.eclipse.ua.tests");
return result;
}
+ @Override
protected void handleStartElement(String name, Attributes attributes,
IParsedXMLContent data) {
if ("participant".equalsIgnoreCase(name)) {
@@ -46,9 +49,11 @@ public class MockSearchParticipantXML extends SearchParticipantXML {
}
}
+ @Override
protected void handleEndElement(String name, IParsedXMLContent data) {
}
+ @Override
protected void handleText(String text, IParsedXMLContent data) {
String top = getTopElement();
if ("text".equalsIgnoreCase(top)) {
@@ -56,6 +61,7 @@ public class MockSearchParticipantXML extends SearchParticipantXML {
}
}
+ @Override
public boolean open(String id) {
System.out.println("Open " + id);
return true;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java
index 2cca0fb46..300fd3839 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/SearchTestUtils.java
@@ -53,8 +53,8 @@ public class SearchTestUtils {
SearchHit[] hits;
hits = getSearchHits(searchWord, nl);
- for (int j=0;j<hits.length;++j) {
- String href = hits[j].getHref();
+ for (SearchHit hit : hits) {
+ String href = hit.getHref();
// ignore query params
int index = href.indexOf('?');
if (index != -1) {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java
index b97166cfe..2113a57f8 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java
@@ -25,24 +25,29 @@ public class UATestContentExtensionProvider extends
// TODO Auto-generated constructor stub
extension = new IContentExtension() {
+ @Override
public boolean isEnabled(IEvaluationContext context) {
// TODO Auto-generated method stub
return true;
}
+ @Override
public IUAElement[] getChildren() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public int getType() {
return REPLACEMENT;
}
+ @Override
public String getPath() {
return "org.eclipse.ua.tests/data/help/search/test6.xhtml#test6_paragraph_to_replace2";
}
+ @Override
public String getContent() {
return "/org.eclipse.ua.tests/data/help/search/testProvider.xhtml";
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java
index 7f9f36107..0a55e3cf6 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/WorkingSetManagerTest.java
@@ -32,24 +32,26 @@ public class WorkingSetManagerTest extends TestCase {
private WorkingSet[] workingSets;
+ @Override
protected void setUp() throws Exception {
WorkingSetManager manager = new WorkingSetManager();
manager.restoreState();
workingSets = manager.getWorkingSets();
- for (int i = 0; i < workingSets.length; i++) {
- manager.removeWorkingSet(workingSets[i]);
+ for (WorkingSet workingSet : workingSets) {
+ manager.removeWorkingSet(workingSet);
}
manager.saveState();
}
+ @Override
protected void tearDown() throws Exception {
WorkingSetManager manager = new WorkingSetManager();
WorkingSet[] wsetsToRemove = manager.getWorkingSets();
- for (int i = 0; i < wsetsToRemove.length; i++) {
- manager.removeWorkingSet(wsetsToRemove[i]);
+ for (WorkingSet element : wsetsToRemove) {
+ manager.removeWorkingSet(element);
}
- for (int i = 0; i < workingSets.length; i++) {
- manager.addWorkingSet(workingSets[i]);
+ for (WorkingSet workingSet : workingSets) {
+ manager.addWorkingSet(workingSet);
}
manager.saveState();
}
@@ -113,8 +115,8 @@ public class WorkingSetManagerTest extends TestCase {
WorkingSetScope scope = new WorkingSetScope("test", mgr, "scope");
for (int i = 1; i < tocs.length; i++) {
ITopic[] topics = tocs[i].getTopics();
- for (int t = 0; t < topics.length; t++) {
- assertFalse(scope.inScope(topics[t]));
+ for (ITopic topic : topics) {
+ assertFalse(scope.inScope(topic));
}
}
};
@@ -129,8 +131,8 @@ public class WorkingSetManagerTest extends TestCase {
mgr.addWorkingSet(wset);
WorkingSetScope scope = new WorkingSetScope("test", mgr, "scope");
ITopic[] topics = tocs[0].getTopics();
- for (int t = 0; t < topics.length; t++) {
- assertTrue(scope.inScope(topics[t]));
+ for (ITopic topic : topics) {
+ assertTrue(scope.inScope(topic));
}
};
@@ -168,8 +170,8 @@ public class WorkingSetManagerTest extends TestCase {
mgr.saveState();
WorkingSetScope scope = new WorkingSetScope("test1", mgr, "scope");
Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
- for (int i = 0; i < tocs.length; i++) {
- assertTrue(scope.inScope(tocs[i]));
+ for (Toc toc : tocs) {
+ assertTrue(scope.inScope(toc));
}
}
@@ -178,10 +180,10 @@ public class WorkingSetManagerTest extends TestCase {
createWsetWithAllTocs(mgr, "test1a");
WorkingSetScope scope = new WorkingSetScope("test1a", mgr, "scope");
Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
- for (int i = 0; i < tocs.length; i++) {;
- ITopic[] topics = tocs[i].getTopics();
- for (int j = 0; j < topics.length; j++) {
- assertTrue(scope.inScope(topics[j]));
+ for (Toc toc : tocs) {;
+ ITopic[] topics = toc.getTopics();
+ for (ITopic topic : topics) {
+ assertTrue(scope.inScope(topic));
}
}
}
@@ -191,12 +193,12 @@ public class WorkingSetManagerTest extends TestCase {
createWsetWithAllTocs(mgr, "test1b");
WorkingSetScope scope = new WorkingSetScope("test1b", mgr, "scope");
Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
- for (int i = 0; i < tocs.length; i++) {;
- ITopic[] topics = tocs[i].getTopics();
- for (int j = 0; j < topics.length; j++) {
- ITopic[] subtopics = topics[j].getSubtopics();
- for (int k = 0; k < subtopics.length; k++) {
- assertTrue(scope.inScope(subtopics[k]));
+ for (Toc toc : tocs) {;
+ ITopic[] topics = toc.getTopics();
+ for (ITopic topic : topics) {
+ ITopic[] subtopics = topic.getSubtopics();
+ for (ITopic subtopic : subtopics) {
+ assertTrue(scope.inScope(subtopic));
}
}
}
@@ -206,8 +208,8 @@ public class WorkingSetManagerTest extends TestCase {
WorkingSet wset = new WorkingSet(name);
List<AdaptableToc> tocList = new ArrayList<AdaptableToc>();
Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
- for (int i = 0; i < tocs.length; i++) {
- tocList.add(mgr.getAdaptableToc(tocs[i].getHref()));
+ for (Toc toc : tocs) {
+ tocList.add(mgr.getAdaptableToc(toc.getHref()));
}
wset.setElements(tocList.toArray(new AdaptableToc[0]));
mgr.addWorkingSet(wset);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/EnabledTopicTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/EnabledTopicTest.java
index fc60f8a21..c49f8a089 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/EnabledTopicTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/EnabledTopicTest.java
@@ -37,23 +37,28 @@ public class EnabledTopicTest extends TestCase {
this.isEnabled = isEnabled;
}
+ @Override
public ITopic[] getSubtopics() {
return children.toArray(new ITopic[children.size()]);
}
+ @Override
public IUAElement[] getChildren() {
return getSubtopics();
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return isEnabled;
}
+ @Override
public String getHref() {
return "http://www.eclipse.org";
}
+ @Override
public String getLabel() {
return label;
}
@@ -69,6 +74,7 @@ public class EnabledTopicTest extends TestCase {
super(label, true);
}
+ @Override
public String getHref() {
return null;
}
@@ -86,6 +92,7 @@ public class EnabledTopicTest extends TestCase {
this.keyword = keyword;
}
+ @Override
public String getKeyword() {
return keyword;
}
@@ -98,14 +105,17 @@ public class EnabledTopicTest extends TestCase {
topics.add(topic);
}
+ @Override
public IIndexEntry[] getSubentries() {
return subEntries.toArray(new IIndexEntry[subEntries.size()]);
}
+ @Override
public ITopic[] getTopics() {
return topics.toArray(new ITopic[topics.size()]);
}
+ @Override
public synchronized IUAElement[] getChildren() {
List<IUAElement> all = new ArrayList<IUAElement>();
all.addAll(subEntries);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/HelpData.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/HelpData.java
index 7810c588d..afdf61675 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/HelpData.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/HelpData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation 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
@@ -19,28 +19,28 @@ import org.eclipse.help.internal.util.ProductPreferences;
public class HelpData extends TestCase {
public void testHelpDataInPlugin() {
- List result = ProductPreferences.getTocOrdering("org.eclipse.ua.tests", "data/help/toc/helpData.xml", "");
+ List<String> result = ProductPreferences.getTocOrdering("org.eclipse.ua.tests", "data/help/toc/helpData.xml", "");
assertEquals(2, result.size());
assertEquals("/org.eclipse.platform.doc.user/toc.xml", result.get(0));
assertEquals("/org.eclipse.platform.doc.isv/toc.xml", result.get(1));
}
public void testPluginsRoot() {
- List result = ProductPreferences.getTocOrdering("org.eclipse.sdk", "PLUGINS_ROOT/org.eclipse.ua.tests/data/help/toc/helpData.xml", "");
+ List<String> result = ProductPreferences.getTocOrdering("org.eclipse.sdk", "PLUGINS_ROOT/org.eclipse.ua.tests/data/help/toc/helpData.xml", "");
assertEquals(2, result.size());
assertEquals("/org.eclipse.platform.doc.user/toc.xml", result.get(0));
assertEquals("/org.eclipse.platform.doc.isv/toc.xml", result.get(1));
}
public void testHelpDataOverridesBaseTocs() {
- List result = ProductPreferences.getTocOrdering("org.eclipse.ua.tests", "data/help/toc/helpData.xml", "org.eclipse.help");
+ List<String> result = ProductPreferences.getTocOrdering("org.eclipse.ua.tests", "data/help/toc/helpData.xml", "org.eclipse.help");
assertEquals(2, result.size());
assertEquals("/org.eclipse.platform.doc.user/toc.xml", result.get(0));
assertEquals("/org.eclipse.platform.doc.isv/toc.xml", result.get(1));
}
public void testBaseTocs() {
- List result = ProductPreferences.getTocOrdering("", "", "/org.eclipse.help/toc.xml,/org.eclipse.test/toc.xml");
+ List<String> result = ProductPreferences.getTocOrdering("", "", "/org.eclipse.help/toc.xml,/org.eclipse.test/toc.xml");
assertEquals(2, result.size());
assertEquals("/org.eclipse.help/toc.xml", result.get(0));
assertEquals("/org.eclipse.test/toc.xml", result.get(1));
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocAssemblerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocAssemblerTest.java
index 21e4d4d82..3922f314c 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocAssemblerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocAssemblerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation 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
@@ -37,7 +37,6 @@ public class TocAssemblerTest extends TestCase {
return new TestSuite(TocAssemblerTest.class);
}
- @SuppressWarnings("unchecked")
public void testAssemble() throws Exception {
TocFileParser parser = new TocFileParser();
TocContribution b = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/b.xml", true, "en", null, null));
@@ -45,11 +44,11 @@ public class TocAssemblerTest extends TestCase {
TocContribution result_b_c = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/result_b_c.xml", true, "en", null, null));
TocAssembler assembler = new TocAssembler();
- List contributions = new ArrayList(Arrays.asList(new Object[] { b, c }));
+ List<TocContribution> contributions = new ArrayList<TocContribution>(Arrays.asList(b, c));
contributions = assembler.assemble(contributions);
assertEquals(1, contributions.size());
String expected = serialize(result_b_c);
- String actual = serialize((TocContribution)contributions.get(0));
+ String actual = serialize(contributions.get(0));
XMLUtil.assertXMLEquals("Assembled TOC did not match expected result", expected, actual);
TocContribution a = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/a.xml", true, "en", null, null));
@@ -58,12 +57,12 @@ public class TocAssemblerTest extends TestCase {
TocContribution d = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/d.xml", false, "en", null, null));
TocContribution result_a_b_c_d = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/result_a_b_c_d.xml", true, "en", null, null));
- contributions = new ArrayList(Arrays.asList(new Object[] { a, b, c, d }));
+ contributions = new ArrayList<TocContribution>(Arrays.asList(a, b, c, d));
contributions = assembler.assemble(contributions);
assertEquals(1, contributions.size());
expected = serialize(result_a_b_c_d);
- actual = serialize((TocContribution)contributions.get(0));
+ actual = serialize(contributions.get(0));
XMLUtil.assertXMLEquals("Assembled TOC did not match expected result", expected, actual);
}
@@ -74,8 +73,7 @@ public class TocAssemblerTest extends TestCase {
TocContribution linkTo3 = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/linkTo3.xml", true, "en", null, null));
TocAssembler assembler = new TocAssembler();
- @SuppressWarnings("unchecked")
- List contributions = new ArrayList(Arrays.asList(new Object[] { linkTo1, linkTo2, linkTo3 }));
+ List<TocContribution> contributions = new ArrayList<TocContribution>(Arrays.asList(linkTo1, linkTo2, linkTo3));
contributions = assembler.assemble(contributions);
assertEquals(3, contributions.size());
}
@@ -85,10 +83,9 @@ public class TocAssemblerTest extends TestCase {
TocContribution b = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/b.xml", true, "en", null, null));
TocContribution c = parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), "data/help/toc/assembler/c.xml", true, "en", null, null));
TocAssembler assembler = new TocAssembler();
- @SuppressWarnings("unchecked")
- List contributions = new ArrayList(Arrays.asList(new Object[] { b, c }));
+ List<TocContribution> contributions = new ArrayList<TocContribution>(Arrays.asList(b, c));
contributions = assembler.assemble(contributions);
- IToc toc =((TocContribution)contributions.get(0)).getToc();
+ IToc toc =contributions.get(0).getToc();
assertNotNull(toc.getTopic("/org.eclipse.ua.tests/B_topic3.html"));
assertNotNull(toc.getTopic("/org.eclipse.ua.tests/C_topic.html"));
assertNull(toc.getTopic("/org.eclipse.ua.tests/D_topic.html"));
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocProviderTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocProviderTest.java
index faf82f25d..9464b2851 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocProviderTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocProviderTest.java
@@ -33,16 +33,15 @@ public class TocProviderTest extends TestCase {
public void testTocProvider() throws Exception {
IToc[] tocs = HelpPlugin.getTocManager().getTocs("en");
IToc uaToc = null;
- for (int i = 0; i < tocs.length; i++) {
- if ("User Assistance Tests".equals(tocs[i].getLabel())) {
- uaToc = tocs[i];
+ for (IToc toc : tocs) {
+ if ("User Assistance Tests".equals(toc.getLabel())) {
+ uaToc = toc;
}
}
assertNotNull("User Assistance Tests not found", uaToc);
ITopic[] children = uaToc.getTopics();
int generatedParentTopics = 0;
- for (int i = 0; i < children.length; i++) {
- ITopic child = children[i];
+ for (ITopic child : children) {
if ("Generated Parent".equals(child.getLabel())) {
generatedParentTopics++;
assertEquals(4, child.getSubtopics().length);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java
index f9f7e9451..8604b4587 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2015 IBM Corporation 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
@@ -47,26 +47,32 @@ public class TocSortingTest extends TestCase {
this.label = label;
}
+ @Override
public ITopic getTopic(String href) {
return null;
}
+ @Override
public ITopic[] getTopics() {
return new ITopic[0];
}
+ @Override
public IUAElement[] getChildren() {
return new IUAElement[0];
}
+ @Override
public boolean isEnabled(IEvaluationContext context) {
return true;
}
+ @Override
public String getHref() {
return null;
}
+ @Override
public String getLabel() {
return label;
}
@@ -85,39 +91,48 @@ public class TocSortingTest extends TestCase {
this.toc = new Toc(name);
}
+ @Override
public String getCategoryId() {
return categoryId;
}
+ @Override
public String getContributorId() {
return "org.eclipse.ua.tests";
}
+ @Override
public String[] getExtraDocuments() {
return new String[0];
}
+ @Override
public String getId() {
return id;
}
+ @Override
public String getLinkTo() {
return null;
}
+ @Override
public String getLocale() {
return "en";
}
+ @Override
public IToc getToc() {
return toc;
}
+ @Override
public boolean isPrimary() {
return true;
}
}
+ @Override
protected void setUp() throws Exception {
helpDataPreference = Platform.getPreferencesService().getString
(HelpPlugin.HELP_DATA_KEY, HelpPlugin.HELP_DATA_KEY, "", null);
@@ -129,6 +144,7 @@ public class TocSortingTest extends TestCase {
setBaseTocs("");
}
+ @Override
protected void tearDown() throws Exception {
setHelpData(helpDataPreference);
setBaseTocs(baseTocsPreference);
@@ -148,8 +164,8 @@ public class TocSortingTest extends TestCase {
private String toString(ITocContribution[] tocs) {
String result = "";
- for (int i = 0; i < tocs.length; i++) {
- result += tocs[i].getToc().getLabel();
+ for (ITocContribution toc : tocs) {
+ result += toc.getToc().getLabel();
}
return result;
}
@@ -260,19 +276,19 @@ public class TocSortingTest extends TestCase {
}
public void testNoProductNoHelpData() {
- List ordering = ProductPreferences.getTocOrdering(null, "", "/a/b.xml,/c/d.xml");
+ List<String> ordering = ProductPreferences.getTocOrdering(null, "", "/a/b.xml,/c/d.xml");
assertEquals(2, ordering.size());
assertEquals("/a/b.xml", ordering.get(0));
assertEquals("/c/d.xml", ordering.get(1));
}
public void testNoProductWithHelpData() {
- List ordering = ProductPreferences.getTocOrdering(null, "helpData.xml", "/a/b.xml,/c/d.xml");
+ List<String> ordering = ProductPreferences.getTocOrdering(null, "helpData.xml", "/a/b.xml,/c/d.xml");
assertNull(ordering);
}
public void testNoProductWithPluginsRoot() {
- List ordering = ProductPreferences.getTocOrdering(null, ORDERED_XML, "/a/b.xml,/c/d.xml");
+ List<String> ordering = ProductPreferences.getTocOrdering(null, ORDERED_XML, "/a/b.xml,/c/d.xml");
assertEquals(3, ordering.size());
assertEquals("/x/toc.xml", ordering.get(0));
assertEquals("/d/toc.xml", ordering.get(1));
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/UaTestTocProvider.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/UaTestTocProvider.java
index 71d66603e..30fc5e18e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/UaTestTocProvider.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/UaTestTocProvider.java
@@ -25,34 +25,42 @@ public class UaTestTocProvider extends AbstractTocProvider {
private class TocContribution implements ITocContribution {
+ @Override
public String getCategoryId() {
return null;
}
+ @Override
public String getContributorId() {
return "org.eclipse.ua.tests";
}
+ @Override
public String[] getExtraDocuments() {
return new String[0];
}
+ @Override
public String getId() {
return "generatedToc";
}
+ @Override
public String getLinkTo() {
return "PLUGINS_ROOT/org.eclipse.ua.tests/data/help/toc/root.xml#generatedContent";
}
+ @Override
public String getLocale() {
return null;
}
+ @Override
public IToc getToc() {
return toc;
}
+ @Override
public boolean isPrimary() {
return false;
}
@@ -74,6 +82,7 @@ public class UaTestTocProvider extends AbstractTocProvider {
contributions = new ITocContribution[] { contribution };
}
+ @Override
public ITocContribution[] getTocContributions(String locale) {
return contributions;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java
index 90ad1bfb6..6380c427e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/LoadTestServlet.java
@@ -30,6 +30,7 @@ public class LoadTestServlet extends HttpServlet {
private static final String XHTML_2 = "</title>\n <style type = \"text/css\"> td { padding-right : 10px; }</style></head>\n<body>\n"; //$NON-NLS-1$
private static final String XHTML_3 = "</body>\n</html>"; //$NON-NLS-1$
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.setCharacterEncoding("UTF-8"); //$NON-NLS-1$
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ParallelTestSupport.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ParallelTestSupport.java
index 39b2b7cbe..02c1de407 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ParallelTestSupport.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ParallelTestSupport.java
@@ -83,6 +83,7 @@ public class ParallelTestSupport {
public String failureReason = null;
+ @Override
public void run() {
for (int j = 0; j <= repetitions; j++) {
try {
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ProducerSerializerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ProducerSerializerTest.java
index 19e13d9cb..09c4837c7 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ProducerSerializerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/ProducerSerializerTest.java
@@ -53,13 +53,13 @@ public class ProducerSerializerTest extends TestCase {
public void testGenerateOutput() throws Exception {
IToc[] tocs = HelpSystem.getTocs();
- for (int i=0;i<tocs.length;++i) {
+ for (IToc toc : tocs) {
// only look for content in data/help/producer
- if (tocs[i].getHref().indexOf("data/help/producer/") != -1) {
- ITopic[] topics = tocs[i].getTopics();
+ if (toc.getHref().indexOf("data/help/producer/") != -1) {
+ ITopic[] topics = toc.getTopics();
// only goes one level deep - don't need subtopics here
- for (int j=0;j<topics.length;++j) {
- String href = topics[j].getHref();
+ for (ITopic topic : topics) {
+ String href = topic.getHref();
String pluginRoot = UserAssistanceTestPlugin.getDefault().getBundle().getLocation().substring("update@".length());
String relativePath = href.substring(href.indexOf('/', 1));
String absolutePath = pluginRoot + relativePath;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java
index f83ef4de1..ac65faf26 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializer.java
@@ -34,8 +34,8 @@ public class TocModelSerializer {
buf.append(indent + " href=\"" + toc.getHref() + "\">\n");
ITopic[] topics = toc.getTopics();
- for (int i=0;i<topics.length;++i) {
- buf.append(serializeAux(topics[i], indent + " "));
+ for (ITopic topic : topics) {
+ buf.append(serializeAux(topic, indent + " "));
}
buf.append(indent + "</toc>");
@@ -52,8 +52,8 @@ public class TocModelSerializer {
buf.append(indent + " href=\"" + topic.getHref() + "\">\n");
ITopic[] subtopics = topic.getSubtopics();
- for (int i=0;i<subtopics.length;++i) {
- buf.append(serializeAux(subtopics[i], indent + " "));
+ for (ITopic subtopic : subtopics) {
+ buf.append(serializeAux(subtopic, indent + " "));
}
buf.append(indent + "</topic>\n");
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializerTest.java
index 7bfeef4be..77cd5173f 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/util/TocModelSerializerTest.java
@@ -56,6 +56,7 @@ public class TocModelSerializerTest extends TestCase {
* Ensure that org.eclipse.help.ui is started. It contributes extra content
* filtering that is used by this test. See UIContentFilterProcessor.
*/
+ @Override
protected void setUp() throws Exception {
HelpUIPlugin.getDefault();
}
@@ -91,18 +92,18 @@ public class TocModelSerializerTest extends TestCase {
Collection<TocFile> tocFiles = new ArrayList<TocFile>();
IExtensionPoint xpt = Platform.getExtensionRegistry().getExtensionPoint(HelpPlugin.PLUGIN_ID, "toc");
IExtension[] extensions = xpt.getExtensions();
- for (int i=0;i<extensions.length;i++) {
- String pluginId = extensions[i].getContributor().getName();
+ for (IExtension extension : extensions) {
+ String pluginId = extension.getContributor().getName();
if (pluginId.equals("org.eclipse.ua.tests")) {
- IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
- for (int j=0;j<configElements.length;j++) {
- if (configElements[j].getName().equals("toc")) {
+ IConfigurationElement[] configElements = extension.getConfigurationElements();
+ for (IConfigurationElement configElement : configElements) {
+ if (configElement.getName().equals("toc")) {
// only get files in data/help/toc/
- String href = configElements[j].getAttribute("file"); //$NON-NLS-1$
+ String href = configElement.getAttribute("file"); //$NON-NLS-1$
if (href.startsWith("data/help/toc/")) {
- boolean isPrimary = "true".equals(configElements[j].getAttribute("primary")); //$NON-NLS-1$
- String extraDir = configElements[j].getAttribute("extradir"); //$NON-NLS-1$
- String categoryId = configElements[j].getAttribute("category"); //$NON-NLS-1$
+ boolean isPrimary = "true".equals(configElement.getAttribute("primary")); //$NON-NLS-1$
+ String extraDir = configElement.getAttribute("extradir"); //$NON-NLS-1$
+ String categoryId = configElement.getAttribute("category"); //$NON-NLS-1$
tocFiles.add(new TocFile(pluginId, href, isPrimary, Platform.getNL(), extraDir, categoryId));
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java
index de041e194..6c432a487 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java
@@ -32,6 +32,7 @@ public class ChildLinkInsertion extends TestCase {
super(out, req, prefix);
}
+ @Override
protected void insertBasedOnKeyword(int index) throws IOException {
if (index == 0 ) {
out.write("<LINKS>".getBytes()); //$NON-NLS-1$
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilter.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilter.java
index 54ed83cb4..e1cda2bc3 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilter.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilter.java
@@ -23,6 +23,7 @@ import org.eclipse.help.webapp.IFilter;
public class CommentFilter implements IFilter {
+ @Override
public OutputStream filter(HttpServletRequest req, OutputStream out) {
return new OutFilter(out);
}
@@ -36,6 +37,7 @@ public class CommentFilter implements IFilter {
this.out = out;
}
+ @Override
public void write(int b) throws IOException {
if (!preambleWritten) {
preambleWritten = true;
@@ -45,6 +47,7 @@ public class CommentFilter implements IFilter {
out.write(b);
}
+ @Override
public void close() throws IOException {
String comment = "<!-- post " + getCommentText() + " -->";
out.write(comment.getBytes());
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterOne.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterOne.java
index 7f3a3ebd3..749806300 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterOne.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterOne.java
@@ -16,7 +16,8 @@ package org.eclipse.ua.tests.help.webapp;
*/
public class CommentFilterOne extends CommentFilter {
- protected String getCommentText() {
+ @Override
+ protected String getCommentText() {
return "1";
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterThree.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterThree.java
index 5a2ddca28..c8053a396 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterThree.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterThree.java
@@ -17,7 +17,8 @@ package org.eclipse.ua.tests.help.webapp;
public class CommentFilterThree extends CommentFilter {
- protected String getCommentText() {
+ @Override
+ protected String getCommentText() {
return "3";
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterTwo.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterTwo.java
index db629f4a9..a39edcec7 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterTwo.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/CommentFilterTwo.java
@@ -17,7 +17,8 @@ package org.eclipse.ua.tests.help.webapp;
public class CommentFilterTwo extends CommentFilter {
- protected String getCommentText() {
+ @Override
+ protected String getCommentText() {
return "2";
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/FilterExtensionTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/FilterExtensionTest.java
index 7787eb13a..21cd3ba50 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/FilterExtensionTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/FilterExtensionTest.java
@@ -25,6 +25,7 @@ import junit.framework.TestCase;
*/
public class FilterExtensionTest extends TestCase {
+ @Override
protected void tearDown() throws Exception {
ExtraFilters.setFilters(new PrioritizedFilter[0]);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java
index a859cf1b8..7cbbd09be 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java
@@ -34,10 +34,12 @@ public class HelpServerBinding extends TestCase {
// To enable these tests for local testing set testUsingIP to true.
private final boolean testUsingIP = false;
+ @Override
protected void setUp() throws Exception {
previousMode = BaseHelpSystem.getMode();
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(previousMode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java
index 5505663b1..f4dc47b6e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java
@@ -34,6 +34,7 @@ public class HelpServerInterrupt extends TestCase {
private Exception exception = null;
+ @Override
public synchronized void run() {
try {
WebappManager.start("help");
@@ -47,6 +48,7 @@ public class HelpServerInterrupt extends TestCase {
}
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java
index 189145942..bf0242814 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation 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
@@ -17,12 +17,11 @@ import javax.servlet.http.Cookie;
import junit.framework.TestCase;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.help.internal.base.BaseHelpSystem;
import org.eclipse.help.internal.util.ProductPreferences;
import org.eclipse.help.internal.webapp.data.UrlUtil;
-import org.eclipse.core.runtime.Platform;
-
/**
* Tests for locale related code in UrlUtil
*/
@@ -30,10 +29,12 @@ public class LocaleTest extends TestCase {
private int mode;
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
+ @Override
protected void setUp() throws Exception {
mode = BaseHelpSystem.getMode();
}
@@ -46,7 +47,6 @@ public class LocaleTest extends TestCase {
assertEquals("ab-cd______ef", UrlUtil.cleanLocale("ab-cd\n\r_\"\'_ef"));
}
- @SuppressWarnings("unchecked")
public void testForced_Locale() {
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
MockServletRequest req = new MockServletRequest();
@@ -56,7 +56,6 @@ public class LocaleTest extends TestCase {
assertEquals("es", locale);
}
- @SuppressWarnings("unchecked")
public void testForcedLangOverridesCookies() {
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
MockServletRequest req = new MockServletRequest();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java
index 1d8aa67a7..e9431bf4d 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java
@@ -51,15 +51,18 @@ public class MockServletRequest implements HttpServletRequest {
}
+ @Override
public String getAuthType() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getContextPath() {
return "/help";
}
+ @Override
public Cookie[] getCookies() {
return cookies;
}
@@ -68,36 +71,43 @@ public class MockServletRequest implements HttpServletRequest {
this.cookies = cookies;
}
+ @Override
public long getDateHeader(String arg0) {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public String getHeader(String arg0) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public Enumeration<String> getHeaderNames() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public Enumeration<String> getHeaders(String arg0) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public int getIntHeader(String arg0) {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public String getMethod() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getPathInfo() {
return pathInfo;
}
@@ -106,125 +116,150 @@ public class MockServletRequest implements HttpServletRequest {
this.pathInfo = info;
}
+ @Override
public String getPathTranslated() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getQueryString() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getRemoteUser() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getRequestURI() {
return "/help/context.jsp";
}
+ @Override
public StringBuffer getRequestURL() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getRequestedSessionId() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getServletPath() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public HttpSession getSession() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public HttpSession getSession(boolean arg0) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public Principal getUserPrincipal() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public boolean isRequestedSessionIdFromCookie() {
// TODO Auto-generated method stub
return false;
}
+ @Override
public boolean isRequestedSessionIdFromURL() {
// TODO Auto-generated method stub
return false;
}
+ @Override
public boolean isRequestedSessionIdFromUrl() {
// TODO Auto-generated method stub
return false;
}
+ @Override
public boolean isRequestedSessionIdValid() {
// TODO Auto-generated method stub
return false;
}
+ @Override
public boolean isUserInRole(String arg0) {
// TODO Auto-generated method stub
return false;
}
+ @Override
public Object getAttribute(String arg0) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public Enumeration<String> getAttributeNames() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getCharacterEncoding() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public int getContentLength() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public String getContentType() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public ServletInputStream getInputStream() throws IOException {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getLocalAddr() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getLocalName() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public int getLocalPort() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public Locale getLocale() {
return locale;
}
@@ -234,173 +269,207 @@ public class MockServletRequest implements HttpServletRequest {
}
+ @Override
public Enumeration<Locale> getLocales() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getParameter(String arg0) {
String[] values= parameterMap.get(arg0);
return values != null ? parameterMap.get(arg0)[0] : null;
}
+ @Override
public Map<String, String[]> getParameterMap() {
return parameterMap;
}
+ @Override
public Enumeration<String> getParameterNames() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String[] getParameterValues(String arg0) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getProtocol() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public BufferedReader getReader() throws IOException {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getRealPath(String arg0) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getRemoteAddr() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getRemoteHost() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public int getRemotePort() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public RequestDispatcher getRequestDispatcher(String arg0) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getScheme() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String getServerName() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public int getServerPort() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public boolean isSecure() {
// TODO Auto-generated method stub
return false;
}
+ @Override
public void removeAttribute(String arg0) {
// TODO Auto-generated method stub
}
+ @Override
public void setAttribute(String arg0, Object arg1) {
// TODO Auto-generated method stub
}
+ @Override
public void setCharacterEncoding(String arg0)
throws UnsupportedEncodingException {
// TODO Auto-generated method stub
}
+ @Override
public ServletContext getServletContext() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public AsyncContext startAsync() throws IllegalStateException {
// TODO Auto-generated method stub
return null;
}
+ @Override
public AsyncContext startAsync(ServletRequest servletRequest,
ServletResponse servletResponse) throws IllegalStateException {
// TODO Auto-generated method stub
return null;
}
+ @Override
public boolean isAsyncStarted() {
// TODO Auto-generated method stub
return false;
}
+ @Override
public boolean isAsyncSupported() {
// TODO Auto-generated method stub
return false;
}
+ @Override
public AsyncContext getAsyncContext() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public DispatcherType getDispatcherType() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public boolean authenticate(HttpServletResponse response)
throws IOException, ServletException {
// TODO Auto-generated method stub
return false;
}
+ @Override
public void login(String username, String password) throws ServletException {
// TODO Auto-generated method stub
}
+ @Override
public void logout() throws ServletException {
// TODO Auto-generated method stub
}
+ @Override
public Collection<Part> getParts() throws IOException, ServletException {
// TODO Auto-generated method stub
return null;
}
+ @Override
public Part getPart(String name) throws IOException, ServletException {
// TODO Auto-generated method stub
return null;
}
+ @Override
public long getContentLengthLong() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public String changeSessionId() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException {
// TODO Auto-generated method stub
return null;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletResponse.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletResponse.java
index 9bddaf858..caccca667 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletResponse.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletResponse.java
@@ -31,65 +31,81 @@ public class MockServletResponse implements HttpServletResponse {
private List<Cookie> cookies = new ArrayList<Cookie>();
private String illegalCharactersFound = "";
+ @Override
public String getCharacterEncoding() {
return null;
}
+ @Override
public String getContentType() {
return null;
}
+ @Override
public ServletOutputStream getOutputStream() throws IOException {
return null;
}
+ @Override
public PrintWriter getWriter() throws IOException {
return null;
}
+ @Override
public void setCharacterEncoding(String charset) {
}
+ @Override
public void setContentLength(int len) {
}
+ @Override
public void setContentType(String type) {
}
+ @Override
public void setBufferSize(int size) {
}
+ @Override
public int getBufferSize() {
return 0;
}
+ @Override
public void flushBuffer() throws IOException {
}
+ @Override
public void resetBuffer() {
}
+ @Override
public boolean isCommitted() {
return false;
}
+ @Override
public void reset() {
}
+ @Override
public void setLocale(Locale loc) {
}
+ @Override
public Locale getLocale() {
return null;
}
+ @Override
public void addCookie(Cookie cookie) {
checkForIllegalCharacters(cookie.getValue());
// Replace if it already exists, otherwise set
@@ -119,81 +135,97 @@ public class MockServletResponse implements HttpServletResponse {
return cookies.toArray(new Cookie[cookies.size()]);
}
+ @Override
public boolean containsHeader(String name) {
// TODO Auto-generated method stub
return false;
}
+ @Override
public String encodeURL(String url) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String encodeRedirectURL(String url) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String encodeUrl(String url) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public String encodeRedirectUrl(String url) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public void sendError(int sc, String msg) throws IOException {
// TODO Auto-generated method stub
}
+ @Override
public void sendError(int sc) throws IOException {
// TODO Auto-generated method stub
}
+ @Override
public void sendRedirect(String location) throws IOException {
// TODO Auto-generated method stub
}
+ @Override
public void setDateHeader(String name, long date) {
// TODO Auto-generated method stub
}
+ @Override
public void addDateHeader(String name, long date) {
// TODO Auto-generated method stub
}
+ @Override
public void setHeader(String name, String value) {
// TODO Auto-generated method stub
}
+ @Override
public void addHeader(String name, String value) {
// TODO Auto-generated method stub
}
+ @Override
public void setIntHeader(String name, int value) {
// TODO Auto-generated method stub
}
+ @Override
public void addIntHeader(String name, int value) {
// TODO Auto-generated method stub
}
+ @Override
public void setStatus(int sc) {
// TODO Auto-generated method stub
}
+ @Override
public void setStatus(int sc, String sm) {
// TODO Auto-generated method stub
@@ -203,26 +235,31 @@ public class MockServletResponse implements HttpServletResponse {
return illegalCharactersFound;
}
+ @Override
public int getStatus() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public String getHeader(String name) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public Collection<String> getHeaders(String name) {
// TODO Auto-generated method stub
return null;
}
+ @Override
public Collection<String> getHeaderNames() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public void setContentLengthLong(long len) {
// TODO Auto-generated method stub
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ParallelServerAccessTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ParallelServerAccessTest.java
index 5d9eb5a04..23c60442e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ParallelServerAccessTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ParallelServerAccessTest.java
@@ -36,10 +36,12 @@ public class ParallelServerAccessTest extends TestCase {
return new TestSuite(ParallelServerAccessTest.class);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
}
+ @Override
protected void tearDown() throws Exception {
LoadServletUtil.stopServer();
}
@@ -91,6 +93,7 @@ public class ParallelServerAccessTest extends TestCase {
public Exception exception;
+ @Override
public void run() {
for (int j = 0; j <= 100; j++) {
try {
@@ -113,6 +116,7 @@ public class ParallelServerAccessTest extends TestCase {
this.actual = actual;
}
+ @Override
public String getMessage() {
return "Expected: " + expected +" Actual: " + actual;
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/RestrictedTopicParameter.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/RestrictedTopicParameter.java
index a4390aac9..dd486b4eb 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/RestrictedTopicParameter.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/RestrictedTopicParameter.java
@@ -30,6 +30,7 @@ public class RestrictedTopicParameter extends TestCase {
private boolean restrictTopic;
private int helpMode;
+ @Override
protected void setUp() throws Exception {
restrictTopic = Platform.getPreferencesService().getBoolean
(HelpBasePlugin.PLUGIN_ID, RESTRICT_TOPIC,
@@ -37,6 +38,7 @@ public class RestrictedTopicParameter extends TestCase {
helpMode = BaseHelpSystem.getMode();
}
+ @Override
protected void tearDown() throws Exception {
setRestrictTopic(restrictTopic);
BaseHelpSystem.setMode(helpMode);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/TocZipTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/TocZipTest.java
index f1c66018a..f5407f333 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/TocZipTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/TocZipTest.java
@@ -28,6 +28,7 @@ import org.eclipse.help.internal.server.WebappManager;
*/
public class TocZipTest extends TestCase {
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/AdvancedSearchServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/AdvancedSearchServiceTest.java
index 36d288891..9e55ba6ef 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/AdvancedSearchServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/AdvancedSearchServiceTest.java
@@ -20,6 +20,7 @@ import org.w3c.dom.Node;
public class AdvancedSearchServiceTest extends SearchServletTest {
+ @Override
protected Node[] getSearchHitsFromServlet(String searchWord)
throws Exception {
int port = WebappManager.getPort();
@@ -27,6 +28,7 @@ public class AdvancedSearchServiceTest extends SearchServletTest {
return makeServletCall(url);
}
+ @Override
protected Node[] getSearchHitsUsingLocale(String searchWord, String locale)
throws Exception {
int port = WebappManager.getPort();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContentServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContentServiceTest.java
index 96264b8dc..0df5b7759 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContentServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContentServiceTest.java
@@ -18,6 +18,7 @@ public class ContentServiceTest extends ContentServletTest {
private static final String UA_TESTS = "org.eclipse.ua.tests";
+ @Override
public void testSimpleContent() throws Exception {
final String path = "/data/help/index/topic1.html";
String remoteContent = ServicesTestUtils.getRemoteContent(UA_TESTS, path, "en");
@@ -25,6 +26,7 @@ public class ContentServiceTest extends ContentServletTest {
assertEquals(remoteContent, localContent);
}
+ @Override
public void testFilteredContent() throws Exception {
final String path = "/data/help/manual/filter.xhtml";
String remoteContent = ServicesTestUtils.getRemoteContent(UA_TESTS, path, "en");
@@ -32,6 +34,7 @@ public class ContentServiceTest extends ContentServletTest {
assertEquals(remoteContent, localContent);
}
+ @Override
public void testContentInEnLocale() throws Exception {
final String path = "/data/help/search/testnl1.xhtml";
String remoteContent = ServicesTestUtils.getRemoteContent(UA_TESTS, path, "en");
@@ -39,6 +42,7 @@ public class ContentServiceTest extends ContentServletTest {
assertEquals(remoteContent, localContent);
}
+ @Override
public void testContentInDeLocale() throws Exception {
final String path = "/data/help/search/testnl1.xhtml";
String remoteContent = ServicesTestUtils.getRemoteContent(UA_TESTS, path, "de");
@@ -48,6 +52,7 @@ public class ContentServiceTest extends ContentServletTest {
assertFalse(remoteContent.equals(enLocalContent));
}
+ @Override
public void testRemoteContentNotFound() throws Exception {
try {
ServicesTestUtils.getRemoteContent(UA_TESTS, "/no/such/path.html", "en");
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContextServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContextServiceTest.java
index 08d681832..1a428734a 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContextServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ContextServiceTest.java
@@ -19,6 +19,7 @@ import org.w3c.dom.Element;
public class ContextServiceTest extends ContextServletTest {
+ @Override
protected Element[] getContextsFromServlet(String phrase)
throws Exception {
int port = WebappManager.getPort();
@@ -27,6 +28,7 @@ public class ContextServiceTest extends ContextServletTest {
return makeServletCall(url);
}
+ @Override
protected Element[] getContextsUsingLocale(String phrase, String locale)
throws Exception {
int port = WebappManager.getPort();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ExtensionServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ExtensionServiceTest.java
index 0000efc5c..a28701a73 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ExtensionServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/ExtensionServiceTest.java
@@ -34,12 +34,14 @@ public class ExtensionServiceTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexFragmentServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexFragmentServiceTest.java
index e488d07b3..e6841ee13 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexFragmentServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexFragmentServiceTest.java
@@ -30,12 +30,14 @@ public class IndexFragmentServiceTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexServiceTest.java
index 29589fee6..33b2e8474 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/IndexServiceTest.java
@@ -25,6 +25,7 @@ import org.xml.sax.InputSource;
public class IndexServiceTest extends IndexServletTest {
+ @Override
protected Node getIndexContributions( String locale)
throws Exception {
int port = WebappManager.getPort();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/SearchServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/SearchServiceTest.java
index 8965169a5..ad0660559 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/SearchServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/SearchServiceTest.java
@@ -20,6 +20,7 @@ import org.w3c.dom.Node;
public class SearchServiceTest extends SearchServletTest {
+ @Override
protected Node[] getSearchHitsFromServlet(String phrase)
throws Exception {
int port = WebappManager.getPort();
@@ -27,6 +28,7 @@ public class SearchServiceTest extends SearchServletTest {
return makeServletCall(url);
}
+ @Override
protected Node[] getSearchHitsUsingLocale(String phrase, String locale)
throws Exception {
int port = WebappManager.getPort();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocFragmentServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocFragmentServiceTest.java
index 68e7a61c9..8fa0bbd77 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocFragmentServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocFragmentServiceTest.java
@@ -36,12 +36,14 @@ public class TocFragmentServiceTest extends TestCase {
private int mode;
+ @Override
protected void setUp() throws Exception {
BaseHelpSystem.ensureWebappRunning();
mode = BaseHelpSystem.getMode();
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
}
+ @Override
protected void tearDown() throws Exception {
BaseHelpSystem.setMode(mode);
}
@@ -98,9 +100,9 @@ public class TocFragmentServiceTest extends TestCase {
private int findUATopicIndex(String title, String locale) {
int index = -1;
Toc[] tocs = HelpPlugin.getTocManager().getTocs(locale);
- for (int i = 0; i < tocs.length; i++) {
- if ("/org.eclipse.ua.tests/data/help/toc/root.xml".equals(tocs[i].getHref())) {
- ITopic[] topics = tocs[i].getTopics();
+ for (Toc toc : tocs) {
+ if ("/org.eclipse.ua.tests/data/help/toc/root.xml".equals(toc.getHref())) {
+ ITopic[] topics = toc.getTopics();
for (int j = 0; j < topics.length; j++) {
if (title.equals(topics[j].getLabel())) {
index = j;
@@ -152,7 +154,7 @@ public class TocFragmentServiceTest extends TestCase {
}
}
}
- return (Element[]) results.toArray(new Element[results.size()]);
+ return results.toArray(new Element[results.size()]);
}
/*
@@ -180,7 +182,7 @@ public class TocFragmentServiceTest extends TestCase {
}
}
}
- return (Element[]) results.toArray(new Element[results.size()]);
+ return results.toArray(new Element[results.size()]);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocServiceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocServiceTest.java
index 6f905bd07..2aee7d79a 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocServiceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/service/TocServiceTest.java
@@ -25,6 +25,7 @@ import org.xml.sax.InputSource;
public class TocServiceTest extends TocServletTest {
+ @Override
protected Node getTocContributions( String locale)
throws Exception {
int port = WebappManager.getPort();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestFrame.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestFrame.java
index bf07d3b5e..cb1ff86a4 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestFrame.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestFrame.java
@@ -17,22 +17,27 @@ import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
public class TestFrame extends AbstractFrame {
+ @Override
public String getName() {
return "testFrame";
}
+ @Override
public String getURL() {
return "/titlesearch/jsp/advanced/testFrame.jsp";
}
+ @Override
public int getLocation() {
return AbstractFrame.BELOW_CONTENT;
}
+ @Override
public String getSize() {
return "24";
}
+ @Override
public boolean isVisible() {
return Platform.getPreferencesService().getBoolean
(UserAssistanceTestPlugin.getPluginId(), "extraFrame", false, null);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestHelpToolbarFrame.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestHelpToolbarFrame.java
index 593c21460..2dbc46910 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestHelpToolbarFrame.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TestHelpToolbarFrame.java
@@ -17,26 +17,32 @@ import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
public class TestHelpToolbarFrame extends AbstractFrame {
+ @Override
public String getName() {
return "testHelpToolbarFrame";
}
+ @Override
public String getURL() {
return "/titlesearch/jsp/advanced/testHelpToolbarFrame.jsp";
}
+ @Override
public int getLocation() {
return AbstractFrame.HELP_TOOLBAR;
}
+ @Override
public String getSize() {
return "*";
}
- public String getFrameAttributes() {
+ @Override
+ public String getFrameAttributes() {
return "\"marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" scrolling=\"no\""; //$NON-NLS-1$
}
+ @Override
public boolean isVisible() {
return Platform.getPreferencesService().getBoolean
(UserAssistanceTestPlugin.getPluginId(), "extraFrame", false, null);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchButton.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchButton.java
index 69a1072a7..3b5914b92 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchButton.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchButton.java
@@ -19,18 +19,22 @@ import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
public class TitleSearchButton extends AbstractButton {
+ @Override
public String getAction() {
return "toggleTitleView";
}
+ @Override
public String getId() {
return "tsearch";
}
+ @Override
public String getImageURL() {
return "/titlesearch/icons/sample3.gif";
}
+ @Override
public String getTooltip(Locale locale) {
if ("es".equals(locale.getLanguage())) {
return "Muestre busque en titulos";
@@ -38,10 +42,12 @@ public class TitleSearchButton extends AbstractButton {
return "Show Search Topic Title";
}
+ @Override
public String getJavaScriptURL() {
return "/titlesearch/script/titlesearch.js";
}
+ @Override
public boolean isAddedToToolbar(String toolbarName) {
boolean addButton = Platform.getPreferencesService().getBoolean
(UserAssistanceTestPlugin.getPluginId(), "extraButton", false, null);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchData.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchData.java
index f6514570f..88d67d180 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchData.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchData.java
@@ -41,10 +41,10 @@ public SearchResult[] getSearchResults() {
results = new ArrayList<SearchResult>();
searchTerm = request.getParameter("searchWord");
IToc[] tocs = getTocs();
- for (int i = 0; i < tocs.length; i++) {
- ITopic[] topics = tocs[i].getTopics();
- for (int t = 0; t < topics.length; t++) {
- searchTopic(topics[t]);
+ for (IToc toc : tocs) {
+ ITopic[] topics = toc.getTopics();
+ for (ITopic topic : topics) {
+ searchTopic(topic);
}
}
return results.toArray(new SearchResult[results.size()]);
@@ -59,8 +59,8 @@ private void searchTopic(ITopic topic) {
results.add(result);
}
ITopic[] topics = topic.getSubtopics();
- for (int t = 0; t < topics.length; t++) {
- searchTopic(topics[t]);
+ for (ITopic topic2 : topics) {
+ searchTopic(topic2);
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchView.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchView.java
index 48e36ce41..6446f48a1 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchView.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webextension/TitleSearchView.java
@@ -19,18 +19,22 @@ import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
public class TitleSearchView extends AbstractView {
+ @Override
public String getImageURL() {
return "/titlesearch/icons/sample3.gif";
}
+ @Override
public char getKey() {
return 0;
}
+ @Override
public String getName() {
return "titlesearch";
}
+ @Override
public String getTitle(Locale locale) {
if ("es".equals(locale.getLanguage())) {
return "Busque en titulos";
@@ -38,19 +42,23 @@ public class TitleSearchView extends AbstractView {
return "Search Topic Title";
}
+ @Override
public String getURL() {
return "/titlesearch/jsp/advanced/";
}
+ @Override
public String getBasicURL() {
return "/titlesearch/jsp/basic/";
}
+ @Override
public boolean isVisible() {
return Platform.getPreferencesService().getBoolean
(UserAssistanceTestPlugin.getPluginId(), "extraView", false, null);
}
+ @Override
public boolean isVisibleBasic() {
return Platform.getPreferencesService().getBoolean
(UserAssistanceTestPlugin.getPluginId(), "extraView", false, null);
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/anchors/ExtensionReorderingTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/anchors/ExtensionReorderingTest.java
index 9f1cdb198..a22e4848b 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/anchors/ExtensionReorderingTest.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/anchors/ExtensionReorderingTest.java
@@ -90,8 +90,8 @@ public class ExtensionReorderingTest extends TestCase {
private String toString(int[] order) {
String result = "";
- for (int i = 0; i < order.length; i++) {
- result = result + order[i];
+ for (int element : order) {
+ result = result + element;
}
return result;
}
@@ -149,12 +149,12 @@ public class ExtensionReorderingTest extends TestCase {
// find all configs with given attribute and attribute value.
Vector<IConfigurationElement> elements = new Vector<IConfigurationElement>();
- for (int i = 0; i < configElements.length; i++) {
- String currentAttributeValue = configElements[i]
+ for (IConfigurationElement configElement : configElements) {
+ String currentAttributeValue = configElement
.getAttribute(attributeName);
if (currentAttributeValue != null
&& currentAttributeValue.equals(attributeValue))
- elements.add(configElements[i]);
+ elements.add(configElement);
}
// now return array.
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java
index 841a792eb..1c99fcd17 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 IBM Corporation and others.
+ * Copyright (c) 2007, 2015 IBM Corporation 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
@@ -18,7 +18,6 @@ import junit.framework.Test;
import junit.framework.TestCase;
import org.eclipse.test.OrderedTestSuite;
-
import org.eclipse.ui.internal.intro.impl.model.ExtensionMap;
import org.eclipse.ui.internal.intro.universal.contentdetect.ContentDetectHelper;
import org.eclipse.ui.internal.intro.universal.contentdetect.ContentDetector;
@@ -62,8 +61,7 @@ public class ContentDetectorTest extends TestCase {
contributors.add("two");
contributors.add("three");
helper.saveContributors(contributors);
- @SuppressWarnings("unchecked")
- Set<String> savedContributors = helper.getContributors();
+ Set<?> savedContributors = helper.getContributors();
assertTrue(savedContributors.size() == 3);
assertTrue(savedContributors.contains("one"));
assertTrue(savedContributors.contains("two"));
@@ -81,7 +79,7 @@ public class ContentDetectorTest extends TestCase {
previous.add("five");
previous.add("two");
previous.add("one");
- Set newContributors = helper.findNewContributors(contributors, previous);
+ Set<?> newContributors = helper.findNewContributors(contributors, previous);
assertTrue(newContributors.size() == 2);
assertTrue(newContributors.contains("four"));
assertTrue(newContributors.contains("three"));
@@ -94,7 +92,7 @@ public class ContentDetectorTest extends TestCase {
assertEquals(ContentDetectHelper.NO_STATE, helper.getExtensionCount());
ContentDetector detector = new ContentDetector();
assertFalse(detector.isNewContentAvailable());
- Set newContent = ContentDetector.getNewContributors();
+ Set<?> newContent = ContentDetector.getNewContributors();
assertTrue(newContent == null || newContent.size() == 0);
String firstContribution = (String) helper.getContributors().iterator().next();
assertFalse(ContentDetector.isNew(firstContribution));
@@ -113,9 +111,8 @@ public class ContentDetectorTest extends TestCase {
assertFalse(detector.isNewContentAvailable());
// Make the first extension appear new
helper.saveExtensionCount(extensionCount - 1);
- @SuppressWarnings("unchecked")
- Set<String> contributors = helper.getContributors();
- String firstContribution = contributors.iterator().next();
+ Set<?> contributors = helper.getContributors();
+ String firstContribution = (String) contributors.iterator().next();
String copyOfFirstContribution = "" + firstContribution;
contributors.remove(firstContribution);
helper.saveContributors(contributors);
@@ -159,6 +156,7 @@ public class ContentDetectorTest extends TestCase {
assertNull(map.getStartPage());
}
+ @Override
protected void finalize() throws Throwable {
// Delete state files so that if we start Eclipse we don't see all content as new
ContentDetectHelper helper = new ContentDetectHelper();
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java
index d39e3b636..bc571d3dc 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/parser/ValidTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation 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
@@ -13,25 +13,23 @@ package org.eclipse.ua.tests.intro.parser;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.junit.Assert;
-import org.osgi.framework.Bundle;
-
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.help.ui.internal.HelpUIPlugin;
import org.eclipse.ua.tests.intro.util.IntroModelSerializer;
import org.eclipse.ua.tests.intro.util.IntroModelSerializerTest;
import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
import org.eclipse.ua.tests.util.FileUtil;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-
import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
import org.eclipse.ui.internal.intro.impl.model.loader.ExtensionPointManager;
+import org.junit.Assert;
+import org.osgi.framework.Bundle;
/*
* Tests the intro parser on valid intro content.
@@ -49,6 +47,7 @@ public class ValidTest extends TestCase {
* Ensure that org.eclipse.help.ui is started. It contributes extra content
* filtering that is used by this test. See UIContentFilterProcessor.
*/
+ @Override
protected void setUp() throws Exception {
HelpUIPlugin.getDefault();
}
@@ -81,13 +80,13 @@ public class ValidTest extends TestCase {
*/
private void singleConfigTest(String configId) throws IOException {
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.config");
- for (int i=0;i<elements.length;++i) {
+ for (IConfigurationElement element : elements) {
/*
* Only use the ones from this test plugin.
*/
- if (elements[i].getDeclaringExtension().getContributor().getName().equals(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName())) {
- String content = elements[i].getAttribute("content");
- String id = elements[i].getAttribute("id");
+ if (element.getDeclaringExtension().getContributor().getName().equals(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName())) {
+ String content = element.getAttribute("content");
+ String id = element.getAttribute("id");
if (id.equals(configId)) {
for (int x = 0; x < 10; x++) {
// Perform 10 times to better detect intermittent ordering bugs
@@ -100,14 +99,14 @@ public class ValidTest extends TestCase {
String actual = serializer.toString();
Assert.assertEquals("The model parsed for intro did not match the expected result for: " + id, expected, actual);
- Map map = IntroModelSerializerTest.getXHTMLFiles(model);
- Iterator iter = map.entrySet().iterator();
+ Map<String, String> map = IntroModelSerializerTest.getXHTMLFiles(model);
+ Iterator<Entry<String, String>> iter = map.entrySet().iterator();
while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry)iter.next();
- String relativePath = (String)entry.getKey();
+ Entry<String, String> entry = iter.next();
+ String relativePath = entry.getKey();
expected = FileUtil.getContents(bundle, FileUtil.getResultFile(relativePath));
- actual = (String)entry.getValue();
+ actual = entry.getValue();
Assert.assertEquals("The XHTML generated for intro did not match the expected result for: " + relativePath, expected, actual);
}
}
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java
index 3173e8ff9..3637c142c 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java
@@ -36,6 +36,7 @@ public class OpenIntroTest extends PerformanceTestCase {
/* (non-Javadoc)
* @see org.eclipse.test.performance.PerformanceTestCase#setUp()
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
closeIntro();
@@ -47,6 +48,7 @@ public class OpenIntroTest extends PerformanceTestCase {
/* (non-Javadoc)
* @see org.eclipse.test.performance.PerformanceTestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
closeIntro();
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java
index 8f449f3dc..3b8a1ea2e 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation 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
@@ -104,29 +104,28 @@ public class IntroModelSerializer {
printPageStyles(rootPage, text);
}
- @SuppressWarnings("unchecked")
private void printPageStyles(AbstractIntroPage page, StringBuffer text) {
text.append("\n\tpage styles are = "); //$NON-NLS-1$
String[] styles = page.getStyles();
- for (int i = 0; i < styles.length; i++)
- text.append(filterURL(styles[i] + "\n\t\t\t")); //$NON-NLS-1$
+ for (String style : styles)
+ text.append(filterURL(style + "\n\t\t\t")); //$NON-NLS-1$
text.append("\n\tpage alt-styles are = "); //$NON-NLS-1$
- final Hashtable altStylesHashtable = page.getAltStyles();
+ final Hashtable<String, Bundle> altStylesHashtable = page.getAltStyles();
if (altStylesHashtable == null)
return;
- Set set = altStylesHashtable.keySet();
+ Set<String> set = altStylesHashtable.keySet();
String[] sorted = new String[set.size()];
set.toArray(sorted);
for (int i=0;i<sorted.length;++i) {
- Bundle bundle = (Bundle) altStylesHashtable.get(sorted[i]);
+ Bundle bundle = altStylesHashtable.get(sorted[i]);
sorted[i] = filterURL(sorted[i]) + " from " + bundle.getSymbolicName(); //$NON-NLS-1$
}
Arrays.sort(sorted);
- for (int i=0;i<sorted.length;++i) {
- text.append(sorted[i] + "\n\t\t"); //$NON-NLS-1$
+ for (String element : sorted) {
+ text.append(element + "\n\t\t"); //$NON-NLS-1$
}
}
@@ -142,41 +141,41 @@ public class IntroModelSerializer {
StringBuffer text, String indent) {
AbstractIntroElement[] children = container.getChildren();
- for (int i = 0; i < children.length; i++) {
- int childType = children[i].getType();
+ for (AbstractIntroElement element : children) {
+ int childType = element.getType();
switch (childType) {
case AbstractIntroElement.ELEMENT:
text.append("SHOULD NEVER BE HERE"); //$NON-NLS-1$
break;
case AbstractIntroElement.GROUP:
- printGroup(text, (IntroGroup) children[i], indent);
+ printGroup(text, (IntroGroup) element, indent);
break;
case AbstractIntroElement.LINK:
- printLink(text, (IntroLink) children[i], indent);
+ printLink(text, (IntroLink) element, indent);
break;
case AbstractIntroElement.TEXT:
- printText(text, (IntroText) children[i], indent);
+ printText(text, (IntroText) element, indent);
break;
case AbstractIntroElement.IMAGE:
- printImage(text, (IntroImage) children[i], indent);
+ printImage(text, (IntroImage) element, indent);
break;
case AbstractIntroElement.HTML:
- printHtml(text, (IntroHTML) children[i], indent);
+ printHtml(text, (IntroHTML) element, indent);
break;
case AbstractIntroElement.INCLUDE:
- printInclude(text, (IntroInclude) children[i], indent);
+ printInclude(text, (IntroInclude) element, indent);
break;
case AbstractIntroElement.HEAD:
- printHead(text, (IntroHead) children[i], indent);
+ printHead(text, (IntroHead) element, indent);
break;
case AbstractIntroElement.PAGE_TITLE:
- printPageTitle(text, (IntroPageTitle) children[i], indent);
+ printPageTitle(text, (IntroPageTitle) element, indent);
break;
case AbstractIntroElement.ANCHOR:
- printAnchor(text, (IntroAnchor) children[i], indent);
+ printAnchor(text, (IntroAnchor) element, indent);
break;
case AbstractIntroElement.CONTENT_PROVIDER:
- printContentProvidor(text, (IntroContentProvider) children[i],
+ printContentProvidor(text, (IntroContentProvider) element,
indent);
break;
@@ -272,15 +271,15 @@ public class IntroModelSerializer {
* @param text
*/
private void printPages(IntroPage[] pages, StringBuffer text) {
- for (int i = 0; i < pages.length; i++) {
- text.append("\n\nPAGE id = " + pages[i].getId()); //$NON-NLS-1$
+ for (IntroPage page : pages) {
+ text.append("\n\nPAGE id = " + page.getId()); //$NON-NLS-1$
text.append("\n----------"); //$NON-NLS-1$
- text.append("\n\ttitle = " + pages[i].getTitle()); //$NON-NLS-1$
- text.append("\n\tstyle = " + filterURL(pages[i].getStyle())); //$NON-NLS-1$
- text.append("\n\talt-style = " + filterURL(pages[i].getAltStyle())); //$NON-NLS-1$
- text.append("\n\tstyle-id = " + pages[i].getStyleId()); //$NON-NLS-1$
- printPageStyles(pages[i], text);
- printPageChildren(pages[i], text);
+ text.append("\n\ttitle = " + page.getTitle()); //$NON-NLS-1$
+ text.append("\n\tstyle = " + filterURL(page.getStyle())); //$NON-NLS-1$
+ text.append("\n\talt-style = " + filterURL(page.getAltStyle())); //$NON-NLS-1$
+ text.append("\n\tstyle-id = " + page.getStyleId()); //$NON-NLS-1$
+ printPageStyles(page, text);
+ printPageChildren(page, text);
}
}
@@ -353,7 +352,8 @@ public class IntroModelSerializer {
/**
* @return Returns the textUI.
*/
- public String toString() {
+ @Override
+ public String toString() {
return buffer.toString();
}
}
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java
index 417505d8b..0a167ac0a 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/util/IntroModelSerializerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation 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
@@ -69,6 +69,7 @@ public class IntroModelSerializerTest extends TestCase {
* content filtering that is used by this test. See
* UIContentFilterProcessor.
*/
+ @Override
protected void setUp() throws Exception {
HelpUIPlugin.getDefault();
}
@@ -78,14 +79,14 @@ public class IntroModelSerializerTest extends TestCase {
* Serialize the test intros.
*/
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.config");
- for (int i=0;i<elements.length;++i) {
+ for (IConfigurationElement element : elements) {
/*
* Only use the ones from this test plugin.
*/
- if (elements[i].getDeclaringExtension().getContributor().getName().equals(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName())) {
+ if (element.getDeclaringExtension().getContributor().getName().equals(UserAssistanceTestPlugin.getDefault().getBundle().getSymbolicName())) {
String pluginRoot = UserAssistanceTestPlugin.getDefault().getBundle().getLocation().substring("update@".length());
- String content = elements[i].getAttribute("content");
- String id = elements[i].getAttribute("id");
+ String content = element.getAttribute("content");
+ String id = element.getAttribute("id");
/*
* First do the intro XML files.
@@ -102,13 +103,13 @@ public class IntroModelSerializerTest extends TestCase {
* Now do the intro XHTML files. Find all the XHTML files
* referenced from the model.
*/
- Map map = getXHTMLFiles(model);
- Iterator iter = map.entrySet().iterator();
+ Map<String, String> map = getXHTMLFiles(model);
+ Iterator<Map.Entry<String, String>> iter = map.entrySet().iterator();
while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry)iter.next();
+ Map.Entry<String, String> entry = iter.next();
file = FileUtil.getResultFile(pluginRoot + entry.getKey());
out = new PrintWriter(new FileOutputStream(file));
- out.print((String)entry.getValue());
+ out.print(entry.getValue());
out.close();
}
}
@@ -121,18 +122,17 @@ public class IntroModelSerializerTest extends TestCase {
* mapping of filenames relative to the test plugin to Strings, the
* contents of the XHTML files.
*/
- @SuppressWarnings("unchecked")
- public static Map getXHTMLFiles(IntroModelRoot model) {
- Map map = new HashMap();
+ public static Map<String, String> getXHTMLFiles(IntroModelRoot model) {
+ Map<String, String> map = new HashMap<String, String>();
Collection<AbstractIntroPage> pages = new ArrayList<AbstractIntroPage>();
IntroHomePage home = model.getRootPage();
if (home.isXHTMLPage()) {
pages.add(home);
}
IntroPage[] otherPages = model.getPages();
- for (int i=0;i<otherPages.length;++i) {
- if (otherPages[i].isXHTMLPage()) {
- pages.add(otherPages[i]);
+ for (IntroPage otherPage : otherPages) {
+ if (otherPage.isXHTMLPage()) {
+ pages.add(otherPage);
}
}
Iterator<AbstractIntroPage> iter = pages.iterator();
@@ -140,6 +140,7 @@ public class IntroModelSerializerTest extends TestCase {
AbstractIntroPage page = iter.next();
BrowserIntroPartImplementation impl = new BrowserIntroPartImplementation();
String xhtml = impl.generateXHTMLPage(page, new IIntroContentProviderSite() {
+ @Override
public void reflow(IIntroContentProvider provider, boolean incremental) {
// dummy site
}

Back to the top