Search in sources :

Example 1 with RichTextEndValueConverter

use of org.eclipse.xtend.core.conversion.RichTextEndValueConverter in project xtext-xtend by eclipse.

the class RichTextValueConverterTest method doTestIncompleteRichStringEnd.

protected void doTestIncompleteRichStringEnd(String text, String expectation) {
    RichTextEndValueConverter converter = get(RichTextEndValueConverter.class);
    try {
        converter.toValue(text, null);
        fail("Expected ValueConverterWithValueException");
    } catch (ValueConverterWithValueException e) {
        String value = (String) e.getValue();
        assertEquals(expectation, value);
    }
}
Also used : ValueConverterWithValueException(org.eclipse.xtext.conversion.ValueConverterWithValueException) CommentRichTextEndValueConverter(org.eclipse.xtend.core.conversion.CommentRichTextEndValueConverter) RichTextEndValueConverter(org.eclipse.xtend.core.conversion.RichTextEndValueConverter)

Example 2 with RichTextEndValueConverter

use of org.eclipse.xtend.core.conversion.RichTextEndValueConverter in project xtext-xtend by eclipse.

the class RichTextValueConverterTest method testRichTextEnd.

@Test
public void testRichTextEnd() {
    String text = "�foobar   '''";
    String expectation = "foobar   ";
    RichTextEndValueConverter converter = get(RichTextEndValueConverter.class);
    String value = converter.toValue(text, null);
    assertEquals(expectation, value);
}
Also used : CommentRichTextEndValueConverter(org.eclipse.xtend.core.conversion.CommentRichTextEndValueConverter) RichTextEndValueConverter(org.eclipse.xtend.core.conversion.RichTextEndValueConverter) Test(org.junit.Test)

Aggregations

CommentRichTextEndValueConverter (org.eclipse.xtend.core.conversion.CommentRichTextEndValueConverter)2 RichTextEndValueConverter (org.eclipse.xtend.core.conversion.RichTextEndValueConverter)2 ValueConverterWithValueException (org.eclipse.xtext.conversion.ValueConverterWithValueException)1 Test (org.junit.Test)1