Exemplo n.º 1
0
 public void testToPage1() throws Exception {
   PageScopeHandlerImpl handler = new PageScopeHandlerImpl();
   assertFalse(handler.toPage(null, null));
   register(AaaPage.class, "aaaPage");
   PageDesc pageDesc = new PageDescImpl(AaaPage.class, "aaaPage");
   assertFalse(handler.toPage(pageDesc, getFacesContext()));
 }
Exemplo n.º 2
0
  public void testToPage2() throws Exception {
    PageScopeHandlerImpl handler = new PageScopeHandlerImpl();
    Aaa2Page page = new Aaa2Page();
    register(page, "aaa2Page");
    PageDesc pageDesc = new PageDescImpl(Aaa2Page.class, "aaa2Page");
    Map map = ScopeValueHelper.getOrCreatePageScopeValues(getFacesContext());
    map.put("aaa", "A");
    map.put("bbb", new Integer(1));

    handler.toPage(pageDesc, getFacesContext());
    assertEquals("A", page.getAaa());
    assertNull(page.getBbb());
    PageScope.removeContext(getFacesContext());
  }