use of org.eclipse.xtext.tasks.PreferenceTaskTagProvider in project xtext-core by eclipse.
the class PreferenceTaskTagProviderTest method test.
@Test
public void test() {
TaskTag _taskTag = new TaskTag();
final Procedure1<TaskTag> _function = (TaskTag it) -> {
it.setName("Foo");
it.setPriority(Priority.LOW);
};
TaskTag _doubleArrow = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag, _function);
TaskTag _taskTag_1 = new TaskTag();
final Procedure1<TaskTag> _function_1 = (TaskTag it) -> {
it.setName("BAR");
it.setPriority(Priority.NORMAL);
};
TaskTag _doubleArrow_1 = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag_1, _function_1);
TaskTag _taskTag_2 = new TaskTag();
final Procedure1<TaskTag> _function_2 = (TaskTag it) -> {
it.setName("baZ");
it.setPriority(Priority.HIGH);
};
TaskTag _doubleArrow_2 = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag_2, _function_2);
final List<TaskTag> tags = Collections.<TaskTag>unmodifiableList(CollectionLiterals.<TaskTag>newArrayList(_doubleArrow, _doubleArrow_1, _doubleArrow_2));
final String names = PreferenceTaskTagProvider.serializeTags(tags);
final String prios = PreferenceTaskTagProvider.serializePriorities(tags);
final IPreferenceValuesProvider.SingletonPreferenceValuesProvider valueProvider = new IPreferenceValuesProvider.SingletonPreferenceValuesProvider();
final MapBasedPreferenceValues values = valueProvider.getPreferenceValues(null);
values.put(PreferenceTaskTagProvider.TAGS_KEY.getId(), names);
values.put(PreferenceTaskTagProvider.PRIORITIES_KEY.getId(), prios);
values.put(PreferenceTaskTagProvider.CASE_SENSITIVE_KEY.getId(), "false");
final PreferenceTaskTagProvider tagProvider = new PreferenceTaskTagProvider();
tagProvider.setPreferenceValuesProvider(valueProvider);
final TaskTags parsedTags = tagProvider.getTaskTags(null);
Assert.assertEquals(Boolean.valueOf(false), Boolean.valueOf(parsedTags.isCaseSensitive()));
Assert.assertEquals(tags.size(), IterableExtensions.size(parsedTags));
int _size = tags.size();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
for (final Integer i : _doubleDotLessThan) {
TaskAssert.assertExactMatch(tags.get((i).intValue()), ((TaskTag[]) Conversions.unwrapArray(parsedTags, TaskTag.class))[(i).intValue()]);
}
}
Aggregations