Package org.hdiv.state

Examples of org.hdiv.state.IState


    String stateId = dataComposer.endRequest();
    dataComposer.endPage();

    assertNotNull(stateId);

    IState state = this.stateUtil.restoreState(stateId);

    assertEquals("test.do", state.getAction());
    String stateParams = state.getParams();
    assertEquals(params, stateParams);
  }
View Full Code Here


    dataComposer.endPage();

    assertTrue(memoryPattern.matcher(stateId).matches());
    assertNotNull(stateId);

    IState state = this.stateUtil.restoreState(stateId);

    assertEquals("test.do", state.getAction());
    List<String> values = state.getParameter("parameter1").getValues();
    assertEquals(1, values.size());
    assertEquals("2", values.get(0));
  }
View Full Code Here

    dataComposer2.compose("parameter2", "2", false);
    String state2 = dataComposer2.endRequest();
    dataComposer2.endPage();

    // Restore state
    IState state = this.stateUtil.restoreState(state2);

    // State contains both parameters
    IParameter param = state.getParameter("parameter1");
    String val = param.getValues().get(0);
    assertEquals("1", val);

    param = state.getParameter("parameter2");
    val = param.getValues().get(0);
    assertEquals("2", val);
  }
View Full Code Here

    assertNotNull(stateId);
    assertNotNull(stateIdInner);
    assertNotSame(stateId, stateIdInner);

    IState state = this.stateUtil.restoreState(stateId);
    IState stateInner = this.stateUtil.restoreState(stateIdInner);
    String action = state.getAction();
    String actionInner = stateInner.getAction();
    assertEquals("test.do", action);
    assertEquals("testinner.do", actionInner);
  }
View Full Code Here

    String stateId = dataComposer.endRequest();
    dataComposer.endPage();

    assertNotNull(stateId);

    IState state = this.stateUtil.restoreState(stateId);

    assertEquals("test.do", state.getAction());

    IParameter param = state.getParameter("parameter1");
    List<String> values = param.getValues();
    assertEquals(1, values.size());
    assertEquals("è-test", values.get(0));// escaped value is the same

    IParameter param2 = state.getParameter("parameterEscaped");
    List<String> values2 = param2.getValues();
    assertEquals(1, values2.size());
    // State stored value is not escaped value, it is the unescaped value
    assertEquals("è-test", values2.get(0));
  }
View Full Code Here

    String stateId = dataComposer.endRequest();
    dataComposer.endPage();

    assertNotNull(stateId);

    IState state = this.stateUtil.restoreState(stateId);

    assertEquals("test.do", state.getAction());

    IParameter param = state.getParameter("parameter1");
    List<String> values = param.getValues();
    assertEquals(0, values.size());
  }
View Full Code Here

    dataComposer.beginRequest("POST", "test.do");
    String result = dataComposer.compose("test.do", "parameter1", "2", false);
    assertEquals("0", result);
    String stateId = dataComposer.endRequest();

    IState state = this.stateUtil.restoreState(stateId);
    assertNotNull(state);
    assertEquals("test.do", state.getAction());

    dataComposer.endPage();
  }
View Full Code Here

    String stateId = dataComposer.endRequest();
    dataComposer.endPage();

    assertNotNull(stateId);

    IState state = this.stateUtil.restoreState(stateId);

    assertEquals("test test.do", state.getAction());

    // Encoded action url
    dataComposer = this.dataComposerFactory.newInstance(request);
    HDIVUtil.setDataComposer(dataComposer, request);

    dataComposer.startPage();
    dataComposer.beginRequest("POST", "test%20test.do");
    stateId = dataComposer.endRequest();
    dataComposer.endPage();

    assertNotNull(stateId);

    state = this.stateUtil.restoreState(stateId);

    // State action value is decoded because we store decoded values only
    assertEquals("test test.do", state.getAction());
  }
View Full Code Here

    String stateId = dataComposer.endRequest();
    dataComposer.endPage();

    assertNotNull(stateId);

    IState state = this.stateUtil.restoreState(stateId);

    assertEquals("test.do", state.getAction());
    List<String> values = state.getParameter("parameter1").getValues();
    assertEquals(1, values.size());
    assertEquals("2", values.get(0));
  }
View Full Code Here

    String stateId = dataComposer.endRequest();
    dataComposer.endPage();

    assertNotNull(stateId);

    IState state = this.stateUtil.restoreState(stateId);

    assertEquals("test.do", state.getAction());
    String stateParams = state.getParams();
    assertEquals(params, stateParams);
  }
View Full Code Here

TOP

Related Classes of org.hdiv.state.IState

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.