コード例 #1
0
  public void testPostProcessInvalidSession() {
    String[] args = {"12312312xFFFFFABABABFFFCD01"};

    lip.before(new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer));
    Object rc =
        lip.after(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer),
            "returnthis");
    assertEquals("returnthis", rc);
    assertEquals("", writer.toString());
  }
コード例 #2
0
  public void testPreProcessWithInvalidSession() {
    String[] args = {"12312312xFFFFFABABABFFFCD01"};

    boolean rc =
        lip.before(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer));
    assertTrue(rc);
  }
コード例 #3
0
  public void testPreProcessWithXmlArg() {
    String[] args = {"<?xml version=\"1.0\"?><somestuff>foo</somestuff>", "password"};

    boolean rc =
        lip.before(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer));

    assertTrue(rc);
  }
コード例 #4
0
  public void testPreProcess() {
    String[] args = {"username", "password"};

    boolean rc =
        lip.before(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer));

    assertTrue(rc);
  }
コード例 #5
0
  public void testPostProcessValidSession() {
    User user = UserTestUtils.findNewUser("testUser", "testOrg");
    // create a web session indicating a logged in user.
    WebSession s = WebSessionFactory.createSession();
    s.setWebUserId(user.getId());
    assertNotNull(s);
    WebSessionFactory.save(s);
    assertNotNull(s.getId());

    String[] args = {s.getKey()};

    lip.before(new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer));
    Object rc =
        lip.after(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer),
            "returnthis");
    assertEquals("returnthis", rc);
    assertEquals("", writer.toString());
  }
コード例 #6
0
  public void testPostProcess() {
    String[] args = {"<?xml version=\"1.0\"?><somestuff>foo</somestuff>", "password"};

    Object rc =
        lip.after(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer),
            "returnthis");
    assertEquals("returnthis", rc);
    assertEquals("", writer.toString());
  }
コード例 #7
0
  public void testAuthLogin() {
    String[] args = {"user", "password"};

    Object rc =
        lip.after(
            new XmlRpcInvocation(10, "auth", "login", null, Arrays.asList(args), writer),
            "returnthis");
    assertEquals("returnthis", rc);
    assertEquals("", writer.toString());
  }
コード例 #8
0
  public void testPostProcessWhereFirstArgHasNoX() {
    String[] args = {"abcdefghijklmnopqrstuvwyz", "password"};

    Object rc =
        lip.after(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer),
            "returnthis");
    assertEquals("returnthis", rc);
    assertEquals("", writer.toString());
  }
コード例 #9
0
  public void testPreProcessWithValidSession() {
    // create a web session indicating a logged in user.
    WebSession s = WebSessionFactory.createSession();
    assertNotNull(s);
    WebSessionFactory.save(s);
    assertNotNull(s.getId());

    String[] args = {s.getKey()};

    boolean rc =
        lip.before(
            new XmlRpcInvocation(10, "handler", "method", null, Arrays.asList(args), writer));

    assertTrue(rc);
  }