Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 09d9bfe1a0a32c929edc88df988b2f79b183f336 (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
50
51
52
53
/*******************************************************************************
 * Copyright (c) 2015 Max Rydahl Andersen 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:
 *     Max Rydahl Andersen- initial API and implementation
 *******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.asciidoc.tests;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.eclipse.jface.text.templates.Template;
import org.eclipse.mylyn.internal.wikitext.ui.WikiTextUiPlugin;
import org.eclipse.mylyn.internal.wikitext.ui.editor.assist.Templates;
import org.eclipse.mylyn.wikitext.asciidoc.AsciiDocLanguage;
import org.junit.Before;
import org.junit.Test;

/**
 * Basic test for templates being present and resolving correctly.
 *
 * @author Max Rydahl Andersen
 */
@SuppressWarnings("restriction")
public class AsciiDocTemplateResolverTest {

	private Templates templates;

	@Before
	public void setUp() throws Exception {
		templates = WikiTextUiPlugin.getDefault().getTemplates().get(new AsciiDocLanguage().getName());
	}

	@Test
	public void hasTemplates() {
		assertTrue("Should have non-zero templates", templates.getTemplate().size() != 0);
	}

	@Test
	public void hasNoUnresolvedNLSStrings() {

		for (Template template : templates.getTemplate()) {
			assertFalse(template.getName() + " with " + template.getDescription() + " has unresolved NLS string",
					template.getDescription().startsWith("%"));
		}

	}
}

Back to the top