-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable java 17 for testing project #903
Merged
minesh-s-patel
merged 5 commits into
finos:main
from
REGnosys:enable-java-17-for-testing-project
Jan 22, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0b8c15d
Updated testing pom to allow J17
minesh-s-patel 122a867
Merge branch 'main' into enable-java-17-for-testing-project
minesh-s-patel b8c33a6
Added integration tests using J17
minesh-s-patel bdce086
Merge branch 'main' into enable-java-17-for-testing-project
minesh-s-patel a53b69f
Stopped the MWE2 Automation for testing and checked in required gener…
minesh-s-patel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should actually refer to the test utility project. It's where Xtext will generate it's test utilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the MWE2 runtimeTest points to
rosetta-testing
The issue is that it generates 2 things
rosetta-testing/src/test
) - which is a Hello World test intended to be overriden.rosetta-testing/src/main
) which we need in the testing utilsWhen I just moved the all the tests to integration testing - it started to generate point 1 which caused a unit test failure.
When I move the MWE2 runtimeTest to point to
rosetta-integration-tests
, then we are generating point 2 int he wrong place.I made a change to just disable the runtime test automation. The automation is meant to be a starting point and does not really (I think) provide much value any more.
The other option is that we move the MWE2 runtimeTest back to
rosetta-testing
, and check in the generated xtend test and live with 1 test being in rosetta-testing. I prefer the first option. @SimonCockx - take a look at the PR now and tell me what you think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!