Search in sources :

Example 1 with TestExplanation1

use of eu.esdihumboldt.hale.common.align.model.impl.mdexpl.test.TestExplanation1 in project hale by halestudio.

the class MarkdownCellExplanationTest method testTemplate.

/**
 * Test if different templates for different languages are retrieved
 * properly.
 */
@Test
public void testTemplate() {
    TestExplanation1 exp = new TestExplanation1();
    Optional<Template> english = exp.getTemplate(TestExplanation1.class, Locale.ENGLISH);
    assertTrue(english.isPresent());
    assertEquals("I'm an English man", english.get().make().toString());
    Optional<Template> german = exp.getTemplate(TestExplanation1.class, Locale.GERMAN);
    assertTrue(german.isPresent());
    assertEquals("Ich bin Deutscher", german.get().make().toString());
    Optional<Template> germany = exp.getTemplate(TestExplanation1.class, Locale.GERMANY);
    assertTrue(germany.isPresent());
    assertEquals("Ich bin Deutscher", germany.get().make().toString());
}
Also used : TestExplanation1(eu.esdihumboldt.hale.common.align.model.impl.mdexpl.test.TestExplanation1) Template(groovy.text.Template) Test(org.junit.Test)

Example 2 with TestExplanation1

use of eu.esdihumboldt.hale.common.align.model.impl.mdexpl.test.TestExplanation1 in project hale by halestudio.

the class MarkdownCellExplanationTest method testLocales1.

@Test
public void testLocales1() {
    TestExplanation1 exp = new TestExplanation1();
    Set<Locale> locales = new HashSet<>();
    Iterables.addAll(locales, exp.getSupportedLocales());
    assertTrue(locales.contains(Locale.ENGLISH));
    assertTrue(locales.contains(Locale.GERMAN));
    assertEquals(2, locales.size());
}
Also used : Locale(java.util.Locale) TestExplanation1(eu.esdihumboldt.hale.common.align.model.impl.mdexpl.test.TestExplanation1) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

TestExplanation1 (eu.esdihumboldt.hale.common.align.model.impl.mdexpl.test.TestExplanation1)2 Test (org.junit.Test)2 Template (groovy.text.Template)1 HashSet (java.util.HashSet)1 Locale (java.util.Locale)1