use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateNamedParameterMultiple.
public void testBasicTemplateNamedParameterMultiple() {
Template template = new Template();
template.setName("test");
template.setTemplateMarkup("_expanded{{{message}}}and{{{message2}}}_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{test|message=foo bar|message2=baz}} two");
assertEquals("one _expandedfoo barandbaz_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateDidgitInTheName2.
public void testBasicTemplateDidgitInTheName2() {
// Bug 380052
Template template = new Template();
template.setName("Item2");
template.setTemplateMarkup("second item");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("This is the {{Item2}}.");
assertEquals("This is the second item.", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testTemplateRepeated.
public void testTemplateRepeated() {
Template template = new Template();
template.setName("test");
template.setTemplateMarkup("_expanded_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{test}} two {{test}}");
assertEquals("one _expanded_ two _expanded_", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateExcluded2.
public void testBasicTemplateExcluded2() {
Template template = new Template();
template.setName("testBar");
template.setTemplateMarkup("_expanded_");
markupLanguage.getTemplates().add(template);
markupLanguage.setTemplateExcludes("boo, baz, test*");
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{testBar}} two");
assertEquals("one two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateNamedParameter.
public void testBasicTemplateNamedParameter() {
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|message=foo bar}} two");
assertEquals("one _expandedfoo bar_ two", markup);
}
Aggregations