public ContentAssistProcessorTestBuilder(ISetup setupClazz, AbstractXtextTests tests) throws Exception { tests.with(setupClazz); injector = tests.getInjector(); this.loadHelper = tests; }
@Override protected void after() { if (folder != null) { delete(); folder = null; initialized = false; } }
/** * Delete all files and folders under the temporary folder. * Usually not called directly, since it is automatically applied * by the {@link Rule} */ public void delete() { recursiveDelete(folder); }
protected final ICompositeNode getRootNode(InputStream model) throws Exception { XtextResource resource = getResource(model); return getRootNode(resource); }
protected final XtextResource getResourceFromString(String model) throws Exception { return getResource(getAsStream(model)); }
protected final ICompositeNode getRootNodeAndExpect(InputStream model, int errors) throws Exception { XtextResource resource = getResourceAndExpect(model, errors); return getRootNode(resource); }
public final EObject getModel(InputStream model) throws Exception { XtextResource resource = getResource(model); return getModel(resource); }
public final EObject getModelAndExpect(InputStream model, int errors) throws Exception { XtextResource resource = getResourceAndExpect(model, errors); return getModel(resource); }
protected final ICompositeNode getRootNode(String model) throws Exception { return getRootNode(getAsStream(model)); }
protected final ICompositeNode getRootNodeAndExpect(String model, int errors) throws Exception { return getRootNodeAndExpect(getAsStream(model), errors); }
public EObject getModel(String model) throws Exception { return getModel(getAsStream(model)); }
public final EObject getModelAndExpect(String model, int errors) throws Exception { return getModelAndExpect(getAsStream(model), errors); }
protected final XtextResource getResourceFromStringAndExpect(String model, int errors) throws Exception { return getResourceAndExpect(getAsStream(model), errors); }
@Override public void restoreRegistry() { stateBeforeInjectorCreation.restoreGlobalState(); }
@Override public Statement apply(Statement base, Description description) { Flaky flaky = description.getAnnotation(Flaky.class); if (flaky == null) { return base; } int trials = flaky.trials(); return new RepeatedStatement(base, trials); }
protected final ICompositeNode getRootNode(InputStream model) throws Exception { XtextResource resource = getResource(model); return getRootNode(resource); }
protected final XtextResource getResourceFromString(String model) throws Exception { return getResource(getAsStream(model)); }
protected final ICompositeNode getRootNodeAndExpect(InputStream model, int errors) throws Exception { XtextResource resource = getResourceAndExpect(model, errors); return getRootNode(resource); }
@Override public void setupRegistry() { stateAfterInjectorCreation.restoreGlobalState(); }
@Override public void restoreRegistry() { stateBeforeInjectorCreation.restoreGlobalState(); }