use of org.eclipse.mylyn.internal.wikitext.MockMarkupLanguage 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.internal.wikitext.MockMarkupLanguage in project mylyn.docs by eclipse.
the class ServiceLocatorTest method assertKnownMarkupLanguage.
protected void assertKnownMarkupLanguage() {
MarkupLanguage markupLanguage = locator.getMarkupLanguage(MockMarkupLanguage.class.getSimpleName());
assertNotNull(markupLanguage);
assertEquals(new MockMarkupLanguage().getName(), markupLanguage.getName());
}
use of org.eclipse.mylyn.internal.wikitext.MockMarkupLanguage 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