Package org.apache.myfaces.test.mock

Examples of org.apache.myfaces.test.mock.MockFacesContext


    Method indexMutator = ReflectionUtils.findMethod(UIRepeat.class, "setIndex", new Class[] { FacesContext.class,
        int.class });
    indexMutator.setAccessible(true);

    ReflectionUtils.invokeMethod(indexMutator, uiRepeat, new Object[] { new MockFacesContext(), 1 });

    ActionEvent event = new ActionEvent(commandButton);

    this.selectionTrackingListener.processAction(event);

    assertTrue(this.dataModel.isCurrentRowSelected());
    assertSame(this.dataModel.getSelectedRow(), this.dataModel.getRowData());
    assertTrue(this.delegateListener.processedEvent);

    ReflectionUtils.invokeMethod(indexMutator, uiRepeat, new Object[] { new MockFacesContext(), 2 });
    assertFalse(this.dataModel.isCurrentRowSelected());
    assertTrue(this.dataModel.getSelectedRow() != this.dataModel.getRowData());
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.test.mock.MockFacesContext

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.