Commit a4ae5511 authored by Emmanuel Bourg's avatar Emmanuel Bourg

Fixed the build failure with Easymock 4 (Closes: #912516)

parent 6b08f61e
libcommons-lang3-java (3.8-2) unstable; urgency=medium
* Team upload.
* Fixed the build failure with Easymock 4 (Closes: #912516)
-- Emmanuel Bourg <ebourg@apache.org> Mon, 26 Nov 2018 00:50:10 +0100
libcommons-lang3-java (3.8-1) unstable; urgency=medium
* Team upload.
......
Description: Fixes the compatibility with Easymock 4
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
+++ b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
@@ -52,7 +52,7 @@
//for fun, show that the same empty instance is used
assertSame(empty, listenerSupport.getListeners());
- final VetoableChangeListener listener1 = EasyMock.createNiceMock(VetoableChangeListener.class);
+ final VetoableChangeListener listener1 = (VetoableChangeListener) EasyMock.createNiceMock(VetoableChangeListener.class);
listenerSupport.addListener(listener1);
assertEquals(1, listenerSupport.getListeners().length);
listenerSupport.addListener(listener1, false);
@@ -120,10 +120,10 @@
//for fun, show that the same empty instance is used
assertSame(empty, listenerSupport.getListeners());
- final VetoableChangeListener listener1 = EasyMock.createNiceMock(VetoableChangeListener.class);
+ final VetoableChangeListener listener1 = (VetoableChangeListener) EasyMock.createNiceMock(VetoableChangeListener.class);
listenerSupport.addListener(listener1);
assertEquals(1, listenerSupport.getListeners().length);
- final VetoableChangeListener listener2 = EasyMock.createNiceMock(VetoableChangeListener.class);
+ final VetoableChangeListener listener2 = (VetoableChangeListener) EasyMock.createNiceMock(VetoableChangeListener.class);
listenerSupport.addListener(listener2);
assertEquals(2, listenerSupport.getListeners().length);
listenerSupport.removeListener(listener1);
@@ -141,7 +141,7 @@
public void vetoableChange(final PropertyChangeEvent e) {
}
});
- listenerSupport.addListener(EasyMock.createNiceMock(VetoableChangeListener.class));
+ listenerSupport.addListener((VetoableChangeListener) EasyMock.createNiceMock(VetoableChangeListener.class));
//serialize:
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -199,7 +199,7 @@
}
};
- final VetoableChangeListener listener = EasyMock.createNiceMock(VetoableChangeListener.class);
+ final VetoableChangeListener listener = (VetoableChangeListener) EasyMock.createNiceMock(VetoableChangeListener.class);
eventListenerSupport.addListener(listener);
final Object source = new Date();
final PropertyChangeEvent ignore = new PropertyChangeEvent(source, "Hour", 5, 6);
--- a/src/test/java/org/apache/commons/lang3/concurrent/BasicThreadFactoryTest.java
+++ b/src/test/java/org/apache/commons/lang3/concurrent/BasicThreadFactoryTest.java
@@ -97,7 +97,7 @@
*/
@Test
public void testBuilderReset() {
- final ThreadFactory wrappedFactory = EasyMock.createMock(ThreadFactory.class);
+ final ThreadFactory wrappedFactory = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
final Thread.UncaughtExceptionHandler exHandler = EasyMock
.createMock(Thread.UncaughtExceptionHandler.class);
EasyMock.replay(wrappedFactory, exHandler);
@@ -117,7 +117,7 @@
*/
@Test
public void testBuilderResetAfterBuild() {
- builder.wrappedFactory(EasyMock.createNiceMock(ThreadFactory.class))
+ builder.wrappedFactory((ThreadFactory) EasyMock.createNiceMock(ThreadFactory.class))
.namingPattern(PATTERN).daemon(true).build();
checkFactoryDefaults(builder.build());
}
@@ -127,8 +127,8 @@
*/
@Test
public void testNewThreadNamingPattern() {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r = (Runnable) EasyMock.createMock(Runnable.class);
final int count = 12;
for (int i = 0; i < count; i++) {
EasyMock.expect(wrapped.newThread(r)).andReturn(new Thread());
@@ -151,8 +151,8 @@
*/
@Test
public void testNewThreadNoNamingPattern() {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r = (Runnable) EasyMock.createMock(Runnable.class);
final String name = "unchangedThreadName";
final Thread t = new Thread(name);
EasyMock.expect(wrapped.newThread(r)).andReturn(t);
@@ -169,8 +169,8 @@
* @param flag the value of the flag
*/
private void checkDaemonFlag(final boolean flag) {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r = (Runnable) EasyMock.createMock(Runnable.class);
final Thread t = new Thread();
EasyMock.expect(wrapped.newThread(r)).andReturn(t);
EasyMock.replay(wrapped, r);
@@ -203,9 +203,9 @@
*/
@Test
public void testNewThreadNoDaemonFlag() {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r1 = EasyMock.createMock(Runnable.class);
- final Runnable r2 = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r1 = (Runnable) EasyMock.createMock(Runnable.class);
+ final Runnable r2 = (Runnable) EasyMock.createMock(Runnable.class);
final Thread t1 = new Thread();
final Thread t2 = new Thread();
t1.setDaemon(true);
@@ -225,8 +225,8 @@
*/
@Test
public void testNewThreadPriority() {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r = (Runnable) EasyMock.createMock(Runnable.class);
final Thread t = new Thread();
EasyMock.expect(wrapped.newThread(r)).andReturn(t);
EasyMock.replay(wrapped, r);
@@ -244,8 +244,8 @@
*/
@Test
public void testNewThreadNoPriority() {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r = (Runnable) EasyMock.createMock(Runnable.class);
final int orgPriority = Thread.NORM_PRIORITY + 1;
final Thread t = new Thread();
t.setPriority(orgPriority);
@@ -262,8 +262,8 @@
*/
@Test
public void testNewThreadExHandler() {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r = (Runnable) EasyMock.createMock(Runnable.class);
final Thread.UncaughtExceptionHandler handler = EasyMock
.createMock(Thread.UncaughtExceptionHandler.class);
final Thread t = new Thread();
@@ -283,8 +283,8 @@
*/
@Test
public void testNewThreadNoExHandler() {
- final ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
- final Runnable r = EasyMock.createMock(Runnable.class);
+ final ThreadFactory wrapped = (ThreadFactory) EasyMock.createMock(ThreadFactory.class);
+ final Runnable r = (Runnable) EasyMock.createMock(Runnable.class);
final Thread.UncaughtExceptionHandler handler = EasyMock
.createMock(Thread.UncaughtExceptionHandler.class);
final Thread t = new Thread();
disable_testGetUserHome_test.diff
ignore-benchmarks.diff
easymock-compatibility.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment