public void testProfind() throws Exception {
    Aradon aradon =
        AradonTester.create()
            .mergeSection("")
            .addLet("/", "webdav", IMatchMode.STARTWITH, WebDavLet.class)
            .putAttribute(VFSEntry.class.getCanonicalName(), VFSEntry.test())
            .getAradon();

    String text =
        ""
            + "<?xml version=\"1.0\" ?>\n"
            + "<D:propfind xmlns:D=\"DAV:\">\n"
            + "        <D:allprop/>\n"
            + "</D:propfind>\n";

    StringRepresentation re = new StringRepresentation(text);

    final IAradonRequest request =
        AradonClientFactory.create(aradon).createRequest("/AbstractFileSystem.java");
    request.addHeader("Depth", "1");

    Representation r = request.setEntity(re).get();
    Debug.line(r);

    aradon.startServer(9002);
    new InfinityThread().startNJoin();
  }
Exemplo n.º 2
0
  public void testAradonQuery() throws Exception {
    AradonTester at = AradonTester.create().register("", "/query", QueryLet.class);
    at.getAradon().getServiceContext().putAttribute(IDBController.class.getCanonicalName(), dc);

    IUserCommand cmd = dc.createUserCommand("select 1 from dual");
    ISerialRequest req = AradonClientFactory.create(at.getAradon()).createSerialRequest("/query");

    Rows rows = req.post(cmd, Rows.class);

    assertEquals(1, rows.getRowCount());
    assertEquals(1, rows.firstRow().getInt(1));
  }
Exemplo n.º 3
0
  @Test
  public void whenInnerClass() throws Exception {
    Aradon aradon =
        AradonTester.create()
            .register("test", "/ex1", HelloAbstractLet.class)
            .register("test", "/ex2/{name}", HelloResource.class)
            .register("test", "/ex3", HelloObjectLet.class)
            .getAradon();

    AradonClient ac = AradonClientFactory.create(aradon);
    assertEquals("hello", ac.createRequest("/test/ex1").get().getText());
    assertEquals("hi bleujin", ac.createRequest("/test/ex2/bleujin").get().getText());

    List<String> names = ac.createSerialRequest("/test/ex3?name=jin").get(List.class);
    assertEquals("[bleujin, hero, jin]", names.toString());

    //		aradon.startServer(9000) ;
    //		new InfinityThread().startNJoin() ;
  }