-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add JDK Modules Export to JUnit Test to run Integration Tests via IDE #864
Add JDK Modules Export to JUnit Test to run Integration Tests via IDE #864
Conversation
Signed-off-by: Stefan Kruk <[email protected]>
addJdkPropertiesIfNecessary(vmParameters, project); | ||
} | ||
|
||
private void addJdkPropertiesIfNecessary(final ParametersList params, final Project project) { |
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.
can you try to rely on PropertiesService
to get required property?
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 will change the Implementation to use the PropertiesService
.
Short question regarding this. In the Service is the method findAllProperties
which currently not supportes all possibilities to set properties.
First of all the Optionl Config dir can also be set via HYBRIS_OPT_CONFIG_DIR
Environment Variable (see https://help.sap.com/docs/SAP_COMMERCE/b490bb4e85bc42a7aa09d513d0bcb18e/8beb75da86691014a0229cf991cb67e4.html)
There is also the possibility to define Properties by specifying a File via Environment Property HYBRIS_RUNTIME_PROPERTIES
. This Property file is loaded before the HYBRIS_OPT_CONFIG_DIR
And finally there is the possibility to define Environment Properties for setting Values (see: https://help.sap.com/docs/SAP_COMMERCE/b490bb4e85bc42a7aa09d513d0bcb18e/8b8e13c9866910149d40b151a9196543.html?q=y_#using-environment-variables-instead-of-files-for-secure-settings)
If desired I can add the Support for those as well so that we will be able to get most of the Properties a User can define.
UPDATE
It also seems project.properties Files are not considered right now as well or am I wrong?
Further is the method resolvePropertyValue
anywhere used?
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.
@StefanKruk , this service was introduced by original authors years ago. This service was initially used for ImpEx files as a resolver for $config-...
properties.
All your comments are valid and it would be great to see them implemented!
p.s. you've missed one very important change, please add yourself to the CONTRIBUTING.md
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 will first change my current implementation for the Integration Tests as you have suggested and will finalize this PR.
Afterwards I will try to update the Properties Loading. I will most likely create a new PR for this.
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/runConfigurations/HybrisJUnitExtension.java
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
src/com/intellij/idea/plugin/hybris/properties/impl/PropertiesServiceImpl.kt
Outdated
Show resolved
Hide resolved
Thanks for the Input. I will try to get the changes done. |
src/com/intellij/idea/plugin/hybris/runConfigurations/HybrisJUnitExtension.java
Outdated
Show resolved
Hide resolved
@StefanKruk , great job, well done! If you would like to participate in any other development feel free to contact me in the Slack, there are few ideas, like:
|
Will Join Slack as soon as JetBrains will send me an invite. They are stating die to technical issues they need to send the invite by hand |
@StefanKruk , actually, I'm referring to the Plugin's Slack channel :) https://github.com/epam/sap-commerce-intellij-idea-plugin |
Actually the slack link is telling me "workspace not found" Please invite me: [email protected] |
changed authentication, can you try now? |
Still no luck, now it is telling me I need a password but I do not have one and also no account associated with the workspace, also the invite link behind the badge is now invalid. |
To Run IntegrationTests via IntelliJ IDEA it is necessary to open some java Modules.
Via Ant this is done by reading the Property
standalone.jdkmodulesexports
fromadvanced.properties
and add them ascompilerarg
(util.xml) orjvmargs
(testing.xml)When running Integration Test without those statements, the Test will fail with several
BeanCreationException
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @8e0379d
It is possible to add those Configuration to the JUnit Run Template so that every other Test is run directly with it, but if new Developers are starting to use the Plugin or the Project needs to be setup again and this setting is forgotten, Integration Tests will fail to run.
Therefore I updated
HybrisJUnitExtension
to read the property fromadvanced.properties
and add them as vmParameters (if not already existing) so that it will be easier to run Integration Tests from now on.Signed-off-by: Your Real Name [email protected]