Package org.jboss.netty.handler.codec.http

Examples of org.jboss.netty.handler.codec.http.HttpRequest.headers()


    PluginLoader.loadJAR("plugin_test.jar");
    HttpQuery.initializeSerializerMaps(null);
    final Channel channelMock = NettyMocks.fakeChannel();
    final HttpRequest req = new DefaultHttpRequest(HttpVersion.HTTP_1_1,
        HttpMethod.GET, "/");
    req.headers().add("Content-Type", "application/tsdbdummy");
    final HttpQuery query = new HttpQuery(tsdb, req, channelMock);
    query.setSerializer();
    assertEquals("net.opentsdb.tsd.DummyHttpSerializer",
        query.serializer().getClass().getCanonicalName());
  }
View Full Code Here


  public void setSerializerDefaultCT() throws Exception {
    HttpQuery.initializeSerializerMaps(null);
    final Channel channelMock = NettyMocks.fakeChannel();
    final HttpRequest req = new DefaultHttpRequest(HttpVersion.HTTP_1_1,
        HttpMethod.GET, "/");
    req.headers().add("Content-Type", "invalid/notfoundtype");
    final HttpQuery query = new HttpQuery(tsdb, req, channelMock);
    query.setSerializer();
    assertEquals(HttpJsonSerializer.class.getCanonicalName(),
        query.serializer().getClass().getCanonicalName());
  }
View Full Code Here

        method, uri);
    if (content != null) {
      req.setContent(ChannelBuffers.copiedBuffer(content,
          Charset.forName("UTF-8")));
    }
    req.headers().set("Content-Type", type);
    return new HttpQuery(tsdb, req, channelMock);
  }
 
  /**
   * Returns a simple pipeline with an HttpRequestDecoder and an
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.