You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/05/23 08:09:09 UTC
[maven] branch MNG-6819-2 updated (5c77cc5 -> 8177d3d)
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a change to branch MNG-6819-2
in repository https://gitbox.apache.org/repos/asf/maven.git.
discard 5c77cc5 [MNG-6819] Fix also NPE in StringSearchModelInterpolator
discard 29a054c [MNG-6819] Refactor unit tests for ModelInterpolator
discard fa20fb4 [MNG-6819] Fix NullPointerException in StringVisitorModelInterpolator
add df3fdc9 A copy of the gradle wrapper ported for use with maven Lightly touched to better mesh with current maven builds. (some of which my not have been necessary in hind sight)
add e210666 Adding simple README
add 1457a7b correcting README formatting
add 3b0965d Update properties file to point to maven 3.2.3
add 2f07f99 Update to Maven 3.3.1 which resides in Maven Central
add ff3e114 Formatting
add 5deb2a6 Make sure the maven.multiModuleProjectDirectory envar is set for proper 3.3.1+ execution
add 821bed1 Update the wrapper jar
add 7bd4364 Use the now standard .mvn directory
add 5d40b53 Use the Maven 3.3.1 startup scripts to account for jvm.config and maven.config
add d1bfe96 Use provisio packaging to produce an archive that can be deployed for use in a Maven plugin
add 5457a1b Use a released version of provisio
add 9fdaf2f [maven-release-plugin] prepare release maven-wrapper-0.1.0
add 03bc10d [maven-release-plugin] prepare for next development iteration
add fcd0a69 Update location for searching for the version
add c830673 [maven-release-plugin] prepare release maven-wrapper-0.1.1
add 0180586 [maven-release-plugin] prepare for next development iteration
add 5093817 Update properties path Whatever
add 580d9be [maven-release-plugin] prepare release maven-wrapper-0.1.2
add 5994302 [maven-release-plugin] prepare for next development iteration
add 70d1052 Update the README.md with instructions
add 7709755 Fix a few typos
add 36149e9 Add a note about using the windows script
add 0aabf3e Fix typo
add 040d343 Remove some unused parts of the windows scripts and rename them to .cmd
add f4b4547 Add license file
add a1b3a7b Add license stanza to POM
add cbb5886 Fix while loop so that basedir is detected in current dir
add c35e352 Correct name of Windows script in README
add 307de3d super-mega minor typo
add ec3d0cc Align Un*x and Windows scripts to both use MAVEN_CONFIG consistently
add 53eff03 Use basedir location instead of "." to locate wrapper jar
add 0fd5540 [maven-release-plugin] prepare release maven-wrapper-0.1.3
add f75e301 [maven-release-plugin] prepare for next development iteration
add 98b6027 Use working files to create wrapper jar
add 5eeb65c [maven-release-plugin] prepare release maven-wrapper-0.1.4
add 4737137 [maven-release-plugin] prepare for next development iteration
add 2d3acb1 Use org.apache.ant
add 7aacf41 Fix typo
add 7fa99bc handle MAVEN_PROJECTBASEDIR correctly in cygwin
add 295826d avoid using MAVEN_CMD_LINE_ARGS for invocation since that can losse parameter escaping
add 6c57c4c Remove whitespace (#22)
add a13b42e Update to release version of parent
add 2d8f4c5 use @REM instead of # (#27)
add 79440c9 Update release version
add 8a6480c Use Apple-recommended strategy for locating JAVA_HOME. This works correctly with both Oracle and Apple JDKs.
add 75a200a upped version to new snapshot since 0.1.6 is already on central
add 022fedb Be defensive about creating directories for files
add d3b3473 Fix path escaping
add 6d30420 remove unused MAVEN_CMD_LINE_ARGS
add bf50858 adding changelog
add 2ccae98 Quote paths in commands
add f2f1887 one more PR merge and changelog update
add ddf2786 upgraded provisio maven plugin
add a3706dc updated to 0.2.0-SNAPSHOT as version due to number of changes
add 55ee1e4 updated parent to latest release
add 3aeabdc updated wrapper maven version to 3.3.9
add 54b2282 fix to avoid usage of stale maven wrapper jar
add 4235271 changelog updates
add fa9b9ab support spaces in folder names on nix, simplified from https://github.com/takari/maven-wrapper/pull/25
add 437912b added changelog entry about spaces fix
add 449d0c7 updated wrapper maven version to 3.5.0
add feac8c6 Add .DS_Store to .gitignore
add 92e3454 Upgraded default Maven version to 3.5.0
add f530a7f ammeded changelog
add fc9c774 added note about dash testing
add 79fc2f2 Use of bashisms make this script fail in minimal /bin/sh implementations like dash
add feb3731 upgraded parent
add afbc151 fixing issue on Solaris
add a23522d added section about supported systems
add b0b56ae solaris support changelog entry and release date
add c64b0f1 [maven-release-plugin] prepare release maven-wrapper-0.2.0
add d104930 [maven-release-plugin] prepare for next development iteration
add 557c8f9 improved wording on supported systems
add ab9742e Make artifact compatible with older Java
add c6b60b2 Ignore IntelliJ files
add 1b903e7 added doc about Java version
add 348ee53 added changelog entry for java 1.5 change and release
add d3a389b [maven-release-plugin] prepare release maven-wrapper-0.2.1
add 8ab08b8 [maven-release-plugin] prepare for next development iteration
add eae4779 fixed version in changelog
add 567fccc formatting, added update via plugin
add 2d87f1f Print out maven wrapper version at every invocation
add 83d12ec added changelog entry, added Takari to output
add e161356 Fix typo
add 578496f words are missing - I think this is what you mean...
add a71bd82 cleaned up version output
add 020545b added verbose mode activated with MVNW_VERBOSE set to true
add 19f375f [maven-release-plugin] prepare release maven-wrapper-0.2.2
add 67640d4 [maven-release-plugin] prepare for next development iteration
add 179ee30 updated wrapper jar
add 8fc916c Fix NPE due to missing MVNW_VERBOSE
add c60c49d update info on wrapper
add a0e1c2f [maven-release-plugin] prepare release maven-wrapper-0.2.3
add 8b57037 [maven-release-plugin] prepare for next development iteration
add 8641c05 wrapper file upgrade
add 4d3985c set title of command window
add 68e102a respect MVNW_VERBOSE when printing diagnostic stuff
add 18e3d3e fix to actually read the environment variable value
add d841301 set to new maven version
add 6da17a7 added recent pr merges
add 958418a upped version
add 3dea57b [pom] Use empty relativePath
add 0a7111f [pom] Update junit to 4.12
add 89e610d [pom] Update mockito-core to 2.8.47
add f5d20ba [pom] Update commons-io to 2.5
add a25a535 [pom] Update ant to 1.9.9
add 635e53e [pom] Update provision-maven-plugin to 0.1.50
add 9e3ce6e removed redundant empty element
add de9d996 added warning about issues found from provisio upgrade
add 638f527 much less verbose progress reporting since it is now a new line each
add b05b99a added chunk size change
add a38c44e added chunk size change
add 190eb35 [maven-release-plugin] prepare release maven-wrapper-0.3.0
add 91dcd24 [maven-release-plugin] prepare for next development iteration
add 1a920c7 - Added an initial version of an auto-downloader for the maven-wrapper.jar
add a3787b7 Cleaned up the code a little to not exit with 0 in case of an error.
add d14aa05 - Made the script use curl or wget if available and fallback to java in case none of them are. - Moved the Java source code to the filesystem.
add 5aa0e6f - Added a download extension for windows
add 50dcbb3 - Added Apache header to the downloader java class
add 87f2983 - Changed the curl and wget detection to the "possix way" using "command"
add a0dfc3e - Changed the wget command to use "-O" instead of "--output-document="
add 34c91b3 - Made the wrapperUrl configurable from the maven-wrapper.properties file - Updated and tested the linux/unix/mac version of the script - Updated and tested the Java downloader - Updated the windows cmd (but not tested yet)
add 661e471 Fixed the windows version of the script
add e4986f6 Removed a hack to force the script to use curl or wget ...
add 75698b0 Updated the download url to the https version
add d7ddce2 Updated to the latest maven-wrapper version.
add 7c3e488 updated to wrapper jar 0.3.0
add ed6d2b4 updated version
add fafe416 added user doc for no jar approach
add 89b4de7 added author creds
add 9a162b5 introduced intermediary var for path to jar since it didnt work without that in bash
add 51e7e64 changed URL to official maven repo URL
add f41375b added note about URL change
add e77b971 adapted to honor the MVNW_VERBOSE flag
add 8f86510 dev and release help
add d6d69f8 updated to new wrapper version in default URLs
add f161035 added release date to changelog
add d4a3342 [maven-release-plugin] prepare release maven-wrapper-0.4.0
add e90950c [maven-release-plugin] prepare for next development iteration
add c4cc2d3 notes for next relase
add c5d75a1 added link to fixed issue
add 276169f updated to latest parent
add ebb8ba4 spelling fix
add d5b4f7c update to Maven 3.5.4 as default
add e4556f5 ant and commons-io upgrades
add 9a165c1 added changes
add 7ee971e updated static files to point to 0.4.1 release
add 18069f7 [maven-release-plugin] prepare release maven-wrapper-0.4.1
add 13d02a8 [maven-release-plugin] prepare for next development iteration
add 2e9c45d added wrapper version in cmd
add 4976f68 updated to wrapper 0.4.2 in prep of new release
add d1d9e3f [maven-release-plugin] prepare release maven-wrapper-0.4.2
add 736646b [maven-release-plugin] prepare for next development iteration
add 02423e8 Fixed typos
add 42ca0a3 Removed todo comment
add b9e6795 Download maven wrapper with authentication if availble
add ed08eab Download using authentication with properties
add 8c37106 Update README.md
add 46f52ba Added macOS as name
add 2643996 updated to Maven 3.6.0, also in plugin
add 68042bb On Windows, use TLS 1.2
add f45eac2 fix compile path for cygwin
add 60668e7 fix wrapper path for cygwin
add 48a9ff3 added recently merged PRs
add 0b08500 add info about using MAVEN_USER_HOME
add 83f577c Update referenced Maven version to 3.6.0
add 12892d3 use quoted string for filepath
add d395ca4 add basic auth support
add 790be24 use MVNW_USER and MVNW_PASSWORD instead of system properties
add e09456d use warning instead of info
add 002f677 remove unintended line
add 618162a added recent merged PRs
add 95dcd2f consistent usage of MVNW_USERNAME and MVWN_PASSWORD
add 8c76743 version update to 0.5.0-SNAPSHOT for next release
add e3ed336 License header cleanup (#105)
add 5528ca7 added pr and issue links
add fa8c70a better instructions for dev and test
add ac2b048 fixed test install command
add 5bbacca added debug flag for testing help
add f81d067 add repo manager usage docs, dev doc updates
add 67e12c5 usage of MVNW_REPOURL for wrapper download
add 94964ce MVN_REPOURL env var usage for Maven binary download
add 9213ff2 updated everything to version 0.5.0
add c89fe4f [maven-release-plugin] prepare release maven-wrapper-0.5.0
add 0e33a4f [maven-release-plugin] prepare for next development iteration
add 5f65c12 Windows note
add 0fe726f typo fix
add d011e4d MVNW_REPOURL parsing fix for mvnw.cmd (#107)
add 3c84a93 style improvement
add 7bb1083 prep for 0.5.1 release
add a37120e [maven-release-plugin] prepare release maven-wrapper-0.5.1
add 1f08e11 [maven-release-plugin] prepare for next development iteration
add b65c86d On Windows, use TLS 1.2
add 5f7d4ca prep for 0.5.2 release
add f15eb8b [maven-release-plugin] prepare release maven-wrapper-0.5.2
add 270c79f [maven-release-plugin] prepare for next development iteration
add af829f1 Add missing required space between 'true' and ']'
add 5762f9d usage of MVNW_REPOURL for wrapper download
add 7d5f452 resolved
add d27cdcc title fix
add fafaf24 [maven-release-plugin] prepare release maven-wrapper-0.5.3
add 7686307 [maven-release-plugin] prepare for next development iteration
add 193facc Added version to default usage
add 76c9c96 Adapt mvnw.cmd to also honour MVNW_VERBOSE
add 90b355c Added recent changes
add c584815 Provide a 'standardized' way to retrieve CLI arguments
add 49c5d41 Updated with recent changes
add 26ff1f4 updated changelog and docs for dev to fix #78
add a3977ad prepped for 0.5.4 release
add c733e0d prepped for 0.5.4 release
add 8272ee7 [maven-release-plugin] prepare release maven-wrapper-0.5.4
add f8c5329 [maven-release-plugin] prepare for next development iteration
add 12ca3ea update to new release
add 28d874a removed wrong space in jar download URL
add 2f7cfda update to Maven 3.6.1
add 067d997 update to default to Maven 3.6.1
add ebc21d6 update for 0.5.5 release
add e70acda [maven-release-plugin] prepare release maven-wrapper-0.5.5
add 9ef2ddb [maven-release-plugin] prepare for next development iteration
add b8790bb update to latest release
add d972c26 source format only
add cccd8b0 more details about what happens for users
add fb42fa9 Corrects the false Maven2 reference in the startup scripts (#121)
add eeda12a Remove trailing whitespace
add f424d6f Fix typo
add ee6d5bd Update to Maven 3.6.3
add 49d28e3 Update for 0.5.6 release
add b011766 [maven-release-plugin] prepare release maven-wrapper-0.5.6
add d1935f2 [maven-release-plugin] prepare for next development iteration
add 3730fb3 [MNG-5937] Fix licenses, removed unwanted root files
add 738d99b [MNG-5937] Split wrapper jar from assemblies Remove unused cli package Reformat code
add 9cc3638 [MNG-5937] Optimize code for Java 8
add cdcd351 [MNG-5937] Adjust JenkinsFile to pick up wrapper dists Improve assembly
add 35e05e4 [MNG-6914] Align mvn and mvnw scripts
new 14c9e15 [MNG-6819] Fix NullPointerException in StringVisitorModelInterpolator
new be3c4eb [MNG-6819] Refactor unit tests for ModelInterpolator
new 8177d3d [MNG-6819] Fix also NPE in StringSearchModelInterpolator
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (5c77cc5)
\
N -- N -- N refs/heads/MNG-6819-2 (8177d3d)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Jenkinsfile | 21 +-
apache-maven/maven-wrapper.pom | 139 +++++++++++++
apache-maven/pom.xml | 27 ++-
.../src/{main/assembly => assembly/maven}/bin.xml | 2 +-
.../src/{ => assembly/maven}/bin/.gitattributes | 0
apache-maven/src/{ => assembly/maven}/bin/m2.conf | 0
apache-maven/src/{ => assembly/maven}/bin/mvnDebug | 0
.../src/{ => assembly/maven}/bin/mvnDebug.cmd | 0
apache-maven/src/{ => assembly/maven}/bin/mvnyjp | 0
.../assembly => assembly/maven}/component.xml | 42 +++-
.../maven}/conf/logging/simplelogger.properties | 0
.../src/{ => assembly/maven}/conf/settings.xml | 0
.../src/{ => assembly/maven}/conf/toolchains.xml | 0
.../src/{main/assembly => assembly/maven}/dir.xml | 2 +-
.../src/{ => assembly/maven}/lib/ext/README.txt | 0
.../maven}/lib/jansi-native/README.txt | 0
.../src/{main/assembly => assembly/maven}/src.xml | 0
apache-maven/src/assembly/shared/init | 128 ++++++++++++
apache-maven/src/assembly/shared/init.cmd | 97 +++++++++
apache-maven/src/assembly/shared/mvnlauncher | 4 +
apache-maven/src/assembly/shared/mvnlauncher.cmd | 4 +
apache-maven/src/assembly/shared/mvnvalidate | 23 +++
apache-maven/src/assembly/shared/mvnvalidate.cmd | 8 +
.../{bin/mvnDebug => assembly/shared/mvnwDebug} | 4 +-
.../mvnDebug.cmd => assembly/shared/mvnwDebug.cmd} | 2 +-
apache-maven/src/assembly/shared/mvnwlauncher | 4 +
apache-maven/src/assembly/shared/mvnwlauncher.cmd | 4 +
apache-maven/src/assembly/shared/run | 22 ++
apache-maven/src/assembly/shared/run.cmd | 29 +++
.../src/{bin/mvnyjp => assembly/shared/validate} | 42 +++-
.../mvnDebug.cmd => assembly/shared/validate.cmd} | 36 +++-
apache-maven/src/assembly/wrapper/bin.xml | 89 ++++++++
apache-maven/src/assembly/wrapper/script.xml | 81 ++++++++
apache-maven/src/assembly/wrapper/script/download | 55 +++++
.../src/assembly/wrapper/script/download.cmd | 36 ++++
.../shared/.mvn/wrapper/maven-wrapper.properties | 8 +-
apache-maven/src/assembly/wrapper/source.xml | 89 ++++++++
.../.mvn/wrapper/MavenWrapperDownloader.java | 131 ++++++++++++
apache-maven/src/assembly/wrapper/source/download | 34 ++++
.../src/assembly/wrapper/source/download.cmd | 21 ++
apache-maven/src/bin/mvn | 199 ------------------
apache-maven/src/bin/mvn.cmd | 201 ------------------
.../apache/maven/settings/GlobalSettingsTest.java | 2 +-
.../AbstractModelInterpolatorTest.java | 3 -
{maven-slf4j-wrapper => maven-wrapper}/pom.xml | 42 +++-
.../apache/maven/wrapper/BootstrapMainStarter.java | 59 ++++++
.../apache/maven/wrapper/DefaultDownloader.java | 192 +++++++++++++++++
.../java/org/apache/maven/wrapper/Downloader.java | 52 +++++
.../java/org/apache/maven/wrapper/Installer.java | 226 +++++++++++++++++++++
.../main/java/org/apache/maven/wrapper/Logger.java | 23 +--
.../org/apache/maven/wrapper/MavenWrapperMain.java | 123 +++++++++++
.../org/apache/maven/wrapper/PathAssembler.java | 131 ++++++++++++
.../apache/maven/wrapper/WrapperConfiguration.java | 116 +++++++++++
.../org/apache/maven/wrapper/WrapperExecutor.java | 175 ++++++++++++++++
.../org/apache/maven/wrapper/DownloaderTest.java | 72 +++++++
.../org/apache/maven/wrapper/InstallerTest.java | 210 +++++++++++++++++++
.../apache/maven/wrapper/PathAssemblerTest.java | 120 +++++++++++
.../apache/maven/wrapper/WrapperExecutorTest.java | 207 +++++++++++++++++++
.../org/apache/maven/wrapper/wrapper.properties | 7 +-
pom.xml | 10 +-
60 files changed, 2890 insertions(+), 464 deletions(-)
create mode 100644 apache-maven/maven-wrapper.pom
rename apache-maven/src/{main/assembly => assembly/maven}/bin.xml (93%)
rename apache-maven/src/{ => assembly/maven}/bin/.gitattributes (100%)
rename apache-maven/src/{ => assembly/maven}/bin/m2.conf (100%)
copy apache-maven/src/{ => assembly/maven}/bin/mvnDebug (100%)
copy apache-maven/src/{ => assembly/maven}/bin/mvnDebug.cmd (100%)
copy apache-maven/src/{ => assembly/maven}/bin/mvnyjp (100%)
rename apache-maven/src/{main/assembly => assembly/maven}/component.xml (70%)
rename apache-maven/src/{ => assembly/maven}/conf/logging/simplelogger.properties (100%)
rename apache-maven/src/{ => assembly/maven}/conf/settings.xml (100%)
rename apache-maven/src/{ => assembly/maven}/conf/toolchains.xml (100%)
rename apache-maven/src/{main/assembly => assembly/maven}/dir.xml (93%)
rename apache-maven/src/{ => assembly/maven}/lib/ext/README.txt (100%)
rename apache-maven/src/{ => assembly/maven}/lib/jansi-native/README.txt (100%)
rename apache-maven/src/{main/assembly => assembly/maven}/src.xml (100%)
create mode 100755 apache-maven/src/assembly/shared/init
create mode 100755 apache-maven/src/assembly/shared/init.cmd
create mode 100644 apache-maven/src/assembly/shared/mvnlauncher
create mode 100644 apache-maven/src/assembly/shared/mvnlauncher.cmd
create mode 100644 apache-maven/src/assembly/shared/mvnvalidate
create mode 100644 apache-maven/src/assembly/shared/mvnvalidate.cmd
rename apache-maven/src/{bin/mvnDebug => assembly/shared/mvnwDebug} (94%)
mode change 100755 => 100644
copy apache-maven/src/{bin/mvnDebug.cmd => assembly/shared/mvnwDebug.cmd} (98%)
create mode 100755 apache-maven/src/assembly/shared/mvnwlauncher
create mode 100755 apache-maven/src/assembly/shared/mvnwlauncher.cmd
create mode 100755 apache-maven/src/assembly/shared/run
create mode 100755 apache-maven/src/assembly/shared/run.cmd
rename apache-maven/src/{bin/mvnyjp => assembly/shared/validate} (58%)
mode change 100755 => 100644
rename apache-maven/src/{bin/mvnDebug.cmd => assembly/shared/validate.cmd} (58%)
create mode 100644 apache-maven/src/assembly/wrapper/bin.xml
create mode 100644 apache-maven/src/assembly/wrapper/script.xml
create mode 100755 apache-maven/src/assembly/wrapper/script/download
create mode 100755 apache-maven/src/assembly/wrapper/script/download.cmd
copy maven-core/src/test/resources/projects/build.properties => apache-maven/src/assembly/wrapper/shared/.mvn/wrapper/maven-wrapper.properties (73%)
create mode 100644 apache-maven/src/assembly/wrapper/source.xml
create mode 100644 apache-maven/src/assembly/wrapper/source/.mvn/wrapper/MavenWrapperDownloader.java
create mode 100644 apache-maven/src/assembly/wrapper/source/download
create mode 100644 apache-maven/src/assembly/wrapper/source/download.cmd
delete mode 100755 apache-maven/src/bin/mvn
delete mode 100644 apache-maven/src/bin/mvn.cmd
copy {maven-slf4j-wrapper => maven-wrapper}/pom.xml (57%)
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/BootstrapMainStarter.java
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/DefaultDownloader.java
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/Downloader.java
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java
copy maven-compat/src/main/java/org/apache/maven/profiles/activation/ProfileActivationException.java => maven-wrapper/src/main/java/org/apache/maven/wrapper/Logger.java (65%)
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/PathAssembler.java
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/WrapperConfiguration.java
create mode 100644 maven-wrapper/src/main/java/org/apache/maven/wrapper/WrapperExecutor.java
create mode 100644 maven-wrapper/src/test/java/org/apache/maven/wrapper/DownloaderTest.java
create mode 100644 maven-wrapper/src/test/java/org/apache/maven/wrapper/InstallerTest.java
create mode 100644 maven-wrapper/src/test/java/org/apache/maven/wrapper/PathAssemblerTest.java
create mode 100644 maven-wrapper/src/test/java/org/apache/maven/wrapper/WrapperExecutorTest.java
copy maven-core/src/test/resources/projects/build.properties => maven-wrapper/src/test/resources/org/apache/maven/wrapper/wrapper.properties (83%)
[maven] 01/03: [MNG-6819] Fix NullPointerException in
StringVisitorModelInterpolator
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MNG-6819-2
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 14c9e156bce509fc36f2590c93d80fb913611871
Author: 碎镜 <sh...@alibaba-inc.com>
AuthorDate: Fri Dec 13 20:07:20 2019 +0800
[MNG-6819] Fix NullPointerException in StringVisitorModelInterpolator
Closes #301
---
apache-maven/src/assembly/maven/bin/mvnDebug | 0
apache-maven/src/assembly/maven/bin/mvnyjp | 0
.../maven/model/interpolation/StringVisitorModelInterpolator.java | 2 +-
3 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/apache-maven/src/assembly/maven/bin/mvnDebug b/apache-maven/src/assembly/maven/bin/mvnDebug
old mode 100644
new mode 100755
diff --git a/apache-maven/src/assembly/maven/bin/mvnyjp b/apache-maven/src/assembly/maven/bin/mvnyjp
old mode 100644
new mode 100755
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java
index 98e36f6..313c4f7 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java
@@ -1420,7 +1420,7 @@ public class StringVisitorModelInterpolator
{
String value = (String) v;
String inter = interpolate( value );
- if ( value != inter )
+ if ( value != inter && inter != null )
{
entry.setValue( inter );
}
[maven] 03/03: [MNG-6819] Fix also NPE in
StringSearchModelInterpolator
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MNG-6819-2
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 8177d3d114ce21cbb3c9ff17e098183cf00f3956
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat May 23 01:30:47 2020 +0200
[MNG-6819] Fix also NPE in StringSearchModelInterpolator
---
.../maven/model/interpolation/StringSearchModelInterpolator.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
index af4d105..93e53b7 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
@@ -365,7 +365,7 @@ public class StringSearchModelInterpolator
String interpolated = ctx.interpolate( value );
- if ( !interpolated.equals( value ) )
+ if ( interpolated != null && !interpolated.equals( value ) )
{
field.set( target, interpolated );
}
@@ -459,7 +459,7 @@ public class StringSearchModelInterpolator
{
String interpolated = ctx.interpolate( (String) value );
- if ( !interpolated.equals( value ) )
+ if ( interpolated != null && !interpolated.equals( value ) )
{
try
{
[maven] 02/03: [MNG-6819] Refactor unit tests for ModelInterpolator
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MNG-6819-2
in repository https://gitbox.apache.org/repos/asf/maven.git
commit be3c4eb406e9b4439c8e2365ab95e2ead90d8697
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat May 23 01:45:10 2020 +0200
[MNG-6819] Refactor unit tests for ModelInterpolator
---
.../AbstractModelInterpolatorTest.java | 203 +++++++++++----------
.../StringSearchModelInterpolatorTest.java | 37 ++--
.../StringVisitorModelInterpolatorTest.java | 35 ++++
3 files changed, 167 insertions(+), 108 deletions(-)
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/AbstractModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/AbstractModelInterpolatorTest.java
index 19a28c1..01cac27 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/AbstractModelInterpolatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/AbstractModelInterpolatorTest.java
@@ -29,9 +29,9 @@ import org.apache.maven.model.Scm;
import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.SimpleProblemCollector;
-import org.apache.maven.model.path.PathTranslator;
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
import java.io.File;
import java.text.SimpleDateFormat;
@@ -42,19 +42,19 @@ import java.util.List;
import java.util.Properties;
import java.util.TimeZone;
+import static org.junit.Assert.*;
+
/**
* @author jdcasey
*/
public abstract class AbstractModelInterpolatorTest
- extends TestCase
{
+ protected ModelInterpolator interpolator;
private Properties context;
- protected void setUp()
- throws Exception
+ @Before
+ public void setUp()
{
- super.setUp();
-
context = new Properties();
context.put( "basedir", "myBasedir" );
context.put( "project.baseUri", "myBaseUri" );
@@ -68,24 +68,13 @@ public abstract class AbstractModelInterpolatorTest
assertEquals( "Expected no fatals", 0, collector.getFatals().size() );
}
- /**
- * @deprecated instead use {@link #assertCollectorState(int, int, int, SimpleProblemCollector)}
- */
- @Deprecated
- protected void assertColllectorState( int numFatals, int numErrors, int numWarnings,
- SimpleProblemCollector collector )
+ protected void assertCollectorState( int numFatals, int numErrors, int numWarnings, SimpleProblemCollector collector )
{
- assertEquals( "Errors", numErrors, collector.getErrors().size() );
+ assertEquals( "Errors", numErrors, collector.getErrors().size() );
assertEquals( "Warnings", numWarnings, collector.getWarnings().size() );
assertEquals( "Fatals", numFatals, collector.getFatals().size() );
}
- protected void assertCollectorState( int numFatals, int numErrors, int numWarnings,
- SimpleProblemCollector collector )
- {
- assertColllectorState(numFatals, numErrors, numWarnings, collector);
- }
-
private ModelBuildingRequest createModelBuildingRequest( Properties p )
{
ModelBuildingRequest config = new DefaultModelBuildingRequest();
@@ -96,6 +85,7 @@ public abstract class AbstractModelInterpolatorTest
return config;
}
+ @Test
public void testDefaultBuildTimestampFormatShouldFormatTimeIn24HourFormat()
{
Calendar cal = Calendar.getInstance();
@@ -121,13 +111,13 @@ public abstract class AbstractModelInterpolatorTest
Date secondTestDate = cal.getTime();
- SimpleDateFormat format =
- new SimpleDateFormat( MavenBuildTimestamp.DEFAULT_BUILD_TIMESTAMP_FORMAT );
+ SimpleDateFormat format = new SimpleDateFormat( MavenBuildTimestamp.DEFAULT_BUILD_TIMESTAMP_FORMAT );
format.setTimeZone( MavenBuildTimestamp.DEFAULT_BUILD_TIME_ZONE );
assertEquals( "1976-11-11T00:16:00Z", format.format( firstTestDate ) );
assertEquals( "1976-11-11T23:16:00Z", format.format( secondTestDate ) );
}
+ @Test
public void testDefaultBuildTimestampFormatWithLocalTimeZoneMidnightRollover()
{
Calendar cal = Calendar.getInstance();
@@ -146,15 +136,14 @@ public abstract class AbstractModelInterpolatorTest
Date secondTestDate = cal.getTime();
- SimpleDateFormat format =
- new SimpleDateFormat( MavenBuildTimestamp.DEFAULT_BUILD_TIMESTAMP_FORMAT );
+ SimpleDateFormat format = new SimpleDateFormat( MavenBuildTimestamp.DEFAULT_BUILD_TIMESTAMP_FORMAT );
format.setTimeZone( MavenBuildTimestamp.DEFAULT_BUILD_TIME_ZONE );
assertEquals( "2014-06-15T23:16:00Z", format.format( firstTestDate ) );
assertEquals( "2014-11-16T00:16:00Z", format.format( secondTestDate ) );
}
- public void testShouldNotThrowExceptionOnReferenceToNonExistentValue()
- throws Exception
+ @Test
+ public void testShouldNotThrowExceptionOnReferenceToNonExistentValue() throws Exception
{
Model model = new Model();
@@ -166,15 +155,15 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
- assertProblemFree( collector );
+ assertProblemFree( collector );
assertEquals( "${test}/somepath", out.getScm().getConnection() );
}
- public void testShouldThrowExceptionOnRecursiveScmConnectionReference()
- throws Exception
+ @Test
+ public void testShouldThrowExceptionOnRecursiveScmConnectionReference() throws Exception
{
Model model = new Model();
@@ -183,22 +172,15 @@ public abstract class AbstractModelInterpolatorTest
model.setScm( scm );
- try
- {
- ModelInterpolator interpolator = createInterpolator();
-
- final SimpleProblemCollector collector = new SimpleProblemCollector();
- interpolator.interpolateModel( model, null, createModelBuildingRequest( context ), collector );
- assertCollectorState( 0, 1, 0, collector );
- }
- catch ( Exception e )
- {
+ ModelInterpolator interpolator = createInterpolator();
- }
+ final SimpleProblemCollector collector = new SimpleProblemCollector();
+ interpolator.interpolateModel( model, null, createModelBuildingRequest( context ), collector );
+ assertCollectorState( 0, 1, 0, collector );
}
- public void testShouldNotThrowExceptionOnReferenceToValueContainingNakedExpression()
- throws Exception
+ @Test
+ public void testShouldNotThrowExceptionOnReferenceToValueContainingNakedExpression() throws Exception
{
Model model = new Model();
@@ -212,16 +194,16 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
- assertProblemFree( collector );
+ assertProblemFree( collector );
assertEquals( "test/somepath", out.getScm().getConnection() );
}
- public void testShouldInterpolateOrganizationNameCorrectly()
- throws Exception
+ @Test
+ public void shouldInterpolateOrganizationNameCorrectly() throws Exception
{
String orgName = "MyCo";
@@ -235,15 +217,14 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
- new SimpleProblemCollector() );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ new SimpleProblemCollector() );
assertEquals( orgName + " Tools", out.getName() );
}
- public void testShouldInterpolateDependencyVersionToSetSameAsProjectVersion()
- throws Exception
+ @Test
+ public void shouldInterpolateDependencyVersionToSetSameAsProjectVersion() throws Exception
{
Model model = new Model();
model.setVersion( "3.8.1" );
@@ -256,15 +237,15 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
- assertCollectorState(0, 0, 1, collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
+ assertCollectorState( 0, 0, 1, collector );
assertEquals( "3.8.1", ( out.getDependencies().get( 0 ) ).getVersion() );
}
- public void testShouldNotInterpolateDependencyVersionWithInvalidReference()
- throws Exception
+ @Test
+ public void testShouldNotInterpolateDependencyVersionWithInvalidReference() throws Exception
{
Model model = new Model();
model.setVersion( "3.8.1" );
@@ -292,15 +273,15 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
assertProblemFree( collector );
assertEquals( "${something}", ( out.getDependencies().get( 0 ) ).getVersion() );
}
- public void testTwoReferences()
- throws Exception
+ @Test
+ public void testTwoReferences() throws Exception
{
Model model = new Model();
model.setVersion( "3.8.1" );
@@ -314,15 +295,15 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
assertCollectorState( 0, 0, 2, collector );
assertEquals( "foo-3.8.1", ( out.getDependencies().get( 0 ) ).getVersion() );
}
- public void testBasedir()
- throws Exception
+ @Test
+ public void testBasedir() throws Exception
{
Model model = new Model();
model.setVersion( "3.8.1" );
@@ -343,8 +324,8 @@ public abstract class AbstractModelInterpolatorTest
assertEquals( "file://localhost/myBasedir/temp-repo", ( out.getRepositories().get( 0 ) ).getUrl() );
}
- public void testBaseUri()
- throws Exception
+ @Test
+ public void testBaseUri() throws Exception
{
Model model = new Model();
model.setVersion( "3.8.1" );
@@ -365,10 +346,10 @@ public abstract class AbstractModelInterpolatorTest
assertEquals( "myBaseUri/temp-repo", ( out.getRepositories().get( 0 ) ).getUrl() );
}
- public void testEnvars()
- throws Exception
+ @Test
+ public void testEnvars() throws Exception
{
- Properties context = new Properties();
+ Properties context = new Properties();
context.put( "env.HOME", "/path/to/home" );
@@ -383,15 +364,15 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
assertProblemFree( collector );
assertEquals( "/path/to/home", out.getProperties().getProperty( "outputDirectory" ) );
}
- public void testEnvarExpressionThatEvaluatesToNullReturnsTheLiteralString()
- throws Exception
+ @Test
+ public void envarExpressionThatEvaluatesToNullReturnsTheLiteralString() throws Exception
{
Model model = new Model();
@@ -404,15 +385,15 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
assertProblemFree( collector );
assertEquals( out.getProperties().getProperty( "outputDirectory" ), "${env.DOES_NOT_EXIST}" );
}
- public void testExpressionThatEvaluatesToNullReturnsTheLiteralString()
- throws Exception
+ @Test
+ public void expressionThatEvaluatesToNullReturnsTheLiteralString() throws Exception
{
Model model = new Model();
@@ -425,15 +406,15 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model out =
- interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ), collector );
+ Model out = interpolator.interpolateModel( model, new File( "." ), createModelBuildingRequest( context ),
+ collector );
assertProblemFree( collector );
assertEquals( out.getProperties().getProperty( "outputDirectory" ), "${DOES_NOT_EXIST}" );
}
- public void testShouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorrectly()
- throws Exception
+ @Test
+ public void shouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorrectly() throws Exception
{
Model model = new Model();
@@ -472,8 +453,8 @@ public abstract class AbstractModelInterpolatorTest
assertEquals( build.getSourceDirectory(), resIt.next().getDirectory() );
}
- public void testShouldInterpolateUnprefixedBasedirExpression()
- throws Exception
+ @Test
+ public void shouldInterpolateUnprefixedBasedirExpression() throws Exception
{
File basedir = new File( "/test/path" );
Model model = new Model();
@@ -485,21 +466,57 @@ public abstract class AbstractModelInterpolatorTest
ModelInterpolator interpolator = createInterpolator();
final SimpleProblemCollector collector = new SimpleProblemCollector();
- Model result = interpolator.interpolateModel( model, basedir, createModelBuildingRequest( context ), collector );
- assertProblemFree( collector );
+ Model result = interpolator.interpolateModel( model, basedir, createModelBuildingRequest( context ),
+ collector );
+ assertProblemFree( collector );
List<Dependency> rDeps = result.getDependencies();
assertNotNull( rDeps );
assertEquals( 1, rDeps.size() );
assertEquals( new File( basedir, "artifact.jar" ).getAbsolutePath(),
- new File( rDeps.get( 0 ).getSystemPath() ).getAbsolutePath() );
+ new File( rDeps.get( 0 ).getSystemPath() ).getAbsolutePath() );
}
- protected abstract ModelInterpolator createInterpolator( PathTranslator translator )
- throws Exception;
+ @Test
+ public void testRecursiveExpressionCycleNPE() throws Exception
+ {
+ Properties props = new Properties();
+ props.setProperty( "aa", "${bb}" );
+ props.setProperty( "bb", "${aa}" );
+ DefaultModelBuildingRequest request = new DefaultModelBuildingRequest();
+
+ Model model = new Model();
+ model.setProperties( props );
+
+ SimpleProblemCollector collector = new SimpleProblemCollector();
+ ModelInterpolator interpolator = createInterpolator();
+ interpolator.interpolateModel( model, null, request, collector );
+
+ assertCollectorState( 0, 2, 0, collector );
+ assertTrue( collector.getErrors().get( 0 ).contains( "Detected the following recursive expression cycle" ) );
+ }
+
+ @Test
+ public void testRecursiveExpressionCycleBaseDir() throws Exception
+ {
+ Properties props = new Properties();
+ props.setProperty( "basedir", "${basedir}" );
+ DefaultModelBuildingRequest request = new DefaultModelBuildingRequest();
+
+ Model model = new Model();
+ model.setProperties( props );
+
+ SimpleProblemCollector collector = new SimpleProblemCollector();
+ ModelInterpolator interpolator = createInterpolator();
+ interpolator.interpolateModel( model, null, request, collector );
+
+ assertCollectorState( 0, 1, 0, collector );
+ assertEquals(
+ "Resolving expression: '${basedir}': Detected the following recursive expression cycle in 'basedir': [basedir]",
+ collector.getErrors().get( 0 ) );
+ }
- protected abstract ModelInterpolator createInterpolator()
- throws Exception;
+ protected abstract ModelInterpolator createInterpolator() throws Exception;
}
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
index 479f681..3672c20 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
@@ -25,6 +25,7 @@ import org.apache.maven.model.Model;
import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.SimpleProblemCollector;
+import org.junit.Test;
import java.io.File;
import java.lang.reflect.Field;
@@ -37,6 +38,8 @@ import java.util.concurrent.FutureTask;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
/**
* StringSearchModelInterpolatorTest - not in use
@@ -48,28 +51,19 @@ import static org.hamcrest.MatcherAssert.assertThat;
public class StringSearchModelInterpolatorTest
extends AbstractModelInterpolatorTest
{
-
- protected ModelInterpolator interpolator;
-
@Override
- protected void setUp()
- throws Exception
+ public void setUp()
{
super.setUp();
interpolator = new StringSearchModelInterpolator();
}
-
- protected ModelInterpolator createInterpolator( org.apache.maven.model.path.PathTranslator translator )
- {
- return this.interpolator;
- }
-
protected ModelInterpolator createInterpolator()
{
return this.interpolator;
}
+ @Test
public void testInterpolateStringArray()
{
Model model = new Model();
@@ -99,6 +93,7 @@ public class StringSearchModelInterpolatorTest
return config;
}
+ @Test
public void testInterpolateObjectWithStringArrayField()
{
Model model = new Model();
@@ -123,6 +118,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "value2", obj.values[1] );
}
+ @Test
public void testInterpolateObjectWithStringListField()
{
Model model = new Model();
@@ -149,6 +145,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "value2", obj.values.get( 1 ) );
}
+ @Test
public void testInterpolateObjectWithStringListFieldAndOneLiteralValue()
{
Model model = new Model();
@@ -175,6 +172,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "value2", obj.values.get( 1 ) );
}
+ @Test
public void testInterpolateObjectWithUnmodifiableStringListField()
{
Model model = new Model();
@@ -198,6 +196,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "${key}", obj.values.get( 0 ) );
}
+ @Test
public void testInterpolateObjectWithStringArrayListField()
{
Model model = new Model();
@@ -228,6 +227,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "value4", ( (String[]) obj.values.get( 1 ) )[1] );
}
+ @Test
public void testInterpolateObjectWithStringToStringMapField()
{
Model model = new Model();
@@ -254,6 +254,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "value2", obj.values.get( "key2" ) );
}
+ @Test
public void testInterpolateObjectWithStringToStringMapFieldAndOneLiteralValue()
{
Model model = new Model();
@@ -280,6 +281,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "value2", obj.values.get( "key2" ) );
}
+ @Test
public void testInterpolateObjectWithUnmodifiableStringToStringMapField()
{
Model model = new Model();
@@ -303,6 +305,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "${key}", obj.values.get( "key" ) );
}
+ @Test
public void testInterpolateObjectWithStringToStringArrayMapField()
{
Model model = new Model();
@@ -333,6 +336,7 @@ public class StringSearchModelInterpolatorTest
assertEquals( "value4", ( (String[]) obj.values.get( "key2" ) )[1] );
}
+ @Test
public void testInterpolateObjectWithPomFile()
throws Exception
{
@@ -364,6 +368,7 @@ public class StringSearchModelInterpolatorTest
) ) );
}
+ @Test
public void testNotInterpolateObjectWithFile()
throws Exception
{
@@ -411,6 +416,7 @@ public class StringSearchModelInterpolatorTest
return (Map<Class<?>, ?>) field.get( null );
}
+ @Test
public void testNotInterpolateFile()
throws Exception
{
@@ -438,6 +444,7 @@ public class StringSearchModelInterpolatorTest
}
+ @Test
public void testConcurrentInterpolation()
throws Exception
{
@@ -452,7 +459,6 @@ public class StringSearchModelInterpolatorTest
final StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
-
int numItems = 100;
final CountDownLatch countDownLatch = new CountDownLatch(1);
@@ -497,7 +503,6 @@ public class StringSearchModelInterpolatorTest
return new ObjectWithMixedProtection( values, values2, values3, "${key5}" );
}
-
private static final class ObjectWithStringArrayField
{
private final String[] values;
@@ -567,6 +572,7 @@ public class StringSearchModelInterpolatorTest
}
}
+ @Test
public void testFinalFieldsExcludedFromInterpolation()
{
Properties props = new Properties();
@@ -578,7 +584,7 @@ public class StringSearchModelInterpolatorTest
StringSearchModelInterpolator interpolator = new StringSearchModelInterpolator();
interpolator.interpolateObject( new ClassWithFinalField(), new Model(), null, request, problems );
- assertProblemFree( problems );
+ assertProblemFree( problems );
}
static class ClassWithFinalField
@@ -586,7 +592,8 @@ public class StringSearchModelInterpolatorTest
public static final String CONSTANT = "${expression}";
}
- public void testLocationTrackerShouldBeExcludedFromInterpolation()
+ @Test
+ public void locationTrackerShouldBeExcludedFromInterpolation()
{
Properties props = new Properties();
props.setProperty( "expression", "value" );
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolatorTest.java
new file mode 100644
index 0000000..bd201ed
--- /dev/null
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolatorTest.java
@@ -0,0 +1,35 @@
+package org.apache.maven.model.interpolation;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class StringVisitorModelInterpolatorTest extends AbstractModelInterpolatorTest
+{
+ @Override
+ public void setUp()
+ {
+ super.setUp();
+ interpolator = new StringVisitorModelInterpolator();
+ }
+
+ protected ModelInterpolator createInterpolator()
+ {
+ return this.interpolator;
+ }
+}
\ No newline at end of file