Examples of ensureReady()


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

    setupMessageListener(latch, topicName);
    final HttpSource httpSource = newHttpSource();
    stream().create(generateStreamName(), "%s | redis --topic=%s", httpSource, topicName);
    Thread.sleep(1000);
    final String stringToPost = "test";
    httpSource.ensureReady().postData(stringToPost);
    latch.await(3, TimeUnit.SECONDS);
    assertEquals(0, latch.getCount());
    container.stop();
  }
View Full Code Here

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

    final String listName = "testListExpression";
    final String stringToPost = "test";
    final HttpSource httpSource = newHttpSource();
    stream().create(generateStreamName(), "%s | redis --queueExpression='''%s'''", httpSource, listName);
    Thread.sleep(1000);
    httpSource.ensureReady().postData(stringToPost);
    byte[] leftPop = (byte[]) createTemplate().boundListOps(listName).leftPop(5, TimeUnit.SECONDS);
    Assert.assertEquals(stringToPost, new String(leftPop));
  }

  @Test
View Full Code Here

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

    final String listName = "testList";
    final String stringToPost = "test";
    final HttpSource httpSource = newHttpSource();
    stream().create(generateStreamName(), "%s | redis --queue=%s", httpSource, listName);
    Thread.sleep(1000);
    httpSource.ensureReady().postData(stringToPost);
    byte[] leftPop = (byte[]) createTemplate().boundListOps(listName).leftPop(5, TimeUnit.SECONDS);
    Assert.assertEquals(stringToPost, new String(leftPop));
  }

  @Test
View Full Code Here

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

    final String stringToPost = "test";
    final HttpSource httpSource = newHttpSource();
    stream().create(generateStreamName(), "%s | redis --keyExpression='''%s''' --collectionType='SET'", httpSource,
        setName);
    Thread.sleep(1000);
    httpSource.ensureReady().postData(stringToPost);
    byte[] popped = (byte[]) createTemplate().boundSetOps(setName).pop();
    Assert.assertEquals(stringToPost, new String(popped));
  }

  @Test
View Full Code Here

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

    final String stringToPost = "test";
    final HttpSource httpSource = newHttpSource();
    stream().create(generateStreamName(), "%s | redis --key=%s --collectionType='SET'", httpSource,
        setName);
    Thread.sleep(1000);
    httpSource.ensureReady().postData(stringToPost);
    byte[] popped = (byte[]) createTemplate().boundSetOps(setName).pop();
    Assert.assertEquals(stringToPost, new String(popped));
  }

  private RedisTemplate<String, Object> createTemplate() {
View Full Code Here

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

    stream().create(
        generateStreamName(),
        "%s | json-to-tuple | transform --expression=payload.foo | %s",
        source, sink);

    source.ensureReady().postData("{\"foo\":\"bar\"}");

    assertThat(sink, eventually(hasContentsThat(equalTo("bar"))));
  }

  /**
 
View Full Code Here

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

    stream().create(
        generateStreamName(),
        "%s | transform --expression=payload.foo.toString() | %s",
        source, sink);

    source.ensureReady().postData("{\"foo\":\"bar\"}");

    assertThat(sink, eventually(hasContentsThat(equalTo("bar"))));

  }
View Full Code Here

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

        +
        "\"urls\":[],\"user_mentions\":[]},"
        +
        "\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"filter_level\":\"medium\",\"lang\":\"bg\"}";

    source.ensureReady().postData(tweet);

    assertThat(sink, eventually(hasContentsThat(equalTo("[hello, there]"))));
  }

}
View Full Code Here

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

        generateStreamName(),
        "%s | aggregator --store=%s --count=%d --aggregation=T(org.springframework.util.StringUtils).collectionToDelimitedString(#this.![payload],' ') --timeout=500000%s | %s ",
        source, storeName, MESSAGES_PER_GROUP,
        streamDynamicPart, sink);

    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");
View Full Code Here

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

    HttpSource httpSource = newHttpSource();
    CounterSink counterSink = metrics().newCounterSink();

    stream().create(generateStreamName(), "%s | splitter | %s", httpSource, counterSink);

    httpSource.ensureReady().postData("Hello World !");
    assertThat(counterSink, eventually(hasValue("1")));

  }

  @Test
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.