use of org.eclipse.emf.mwe.core.WorkflowContext in project xtext-core by eclipse.
the class AbstractReaderTest method testLoadByType_withNsURI.
@SuppressWarnings("unchecked")
@Test
public void testLoadByType_withNsURI() throws Exception {
Reader reader = getReader();
reader.addPath(pathTo("emptyFolder"));
reader.addPath(pathTo("nonemptyFolder"));
reader.addRegister(new IndexTestLanguageStandaloneSetup());
SlotEntry entry = createSlotEntry();
entry.setType("Entity");
entry.setNsURI(IndexTestLanguagePackage.eNS_URI);
reader.addLoad(entry);
WorkflowContext ctx = ctx();
reader.invoke(ctx, monitor(), issues());
List<Entity> entities = (List<Entity>) ctx.get("model");
assertEquals(2, entities.size());
}
use of org.eclipse.emf.mwe.core.WorkflowContext in project xtext-core by eclipse.
the class AbstractReaderTest method testLoadBySuperType.
@SuppressWarnings("unchecked")
@Test
public void testLoadBySuperType() throws Exception {
Reader reader = getReader();
reader.addPath(pathTo("emptyFolder"));
reader.addPath(pathTo("nonemptyFolder"));
reader.addRegister(new IndexTestLanguageStandaloneSetup());
SlotEntry entry = createSlotEntry();
entry.setType("Type");
reader.addLoad(entry);
WorkflowContext ctx = ctx();
reader.invoke(ctx, monitor(), issues());
List<Entity> entities = (List<Entity>) ctx.get("model");
assertEquals(3, entities.size());
}
use of org.eclipse.emf.mwe.core.WorkflowContext in project xtext-core by eclipse.
the class AbstractReaderTest method testLoadByType.
@SuppressWarnings("unchecked")
@Test
public void testLoadByType() throws Exception {
Reader reader = getReader();
reader.addPath(pathTo("emptyFolder"));
reader.addPath(pathTo("nonemptyFolder"));
reader.addRegister(new IndexTestLanguageStandaloneSetup());
SlotEntry entry = createSlotEntry();
entry.setType("Entity");
reader.addLoad(entry);
WorkflowContext ctx = ctx();
reader.invoke(ctx, monitor(), issues());
List<Entity> entities = (List<Entity>) ctx.get("model");
assertEquals(2, entities.size());
}
use of org.eclipse.emf.mwe.core.WorkflowContext in project xtext-core by eclipse.
the class AbstractReaderTest method testLoadByType_withUnkownNsURI.
@Test
public void testLoadByType_withUnkownNsURI() throws Exception {
Reader reader = getReader();
reader.addPath(pathTo("emptyFolder"));
reader.addPath(pathTo("nonemptyFolder"));
reader.addRegister(new IndexTestLanguageStandaloneSetup());
SlotEntry entry = createSlotEntry();
entry.setType("Entity");
entry.setNsURI("unknown ns uri");
reader.addLoad(entry);
WorkflowContext ctx = ctx();
try {
reader.invoke(ctx, monitor(), issues());
fail("workflow interuption expected.");
} catch (WorkflowInterruptedException e) {
// expected
}
}
use of org.eclipse.emf.mwe.core.WorkflowContext in project xtext-core by eclipse.
the class AbstractReaderTest method testLoadByType_FirstOnly.
@Test
public void testLoadByType_FirstOnly() throws Exception {
Reader reader = getReader();
reader.addPath(pathTo("emptyFolder"));
reader.addPath(pathTo("nonemptyFolder"));
reader.addRegister(new IndexTestLanguageStandaloneSetup());
SlotEntry entry = createSlotEntry();
entry.setType("Entity");
entry.setFirstOnly(true);
reader.addLoad(entry);
WorkflowContext ctx = ctx();
reader.invoke(ctx, monitor(), issues());
assertEquals("Person", ((Entity) ctx.get("model")).getName());
}
Aggregations