-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable java 17 for testing project (#903)
* Updated testing pom to allow J17 * Added integration tests using J17 * Stopped the MWE2 Automation for testing and checked in required generated files
- Loading branch information
1 parent
41d996f
commit f81de67
Showing
88 changed files
with
156 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.regnosys.rosetta</groupId> | ||
<artifactId>com.regnosys.rosetta.parent</artifactId> | ||
<version>0.0.0.main-SNAPSHOT</version> | ||
</parent> | ||
|
||
<name>Rosetta DSL Integration Test Project</name> | ||
<artifactId>rosetta-integration-tests</artifactId> | ||
<properties> | ||
<maven.compiler.release>17</maven.compiler.release> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- Inter-project dependencies --> | ||
<dependency> | ||
<groupId>com.regnosys.rosetta</groupId> | ||
<artifactId>com.regnosys.rosetta</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.regnosys.rosetta</groupId> | ||
<artifactId>com.regnosys.rosetta.tests</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
|
||
<!-- External dependencies --> | ||
<dependency> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>org.eclipse.xtext.testing</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>org.eclipse.xtext.xbase.testing</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mdkt.compiler</groupId> | ||
<artifactId>InMemoryJavaCompiler</artifactId> | ||
</dependency> | ||
|
||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.xtend</groupId> | ||
<artifactId>xtend-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<configuration> | ||
<filesets combine.children="append"> | ||
<fileset> | ||
<directory>${basedir}/xtend-gen</directory> | ||
<includes> | ||
<include>**/*</include> | ||
</includes> | ||
</fileset> | ||
</filesets> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
rosetta-testing/src/main/java/com/regnosys/rosetta/tests/RosettaInjectorProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (c) REGnosys 2018 (www.regnosys.com) | ||
* generated by Xtext 2.38.0.M1 | ||
*/ | ||
package com.regnosys.rosetta.tests; | ||
|
||
import com.google.inject.Guice; | ||
import com.google.inject.Injector; | ||
import com.regnosys.rosetta.RosettaRuntimeModule; | ||
import com.regnosys.rosetta.RosettaStandaloneSetup; | ||
import org.eclipse.xtext.testing.GlobalRegistries; | ||
import org.eclipse.xtext.testing.GlobalRegistries.GlobalStateMemento; | ||
import org.eclipse.xtext.testing.IInjectorProvider; | ||
import org.eclipse.xtext.testing.IRegistryConfigurator; | ||
|
||
public class RosettaInjectorProvider implements IInjectorProvider, IRegistryConfigurator { | ||
|
||
protected GlobalStateMemento stateBeforeInjectorCreation; | ||
protected GlobalStateMemento stateAfterInjectorCreation; | ||
protected Injector injector; | ||
|
||
static { | ||
GlobalRegistries.initializeDefaults(); | ||
} | ||
|
||
@Override | ||
public Injector getInjector() { | ||
if (injector == null) { | ||
this.injector = internalCreateInjector(); | ||
stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState(); | ||
} | ||
return injector; | ||
} | ||
|
||
protected Injector internalCreateInjector() { | ||
return new RosettaStandaloneSetup() { | ||
@Override | ||
public Injector createInjector() { | ||
return Guice.createInjector(createRuntimeModule()); | ||
} | ||
}.createInjectorAndDoEMFRegistration(); | ||
} | ||
|
||
protected RosettaRuntimeModule createRuntimeModule() { | ||
// make it work also with Maven/Tycho and OSGI | ||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=493672 | ||
return new RosettaRuntimeModule() { | ||
@Override | ||
public ClassLoader bindClassLoaderToInstance() { | ||
return RosettaInjectorProvider.class | ||
.getClassLoader(); | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public void restoreRegistry() { | ||
stateBeforeInjectorCreation.restoreGlobalState(); | ||
stateBeforeInjectorCreation = null; | ||
} | ||
|
||
@Override | ||
public void setupRegistry() { | ||
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState(); | ||
if (injector == null) { | ||
getInjector(); | ||
} | ||
stateAfterInjectorCreation.restoreGlobalState(); | ||
} | ||
} |