From 193f8f38c37af249efd0146f71695208d93e3fe1 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 29 Aug 2019 15:24:40 +0200 Subject: [PATCH] Port to hamcrest 2.1 --- 0002-Port-to-hamcrest-2.1.patch | 79 +++++++++++++++++++++++++++++++++ maven-shared-utils.spec | 7 ++- 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 0002-Port-to-hamcrest-2.1.patch diff --git a/0002-Port-to-hamcrest-2.1.patch b/0002-Port-to-hamcrest-2.1.patch new file mode 100644 index 0000000..f975bac --- /dev/null +++ b/0002-Port-to-hamcrest-2.1.patch @@ -0,0 +1,79 @@ +From 613f27fe7ff4a89c21689a16f6f6b9b3e0b7c347 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Thu, 29 Aug 2019 15:04:46 +0200 +Subject: [PATCH] Port to hamcrest 2.1 + +--- + .../shared/utils/reflection/ReflectorTest.java | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTest.java b/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTest.java +index 0088361..09f6048 100644 +--- a/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTest.java ++++ b/src/test/java/org/apache/maven/shared/utils/reflection/ReflectorTest.java +@@ -50,7 +50,7 @@ public class ReflectorTest + public void newInstanceClassNull() + throws Exception + { +- assertThat( reflector.newInstance( Object.class, null ), is( Object.class ) ); ++ assertThat( reflector.newInstance( Object.class, null ), isA( Object.class ) ); + } + + @Test( expected = NullPointerException.class ) +@@ -64,7 +64,7 @@ public class ReflectorTest + public void newInstanceClassEmptyArray() + throws Exception + { +- assertThat( reflector.newInstance( Object.class, new Object[0] ), is( Object.class ) ); ++ assertThat( reflector.newInstance( Object.class, new Object[0] ), isA( Object.class ) ); + } + + @Test( expected = ReflectorException.class ) +@@ -156,7 +156,7 @@ public class ReflectorTest + public void getSingletonClassNull() + throws Exception + { +- assertThat( reflector.getSingleton( (Class)Object.class, (Object)null ), is( Object.class ) ); ++ assertThat( reflector.getSingleton( (Class)Object.class, (Object)null ), isA( Object.class ) ); + } + + @Test( expected = NullPointerException.class ) +@@ -170,7 +170,7 @@ public class ReflectorTest + public void getSingletonClassEmptyArray() + throws Exception + { +- assertThat( reflector.getSingleton( Object.class, new Object[0] ), is( Object.class ) ); ++ assertThat( reflector.getSingleton( Object.class, new Object[0] ), isA( Object.class ) ); + } + + @Test( expected = ReflectorException.class ) +@@ -787,7 +787,7 @@ public class ReflectorTest + public void invokeStaticClassNullNull() + throws Exception + { +- assertThat( reflector.invokeStatic( Object.class, (String)null, (Object)null ), is( Object.class ) ); ++ assertThat( reflector.invokeStatic( Object.class, (String)null, (Object)null ), isA( Object.class ) ); + } + + @Test( expected = NullPointerException.class ) +@@ -801,7 +801,7 @@ public class ReflectorTest + public void invokeStaticClassNullEmptyArray() + throws Exception + { +- assertThat( reflector.invokeStatic( Object.class, null, new Object[0] ), is( Object.class ) ); ++ assertThat( reflector.invokeStatic( Object.class, null, new Object[0] ), isA( Object.class ) ); + } + + @Test( expected = NullPointerException.class ) +@@ -829,7 +829,7 @@ public class ReflectorTest + public void invokeStaticClassEmptyEmptyArray() + throws Exception + { +- assertThat( reflector.invokeStatic( Object.class, "", new Object[0] ), is( Object.class ) ); ++ assertThat( reflector.invokeStatic( Object.class, "", new Object[0] ), isA( Object.class ) ); + } + + @Test( expected = IllegalArgumentException.class ) +-- +2.21.0 + diff --git a/maven-shared-utils.spec b/maven-shared-utils.spec index 31b0aca..b2958f2 100644 --- a/maven-shared-utils.spec +++ b/maven-shared-utils.spec @@ -8,7 +8,9 @@ BuildArch: noarch Source0: http://repo1.maven.org/maven2/org/apache/maven/shared/%{name}/%{version}/%{name}-%{version}-source-release.zip # XXX temporary for maven upgrade -Patch0: 0001-Restore-compatibility-with-current-maven.patch +Patch1: 0001-Restore-compatibility-with-current-maven.patch + +Patch2: 0002-Port-to-hamcrest-2.1.patch BuildRequires: maven-local BuildRequires: mvn(com.google.code.findbugs:jsr305) @@ -35,7 +37,8 @@ a lot of unused code. %prep %setup -q -%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %pom_remove_plugin org.codehaus.mojo:findbugs-maven-plugin