+ remove @Override annotations to allow the code to be compiled on 1.5 (though it requires JDK 6 for its collection support)
This commit is contained in:
@@ -78,7 +78,7 @@ public class Address implements Serializable {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
@@ -87,7 +87,7 @@ public class Address implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class Person implements Serializable {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
@@ -91,7 +91,7 @@ public class Person implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
|
||||
package org.springframework.data.redis.cache;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -57,12 +58,12 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
return CollectionTestParams.testParams();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected Cache createCache(RedisTemplate nativeCache) {
|
||||
return new RedisCache(CACHE_NAME, CACHE_NAME.concat(":").getBytes(), nativeCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected RedisTemplate createNativeCache() throws Exception {
|
||||
return template;
|
||||
}
|
||||
@@ -79,7 +80,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
ConnectionFactoryTracker.cleanUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected Object getObject() {
|
||||
return objFactory.instance();
|
||||
}
|
||||
@@ -98,7 +99,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
final Object monitor = new Object();
|
||||
|
||||
Thread th = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
||||
public void run() {
|
||||
synchronized (monitor) {
|
||||
monitor.notify();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class NamespaceTest {
|
||||
public void testSanityTest() throws Exception {
|
||||
RedisMessageListenerContainer container = ctx.getBean(RedisMessageListenerContainer.class);
|
||||
assertTrue(container.isRunning());
|
||||
Thread.sleep(TimeUnit.SECONDS.toMillis(2));
|
||||
Thread.sleep(TimeUnit.SECONDS.toMillis(8));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -57,7 +57,7 @@ public class NamespaceTest {
|
||||
StringRedisTemplate template = ctx.getBean(StringRedisTemplate.class);
|
||||
template.convertAndSend("x1", "[X]test");
|
||||
template.convertAndSend("z1", "[Z]test");
|
||||
Thread.sleep(TimeUnit.SECONDS.toMillis(5));
|
||||
Thread.sleep(TimeUnit.SECONDS.toMillis(8));
|
||||
}
|
||||
|
||||
public void testErrorHandler() throws Exception {
|
||||
|
||||
@@ -27,7 +27,7 @@ public class StubErrorHandler implements ErrorHandler {
|
||||
|
||||
public BlockingDeque<Throwable> throwables = new LinkedBlockingDeque<Throwable>();
|
||||
|
||||
@Override
|
||||
|
||||
public void handleError(Throwable t) {
|
||||
throwables.add(t);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
final BlockingDeque<Message> queue = new LinkedBlockingDeque<Message>();
|
||||
|
||||
final MessageListener ml = new MessageListener() {
|
||||
@Override
|
||||
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
queue.add(message);
|
||||
System.out.println("received message");
|
||||
@@ -217,7 +217,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
final AtomicBoolean flag = new AtomicBoolean(true);
|
||||
|
||||
Runnable listener = new Runnable() {
|
||||
@Override
|
||||
|
||||
public void run() {
|
||||
subConn.subscribe(ml, channel);
|
||||
System.out.println("Subscribed");
|
||||
@@ -256,7 +256,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
|
||||
MessageListener listener = new MessageListener() {
|
||||
|
||||
@Override
|
||||
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
assertArrayEquals(expectedChannel, message.getChannel());
|
||||
assertArrayEquals(expectedMessage, message.getBody());
|
||||
@@ -264,7 +264,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
};
|
||||
|
||||
Thread th = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
||||
public void run() {
|
||||
// sleep 1 second to let the registration happen
|
||||
try {
|
||||
@@ -293,7 +293,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
|
||||
MessageListener listener = new MessageListener() {
|
||||
|
||||
@Override
|
||||
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
assertArrayEquals(expectedPattern, pattern);
|
||||
assertArrayEquals(expectedMessage, message.getBody());
|
||||
@@ -302,7 +302,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
};
|
||||
|
||||
Thread th = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
||||
public void run() {
|
||||
// sleep 1 second to let the registration happen
|
||||
try {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
|
||||
factory.afterPropertiesSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected RedisConnectionFactory getConnectionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class JRedisConnectionIntegrationTests extends AbstractConnectionIntegrat
|
||||
factory.afterPropertiesSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected RedisConnectionFactory getConnectionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class RjcConnectionIntegrationTests extends AbstractConnectionIntegration
|
||||
factory.afterPropertiesSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected RedisConnectionFactory getConnectionFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SessionTest {
|
||||
final StringRedisTemplate template = new StringRedisTemplate(factory);
|
||||
|
||||
template.execute(new SessionCallback<Object>() {
|
||||
@Override
|
||||
|
||||
public Object execute(RedisOperations operations) {
|
||||
checkConnection(template, conn);
|
||||
template.discard();
|
||||
@@ -56,7 +56,7 @@ public class SessionTest {
|
||||
private void checkConnection(RedisTemplate<?, ?> template, final RedisConnection expectedConnection) {
|
||||
template.execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
|
||||
public Object doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
assertSame(expectedConnection, connection);
|
||||
return null;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class MessageListenerTest {
|
||||
|
||||
MessageListenerAdapter adapter = new MessageListenerAdapter(mock) {
|
||||
|
||||
@Override
|
||||
|
||||
protected void handleListenerException(Throwable ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.springframework.data.redis.connection.MessageListener;
|
||||
*/
|
||||
public class ThrowableMessageListener implements MessageListener {
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
throw new IllegalStateException("throwing exception for message " + message);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.data.redis.hash.HashMapper;
|
||||
*/
|
||||
public class BeanUtilsHashMapperTest extends AbstractHashMapperTest {
|
||||
|
||||
@Override
|
||||
|
||||
protected HashMapper mapperFor(Class t) {
|
||||
return new BeanUtilsHashMapper(t);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.data.redis.hash.JacksonHashMapper;
|
||||
|
||||
public class JacksonHashMapperTest extends AbstractHashMapperTest {
|
||||
|
||||
@Override
|
||||
|
||||
protected HashMapper mapperFor(Class t) {
|
||||
return new JacksonHashMapper(t);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class SimpleRedisSerializerTests {
|
||||
private static class A implements Serializable {
|
||||
private Integer value = Integer.valueOf(30);
|
||||
|
||||
@Override
|
||||
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
@@ -45,7 +45,7 @@ public class SimpleRedisSerializerTests {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
@@ -68,7 +68,7 @@ public class SimpleRedisSerializerTests {
|
||||
private String name = getClass().getName();
|
||||
private A a = new A();
|
||||
|
||||
@Override
|
||||
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
@@ -77,7 +77,7 @@ public class SimpleRedisSerializerTests {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
||||
@@ -93,7 +93,7 @@ public abstract class AbstractRedisCollectionTests<T> {
|
||||
collection.getOperations().delete(Collections.singleton(collection.getKey()));
|
||||
template.execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.flushDb();
|
||||
return null;
|
||||
|
||||
@@ -100,7 +100,7 @@ public abstract class AbstractRedisMapTests<K, V> {
|
||||
map.getOperations().delete(Collections.singleton(map.getKey()));
|
||||
template.execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.flushDb();
|
||||
return null;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class PersonObjectFactory implements ObjectFactory<Person> {
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
@Override
|
||||
|
||||
public Person instance() {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
return new Person(uuid, uuid, ++counter, new Address(uuid, counter));
|
||||
|
||||
@@ -67,7 +67,7 @@ public class RedisCollectionFactoryBeanTests {
|
||||
// clean up the whole db
|
||||
template.execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.flushDb();
|
||||
return null;
|
||||
|
||||
@@ -37,12 +37,12 @@ public class RedisListTests extends AbstractRedisListTests<Object> {
|
||||
super(factory, template);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
RedisStore copyStore(RedisStore store) {
|
||||
return new DefaultRedisList(store.getKey().toString(), store.getOperations());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
AbstractRedisCollection<Object> createCollection() {
|
||||
String redisName = getClass().getName();
|
||||
return new DefaultRedisList(redisName, template);
|
||||
|
||||
@@ -42,7 +42,7 @@ public class RedisMapTests extends AbstractRedisMapTests<Object, Object> {
|
||||
super(keyFactory, valueFactory, template);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
RedisMap<Object, Object> createMap() {
|
||||
String redisName = getClass().getSimpleName();
|
||||
return new DefaultRedisMap<Object, Object>(redisName, template);
|
||||
|
||||
@@ -66,14 +66,14 @@ public class RedisPropertiesTests extends RedisMapTests {
|
||||
super(keyFactory, valueFactory, template);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
RedisMap<Object, Object> createMap() {
|
||||
String redisName = getClass().getSimpleName();
|
||||
props = new RedisProperties(defaults, redisName, new StringRedisTemplate(template.getConnectionFactory()));
|
||||
return props;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected RedisStore copyStore(RedisStore store) {
|
||||
return new RedisProperties(store.getKey(), store.getOperations());
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@ public class RedisSetTests extends AbstractRedisSetTests<Object> {
|
||||
super(factory, template);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
RedisStore copyStore(RedisStore store) {
|
||||
return new DefaultRedisSet(store.getKey().toString(), store.getOperations());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
AbstractRedisCollection<Object> createCollection() {
|
||||
String redisName = getClass().getName();
|
||||
return new DefaultRedisSet(redisName, template);
|
||||
|
||||
@@ -37,12 +37,12 @@ public class RedisZSetTests extends AbstractRedisZSetTest<Object> {
|
||||
super(factory, template);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
RedisStore copyStore(RedisStore store) {
|
||||
return new DefaultRedisZSet(store.getKey().toString(), store.getOperations());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
AbstractRedisCollection<Object> createCollection() {
|
||||
String redisName = getClass().getName();
|
||||
return new DefaultRedisZSet(redisName, template);
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.UUID;
|
||||
*/
|
||||
public class StringObjectFactory implements ObjectFactory<String> {
|
||||
|
||||
@Override
|
||||
|
||||
public String instance() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user