mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
Allow to set the class loader for the grammar provider.
This commit is contained in:
parent
6a8ea1a411
commit
730eb96464
2 changed files with 11 additions and 3 deletions
|
@ -74,4 +74,14 @@ public class GrammarProvider {
|
|||
}
|
||||
return grammar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Public for testing purpose.
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
* @since 2.9
|
||||
*/
|
||||
public void setClassLoader(ClassLoader classLoader) {
|
||||
this.classLoader = classLoader;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,6 @@ public class XtextSerializerTest extends AbstractXtextTests {
|
|||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
// StandaloneSetup standaloneSetup = new StandaloneSetup();
|
||||
// standaloneSetup.setIgnoreBrokenProjectFiles(true);
|
||||
// standaloneSetup.setPlatformUri("../..");
|
||||
with(new XtextStandaloneSetup());
|
||||
getInjector().injectMembers(this);
|
||||
}
|
||||
|
@ -81,6 +78,7 @@ public class XtextSerializerTest extends AbstractXtextTests {
|
|||
return XtextSerializerTest.this.get(XtextResourceSet.class);
|
||||
}
|
||||
});
|
||||
grammarProvider.setClassLoader(getClass().getClassLoader());
|
||||
TerminalsGrammarAccess gaTerminals = new TerminalsGrammarAccess(grammarProvider);
|
||||
BaseInheritanceTestLanguageGrammarAccess gaBaseInheritanceTestLanguage = new BaseInheritanceTestLanguageGrammarAccess(grammarProvider, gaTerminals);
|
||||
InheritanceTestLanguageGrammarAccess grammarAccess = new InheritanceTestLanguageGrammarAccess(grammarProvider, gaBaseInheritanceTestLanguage, gaTerminals);
|
||||
|
|
Loading…
Reference in a new issue