Examples of PageA


Examples of org.apache.wicket.security.pages.secure.PageA

    // IsecureComponent
    Map<String, WaspAction> authorized = new HashMap<String, WaspAction>();
    authorized.put(SecureComponentHelper.alias(PageA.class), application.getActionFactory()
      .getAction("access"));
    login(authorized);
    new PageA(); // still allowed here
    authorized.clear();
    authorized.put(SecureComponentHelper.alias(SecureTextField.class), application
      .getActionFactory().getAction("access"));
    logoff(authorized);
    try
    {
      new PageA();
      fail("somehow page was instantiated");
    }
    catch (UnauthorizedInstantiationException e)
    {
      // because we are not allowed to instantiate a SecureTextField
      // anymore
    }
    mock.processRequestCycle();
    try
    {
      tearDown();
      setSecureClass(ISecurePage.class);
      setUp();
    }
    catch (Exception e)
    {
      log.error(e.getMessage(), e);
      fail(e.getMessage());
    }
    doLogin();
    // now we only check pages so all components will be created, this does
    // not affect
    // the render check though
    mock.setupRequestAndResponse();
    logoff(authorized);
    authorized.clear();
    authorized.put(SecureComponentHelper.alias(PageA.class), application.getActionFactory()
      .getAction("access"));
    // need to enable page a again
    login(authorized);
    new PageA(); // only pages are checked so now securetextfield is
    // allowed.
    mock.processRequestCycle();
  }
View Full Code Here

Examples of org.apache.wicket.util.io.PageA

   * @throws Exception
   */
  public void testPageSerialization() throws Exception
  {
    PageB b = new PageB("test");
    PageA a = new PageA(b);
    b.setA(a);

    tester.setupRequestAndResponse();

    Session session = Session.get();

    a.getPageMap().put(a);
    a.getPageMap().put(b);

    PageA a2 = (PageA)a.getPageMap().get(a.getNumericId(), a.getCurrentVersionNumber());

    Assert.assertEquals(a, a2);

    Assert.assertSame(a2, a2.getB().getA());
  }
View Full Code Here

Examples of org.apache.wicket.util.io.PageA

   * @throws Exception
   */
  public void testPageSerialization() throws Exception
  {
    PageB b = new PageB("test");
    PageA a = new PageA(b);
    b.setA(a);

    tester.setupRequestAndResponse();

    Session.get();

    a.getPageMap().put(a);
    a.getPageMap().put(b);

    PageA a2 = (PageA)a.getPageMap().get(a.getNumericId(), a.getCurrentVersionNumber());

    Assert.assertEquals(a, a2);

    Assert.assertSame(a2, a2.getB().getA());
  }
View Full Code Here

Examples of org.apache.wicket.util.io.PageA

   * @throws Exception
   */
  public void testPageSerialization() throws Exception
  {
    PageB b = new PageB("test");
    PageA a = new PageA(b);
    b.setA(a);

    tester.setupRequestAndResponse();

    Session session = Session.get();

    a.getPageMap().put(a);
    a.getPageMap().put(b);

    PageA a2 = (PageA)a.getPageMap().get(a.getNumericId(), a.getCurrentVersionNumber());

    Assert.assertEquals(a, a2);

    Assert.assertSame(a2, a2.getB().getA());
  }
View Full Code Here

Examples of org.apache.wicket.util.io.PageA

   * @throws Exception
   */
  public void testPageSerialization() throws Exception
  {
    PageB b = new PageB("test");
    PageA a = new PageA(b);
    b.setA(a);
   
    tester.setupRequestAndResponse();
   
    Session session = Session.get();
   
    a.getPageMap().put(a);
    a.getPageMap().put(b);
   
    PageA a2 = (PageA)a.getPageMap().get(a.getNumericId(), a.getCurrentVersionNumber());
   
    Assert.assertEquals(a, a2);
   
    Assert.assertSame(a2, a2.getB().getA());
  }
View Full Code Here

Examples of org.wicketstuff.security.pages.secure.PageA

    // IsecureComponent
    Map<String, WaspAction> authorized = new HashMap<String, WaspAction>();
    authorized.put(SecureComponentHelper.alias(PageA.class), application.getActionFactory()
      .getAction("access"));
    login(authorized);
    new PageA(); // still allowed here
    authorized.clear();
    authorized.put(SecureComponentHelper.alias(SecureTextField.class),
      application.getActionFactory().getAction("access"));
    logoff(authorized);
    try
    {
      new PageA();
      fail("somehow page was instantiated");
    }
    catch (UnauthorizedInstantiationException e)
    {
      // because we are not allowed to instantiate a SecureTextField
      // anymore
    }
    mock.processRequest();
    try
    {
      tearDown();
      setSecureClass(ISecurePage.class);
      setUp();
    }
    catch (Exception e)
    {
      log.error(e.getMessage(), e);
      fail(e.getMessage());
    }
    doLogin();
    // now we only check pages so all components will be created, this does
    // not affect
    // the render check though
    logoff(authorized);
    authorized.clear();
    authorized.put(SecureComponentHelper.alias(PageA.class), application.getActionFactory()
      .getAction("access"));
    // need to enable page a again
    login(authorized);
    new PageA(); // only pages are checked so now securetextfield is
    // allowed.
    mock.processRequest();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.