Java 类org.eclipse.xtext.testing.GlobalRegistries 实例源码

项目:xtext-extras    文件:AbstractPortableURIsTest.java   
@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());
}
项目:xtext-core    文件:SrcSegmentsInUrisAreNotRemovedTests.java   
@Before
public void setUp() throws Exception {
    globalStateMemento = GlobalRegistries.makeCopyOfGlobalState();
    EPackage.Registry.INSTANCE.put(XMLTypePackage.eNS_URI, XMLTypePackage.eINSTANCE);
    EcoreResourceFactoryImpl resFactory = new EcoreResourceFactoryImpl();
    set.getResourceFactoryRegistry().getExtensionToFactoryMap()
            .put("ecore", resFactory);

    aRes = (XMIResource) set.createResource(URI.createPlatformResourceURI(
            "/myProject/main/src/some/package/a.ecore", true));
    InputStream stream = new ByteArrayInputStream(
            aResContent.getBytes("US-ASCII"));
    aRes.load(stream, set.getLoadOptions());
    stream.close();

    bRes = (XMIResource) set.createResource(URI.createPlatformResourceURI(
            "/myProject/model/b.ecore", true));

    stream = new ByteArrayInputStream(
            bResContent.getBytes("US-ASCII"));
    bRes.load(stream, set.getLoadOptions());
    stream.close();

}
项目:pokemon-tcgo-deck-generator    文件:PkmntcgoInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:n4js    文件:N4JSInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        try {
            this.injector = internalCreateInjector();

        } catch (Throwable e) {
            // #############################################################################
            // IDE-2514: Temporarily exists on exception due to PolymorphicDispatcher problem
            boolean polymorphicDispatchProblem = false;
            if (e.getMessage().contains("Comparison method violates its general contract!")) {
                String pdName = PolymorphicDispatcher.class.getName();
                for (StackTraceElement ste : e.getStackTrace()) {
                    String steName = ste.toString();
                    if (steName.contains(pdName)) {
                        polymorphicDispatchProblem = true;
                    }
                }
            }

            if (polymorphicDispatchProblem) {
                String msg = "Comparison method violates its general contract!\n\t";
                msg += "at org.eclipse.n4js.N4JSInjectorProvider.getInjector(N4JSInjectorProvider.java:90)\\n\\t";
                msg += "Reason might be the PolymorphicDispatcher";
                msg += "Exit.";
                System.err.println(msg);
                System.exit(-1);
            } else {
                throw e;
            }
            // Fail fast End
            // #############################################################################
        }
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:n4js    文件:N4MFInjectorProvider.java   
@Override
public Injector getInjector()
{
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:n4js    文件:RegularExpressionInjectorProvider.java   
@Override
public Injector getInjector()
{
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:n4js    文件:TypesInjectorProvider.java   
@Override
public Injector getInjector()
{
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:bromium    文件:BromiumInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:gw4e.project    文件:DSLPoliciesInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:OCCI-Studio    文件:OCCIInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:PureXbaseInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:RefactoringTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:StandaloneBuilderInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:XbaseInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:XbaseWithAnnotationsInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:Bug462047LangInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:XImportSectionTestLangInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:ContentAssistFragmentTestLangInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:URIHandlerTestInjectorProvider.java   
@Override
public Injector getInjector()
{
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:AbstractPortableURIsTest.java   
@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.createPlatformResourceURI("org.eclipse.emf.ecore/", false), URI.createURI("classpath:/"));
    resourceSet.getLoadOptions().put(XMLResource.OPTION_URI_HANDLER, this);
}
项目:xtext-extras    文件:XtextInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = new XtextStandaloneSetup().createInjectorAndDoEMFRegistration();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-extras    文件:AbstractURIHandlerTest.java   
@Before
public void setUp() {
  this.globalState = GlobalRegistries.makeCopyOfGlobalState();
  EPackage.Registry.INSTANCE.put(XMLTypePackage.eNS_URI, XMLTypePackage.eINSTANCE);
  this.resourceSet = this.getNewResourceSet();
  this.primaryResource = this.resourceSet.createResource(this.getResourceURI());
  this.referencedResource = this.resourceSet.createResource(this.getReferencedURI());
}
项目:xtext-core    文件:PartialContentAssistTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:TestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:IndentationAwareUiTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:PartialSerializationTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:WrappingInjectorProvider.java   
public WrappingInjectorProvider(IInjectorProvider delegate) {
    this.delegate = delegate;
    stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    this.injector = createInjector();
    if (delegate instanceof IRegistryConfigurator) {
        ((IRegistryConfigurator) delegate).setupRegistry();
    }
    registerFactory(injector);
    stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    if (delegate instanceof IRegistryConfigurator) {
        ((IRegistryConfigurator) delegate).restoreRegistry();
    }
}
项目:xtext-core    文件:FileAwareTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:XtextGrammarTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:FragmentTestLanguageExInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:FragmentTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:TwoParametersTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:ParametersTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:ParametersTestLanguageExInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:NoParametersTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:IndentationAwareTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:SequencerTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:RegionAccessTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:FormatterTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}
项目:xtext-core    文件:LazyLinkingTestLanguageInjectorProvider.java   
@Override
public Injector getInjector() {
    if (injector == null) {
        stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
        this.injector = internalCreateInjector();
        stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
    }
    return injector;
}