Examples of RegisterResponseEntry


Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

    assertTrue("obj.get(\"id\") type = " + obj.get("id").getClass().getName() + ", not Integer",
               obj.get("id") instanceof Integer);
    assertTrue("obj.get(\"version\") type = " + obj.get("version").getClass().getName() + ", not Integer",
               obj.get("version") instanceof Integer);
    RegisterResponseEntry rre = new RegisterResponseEntry((Integer)obj.get("id"),
                                                          ((Integer)obj.get("version")).shortValue(),
                                                          (String)obj.get("schema"));
    assertEquals("unexpected source id", 4002, rre.getId());
    Schema resSchema = Schema.parse(rre.getSchema());
    assertEquals("unexpected source-schema name for source id 4002", "test4.source2_v1", resSchema.getFullName());

    // There's no guarantee of a metadataSchemas entry in general, but we pre-stuffed our
    // VersionedSchemaSetBackedRegistryService with one in the test's constructor, so we
    // expect the relay to hand it back to us.  Or else.
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

    {
      Assert.fail("ObjectMapper failed unexpectedly");
    }
    assertNotNull("missing source schemas in response", sourceSchemasList);
    assertEquals("expected one source schema", 1, sourceSchemasList.size());
    RegisterResponseEntry rre = sourceSchemasList.get(0);
    assertEquals("unexpected source id", 4002, rre.getId());
    Schema resSchema = Schema.parse(rre.getSchema());
    assertEquals("unexpected source-schema name for source id 4002", "test4.source2_v1", resSchema.getFullName());

    // protocolVersion == 3:  as with v2 above; just do a quick sanity check
    httpRequest =
        new DefaultHttpRequest(HttpVersion.HTTP_1_1,
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

    final String SOURCE1_SCHEMA_STR = "{\"name\":\"source1\",\"type\":\"record\",\"fields\":[{\"name\":\"s\",\"type\":\"string\"}]}";
    final String SOURCE2_SCHEMA_STR = "{\"name\":\"source2\",\"type\":\"record\",\"fields\":[{\"name\":\"s\",\"type\":\"string\"}]}";;
    final String SOURCE3_SCHEMA_STR = "{\"name\":\"source3\",\"type\":\"record\",\"fields\":[{\"name\":\"s\",\"type\":\"string\"}]}";;

    l1.add(new RegisterResponseEntry(1L, (short)1,SOURCE1_SCHEMA_STR));
    l2.add(new RegisterResponseEntry(2L, (short)1,SOURCE2_SCHEMA_STR));
    l3.add(new RegisterResponseEntry(3L, (short)1,SOURCE3_SCHEMA_STR));

    schemaMap.put(1L, l1);
    schemaMap.put(2L, l2);
    schemaMap.put(3L, l3);
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

    final String SOURCE1_SCHEMA_STR = "{\"name\":\"source1\",\"type\":\"record\",\"fields\":[{\"name\":\"s\",\"type\":\"string\"}]}";
    final String SOURCE2_SCHEMA_STR = "{\"name\":\"source2\",\"type\":\"record\",\"fields\":[{\"name\":\"s\",\"type\":\"string\"}]}";;
    final String SOURCE3_SCHEMA_STR = "{\"name\":\"source3\",\"type\":\"record\",\"fields\":[{\"name\":\"s\",\"type\":\"string\"}]}";;

    l1.add(new RegisterResponseEntry(1L, (short)1,SOURCE1_SCHEMA_STR));
    l2.add(new RegisterResponseEntry(2L, (short)1,SOURCE2_SCHEMA_STR));
    l3.add(new RegisterResponseEntry(3L, (short)1,SOURCE3_SCHEMA_STR));

    schemaMap.put(1L, l1);
    schemaMap.put(2L, l2);
    schemaMap.put(3L, l3);
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

          log.debug("process the /register request");
          NettyTestUtils.waitForHttpRequest(objCapture, "/register.*", 1000);
          objCapture.clear();

          log.debug("send back the /register response");
          RegisterResponseEntry entry = new RegisterResponseEntry(1L, (short)1, SOURCE1_SCHEMA_STR);
          String responseStr = NettyTestUtils.generateRegisterResponse(entry);
          body = new DefaultHttpChunk(
              ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));
          NettyTestUtils.sendServerResponses(relay, clientAddr, sourcesResp, body);

View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

          // make sure our handler will save the 'future' of the next write operation - 'stream'
          mock.enableSaveTheFuture(true);

          log.debug("send back the /register response");
          RegisterResponseEntry entry = new RegisterResponseEntry(1L, (short)1, SOURCE1_SCHEMA_STR);
          String responseStr = NettyTestUtils.generateRegisterResponse(entry);
          body = new DefaultHttpChunk(
              ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));
          NettyTestUtils.sendServerResponses(relay, clientAddr, sourcesResp, body);
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

          mock.enableSaveTheFuture(true);
          // delay write complete. insert Timeout exception before that
          mock.delayWriteComplete(true);

          log.debug("send back the /register response");
          RegisterResponseEntry entry = new RegisterResponseEntry(1L, (short)1, SOURCE1_SCHEMA_STR);
          String responseStr = NettyTestUtils.generateRegisterResponse(entry);
          body = new DefaultHttpChunk(
              ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));

          NettyTestUtils.sendServerResponses(relay, clientAddr, httpResp, body);
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

      log.debug("process the /register request");
      NettyTestUtils.waitForHttpRequest(objCapture, "/register.*", 1000);
      objCapture.clear();

      log.debug("send back the /register response");
      RegisterResponseEntry entry = new RegisterResponseEntry(1L, (short)1, SOURCE1_SCHEMA_STR);
      String responseStr = NettyTestUtils.generateRegisterResponse(entry);
      HttpResponse registerResp = new DefaultHttpResponse(HttpVersion.HTTP_1_1,
                                                         HttpResponseStatus.OK);
      HttpChunk body = new DefaultHttpChunk(
                                  ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

          // make sure our handler will save the 'future' of the next write operation - 'stream'
          mock.enableSaveTheFuture(true);

          log.info("send back the /register response");
          RegisterResponseEntry entry = new RegisterResponseEntry(1L, (short)1, SOURCE1_SCHEMA_STR);
          String responseStr = NettyTestUtils.generateRegisterResponse(entry);
          body = new DefaultHttpChunk(
              ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));
          NettyTestUtils.sendServerResponses(relay, clientAddr, sourcesResp, body);
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.RegisterResponseEntry

          //process the /register request
        NettyTestUtils.waitForHttpRequest(objCapture, "/register.*", 1000);
          objCapture.clear();

          //send back the /register response
          RegisterResponseEntry entry = new RegisterResponseEntry(1L, (short)1, SOURCE1_SCHEMA_STR);
          String responseStr = NettyTestUtils.generateRegisterResponse(entry);
          body = new DefaultHttpChunk(
              ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));
          NettyTestUtils.sendServerResponses(relay, clientAddr, sourcesResp, body);

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.