Package org.springframework.xd.test.fixtures

Examples of org.springframework.xd.test.fixtures.FileSink$FileSinkContentsMatcher


  @Test
  public void testTappingModulesVariations() throws IOException {
    // Note: this test is using a regular sink, not a named channel sink
    HttpSource httpSource = newHttpSource();

    FileSink sink = newFileSink().binary(true);
    FileSink tapsink3 = newFileSink().binary(true);
    FileSink tapsink5 = newFileSink().binary(true);
    FileSink tapsink6 = newFileSink().binary(true);

    String streamName = generateStreamName();
    stream().create(streamName, "%s | transform --expression=payload.toUpperCase() | %s", httpSource, sink);
    stream().create(generateStreamName(), "%s > transform --expression=payload.replaceAll('A','.') | %s",
        getTapName(streamName), tapsink3);
View Full Code Here


  @Test
  public void testTappingModulesVariationsWithSinkChannel_XD629() throws IOException {
    HttpSource source = newHttpSource();

    FileSink sink = newFileSink().binary(true);
    FileSink tapsink3 = newFileSink().binary(true);
    FileSink tapsink5 = newFileSink().binary(true);

    String streamName = generateStreamName();
    String queue = generateQueueName();
    stream().create(streamName,
        "%s | transform --expression=payload.toUpperCase() | filter --expression=true > %s", source, queue);
View Full Code Here

  }

  @Test
  public void testUsingLabels() throws IOException {
    FileSink sink1 = newFileSink().binary(true);
    FileSink sink2 = newFileSink().binary(true);

    HttpSource source = newHttpSource();

    String streamName = generateStreamName();
    stream().create(streamName, "%s | flibble: transform --expression=payload.toUpperCase() | %s", source, sink1);
View Full Code Here

  @Test
  public void testNamedChannels() throws Exception {
    HttpSource source1 = newHttpSource();
    HttpSource source2 = newHttpSource();
    HttpSource source3 = newHttpSource();
    FileSink sink = newFileSink().binary(true);

    String streamName0 = generateStreamName();
    String streamName1 = generateStreamName();
    String streamName2 = generateStreamName();
View Full Code Here

  }

  @Test
  public void testJsonPath() throws IOException {
    HttpSource source = newHttpSource();
    FileSink sink = newFileSink().binary(true);
    stream().create(generateStreamName(),
        "%s | transform --expression='#jsonPath(payload, \"$.foo.bar\")' | %s",
        source, sink);
    source.ensureReady().postData("{\"foo\":{\"bar\":\"123\"}}");
    assertThat(sink, eventually(hasContentsThat(equalTo("123"))));
View Full Code Here

  @Test
  public void testUsingPlaceholdersInsideStreamDefinition() {
    String streamName = generateStreamName();
    HttpSource source = newHttpSource();
    FileSink sink = newFileSink().binary(true);

    stream().create(streamName, "%s | transform --expression=\"'${xd.stream.name}'\" | %s", source, sink);

    source.ensureReady().postData("whatever");
    assertThat(sink, eventually(hasContentsThat(equalTo(streamName))));
View Full Code Here

    dataSource.setUrl(jdbcUrl);
    return dataSource;
  }

  protected FileSink newFileSink() {
    FileSink fileSink = new FileSink();
    disposables.add(fileSink);
    return fileSink;
  }
View Full Code Here

   * required for end-user usecases (see {@link #testJsonPropertyAccessor()}).
   */
  @Test
  public void testTuplePropertyAccessor() throws Exception {
    logger.info("Creating stream with temp File 'tupletest' as sink");
    FileSink sink = newFileSink().binary(true);
    HttpSource source = newHttpSource();

    stream().create(
        generateStreamName(),
        "%s | json-to-tuple | transform --expression=payload.foo | %s",
View Full Code Here

  /**
   * This tests that we have Json property access out of the box.
   */
  @Test
  public void testJsonPropertyAccessor() throws Exception {
    FileSink sink = newFileSink().binary(true);
    HttpSource source = newHttpSource();

    stream().create(
        generateStreamName(),
        "%s | transform --expression=payload.foo.toString() | %s",
View Full Code Here

  }

  @Test
  public void testTuplePropertyAccessorProjection() throws Exception {
    FileSink sink = newFileSink().binary(true);
    HttpSource source = newHttpSource();

    stream().create(
        generateStreamName(),
        "%s | json-to-tuple | transform --expression=payload.entities.hashtags.![text].toString() | %s",
View Full Code Here

TOP

Related Classes of org.springframework.xd.test.fixtures.FileSink$FileSinkContentsMatcher

Copyright © 2018 www.massapicom. 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.