Examples of postData()


Examples of com.onarandombox.MultiverseCore.utils.webpaste.PasteService.postData()

     * @return URL of visible paste
     */
    private static String postToService(PasteServiceType type, boolean isPrivate, String pasteData) {
        PasteService ps = PasteServiceFactory.getService(type, isPrivate);
        try {
            return SHORTENER.shorten(ps.postData(ps.encodeData(pasteData), ps.getPostURL()));
        } catch (PasteFailedException e) {
            System.out.print(e);
            return "Error posting to service";
        }
    }
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()


    String streamName = generateStreamName().replaceAll("-", "_");
    stream().create(streamName, "%s | %s", httpSource, jdbcSink);
    httpSource.ensureReady().postData("Hi there!");
    httpSource.postData("How are you?");

    String query = String.format("SELECT payload FROM %s", streamName);
    List<String> result = jdbcSink.getJdbcTemplate().queryForList(query, String.class);
    assertThat(result, contains("Hi there!", "How are you?"));
  }
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

    stream().create(generateStreamName(),
        "%s | router --expression=payload.contains('a')?'" + queue1 + "':'" + queue2 + "'",
        httpSource);

    httpSource.ensureReady();
    httpSource.postData("a");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foo"))));
    httpSource.postData("b");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foob-bar"))));
  }
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

        httpSource);

    httpSource.ensureReady();
    httpSource.postData("a");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foo"))));
    httpSource.postData("b");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foob-bar"))));
  }

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

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

    stream().create(generateStreamName(), "queue:testUsingScript2 > transform --expression=payload+'-bar' | %s", fileSink);
    stream().create(generateStreamName(),
        "%s | router --script='org/springframework/xd/shell/command/router.groovy'", httpSource);

    httpSource.ensureReady();
    httpSource.postData("a");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foo"))));
    httpSource.postData("b");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foob-bar"))));
  }
}
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

        "%s | router --script='org/springframework/xd/shell/command/router.groovy'", httpSource);

    httpSource.ensureReady();
    httpSource.postData("a");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foo"))));
    httpSource.postData("b");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foob-bar"))));
  }
}
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

  public void testNamedChannelWithNoConsumerShouldBuffer() {
    String streamName = generateStreamName();
    logger.info("Create " + streamName + " stream");
    HttpSource source = newHttpSource();
    stream().create(streamName, "%s > %s", source, generateQueueName());
    source.postData("blahblah");
  }

  @Test
  public void testNamedChannelsLinkingSourceAndSink() {
    HttpSource source = newHttpSource();
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

  public void testNamedChannelsLinkingSourceAndSink() {
    HttpSource source = newHttpSource();
    String queue = generateQueueName();
    stream().create(generateStreamName(), "%s > %s", source, queue);
    stream().create(generateStreamName(), "%s > transform --expression=payload.toUpperCase() | log", queue);
    source.postData("blahblah");
  }

  /**
   * Test a stream that is simply one processor module connecting two named channels.
   */
 
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

    stream().create(streamName0, "%s > %s", source, queue1);
    stream().create(streamName1, "%s > transform --expression=payload.toUpperCase() > %s", queue1, queue2);
    stream().create(streamName2, "%s > %s", queue2, sink);

    source.postData("blahblah");

    assertThat(String.format("Assert failed for streams %s, %s, %s", streamName0, streamName1, streamName2),
        sink, eventually(hasContentsThat(equalTo("BLAHBLAH"))));
  }
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.postData()

    source.ensureReady();

    StopWatch stopWatch = new StopWatch(storeName);
    stopWatch.start(storeName + "-" + executionCount);
    for (int i = 0; i < MESSAGES_PER_GROUP * MESSAGE_GROUPS_PER_EXECUTION; i++) {
      source.postData("boo");
    }

    assertThat(sink, eventually(hasValue(NumberFormat.getInstance().format(MESSAGE_GROUPS_PER_EXECUTION))));

    stopWatch.stop();
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.