public void testToScope2() throws Exception {
    PageScopeHandlerImpl handler = new PageScopeHandlerImpl();
    Aaa2Page page = new Aaa2Page();
    page.setAaa("A");
    page.setBbb(new Integer(1));
    register(page, "aaa2Page");
    PageDesc pageDesc = new PageDescImpl(Aaa2Page.class, "aaa2Page");

    handler.toScope(pageDesc, getFacesContext());
    Map map = ScopeValueHelper.getOrCreatePageScopeValues(getFacesContext());
    assertEquals("A", map.get("aaa"));
    assertEquals(null, map.get("bbb"));
  }
  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());
  }