Search in sources :

Example 6 with FkBase

use of io.wring.fake.FkBase in project wring by yegor256.

the class TkFaviconTest method rendersIcon.

/**
 * TkFavicon can render home page.
 * @throws Exception If some problem inside
 */
@Test
public void rendersIcon() throws Exception {
    final Take take = new TkAppAuth(new TkFavicon(new FkBase()));
    MatcherAssert.assertThat(new RsPrint(take.act(new RqFake())).printBody(), Matchers.notNullValue());
}
Also used : Take(org.takes.Take) FkBase(io.wring.fake.FkBase) RqFake(org.takes.rq.RqFake) RsPrint(org.takes.rs.RsPrint) Test(org.junit.Test)

Example 7 with FkBase

use of io.wring.fake.FkBase in project wring by yegor256.

the class CycleTest method processesSinglePipe.

/**
 * Cycle can process a single pipe.
 * @throws Exception If some problem inside
 */
@Test
public void processesSinglePipe() throws Exception {
    final Base base = new FkBase();
    final Pipe pipe = new FkPipe();
    new Cycle(base).exec(pipe);
}
Also used : FkBase(io.wring.fake.FkBase) Pipe(io.wring.model.Pipe) FkPipe(io.wring.fake.FkPipe) Base(io.wring.model.Base) FkBase(io.wring.fake.FkBase) FkPipe(io.wring.fake.FkPipe) Test(org.junit.Test)

Example 8 with FkBase

use of io.wring.fake.FkBase in project wring by yegor256.

the class CycleTest method processesSinglePipeWithBrokenJson.

/**
 * Cycle can process a single pipe with broken JSOn.
 * @throws Exception If some problem inside
 */
@Test
public void processesSinglePipeWithBrokenJson() throws Exception {
    final Base base = new FkBase();
    final Pipe pipe = new FkPipe(new Directives().add("pipe").add("urn").set("urn:test:1").up().add("json").set("{\"a\":\"/@[a-z0-9\\\\-]\\\\s+\"}").up().up());
    new Cycle(base).exec(pipe);
}
Also used : FkBase(io.wring.fake.FkBase) Directives(org.xembly.Directives) Pipe(io.wring.model.Pipe) FkPipe(io.wring.fake.FkPipe) Base(io.wring.model.Base) FkBase(io.wring.fake.FkBase) FkPipe(io.wring.fake.FkPipe) Test(org.junit.Test)

Example 9 with FkBase

use of io.wring.fake.FkBase in project wring by yegor256.

the class TkIndexTest method rendersHomePage.

/**
 * TkHome can render home page.
 * @throws Exception If some problem inside
 */
@Test
public void rendersHomePage() throws Exception {
    final Take take = new TkIndex(new FkBase());
    MatcherAssert.assertThat(XhtmlMatchers.xhtml(new RsPrint(take.act(new RqWithHeader(new RqFake("GET", "/"), "Accept", "text/xml"))).printBody()), XhtmlMatchers.hasXPaths("/page/millis", "/page/links/link[@rel='takes:github']", "/page/total"));
}
Also used : Take(org.takes.Take) FkBase(io.wring.fake.FkBase) RqFake(org.takes.rq.RqFake) RsPrint(org.takes.rs.RsPrint) RqWithHeader(org.takes.rq.RqWithHeader) Test(org.junit.Test)

Aggregations

FkBase (io.wring.fake.FkBase)9 Test (org.junit.Test)9 Take (org.takes.Take)6 RqFake (org.takes.rq.RqFake)5 RsPrint (org.takes.rs.RsPrint)4 FkPipe (io.wring.fake.FkPipe)2 Base (io.wring.model.Base)2 Pipe (io.wring.model.Pipe)2 RqWithHeader (org.takes.rq.RqWithHeader)2 JdkRequest (com.jcabi.http.request.JdkRequest)1 RestResponse (com.jcabi.http.response.RestResponse)1 XmlResponse (com.jcabi.http.response.XmlResponse)1 Events (io.wring.model.Events)1 HmRsStatus (org.takes.facets.hamcrest.HmRsStatus)1 FtRemote (org.takes.http.FtRemote)1 RqWithHeaders (org.takes.rq.RqWithHeaders)1 Directives (org.xembly.Directives)1