diff options
author | Chris Goldthorpe | 2009-05-02 18:39:57 +0000 |
---|---|---|
committer | Chris Goldthorpe | 2009-05-02 18:39:57 +0000 |
commit | 6509fd7726c200a7df3be79914b90426cc7f533c (patch) | |
tree | 29e9c6b2556b31222e14fdea1e107c56425926ab /org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc | |
parent | 70b7118617ac1b20c129e395a57e890ee3c4d3d7 (diff) | |
download | eclipse.platform.ua-6509fd7726c200a7df3be79914b90426cc7f533c.tar.gz eclipse.platform.ua-6509fd7726c200a7df3be79914b90426cc7f533c.tar.xz eclipse.platform.ua-6509fd7726c200a7df3be79914b90426cc7f533c.zip |
Bug 274377 [Test] Add test to verify that search index exists for the 5 doc plugins
Diffstat (limited to 'org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc')
-rw-r--r-- | org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/AllTocTests.java | 3 | ||||
-rw-r--r-- | org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/PrebuiltIndexChecker.java | 70 |
2 files changed, 72 insertions, 1 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/AllTocTests.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/AllTocTests.java index 4e330fbda..7f0915497 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/AllTocTests.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/AllTocTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 2008 IBM Corporation and others. + * Copyright (c) 2006, 2009 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,5 +38,6 @@ public class AllTocTests extends TestSuite { addTestSuite(TocIconPathTest.class); addTestSuite(TocProviderTest.class); addTestSuite(HelpData.class); + addTestSuite(PrebuiltIndexChecker.class); } } diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/PrebuiltIndexChecker.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/PrebuiltIndexChecker.java new file mode 100644 index 000000000..d92a21d79 --- /dev/null +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/PrebuiltIndexChecker.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2009 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.ua.tests.help.toc; + +import java.net.URL; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; + +public class PrebuiltIndexChecker extends TestCase { + + private static final String PLATFORM_USER = "org.eclipse.platform.doc.user"; + private static final String PLATFORM_ISV = "org.eclipse.platform.doc.isv"; + private static final String PDE_USER = "org.eclipse.pde.doc.user"; + private static final String JDT_USER = "org.eclipse.jdt.doc.user"; + private static final String JDT_ISV = "org.eclipse.jdt.doc.isv"; + + public static Test suite() { + return new TestSuite(PrebuiltIndexChecker.class); + } + + public void testPlatformUser() throws Exception { + validateIndex(PLATFORM_USER, "index"); + } + + public void testPlatformIsv() throws Exception { + validateIndex(PLATFORM_ISV, "index"); + } + + public void testPdeUser() throws Exception { + validateIndex(PDE_USER, "index"); + } + + public void testJdtUser() throws Exception { + validateIndex(JDT_USER, "index"); + } + + public void testJdtIsv() throws Exception { + validateIndex(JDT_ISV, "index"); + } + + private void validateIndex(String plugin, String filepath) { + Bundle bundle = Platform.getBundle(plugin); + assertNotNull(bundle); + + String[] suffixes = { "", "/indexed_contributions", "/indexed_docs", "/indexed_dependencies" }; + for (int i = 0; i < suffixes.length; i++) { + String fullPath = filepath + suffixes[i]; + IPath path = new Path(fullPath); + URL url = FileLocator.find(bundle, path, null); + assertNotNull("could not open: " + fullPath, url); + } + } + +} |