refactoring

pull/2070/head
Nikita Koksharov 6 years ago
parent 765d6ed129
commit 98c73ccc14

@ -98,7 +98,13 @@
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>1.41</version>
<version>1.46</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>joor-java-8</artifactId>
<version>0.9.11</version>
<scope>test</scope>
</dependency>
<dependency>

@ -102,8 +102,7 @@ public class RedissonExecutorService implements RScheduledExecutorService {
private static final Logger LOGGER = LoggerFactory.getLogger(RedissonExecutorService.class);
@SuppressWarnings("StaticVariableName")
private static RemoteInvocationOptions RESULT_OPTIONS = RemoteInvocationOptions.defaults().noAck().expectResultWithin(1, TimeUnit.HOURS);
private static final RemoteInvocationOptions RESULT_OPTIONS = RemoteInvocationOptions.defaults().noAck().expectResultWithin(1, TimeUnit.HOURS);
public static final int SHUTDOWN_STATE = 1;
public static final int TERMINATED_STATE = 2;

@ -13,6 +13,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.joor.Reflect;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@ -105,7 +106,8 @@ public class RedissonScheduledExecutorServiceTest extends BaseTest {
assertThat(f.isSuccess()).isTrue();
assertThat(System.currentTimeMillis() - start).isBetween(11000L, 11500L);
Deencapsulation.setField(RedissonExecutorService.class, "RESULT_OPTIONS", RemoteInvocationOptions.defaults().noAck().expectResultWithin(3, TimeUnit.SECONDS));
Reflect.onClass(RedissonExecutorService.class).set("RESULT_OPTIONS", RemoteInvocationOptions.defaults().noAck().expectResultWithin(3, TimeUnit.SECONDS));
executor = redisson.getExecutorService("test", ExecutorOptions.defaults().taskRetryInterval(5, TimeUnit.SECONDS));
start = System.currentTimeMillis();
RScheduledFuture<?> f1 = executor.schedule(new ScheduledCallableTask(), 5, TimeUnit.SECONDS);

Loading…
Cancel
Save