Search in sources :

Example 1 with Pipes

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));
}
Also used : User(io.wring.model.User) Pipes(io.wring.model.Pipes) Test(org.junit.Test)

Example 2 with Pipes

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();
}
Also used : User(io.wring.model.User) Pipe(io.wring.model.Pipe) Xembler(org.xembly.Xembler) Pipes(io.wring.model.Pipes) Test(org.junit.Test)

Aggregations

Pipes (io.wring.model.Pipes)2 User (io.wring.model.User)2 Test (org.junit.Test)2 Pipe (io.wring.model.Pipe)1 Xembler (org.xembly.Xembler)1