Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch.await()


        in.setBody("Hello");
        in.setHeader("cheese", 123);
        producer.process(exchange);
       
        // The Activated endpoint should send it to the pojo due to the configured route.
        assertTrue("The message ware received by the Pojo", receivedCountDown.await(5, TimeUnit.SECONDS));
       

  }

    @Override
View Full Code Here


                List nodes = (List) i.next();
                resolveArtifactPool.execute( new ResolveArtifactTask( resolveArtifactPool, latch, nodes,
                                                                      localRepository, resolvedArtifacts,
                                                                      missingArtifacts, resolutionExceptions ) );
            }
            latch.await();
        }
        catch ( InterruptedException e )
        {
            throw new ArtifactResolutionException( "Resolution interrupted", null, e );
        }
View Full Code Here

                }
            }.start();
        }
        barrier.await();
       
        boolean b = doneCountDownLatch.await(30, TimeUnit.SECONDS);
        long end = System.currentTimeMillis();
        log.info("Iterations: "+iterations.get());
        log.info("counter: "+counter.get());
        log.info("Dequeues/s: "+(1000.0*ENQUEUE_COUNT/(end-start)));
        log.info("duration: "+((end-start)/1000.0));
View Full Code Here

                publishDone.countDown();
            }
        }.start();
       
        // Assert that we block:
        assertFalse( publishDone.await(3, TimeUnit.SECONDS)  );
       
        // Restart the remote server.  State should be re-played and the publish should continue.
        remoteURI = remoteConnector.getServer().getConnectURI().toString();
        restartRemoteBroker();
View Full Code Here

        // Restart the remote server.  State should be re-played and the publish should continue.
        remoteURI = remoteConnector.getServer().getConnectURI().toString();
        restartRemoteBroker();

        // This should reconnect, and resend
        assertTrue( publishDone.await(10, TimeUnit.SECONDS)  );

    }

    protected String getLocalURI() {
        return "tcp://localhost:0?wireFormat.tcpNoDelayEnabled=true";
View Full Code Here

      // Test sending to Queue B it should block.
      // Since even though  the it's queue limits have not been reached, the connection
      // is blocked.
      CountDownLatch pubishDoneToQeueuB = asyncSendTo(queueB, "Message 1");
      assertTrue( pubishDoneToQeueuB.await(2, TimeUnit.SECONDS) );
     
      TextMessage msg = (TextMessage) consumer.receive();
      assertEquals("Message 1", msg.getText());
      msg.acknowledge();
     
View Full Code Here

      TextMessage msg = (TextMessage) consumer.receive();
      assertEquals("Message 1", msg.getText());
      msg.acknowledge();
     
      pubishDoneToQeueuB = asyncSendTo(queueB, "Message 2");
      assertTrue( pubishDoneToQeueuB.await(2, TimeUnit.SECONDS) );
     
      msg = (TextMessage) consumer.receive();
      assertEquals("Message 2", msg.getText());
      msg.acknowledge();
    }
View Full Code Here

      // Test sending to Queue B it should block.
      // Since even though  the it's queue limits have not been reached, the connection
      // is blocked.
      CountDownLatch pubishDoneToQeueuB = asyncSendTo(queueB, "Message 1");
      assertFalse( pubishDoneToQeueuB.await(2, TimeUnit.SECONDS) );     
    }


  private void fillQueue(final ActiveMQQueue queue) throws JMSException, InterruptedException {
    final AtomicBoolean done = new AtomicBoolean(true);
View Full Code Here

           
          
        }  
       
       
        latch.await(300000,TimeUnit.MILLISECONDS);
        assertEquals("Still dipatching - count down latch not sprung" , latch.getCount(),0);
        assertEquals("cosumerList - expected: " + MESSAGE_COUNT + " but was: " + consumerList.size(),consumerList.size(),senderList.size());
        assertEquals(senderList,consumerList);
        producerConnection.close();
        consumerConnection.close();      
View Full Code Here

                }
            }
        });
        connection.start();
       
        if( doneCountDownLatch.await(5, TimeUnit.SECONDS) ) {
            if( errorMessage[0]!=null ) {
                fail(errorMessage[0]);
            }           
        } else {
            fail("Timeout waiting for async message delivery to complete.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.