use of org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider in project xtext-eclipse by eclipse.
the class XtextResourceSetBasedProjectProviderTest method setUp.
@Before
public void setUp() throws Exception {
resourceSet = new XtextResourceSet();
mockProjectProvider = new MockJavaProjectProvider();
resourceSet.setClasspathURIContext(mockProjectProvider.getJavaProject(null));
projectProvider = new XtextResourceSetBasedProjectProvider();
}
use of org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider in project xtext-eclipse by eclipse.
the class JdtBasedConstructorScopeTest method setUp.
@Before
public void setUp() throws Exception {
projectProvider = new MockJavaProjectProvider();
factory = new JdtTypeProviderFactory(projectProvider);
resourceSet = new ResourceSetImpl();
typeScope = new JdtBasedSimpleTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(), Predicates.<IEObjectDescription>alwaysTrue());
constructorScope = new JdtBasedConstructorScope(typeScope);
}
use of org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider in project xtext-eclipse by eclipse.
the class JdtBasedSimpleTypeScopeProviderTest method setUp.
@Before
public void setUp() throws Exception {
projectProvider = new MockJavaProjectProvider();
factory = new JdtTypeProviderFactory(projectProvider);
IQualifiedNameConverter qualifiedNameConverter = new IQualifiedNameConverter.DefaultImpl();
scopeProvider = new JdtBasedSimpleTypeScopeProvider(factory, qualifiedNameConverter);
resourceSet = new ResourceSetImpl();
resource = new ResourceImpl();
resource.setURI(URI.createURI("http://does/not/exist.file"));
emptyResource = new ResourceImpl();
emptyResource.setURI(URI.createURI("http://does/not/exist.file2"));
resourceSet.getResources().add(emptyResource);
resourceSet.getResources().add(resource);
field = TypesFactory.eINSTANCE.createJvmField();
resource.getContents().add(field);
}
use of org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider in project xtext-eclipse by eclipse.
the class JdtBasedSimpleTypeScopeTest method setUp.
@Before
public void setUp() throws Exception {
projectProvider = new MockJavaProjectProvider();
factory = new JdtTypeProviderFactory(projectProvider);
resourceSet = new ResourceSetImpl();
typeScope = new JdtBasedSimpleTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(), Predicates.<IEObjectDescription>alwaysTrue());
}
use of org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider in project xtext-eclipse by eclipse.
the class TypeResourceUnloaderTest method setUp.
@Before
public void setUp() throws Exception {
eventBroker = AbstractActivator.getInstance().getInjector(DUMMY_LANG_NAME).getInstance(IStateChangeEventBroker.class);
projectProvider = new MockJavaProjectProvider();
projectProvider.setUseSource(true);
project = projectProvider.getJavaProject(null);
type = project.findType(NESTED_TYPES);
compilationUnit = type.getCompilationUnit();
compilationUnit.becomeWorkingCopy(null);
// wait until the BackgroundThread for the reconciler was started
editor = waitForElementChangedEvent(new Callable<IEditorPart>() {
@Override
public IEditorPart call() throws Exception {
return JavaUI.openInEditor(compilationUnit);
}
}, true);
eventBroker.addListener(this);
document = getDocument();
originalContent = document.get();
subsequentEvents = Lists.newArrayList();
}
Aggregations