Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: afdf61675eeac97fa0114785d9f916de0525e34b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*******************************************************************************
 * 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
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ua.tests.help.toc;

import java.util.List;

import junit.framework.TestCase;

import org.eclipse.help.internal.util.ProductPreferences;

public class HelpData extends TestCase {

	public void testHelpDataInPlugin() {
		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<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<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<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));
	}
	
}

Back to the top