Fix test failures when JAVA_HOME is not set

This commit is contained in:
Mikolaj Izdebski 2020-03-25 07:00:47 +01:00
parent 8a6c0f0d29
commit b0c39f1527
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,39 @@
From d6623bd636d7f07aa8c73234375bdd11ccd6ee95 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Wed, 25 Mar 2020 06:58:13 +0100
Subject: [PATCH] Use PATH env variable instead of JAVA_HOME
---
.../plexus/interpolation/EnvarBasedValueSourceTest.java | 2 +-
.../plexus/interpolation/fixed/EnvarBasedValueSourceTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java b/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java
index bc88e8b..6fc4c13 100644
--- a/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java
+++ b/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java
@@ -87,7 +87,7 @@ public class EnvarBasedValueSourceTest
EnvarBasedValueSource source = new EnvarBasedValueSource();
- String realEnvVar = "JAVA_HOME";
+ String realEnvVar = "PATH";
String realValue = System.getenv().get( realEnvVar );
assertNotNull( "Can't run this test until " + realEnvVar + " env variable is set", realValue );
diff --git a/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java b/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java
index beaf014..94899d7 100644
--- a/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java
+++ b/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java
@@ -87,7 +87,7 @@ public class EnvarBasedValueSourceTest
EnvarBasedValueSource source = new EnvarBasedValueSource();
- String realEnvVar = "JAVA_HOME";
+ String realEnvVar = "PATH";
String realValue = System.getenv().get( realEnvVar );
assertNotNull( "Can't run this test until " + realEnvVar + " env variable is set", realValue );
--
2.21.0

View File

@ -9,6 +9,8 @@ BuildArch: noarch
Source0: https://github.com/codehaus-plexus/plexus-interpolation/archive/plexus-interpolation-%{version}.tar.gz Source0: https://github.com/codehaus-plexus/plexus-interpolation/archive/plexus-interpolation-%{version}.tar.gz
Patch0: 0001-Use-PATH-env-variable-instead-of-JAVA_HOME.patch
BuildRequires: maven-local-openjdk8 BuildRequires: maven-local-openjdk8
BuildRequires: mvn(junit:junit) BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.codehaus.plexus:plexus-components:pom:) BuildRequires: mvn(org.codehaus.plexus:plexus-components:pom:)
@ -25,6 +27,7 @@ related projects.
%prep %prep
%setup -q -n plexus-interpolation-plexus-interpolation-%{version} %setup -q -n plexus-interpolation-plexus-interpolation-%{version}
%patch0 -p1
%pom_remove_plugin :maven-release-plugin %pom_remove_plugin :maven-release-plugin
%pom_remove_plugin :maven-scm-publish-plugin %pom_remove_plugin :maven-scm-publish-plugin