use of org.eclipse.xtext.ui.editor.ValidationJobScheduler in project xtext-eclipse by eclipse.
the class ValidationJobSchedulerTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
referenceDescriptions = Lists.newArrayList();
dirtyStateManager = new DirtyStateManager();
testMe = new ValidationJobScheduler();
testMe.setDirtyStateManager(dirtyStateManager);
testMe.setDescriptionUtils(new DescriptionUtils());
testMe.setResourceDescriptions(this);
testMe.setResourceDescriptionManager(new DefaultResourceDescriptionManager());
DocumentTokenSource nullSource = new DocumentTokenSource() {
@Override
protected IRegion computeDamageRegion(DocumentEvent e) {
return new Region(0, 0);
}
};
document = new XtextDocument(nullSource, null, outdatedStateManager, operationCanceledManager) {
@Override
public URI getResourceURI() {
return documentURI;
}
@Override
public void checkAndUpdateAnnotations() {
validationScheduled = true;
}
};
documentResource = new TestableDocumentResource();
targetResource = new AbstractResourceDescription() {
@Override
public URI getURI() {
return targetURI;
}
@Override
public Iterable<IReferenceDescription> getReferenceDescriptions() {
throw new UnsupportedOperationException();
}
@Override
public Iterable<QualifiedName> getImportedNames() {
throw new UnsupportedOperationException();
}
@Override
protected List<IEObjectDescription> computeExportedObjects() {
if (documentResource.importedName == null)
throw new UnsupportedOperationException();
return Collections.emptyList();
}
};
}
Aggregations