Package com.linkedin.databus2.relay.TestDatabusRelayMain

Examples of com.linkedin.databus2.relay.TestDatabusRelayMain.ClientRunner


  }

  public AbstractRelayFactory(SourceIdNameRegistry sourcesIdNameRegistry)
  {
    if(sourcesIdNameRegistry == null)
      sourcesIdNameRegistry = new SourceIdNameRegistry();
    _sourcesIdNameRegistry = sourcesIdNameRegistry;
  }
View Full Code Here


                     srcidCounts.get((short)2).intValue());

        //check metadata schemas

        EventCountingConsumer myCons = (EventCountingConsumer) mockConsumer;
        VersionedSchema metadataSchema = myCons.getMetadataSchema();
        Assert.assertTrue(null != metadataSchema);

        log.info("Metadata VersionedSchema = " + metadataSchema);
        Assert.assertEquals(metadataSchema.getVersion(),2);
        Assert.assertEquals(metadataSchema.getSchemaBaseName(), SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE);

        verifyNoLocks(log, eventsBuf);
        log.info("end\n");
    }
View Full Code Here

        //It seems that there is a race condition between the writeFuture succeeding
        //and the writeComplete message getting to the handler. Make sure that the
        //writeComplete has got to the handler before we do anything else with
        //the channel.
        final GenericHttpResponseHandler handler = getResponseHandler(channel);
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return handler._messageState.hasSentRequest();
          }
        }, "request sent", 1000, log);

        HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.SERVICE_UNAVAILABLE);
        resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        sendServerResponse(clientAddr, resp, 2000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);

        sendServerResponse(clientAddr, new DefaultHttpChunkTrailer(), 1000);

        final List<String> callbacks = respProcessor.getCallbacks();
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return 4 == callbacks.size();
View Full Code Here

      final List<String> callbacks = respProcessor.getCallbacks();
      final List<String> connectCallbacks = connectListener.getCallbacks();
      final List<String> requestCallbacks = requestListener.getCallbacks();
      final List<String> closeCallbacks = closeListener.getCallbacks();

      TestUtil.assertWithBackoff(new ConditionCheck()
      {
        @Override
        public boolean check()
        {
          return 1 == closeCallbacks.size();
View Full Code Here

        stateSanityCheck(connectCallbacks,requestCallbacks,callbacks,closeCallbacks);
        Assert.assertEquals(1,connectCallbacks.size());
        Assert.assertEquals(connectCallbacks.get(0),"onConnectSuccess");
        Assert.assertEquals(requestCallbacks.size(),1);
        Assert.assertEquals(requestCallbacks.get(0),"onSendRequestSuccess");
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return callbacks.size() == 4;
View Full Code Here

      final List<String> respCallbacks = respProcessor.getCallbacks();
      final List<String> connectCallbacks = connectListener.getCallbacks();
      final List<String> requestCallbacks = requestListener.getCallbacks();
      final List<String> closeChannelCallbacks = closeListener.getCallbacks();

      TestUtil.assertWithBackoff(new ConditionCheck()
      {
        @Override
        public boolean check()
        {
          return 1 == closeChannelCallbacks.size();
View Full Code Here

  }

  static Channel createClientBootstrap(final GenericHttpResponseHandler responseHandler,int port)
  {
    final ChannelFuture connectFuture = createChannelFuture(responseHandler, port);
    TestUtil.assertWithBackoff(new ConditionCheck()
    {
      @Override
      public boolean check()
      {
        return (connectFuture.isDone() && connectFuture.isSuccess() && responseHandler.getMessageState()==MessageState.REQUEST_WAIT);
View Full Code Here

     * @param eventsBuf
     */
    private void verifyNoLocks(final Logger log,
                               final TestGenericDispatcherEventBuffer eventsBuf)
    {
      TestUtil.assertWithBackoff(new ConditionCheck()
      {
        @Override
        public boolean check()
        {
          if (null != log)
View Full Code Here

        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesIdsMessage(sourcesMap.values()));
        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesSchemasMessage(schemaMap));

        try
        {
          TestUtil.assertWithBackoff(new ConditionCheck()
          {
            @Override
            public boolean check()
            {
              LOG.info(dispatcher.getStatus().getStatus().toString());
View Full Code Here

        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesIdsMessage(sourcesMap.values()));
        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesSchemasMessage(schemaMap));

        log.info("starting event dispatch");

        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return null != dispatcher.getDispatcherState().getEventsIterator() &&
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.relay.TestDatabusRelayMain.ClientRunner

Copyright © 2018 www.massapicom. 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.