Examples of ensureReady()


Examples of net.sf.collabreview.reputation.ReputationMetric.ensureReady()

  }

  @Override
  public boolean renderCore(HttpServletRequest request, PrintWriter writer) throws Exception {
    ReputationMetric metric = collabReview.getReputationMetricManager().findReputationMetric(metricName);
    metric.ensureReady();
    List<String> contributors = metric.listContributors();
    if (invert) {
      Collections.reverse(contributors);
    }
    if (contributors.size() == 0) {
View Full Code Here

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

    FileSink sink = newFileSink().binary(true);
    HttpSource httpSource = newHttpSource();
    compose().newModule("filterAndTransform",
        "filter --expression=true | transform --expression=payload.replace('abc','...')");
    stream().create(generateStreamName(), "%s | filterAndTransform | %s", httpSource, sink);
    httpSource.ensureReady().postData("abcdefghi!");
    assertThat(sink, eventually(hasContentsThat(equalTo("...defghi!"))));
  }

  /**
   * This tests that options passed at usage time of a composed module are override definition values.
View Full Code Here

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

        "filter --expression=false | transform --expression=payload.replace('abc','...')");
    String options = String.format(
        "--filter%sexpression=true --transform%sexpression=payload.replace('def','...')", OPTION_SEPARATOR,
        OPTION_SEPARATOR);
    stream().create(generateStreamName(), "%s | filterAndTransform %s | %s", httpSource, options, sink);
    httpSource.ensureReady().postData("abcdefghi!");
    assertThat(sink, eventually(hasContentsThat(equalTo("abc...ghi!"))));

  }

  private Matcher<TableRow> rowWithValue(final int col, final String value) {
View Full Code Here

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

    HttpSource httpSource = newHttpSource();


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

    String query = String.format("SELECT payload FROM %s", streamName);
    assertEquals(
        "Hi there!",
        jdbcSink.getJdbcTemplate().queryForObject(query, String.class));
View Full Code Here

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

    HttpSource httpSource = newHttpSource();


    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.ensureReady()

    JdbcSink jdbcSink = newJdbcSink().tableName(tableName);

    HttpSource httpSource = newHttpSource();

    stream().create(generateStreamName(), "%s | %s", httpSource, jdbcSink);
    httpSource.ensureReady().postData("Hi there!");

    String query = String.format("SELECT payload FROM %s", tableName);
    assertEquals(
        "Hi there!",
        jdbcSink.getJdbcTemplate().queryForObject(query, String.class));
View Full Code Here

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


    String streamName = generateStreamName().replaceAll("-", "_");
    stream().create(streamName, "%s | %s", httpSource, jdbcSink);
    String json = "{\"foo\":5, \"bar\": \"hello\"}";
    httpSource.ensureReady().postData(json);

    String query = String.format("SELECT foo, bar FROM %s", streamName);
    Result result = jdbcSink.getJdbcTemplate().queryForObject(query, new BeanPropertyRowMapper<>(Result.class));
    assertEquals("hello", result.getBar());
    assertEquals(5, result.getFoo());
View Full Code Here

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

    HttpSource httpSource = newHttpSource();

    String streamName = generateStreamName().replaceAll("-", "_");
    stream().create(streamName, "%s | %s", httpSource, jdbcSink);
    String json = "{\"fooBar\":5, \"barFoo\": \"hello\", \"bar_baz\": \"good_bye\"}";
    httpSource.ensureReady().postData(json);

    String query = String.format("SELECT foo_bar, bar_foo, bar_baz FROM %s", streamName);
    Map<String, Object> result = jdbcSink.getJdbcTemplate().queryForMap(query);
    assertEquals("hello", result.get("bar_foo"));
    assertEquals("5", result.get("foo_bar"));
View Full Code Here

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

    stream().create(generateStreamName(), "%s > transform --expression=payload+'-bar' | %s", queue2, fileSink);
    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.ensureReady()

    stream().create(generateStreamName(), "queue:testUsingScript1 > transform --expression=payload+'-foo' | %s", fileSink);
    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
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.