-
Notifications
You must be signed in to change notification settings - Fork 320
/
JvmGenericTypeValidatorTestLangInjectorProviderCustom.java
39 lines (34 loc) · 1.65 KB
/
JvmGenericTypeValidatorTestLangInjectorProviderCustom.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*******************************************************************************
* Copyright (c) 2024 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.xtext.xbase.tests.validation;
import org.eclipse.xtext.util.JavaVersion;
import org.eclipse.xtext.xbase.testing.JavaVersionModule;
import org.eclipse.xtext.xbase.testlanguages.JvmGenericTypeValidatorTestLangStandaloneSetup;
import org.eclipse.xtext.xbase.testlanguages.tests.JvmGenericTypeValidatorTestLangInjectorProvider;
import com.google.inject.Guice;
import com.google.inject.Injector;
/**
* To let the validator/scoping/linking find the Java classes of "testdata" referred in some tests also in an OSGI and Maven/Tycho
* environment. This is required because the original {@link JvmGenericTypeValidatorTestLangInjectorProvider} is not in this bundle.
* Moreover, we configure Java 8.
*
* @author Lorenzo Bettini - Initial contribution and API
*/
public class JvmGenericTypeValidatorTestLangInjectorProviderCustom extends JvmGenericTypeValidatorTestLangInjectorProvider {
@Override
protected Injector internalCreateInjector() {
return new JvmGenericTypeValidatorTestLangStandaloneSetup() {
@Override
public Injector createInjector() {
return Guice.createInjector(createRuntimeModule(),
new JavaVersionModule(JavaVersion.JAVA8));
}
}.createInjectorAndDoEMFRegistration();
}
}