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

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


        _sender.start();

        _sender.join();
        _receiver.join();

        assertTrue(disconnectedLatch.await(20000, TimeUnit.MILLISECONDS));

        assertFalse(_receiver.isConnected());
    }

    public void testSendPushPull() throws Exception
View Full Code Here


        proxyPushSupplier_.connect_typed_push_consumer(_consumer);

        // run test
        objectUnderTest_.getMessageConsumer().queueMessage(_event.getHandle());

        assertTrue(_hasReceived.await(5000, TimeUnit.MILLISECONDS));
       
        // verify results
        _mockCoffee.verify();
    }
View Full Code Here

            }
        }.start();

        objectUnderTest_.getMessageConsumer().queueMessage(_mesg.getHandle());

        assertTrue(_latch.await(1000, TimeUnit.MICROSECONDS));

        assertEquals("jacorb", _name.value);
        assertEquals(10, _minutes.value);
    }
View Full Code Here

        {
            public void run()
            {
                try
                {
                    getPutOrder.await();

                    objectUnderTest_.enqeue(mesg.getHandle());

                    delivered.set(true);
View Full Code Here

            }
        };

        _taskProcessor.processMessage(_event);

        _latch.await();

        assertFalse(failed.get());
       
        _taskProcessor.dispose();
    }
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

                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", originatingArtifact, e );
        }
View Full Code Here

        c1.set( future.getSession() );
        ((IoSession) c1.get()).write( "start" );

        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();

        while ( !messageCount.await( 100, TimeUnit.MILLISECONDS ) ) {
            long[] threads = threadMXBean.findMonitorDeadlockedThreads();

            if ( null != threads ) {
                StringBuffer sb = new StringBuffer( 256 );
                ThreadInfo[] infos = threadMXBean.getThreadInfo( threads, Integer.MAX_VALUE );
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.