Package org.hdiv.state

Examples of org.hdiv.state.State


  public void testAddPage() {

    IPage page = new Page();
    page.setId(20);

    IState state = new State(0);
    state.setAction("/action");
    IParameter param = new Parameter("name", "value", false, null, true);
    state.addParameter(param);
    page.addState(state);

    session.addPage("20", page);

  }
View Full Code Here


  public void testGetState() {

    IPage page = new Page();
    page.setId(20);

    IState state = new State(0);
    state.setAction("/action");
    IParameter param = new Parameter("name", "value", false, null, true);
    state.addParameter(param);
    page.addState(state);

    session.addPage("20", page);

    // Restore state
View Full Code Here

  public void testGetPage() {

    IPage page = new Page();
    page.setId(20);

    IState state = new State(0);
    state.setAction("/action");
    IParameter param = new Parameter("name", "value", false, null, true);
    state.addParameter(param);
    page.addState(state);

    session.addPage("20", page);

    // Restore page
View Full Code Here

    IPage page1 = new Page();
    IPage page2 = new Page();
    IPage page3 = new Page();

    IState state1 = new State(0);
    IState state2 = new State(0);
    IState state3 = new State(0);

    page1.addState(state1);
    page1.setId(1);
    cache.addPage("1");
View Full Code Here

  /*
   * Test method for 'org.hdiv.state.StateUtil.encode64Cipher(Object)'
   */
  public void testEncode64() {

    IState state = new State(0);

    state.setAction("action1");
    Parameter parameter1 = new Parameter("parameter1", "value1", false, "text", false);
    parameter1.addValue("value2");
    Parameter parameter2 = new Parameter("parameter2""value1", false, "text", false);
    parameter2.addValue("value2");
    Parameter parameter3 = new Parameter("parameter3""value1", false, "text", false);
    parameter3.addValue("value2");
   
    state.addParameter(parameter1);
    state.addParameter(parameter2);
    state.addParameter(parameter3);

    String data = encodingUtil.encode64Cipher(state);
    State obj = (State) encodingUtil.decode64Cipher(data);

    assertEquals(obj.getAction(), state.getAction());
  }
View Full Code Here

      throw new HDIVException(Constants.ENCODING_UTF_8 + " enconding not supported.", e);
    } catch (IllegalArgumentException e) {
    }

    // Create new IState
    IState state = new State(this.requestCounter);
    state.setAction(action);
    state.setMethod(method);

    return this.beginRequest(state);
  }
View Full Code Here

  public void testSameState() {

    ScopedStateCache cache = new ScopedStateCache();

    State state = new State(0);
    state.setAction("/action");
    String token = "123456789";

    String stateId = cache.addState(state, token);
    assertNotNull(stateId);
View Full Code Here

    assertTrue(stateScope.isScopeState("U-111-11111"));
  }

  public void testAddState() {

    IState state = new State(0);
    state.setAction("/action");

    this.stateScope.addState(state, "token");

    IState state2 = this.stateScope.restoreState(0);
View Full Code Here

    assertEquals(state, state2);
  }

  public void testAddSameActionState() {

    IState state = new State(0);
    state.setAction("/action");
    IParameter param = new Parameter("uno", "value", false, null, false);
    state.addParameter(param);

    String id = this.stateScope.addState(state, "token");

    IState state2 = new State(1);
    state2.setAction("/action");
    IParameter param2 = new Parameter("uno", "value", false, null, false);
    state2.addParameter(param2);

    String id2 = this.stateScope.addState(state2, "token");

    assertEquals(id, id2);
  }
View Full Code Here

    assertTrue(stateScope.isScopeState("A-111-11111"));
  }

  public void testAddState() {

    IState state = new State(0);
    state.setAction("/action");

    this.stateScope.addState(state, "token");

    IState state2 = this.stateScope.restoreState(0);
View Full Code Here

TOP

Related Classes of org.hdiv.state.State

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.