summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šulc <fordfrog@gentoo.org>2024-07-26 11:33:47 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2024-07-26 11:33:47 +0200
commit8fc319802f811bfc774024d7cf46d3a6815aabde (patch)
tree33812ff99804082cc1e7e716ae964442059f5546 /dev-java
parentdev-java/tomcat-native: sorted variables in 2.0.8 (diff)
downloadgentoo-8fc319802f811bfc774024d7cf46d3a6815aabde.tar.gz
gentoo-8fc319802f811bfc774024d7cf46d3a6815aabde.tar.bz2
gentoo-8fc319802f811bfc774024d7cf46d3a6815aabde.zip
dev-java/stringtemplate: fixed tests in java 21+ for 4.3.4 + simplified applying the patch
Closes: https://bugs.gentoo.org/936535 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21+-TestRenderers.patch (renamed from dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch)8
-rw-r--r--dev-java/stringtemplate/stringtemplate-4.3.4.ebuild9
2 files changed, 8 insertions, 9 deletions
diff --git a/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch b/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21+-TestRenderers.patch
index 127f5e0a4b61..22b271671b8d 100644
--- a/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch
+++ b/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21+-TestRenderers.patch
@@ -6,7 +6,7 @@ there are different space characters used in java 21 (narrow space)
String expecting = "datetime: 7/5/05, 12:00 AM";
if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
expecting = "datetime: 7/5/05 12:00 AM";
-+ } else if ( javaVersion.startsWith("21") ) {
++ } else if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
+ expecting = "datetime: 7/5/05, 12:00 AM";
}
String result = st.render();
@@ -15,7 +15,7 @@ there are different space characters used in java 21 (narrow space)
String expecting = " datetime: 7/5/05, 12:00 AM ";
if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
expecting = " datetime: 7/5/05 12:00 AM ";
-+ } else if ( javaVersion.startsWith("21") ) {
++ } else if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
+ expecting = " datetime: 7/5/05, 12:00 AM ";
}
String result = st.render();
@@ -24,7 +24,7 @@ there are different space characters used in java 21 (narrow space)
String expecting = " datetime: Tuesday, July 5, 2005 at 12:00:00 AM Pacific Daylight Time ";
if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
expecting = " datetime: Tuesday, July 5, 2005 12:00:00 AM PDT ";
-+ } else if ( javaVersion.startsWith("21") ) {
++ } else if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
+ expecting = " datetime: Tuesday, July 5, 2005, 12:00:00 AM Pacific Daylight Time ";
}
String result = st.render();
@@ -33,7 +33,7 @@ there are different space characters used in java 21 (narrow space)
ST st = group.getInstanceOf("dateThing");
st.add("created", new GregorianCalendar(2005, 7 - 1, 5));
String expecting = " time: 12:00:00 AM ";
-+ if ( javaVersion.startsWith("21") ) {
++ if ( Integer.valueOf(javaVersion.replaceAll("^(\\d+).*", "$1")) >= 21 ) {
+ expecting = " time: 12:00:00 AM ";
+ }
String result = st.render();
diff --git a/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild b/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild
index dd01fef37fd3..0ed931834169 100644
--- a/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild
+++ b/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild
@@ -53,7 +53,10 @@ JAVA_TEST_SRC_DIR="${TARBALL_S}/test"
JAVA_TEST_RESOURCE_DIRS=( "${TARBALL_S}/test/resources" )
DOCS=( "${TARBALL_S}/"{CHANGES.txt,README.md} )
-PATCHES=( "${FILESDIR}/stringtemplate-4.3.4-BaseTest-javac-source-target.patch" )
+PATCHES=(
+ "${FILESDIR}/stringtemplate-4.3.4-BaseTest-javac-source-target.patch"
+ "${FILESDIR}/stringtemplate-4.3.4-Java21+-TestRenderers.patch"
+)
src_prepare() {
default #780585
@@ -65,10 +68,6 @@ src_prepare() {
}
src_test() {
- local vm_version="$(java-config -g PROVIDES_VERSION)"
- if ver_test "${vm_version}" -ge 21; then
- eapply "${FILESDIR}/stringtemplate-4.3.4-Java21-TestRenderers.patch"
- fi
# Make sure no older versions of this slot are present in the classpath
# https://bugs.gentoo.org/834138#c4
local old_ver_cp="$(nonfatal java-pkg_getjars "${PN}-${SLOT}")"