Update to byteman 4.0.16 for JDK 17 support

- Drop jboss-modules dependency which isn't needed (wasn't being built)
- This requires objectweb-asm 9.1 for JDK 17 support and testng 7
- Remove tests_pom_xml.patch now included upstream

Resolves: RHBZ#1973765
This commit is contained in:
Severin Gehwolf 2021-06-18 19:06:19 +02:00
parent edaa2f98a0
commit 5f3470230a
5 changed files with 38 additions and 31 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@
/4.0.3.tar.gz
/4.0.4.tar.gz
/4.0.5.tar.gz
/4.0.16.tar.gz

View File

@ -14,12 +14,12 @@
%global bindir %{homedir}/bin
Name: byteman
Version: 4.0.11
Release: 5%{?dist}
Version: 4.0.16
Release: 1%{?dist}
Summary: Java agent-based bytecode injection tool
License: LGPLv2+
URL: http://www.jboss.org/byteman
# wget -O 4.0.11.tar.gz https://github.com/bytemanproject/byteman/archive/4.0.11.tar.gz
# wget -O 4.0.16.tar.gz https://github.com/bytemanproject/byteman/archive/4.0.16.tar.gz
Source0: https://github.com/bytemanproject/byteman/archive/%{version}.tar.gz
BuildArch: noarch
@ -45,18 +45,16 @@ BuildRequires: objectweb-asm
BuildRequires: junit
BuildRequires: junit5
BuildRequires: testng
# JBoss modules byteman plugin requires it
BuildRequires: mvn(org.jboss.modules:jboss-modules)
Provides: bundled(objectweb-asm) = 7.0
Provides: bundled(java_cup) = 1:0.11b-8
Provides: bundled(objectweb-asm) = 9.1
Provides: bundled(java_cup) = 1:0.11b-19
# We are filtering java-headless >= 1:1.9 requirement. Add
# JDK 8 requirement here explicitly which shouldn't match the filter.
Requires: java-headless >= 1:1.8
# Related pieces removed via pom_xpath_remove macros
Patch1: remove_submit_integration_test_verification.patch
Patch2: tests_pom_xml.patch
Patch2: testng7_port.patch
%description
Byteman is a tool which simplifies tracing and testing of Java programs.
@ -131,10 +129,14 @@ sed -i "s|java-cup|java_cup|" tests/pom.xml
# Don't use javadoc plugin, use XMvn for javadocs
%pom_remove_plugin -r :maven-javadoc-plugin
%pom_remove_dep 'org.apache.maven:maven-project' contrib/rulecheck-maven-plugin
%pom_xpath_remove 'pom:execution[pom:id="make-javadoc-assembly"]' byteman
# Put byteman-rulecheck-maven-plugin into a separate package
%mvn_package ":byteman-rulecheck-maven-plugin" rulecheck-maven-plugin
# CNFE being thrown without this for bmunit5 in rawhide and with tests enabled
%pom_add_dep "org.apache.commons:commons-lang3" contrib/bmunit5
# Put byteman-bmunit/byteman-dtest into a separate packages since they
# runtime require junit
%mvn_package ":byteman-bmunit" bmunit
@ -213,6 +215,10 @@ ln -s %{_javadir}/byteman/byteman.jar $RPM_BUILD_ROOT%{homedir}/lib/byteman.jar
%{homedir}/lib/byteman-dtest.jar
%changelog
* Fri Jun 18 2021 Severin Gehwolf <sgehwolf@redhat.com> - 4.0.16-1
- Update to latest upstream 4.0.16 release for JDK 17 support.
- Drop not-needed jboss-modules BR.
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 4.0.11-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937

View File

@ -1 +1 @@
SHA512 (4.0.11.tar.gz) = 05e82df5e6747934c3b80932534118c25571482c4dd0f0be0468a683e6185ca4ae039f7bdabc0151067c2c61cf450b19636c50840ae6749df461dc0a1f305f69
SHA512 (4.0.16.tar.gz) = e0ec3932b698d07e0543988a944ccdf36533147e056218e0cc92d0ed9695dfaa5066482f493607b16732fcf3c6f5107eefdd7930f6877b747cb21bfecdb737dd

22
testng7_port.patch Normal file
View File

@ -0,0 +1,22 @@
diff --git a/byteman-4.0.15/contrib/bmunit/src/org/jboss/byteman/contrib/bmunit/BMNGListener.java b/byteman-4.0.15/contrib/bmunit/src/org/jboss/byteman/contrib/bmunit/BMNGListener.java
index 2f784bc..9e4fec9 100644
--- a/byteman-4.0.15/contrib/bmunit/src/org/jboss/byteman/contrib/bmunit/BMNGListener.java
+++ b/byteman-4.0.15/contrib/bmunit/src/org/jboss/byteman/contrib/bmunit/BMNGListener.java
@@ -61,7 +61,7 @@ public class BMNGListener extends BMNGAbstractRunner implements IInvokedMethodLi
}
public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
- Method javaMethod = method.getTestMethod().getMethod();
+ Method javaMethod = method.getTestMethod().getConstructorOrMethod().getMethod();
Class clazz = javaMethod.getDeclaringClass();
if (!checkBMNGListener(clazz)) {
return;
@@ -81,7 +81,7 @@ public class BMNGListener extends BMNGAbstractRunner implements IInvokedMethodLi
}
public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
- Method javaMethod = method.getTestMethod().getMethod();
+ Method javaMethod = method.getTestMethod().getConstructorOrMethod().getMethod();
Class clazz = javaMethod.getDeclaringClass();
if (!checkBMNGListener(clazz)) {
return;

View File

@ -1,22 +0,0 @@
diff --git a/byteman-4.0.11/tests/pom.xml b/byteman-4.0.11/tests/pom.xml
index 60e4e1a..1a2abed 100644
--- a/byteman-4.0.11/tests/pom.xml
+++ b/byteman-4.0.11/tests/pom.xml
@@ -1166,7 +1166,7 @@
<includes>
<include>org/jboss/byteman/tests/bugfixes/TestTraceOpenAndWrite.class</include>
</includes>
- <argLine>-javaagent:${project.build.directory}/byteman-${project.version}.jar=script:${project.build.testOutputDirectory}/scripts/bugfixes/TestTraceOpenAndWrite.btm</argLine>
+ <argLine>-javaagent:${project.build.directory}/../../byteman/target/byteman-${project.version}.jar=script:${project.build.directory}/../../agent/src/test/resources/scripts/bugfixes/TestTraceOpenAndWrite.btm</argLine>
</configuration>
</execution>
<!-- dynamic rule submission
@@ -2184,7 +2184,7 @@
<includes>
<include>org/jboss/byteman/tests/bugfixes/TestTraceOpenAndWrite.class</include>
</includes>
- <argLine>-Dorg.jboss.byteman.compile.to.bytecode -javaagent:${project.build.directory}/byteman-${project.version}.jar=script:${project.build.testOutputDirectory}/scripts/bugfixes/TestTraceOpenAndWrite.btm</argLine>
+ <argLine>-Dorg.jboss.byteman.compile.to.bytecode -javaagent:${project.build.directory}/../../byteman/target/byteman-${project.version}.jar=script:${project.build.directory}/../../agent/src/test/resources/scripts/bugfixes/TestTraceOpenAndWrite.btm</argLine>
</configuration>
</execution>
<execution>