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/help
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/help')
-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
109 files changed, 556 insertions, 222 deletions
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);

Back to the top