Remove unused java patch

Julien LepillerMon Feb 12 10:17:56+0100 2018

7236104

Remove unused java patch

java-powermock-fix-java-files.patch unknown status 2

1-
From 1ac84b58b4383fa118d98c35956d722d11cf449e Mon Sep 17 00:00:00 2001
2-
From: Julien Lepiller <julien@lepiller.eu>
3-
Date: Tue, 22 Aug 2017 20:40:27 +0200
4-
Subject: [PATCH] Fix java files.
5-
6-
---
7-
 .../internal/impl/DelegatingPowerMockRunner.java   | 13 +++++++---
8-
 .../java/org/powermock/reflect/WhiteBoxTest.java   | 30 +++++++++++-----------
9-
 .../reflect/internal/proxy/ClassFactory.java       |  6 ++---
10-
 3 files changed, 27 insertions(+), 22 deletions(-)
11-
12-
diff --git a/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java b/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java
13-
index 301f854..caecbbd 100644
14-
--- a/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java
15-
+++ b/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java
16-
@@ -98,12 +98,17 @@ implements PowerMockJUnitRunnerDelegate, Filterable {
17-
             @Override
18-
             public Runner call() throws Exception {
19-
                 try {
20-
-                    return Whitebox.invokeConstructor(
21-
-                            testClass.isAnnotationPresent(PowerMockRunnerDelegate.class)
22-
-                            ? testClass.getAnnotation(PowerMockRunnerDelegate.class).value()
23-
-                            : PowerMockRunnerDelegate.DefaultJUnitRunner.class,
24-
+                    if(testClass.isAnnotationPresent(PowerMockRunnerDelegate.class)) {
25-
+                        return Whitebox.invokeConstructor(
26-
+                            testClass.getAnnotation(PowerMockRunnerDelegate.class).value(),
27-
                             new Class[] {Class.class},
28-
                             new Object[] {testClass});
29-
+                    } else {
30-
+                        return Whitebox.invokeConstructor(
31-
+                            PowerMockRunnerDelegate.DefaultJUnitRunner.class,
32-
+                            new Class[] {Class.class},
33-
+                            new Object[] {testClass});
34-
+                    }
35-
                 } catch (ConstructorNotFoundException rootProblem) {
36-
                     if (testClass.isAnnotationPresent(PowerMockRunnerDelegate.class)
37-
                             && JUnitVersion.isGreaterThanOrEqualTo("4.5")) {
38-
diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
39-
index bf1e2e3..0d60487 100644
40-
--- a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
41-
+++ b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
42-
@@ -248,7 +248,7 @@ public class WhiteBoxTest {
43-
 
44-
     @Test
45-
     public void testMethodWithPrimitiveAndWrappedInt_primtive_wrapped() throws Exception {
46-
-        assertEquals(17, Whitebox.invokeMethod(new ClassWithPrivateMethods(), "methodWithPrimitiveAndWrappedInt",
47-
+        assertEquals((Integer)17, Whitebox.invokeMethod(new ClassWithPrivateMethods(), "methodWithPrimitiveAndWrappedInt",
48-
                                                new Class[]{int.class, Integer.class}, 9, Integer.valueOf(8)));
49-
     }
50-
 
51-
@@ -257,7 +257,7 @@ public class WhiteBoxTest {
52-
         int expected = 123;
53-
         Whitebox.setInternalState(ClassWithInternalState.class, "staticState", expected);
54-
         assertEquals(expected, ClassWithInternalState.getStaticState());
55-
-        assertEquals(expected, Whitebox.getInternalState(ClassWithInternalState.class, "staticState"));
56-
+        assertEquals(expected, (int)Whitebox.getInternalState(ClassWithInternalState.class, "staticState"));
57-
     }
58-
 
59-
 	@Test
60-
@@ -334,25 +334,25 @@ public class WhiteBoxTest {
61-
     @Test
62-
     public void testInvokeVarArgsMethod_multipleValues() throws Exception {
63-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
64-
-        assertEquals(6, Whitebox.invokeMethod(tested, "varArgsMethod", 1, 2, 3));
65-
+        assertEquals(6, (int)Whitebox.invokeMethod(tested, "varArgsMethod", 1, 2, 3));
66-
     }
67-
 
68-
     @Test
69-
     public void testInvokeVarArgsMethod_noArguments() throws Exception {
70-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
71-
-        assertEquals(0, Whitebox.invokeMethod(tested, "varArgsMethod"));
72-
+        assertEquals(0, (int)Whitebox.invokeMethod(tested, "varArgsMethod"));
73-
     }
74-
 
75-
     @Test
76-
     public void testInvokeVarArgsMethod_oneArgument() throws Exception {
77-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
78-
-        assertEquals(4, Whitebox.invokeMethod(tested, "varArgsMethod", 2));
79-
+        assertEquals(4, (int)Whitebox.invokeMethod(tested, "varArgsMethod", 2));
80-
     }
81-
 
82-
     @Test
83-
     public void testInvokeVarArgsMethod_invokeVarArgsWithOneArgument() throws Exception {
84-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
85-
-        assertEquals(1, Whitebox.invokeMethod(tested, "varArgsMethod", new Class<?>[]{int[].class}, 1));
86-
+        assertEquals(1, (int)Whitebox.invokeMethod(tested, "varArgsMethod", new Class<?>[]{int[].class}, 1));
87-
     }
88-
 
89-
     @Test
90-
@@ -376,7 +376,7 @@ public class WhiteBoxTest {
91-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
92-
         };
93-
         Whitebox.setInternalState(tested, fieldName, value);
94-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
95-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
96-
     }
97-
 
98-
     @Test
99-
@@ -387,8 +387,8 @@ public class WhiteBoxTest {
100-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
101-
         };
102-
         Whitebox.setInternalState(tested, fieldName, value);
103-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
104-
-        assertEquals(-1, Whitebox.getInternalState(tested, fieldName, ClassWithInternalState.class));
105-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
106-
+        assertEquals(-1, (int)Whitebox.getInternalState(tested, fieldName, ClassWithInternalState.class));
107-
     }
108-
 
109-
     @Test(expected = IllegalArgumentException.class)
110-
@@ -398,7 +398,7 @@ public class WhiteBoxTest {
111-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
112-
         };
113-
         Whitebox.setInternalState(tested, fieldName, new Object());
114-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
115-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
116-
     }
117-
 
118-
     @Test(expected = IllegalArgumentException.class)
119-
@@ -408,7 +408,7 @@ public class WhiteBoxTest {
120-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
121-
         };
122-
         Whitebox.setInternalState(tested, fieldName, (Object) null);
123-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
124-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
125-
     }
126-
 
127-
     @Test
128-
@@ -417,8 +417,8 @@ public class WhiteBoxTest {
129-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState();
130-
         Whitebox.setInternalState(tested, int.class, value);
131-
         assertEquals(value, (int) Whitebox.getInternalState(tested, int.class));
132-
-        assertEquals(value, Whitebox.getInternalState(tested, "anotherInternalState"));
133-
-        assertEquals(value, Whitebox.getInternalState(tested, "anotherInternalState",
134-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "anotherInternalState"));
135-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "anotherInternalState",
136-
                                                       ClassWithChildThatHasInternalState.class));
137-
     }
138-
 
139-
@@ -429,7 +429,7 @@ public class WhiteBoxTest {
140-
         Whitebox.setInternalState(tested, int.class, value, ClassWithInternalState.class);
141-
         assertEquals(42, (int) Whitebox.getInternalState(tested, int.class));
142-
         assertEquals(value, (int) Whitebox.getInternalState(tested, int.class, ClassWithInternalState.class));
143-
-        assertEquals(value, Whitebox.getInternalState(tested, "staticState", ClassWithInternalState.class));
144-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "staticState", ClassWithInternalState.class));
145-
     }
146-
 
147-
     @Test
148-
@@ -619,7 +619,7 @@ public class WhiteBoxTest {
149-
     @Test
150-
     public void testInvokeMethodWithBothNormalAndVarArgsParameter() throws Exception {
151-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
152-
-        assertEquals(4, Whitebox.invokeMethod(tested, "varArgsMethod2", 1, 2, 3));
153-
+        assertEquals(4, (int)Whitebox.invokeMethod(tested, "varArgsMethod2", 1, 2, 3));
154-
     }
155-
 
156-
     @Test
157-
diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java b/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
158-
index a5e5fda..14b8bbe 100644
159-
--- a/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
160-
+++ b/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
161-
@@ -1,8 +1,8 @@
162-
 package org.powermock.reflect.internal.proxy;
163-
 
164-
-import net.sf.cglib.asm.ClassWriter;
165-
-import net.sf.cglib.asm.MethodVisitor;
166-
-import net.sf.cglib.asm.Opcodes;
167-
+import org.objectweb.asm.ClassWriter;
168-
+import org.objectweb.asm.MethodVisitor;
169-
+import org.objectweb.asm.Opcodes;
170-
 
171-
 class ClassFactory implements Opcodes {
172-
     
173-
-- 
174-
2.14.1
175-

java-powermock-fix-tests.patch unknown status 2

1-
From 09f037e0fbb55e9a1f3762c64cad4bf72d14d971 Mon Sep 17 00:00:00 2001
2-
From: Julien Lepiller <julien@lepiller.eu>
3-
Date: Tue, 22 Aug 2017 20:40:27 +0200
4-
Subject: [PATCH] Fix tests.
5-
6-
---
7-
 .../java/org/powermock/reflect/WhiteBoxTest.java   | 30 +++++++++++-----------
8-
 .../reflect/internal/proxy/ClassFactory.java       |  6 ++---
9-
 2 files changed, 18 insertions(+), 18 deletions(-)
10-
11-
diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
12-
index bf1e2e3..0d60487 100644
13-
--- a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
14-
+++ b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
15-
@@ -248,7 +248,7 @@ public class WhiteBoxTest {
16-
 
17-
     @Test
18-
     public void testMethodWithPrimitiveAndWrappedInt_primtive_wrapped() throws Exception {
19-
-        assertEquals(17, Whitebox.invokeMethod(new ClassWithPrivateMethods(), "methodWithPrimitiveAndWrappedInt",
20-
+        assertEquals((Integer)17, Whitebox.invokeMethod(new ClassWithPrivateMethods(), "methodWithPrimitiveAndWrappedInt",
21-
                                                new Class[]{int.class, Integer.class}, 9, Integer.valueOf(8)));
22-
     }
23-
 
24-
@@ -257,7 +257,7 @@ public class WhiteBoxTest {
25-
         int expected = 123;
26-
         Whitebox.setInternalState(ClassWithInternalState.class, "staticState", expected);
27-
         assertEquals(expected, ClassWithInternalState.getStaticState());
28-
-        assertEquals(expected, Whitebox.getInternalState(ClassWithInternalState.class, "staticState"));
29-
+        assertEquals(expected, (int)Whitebox.getInternalState(ClassWithInternalState.class, "staticState"));
30-
     }
31-
 
32-
 	@Test
33-
@@ -334,25 +334,25 @@ public class WhiteBoxTest {
34-
     @Test
35-
     public void testInvokeVarArgsMethod_multipleValues() throws Exception {
36-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
37-
-        assertEquals(6, Whitebox.invokeMethod(tested, "varArgsMethod", 1, 2, 3));
38-
+        assertEquals(6, (int)Whitebox.invokeMethod(tested, "varArgsMethod", 1, 2, 3));
39-
     }
40-
 
41-
     @Test
42-
     public void testInvokeVarArgsMethod_noArguments() throws Exception {
43-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
44-
-        assertEquals(0, Whitebox.invokeMethod(tested, "varArgsMethod"));
45-
+        assertEquals(0, (int)Whitebox.invokeMethod(tested, "varArgsMethod"));
46-
     }
47-
 
48-
     @Test
49-
     public void testInvokeVarArgsMethod_oneArgument() throws Exception {
50-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
51-
-        assertEquals(4, Whitebox.invokeMethod(tested, "varArgsMethod", 2));
52-
+        assertEquals(4, (int)Whitebox.invokeMethod(tested, "varArgsMethod", 2));
53-
     }
54-
 
55-
     @Test
56-
     public void testInvokeVarArgsMethod_invokeVarArgsWithOneArgument() throws Exception {
57-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
58-
-        assertEquals(1, Whitebox.invokeMethod(tested, "varArgsMethod", new Class<?>[]{int[].class}, 1));
59-
+        assertEquals(1, (int)Whitebox.invokeMethod(tested, "varArgsMethod", new Class<?>[]{int[].class}, 1));
60-
     }
61-
 
62-
     @Test
63-
@@ -376,7 +376,7 @@ public class WhiteBoxTest {
64-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
65-
         };
66-
         Whitebox.setInternalState(tested, fieldName, value);
67-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
68-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
69-
     }
70-
 
71-
     @Test
72-
@@ -387,8 +387,8 @@ public class WhiteBoxTest {
73-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
74-
         };
75-
         Whitebox.setInternalState(tested, fieldName, value);
76-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
77-
-        assertEquals(-1, Whitebox.getInternalState(tested, fieldName, ClassWithInternalState.class));
78-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
79-
+        assertEquals(-1, (int)Whitebox.getInternalState(tested, fieldName, ClassWithInternalState.class));
80-
     }
81-
 
82-
     @Test(expected = IllegalArgumentException.class)
83-
@@ -398,7 +398,7 @@ public class WhiteBoxTest {
84-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
85-
         };
86-
         Whitebox.setInternalState(tested, fieldName, new Object());
87-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
88-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
89-
     }
90-
 
91-
     @Test(expected = IllegalArgumentException.class)
92-
@@ -408,7 +408,7 @@ public class WhiteBoxTest {
93-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
94-
         };
95-
         Whitebox.setInternalState(tested, fieldName, (Object) null);
96-
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
97-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
98-
     }
99-
 
100-
     @Test
101-
@@ -417,8 +417,8 @@ public class WhiteBoxTest {
102-
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState();
103-
         Whitebox.setInternalState(tested, int.class, value);
104-
         assertEquals(value, (int) Whitebox.getInternalState(tested, int.class));
105-
-        assertEquals(value, Whitebox.getInternalState(tested, "anotherInternalState"));
106-
-        assertEquals(value, Whitebox.getInternalState(tested, "anotherInternalState",
107-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "anotherInternalState"));
108-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "anotherInternalState",
109-
                                                       ClassWithChildThatHasInternalState.class));
110-
     }
111-
 
112-
@@ -429,7 +429,7 @@ public class WhiteBoxTest {
113-
         Whitebox.setInternalState(tested, int.class, value, ClassWithInternalState.class);
114-
         assertEquals(42, (int) Whitebox.getInternalState(tested, int.class));
115-
         assertEquals(value, (int) Whitebox.getInternalState(tested, int.class, ClassWithInternalState.class));
116-
-        assertEquals(value, Whitebox.getInternalState(tested, "staticState", ClassWithInternalState.class));
117-
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "staticState", ClassWithInternalState.class));
118-
     }
119-
 
120-
     @Test
121-
@@ -619,7 +619,7 @@ public class WhiteBoxTest {
122-
     @Test
123-
     public void testInvokeMethodWithBothNormalAndVarArgsParameter() throws Exception {
124-
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
125-
-        assertEquals(4, Whitebox.invokeMethod(tested, "varArgsMethod2", 1, 2, 3));
126-
+        assertEquals(4, (int)Whitebox.invokeMethod(tested, "varArgsMethod2", 1, 2, 3));
127-
     }
128-
 
129-
     @Test
130-
diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java b/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
131-
index a5e5fda..14b8bbe 100644
132-
--- a/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
133-
+++ b/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
134-
@@ -1,8 +1,8 @@
135-
 package org.powermock.reflect.internal.proxy;
136-
 
137-
-import net.sf.cglib.asm.ClassWriter;
138-
-import net.sf.cglib.asm.MethodVisitor;
139-
-import net.sf.cglib.asm.Opcodes;
140-
+import org.objectweb.asm.ClassWriter;
141-
+import org.objectweb.asm.MethodVisitor;
142-
+import org.objectweb.asm.Opcodes;
143-
 
144-
 class ClassFactory implements Opcodes {
145-
     
146-
-- 
147-
2.13.4
148-