org.eclipse.xtext.testing.GlobalRegistries Java Examples

The following examples show how to use org.eclipse.xtext.testing.GlobalRegistries. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractPortableURIsTest.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
	globalStateMemento = GlobalRegistries.makeCopyOfGlobalState();
	EPackage.Registry.INSTANCE.put(XMLTypePackage.eNS_URI, XMLTypePackage.eINSTANCE);
	resourceSet = new XtextResourceSet();
	resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
	resourceSet.getPackageRegistry().put(GenModelPackage.eNS_URI, GenModelPackage.eINSTANCE);
	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("genmodel", new EcoreResourceFactoryImpl());
	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
	resourceSet.getURIConverter().getURIMap().put(URI.createPlatformPluginURI("org.eclipse.xtext/", false), URI.createURI("classpath:/"));
	resourceSet.getURIConverter().getURIMap().put(URI.createPlatformPluginURI("org.eclipse.xtext.xbase/", false), URI.createURI("classpath:/"));
	resourceSet.getURIConverter().getURIMap().put(URI.createPlatformPluginURI("org.eclipse.xtext.common.types/", false), URI.createURI("classpath:/"));
	resourceSet.getURIConverter().getURIMap().put(URI.createPlatformResourceURI("org.eclipse.emf.ecore/", false), URI.createURI("classpath:/"));
	resourceSet.getURIConverter().getURIMap().put(URI.createPlatformResourceURI("org.eclipse.xtext.xbase/", false), URI.createURI("classpath:/"));
	resourceSet.getURIConverter().getURIMap().put(URI.createPlatformResourceURI("org.eclipse.xtext.common.types/", false), URI.createURI("classpath:/"));
	resourceSet.getLoadOptions().put(XMLResource.OPTION_URI_HANDLER, this);
	resourceSet.setClasspathURIContext(getClasspathURIContext());
}
 
Example #2
Source File: ParametersTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #3
Source File: Bug286935TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #4
Source File: Bug347012TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #5
Source File: Bug307519TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #6
Source File: UnorderedGroupsTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #7
Source File: ContentAssistCustomizingTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #8
Source File: RefactoringTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #9
Source File: Bug332217TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #10
Source File: Bug286935TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #11
Source File: ContentAssistContextTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #12
Source File: Bug288734TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #13
Source File: TwoContextsTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #14
Source File: Bug287941TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #15
Source File: TwoParametersTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #16
Source File: Bug288734TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #17
Source File: GH341TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #18
Source File: SingleCodetemplateInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #19
Source File: NoParametersTestLanguageInjectorProvider.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #20
Source File: OutlineTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #21
Source File: Bug377311TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #22
Source File: ImportUriUiTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #23
Source File: QuickfixCrossrefTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #24
Source File: TestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #25
Source File: ParametersTestLanguageInjectorProvider.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #26
Source File: IndentationAwareUiTestLanguageInjectorProvider.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #27
Source File: UnorderedGroupsTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #28
Source File: ReferenceGrammarUiTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setupRegistry() {
	stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	if (injector == null) {
		getInjector();
	}
	stateAfterInjectorCreation.restoreGlobalState();
}
 
Example #29
Source File: ReferenceGrammarUiTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}
 
Example #30
Source File: DomainModelTestLanguageInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Injector getInjector() {
	if (injector == null) {
		this.injector = internalCreateInjector();
		stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
	}
	return injector;
}