Examples of content()


Examples of com.couchbase.client.java.document.JsonDoubleDocument.content()

    public void shouldDecodeCommonFlagsDouble() {
        ByteBuf content = Unpooled.copiedBuffer("1.7976931348623157E308", CharsetUtil.UTF_8);
        JsonDoubleDocument decoded = converter.decode("id", content, 0, 0, TranscoderUtils.JSON_COMMON_FLAGS,
            ResponseStatus.SUCCESS);

        assertEquals(Double.MAX_VALUE, decoded.content(), 0);
    }

    @Test
    public void shouldDecodeLegacyDouble() {
        byte[] bytes = LegacyTranscoder.encodeNum(Double.doubleToRawLongBits(Double.MAX_VALUE), 8);
View Full Code Here

Examples of com.couchbase.client.java.document.JsonLongDocument.content()

  }

    @Test
    public void shouldIncrementFromCounter() throws Exception {
        JsonLongDocument doc1 = bucket().counter("incr-key", 10, 0, 0);
        assertEquals(0L, (long) doc1.content());

        JsonLongDocument doc2 = bucket().counter("incr-key", 10, 0, 0);
        assertEquals(10L, (long) doc2.content());

        JsonLongDocument doc3 = bucket().counter("incr-key", 10, 0, 0);
View Full Code Here

Examples of com.couchbase.client.java.document.JsonStringDocument.content()

    public void shouldDecodeCommonString() {
        ByteBuf content = Unpooled.copiedBuffer("\"value\"", CharsetUtil.UTF_8);
        JsonStringDocument decoded = converter.decode("id", content, 0, 0, TranscoderUtils.JSON_COMPAT_FLAGS,
            ResponseStatus.SUCCESS);

        assertEquals("value", decoded.content());
    }

    @Test
    public void shouldDecodeEmptyCommonString() {
        ByteBuf content = Unpooled.copiedBuffer("\"\"", CharsetUtil.UTF_8);
View Full Code Here

Examples of com.couchbase.client.java.document.LegacyDocument.content()

        User user = new User("Michael");
        LegacyDocument doc = LegacyDocument.create(id, user);
        bucket().upsert(doc);

        LegacyDocument found = bucket().get(id, LegacyDocument.class);
        assertEquals(found.content().getClass(), user.getClass());
        assertEquals("Michael", ((User) found.content()).getFirstname());
    }

    @Test
    public void shouldAppendString() {
View Full Code Here

Examples of com.couchbase.client.java.document.RawJsonDocument.content()

        String content = "{\"foo\": 1234}";

        bucket().insert(RawJsonDocument.create(id, content));

        RawJsonDocument foundRaw = bucket().get(id, RawJsonDocument.class);
        assertEquals(content, foundRaw.content());

        JsonDocument foundParsed = bucket().get(id);
        assertEquals(1234, (int) foundParsed.content().getInt("foo"));
    }
View Full Code Here

Examples of com.couchbase.client.java.document.StringDocument.content()

    public void shouldDecodeCommonString() {
        ByteBuf content = Unpooled.copiedBuffer("value", CharsetUtil.UTF_8);
        StringDocument decoded = converter.decode("id", content, 0, 0, TranscoderUtils.STRING_COMMON_FLAGS,
            ResponseStatus.SUCCESS);

        assertEquals("value", decoded.content());
    }

    @Test
    public void shouldDecodeLegacyString() {
        ByteBuf content = Unpooled.copiedBuffer("value", CharsetUtil.UTF_8);
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jetty.client.HttpRequest.content()

        BodyGenerator bodyGenerator = finalRequest.getBodyGenerator();
        if (bodyGenerator != null) {
            if (bodyGenerator instanceof StaticBodyGenerator) {
                StaticBodyGenerator staticBodyGenerator = (StaticBodyGenerator) bodyGenerator;
                jettyRequest.content(new BytesContentProvider(staticBodyGenerator.getBody()));
            }
            else {
                jettyRequest.content(new BodyGeneratorContentProvider(bodyGenerator, httpClient.getExecutor()));
            }
        }
View Full Code Here

Examples of com.github.tomakehurst.wiremock.testsupport.WireMockResponse.content()

        .willReturn(aResponse()
        .proxiedFrom(TARGET_SERVICE_BASE_URL)));
   
    WireMockResponse response = testClient.get("/proxied/resource?param=value");
   
    assertThat(response.content(), is("Proxied content"));
    assertThat(response.firstHeader("Content-Type"), is("text/plain"));
  }
 
  @Test
  public void successfullyPostsResponseToOtherServiceViaProxy() {
View Full Code Here

Examples of com.google.caliper.runner.StreamService.StreamItem.content()

    makeService(FakeWorkers.PrintClient.class, "foo", "bar");
    service.startAsync().awaitRunning();
    StreamItem item1 = readItem();
    assertEquals(Kind.DATA, item1.kind());
    Set<String> lines = Sets.newHashSet();
    lines.add(item1.content().toString());
    StreamItem item2 = readItem();
    assertEquals(Kind.DATA, item2.kind());
    lines.add(item2.content().toString());
    assertEquals(Sets.newHashSet("foo", "bar"), lines);
    assertEquals(State.RUNNING, service.state());
View Full Code Here

Examples of com.jayway.restassured.specification.ResponseSpecification.content()

        .expect()
//         .log().all()
        .statusCode( HttpStatus.SC_OK )
        .contentType( contentType );
    if ( running ) {
      response.content(
          "app.trackingUrl",
          anyOf(
              startsWith( "http://" + gatewayHostName + ":" + gatewayAddress.getPort() + "/" ),
              startsWith( "http://" + gatewayAddrName + ":" + gatewayAddress.getPort() + "/" ) ) );
    } else {
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.