use of org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguageProvider in project mylyn.docs by eclipse.
the class MarkupLanguageProviderTest method getMarkupLanguagesNullName.
@Test
public void getMarkupLanguagesNullName() {
MarkupLanguageProvider provider = new MarkupLanguageProvider() {
@Override
protected Set<MarkupLanguage> loadMarkupLanguages() {
MockMarkupLanguage language = new MockMarkupLanguage();
language.setName(null);
return ImmutableSet.<MarkupLanguage>of(language);
}
};
thrown.expect(NullPointerException.class);
thrown.expectMessage("Provided languages must have a name");
provider.getMarkupLanguages();
}
use of org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguageProvider in project mylyn.docs by eclipse.
the class MarkupLanguageProviderTest method getMarkupLanguages.
@Test
public void getMarkupLanguages() {
MarkupLanguageProvider provider = new TestLanguageProvider();
assertNotNull(provider.getMarkupLanguages());
assertEquals(1, provider.getMarkupLanguages().size());
assertEquals("Test", provider.getMarkupLanguages().iterator().next().getName());
}
use of org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguageProvider in project mylyn.docs by eclipse.
the class MarkupLanguageProviderTest method getMarkupLanguagesNull.
@Test
public void getMarkupLanguagesNull() {
MarkupLanguageProvider provider = new MarkupLanguageProvider() {
@Override
protected Set<MarkupLanguage> loadMarkupLanguages() {
return null;
}
};
thrown.expect(NullPointerException.class);
thrown.expectMessage("loadMarkupLanguages() must not return null");
provider.getMarkupLanguages();
}
use of org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguageProvider in project mylyn.docs by eclipse.
the class MarkupLanguageProviderTest method getMarkupLanguagesDuplicatedNames.
@Test
public void getMarkupLanguagesDuplicatedNames() {
MarkupLanguageProvider provider = new MarkupLanguageProvider() {
@Override
protected Set<MarkupLanguage> loadMarkupLanguages() {
return ImmutableSet.<MarkupLanguage>of(new MockMarkupLanguage("Test"), new MockMarkupLanguage("Test"));
}
};
thrown.expect(IllegalStateException.class);
thrown.expectMessage("Language name 'Test' must not be provided more than once");
provider.getMarkupLanguages();
}
Aggregations