use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateNamedParameter_EmptyDefaultValue.
public void testBasicTemplateNamedParameter_EmptyDefaultValue() {
Template template = new Template();
template.setName("test");
template.setTemplateMarkup("_expanded{{{message|}}}_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{test}} two");
assertEquals("one _expanded_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplatePositionalParameter_DefaultValue.
public void testBasicTemplatePositionalParameter_DefaultValue() {
Template template = new Template();
template.setName("test");
template.setTemplateMarkup("_expanded{{{1|first}}}and{{{2|second}}}_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{test}} two");
assertEquals("one _expandedfirstandsecond_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateExcludedWithWildcards.
public void testBasicTemplateExcludedWithWildcards() {
Template template = new Template();
template.setName("Foo:test");
template.setTemplateMarkup("_expanded_");
markupLanguage.getTemplates().add(template);
markupLanguage.setTemplateExcludes("boo, baz, *test*");
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{Foo:test}} two");
assertEquals("one two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateWithBrackets.
public void testBasicTemplateWithBrackets() {
// Bug 468237
Template template = new Template();
template.setName("Templ(a)te");
template.setTemplateMarkup("_expanded_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{Templ(a)te}} two");
assertEquals("one _expanded_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateDidgitInTheName.
public void testBasicTemplateDidgitInTheName() {
// Bug 380052
Template template = new Template();
template.setName("1stTest");
template.setTemplateMarkup("first test");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("This is a {{1stTest}}.");
assertEquals("This is a first test.", markup);
}
Aggregations