-
Notifications
You must be signed in to change notification settings - Fork 306
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
FISH-1014 Variables (ENV=...) in @DatasourceDefinition not applied to 'className' #5095 #5142
Conversation
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.
Overall looks good, just few minor changes
...va/org/glassfish/jdbcruntime/deployment/annotation/handlers/DataSourceDefinitionHandler.java
Outdated
Show resolved
Hide resolved
.../java/org/glassfish/jdbcruntime/deployment/annotation/handlers/DataSourceDefinitionImpl.java
Outdated
Show resolved
Hide resolved
…est. Integrated into one test. Removed unnecessary files.
@@ -48,6 +48,7 @@ | |||
import org.glassfish.apf.AnnotationInfo; | |||
import org.glassfish.apf.AnnotationProcessorException; | |||
import org.glassfish.apf.HandlerProcessingResult; | |||
import org.glassfish.config.support.TranslatedConfigView; |
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.
You could import static TranslatedConfigView.expandValue
so you only use expandValue()
so it could be more concise :)
jenkins test please |
FISH-1014 Variables (ENV=...) in @DatasourceDefinition not applied to 'className' payara#5095
Description
This is a simple fix in DataSourceDefinitionHandler where all String base properties from the DataSourceDefinition are expanded using the
TranslatedConfigView.expandValue(value)
Testing
New tests
TranslatedConfigView.expandValue() is a static method so cannot be easily mocked.
So I created EnvironmentUtil which can set the current environment (not sure if this will cause problems)
I created DataSourceDefinitionExpansionTest.java which only tests expansion of environment variables.
This proves that TranslatedConfigView is called.
Testing Performed
I built payara and tested using payara-micro. My test project (see ticket) works fine now.
Testing Environment
I tested on Mac
java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)
Maven home: /usr/local/Cellar/maven/3.6.2/libexec
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre
Default locale: nl_NL, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"
Documentation
n/a
Notes for Reviewers
This is the first time I created a pull-request so I'd like to hear how to proceed.
Can I run tests locally (they currently fail in the master branch).
Or is there a way I can run the jenkins tests locally?