public final void execute(Runnable task, long startTimeout) { task = wrap(task); getDelegate().execute(task, startTimeout); }
public final void execute(Runnable task, long startTimeout) { task = wrap(task); getDelegate().execute(task, startTimeout); }
try { if (isAsync) { ((AsyncTaskExecutor) taskExecutor).execute(workHandle, startTimeout);
@Test public void executeStartTimeout() { executor.execute(runnable, 1); verify(getExecutor()).execute(wrappedRunnable, 1); }
try { if (isAsync) { ((AsyncTaskExecutor) taskExecutor).execute(workHandle, startTimeout);
final CountDownLatch latch3 = new CountDownLatch(1); lock1.lockInterruptibly(); this.taskExecutor.execute(() -> { Lock lock2 = JdbcLockRegistryTests.this.registry.obtain("foo"); try {
final CountDownLatch latch3 = new CountDownLatch(1); lock1.lockInterruptibly(); this.taskExecutor.execute(() -> { Lock lock2 = registry2.obtain("foo"); try {
@Test public void testByteArrayBlocksForZeroRead() throws Exception { SocketChannel socketChannel = mock(SocketChannel.class); Socket socket = mock(Socket.class); when(socketChannel.socket()).thenReturn(socket); TcpNioConnection connection = new TcpNioConnection(socketChannel, false, false, null, null); final TcpNioConnection.ChannelInputStream stream = (ChannelInputStream) new DirectFieldAccessor(connection) .getPropertyValue("channelInputStream"); final CountDownLatch latch = new CountDownLatch(1); final byte[] out = new byte[4]; this.executor.execute(() -> { try { stream.read(out); } catch (IOException e) { e.printStackTrace(); } latch.countDown(); }); Thread.sleep(1000); assertEquals(0x00, out[0]); stream.write(ByteBuffer.wrap("foo".getBytes())); assertTrue(latch.await(10, TimeUnit.SECONDS)); assertEquals("foo\u0000", new String(out)); }
final CountDownLatch done = new CountDownLatch(1); final AtomicReference<ServerSocket> serverSocket = new AtomicReference<>(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final CountDownLatch latch = new CountDownLatch(1); final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final CountDownLatch latch = new CountDownLatch(1); final AtomicReference<ServerSocket> serverSocket = new AtomicReference<>(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final CountDownLatch done = new CountDownLatch(1); final AtomicReference<ServerSocket> serverSocket = new AtomicReference<>(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final Semaphore semaphore = new Semaphore(0); final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final Semaphore semaphore = new Semaphore(0); final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final AtomicBoolean done = new AtomicBoolean(); final AtomicReference<ServerSocket> serverSocket = new AtomicReference<>(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0, 10);
final CountDownLatch latch = new CountDownLatch(1); final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final CountDownLatch latch = new CountDownLatch(1); final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final CountDownLatch latch = new CountDownLatch(1); final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final CountDownLatch latch = new CountDownLatch(1); final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { try { ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0);
final AtomicBoolean done = new AtomicBoolean(); this.executor.execute(() -> { List<Socket> sockets = new ArrayList<>(); try {