use of io.wring.model.Pipes in project wring by yegor256.
the class DyPipesITCase method addsManyPipes.
/**
* DyPipes can add many pipes.
* @throws Exception If some problem inside
*/
@Test
public void addsManyPipes() throws Exception {
final User user = new DyUser(new Dynamo(), "sarah");
final Pipes pipes = user.pipes();
for (int idx = 0; idx < Tv.FIVE; ++idx) {
pipes.add("{\"oops\":true}");
}
MatcherAssert.assertThat(Iterables.size(pipes.iterate()), Matchers.equalTo(Tv.FIVE));
}
use of io.wring.model.Pipes in project wring by yegor256.
the class DyPipesITCase method addsAndRemovePipes.
/**
* DyPipes can add and remove pipes.
* @throws Exception If some problem inside
*/
@Test
public void addsAndRemovePipes() throws Exception {
final User user = new DyUser(new Dynamo(), "jeffrey");
final Pipes pipes = user.pipes();
pipes.add("{\"name\": \"hello\"}");
final Pipe pipe = pipes.iterate().iterator().next();
MatcherAssert.assertThat(new Xembler(pipe.asXembly()).xml(), XhtmlMatchers.hasXPaths("/pipe/json", "/pipe/id"));
pipe.delete();
}