Hello,
I am trying to use the Shale testing framework in order to test how
ActionEvents can be trapped and manager.
I am using the AbstractJsfTestCase as my extension for my test case.
What I am trying to do is mimic the generation of the action event,
and then process asserts around that.
After calling super.setUp() I have done the following:
// create the view
UIForm parent = new HtmlForm();
parent.setId("form1");
parent.setParent(facesContext.getViewRoot());
// Add the components to the HTML Form
button = new UICommand();
button.setId("button1");
button.setParent(parent);
UIData table = new UIData();
table.setId("myTable");
table.setParent(parent);
In my testMethod() I am performing the following:
ActionEvent eventFC = new ActionEvent(button);
assertNotNull("Action Event was returned null - expected an object",
eventFC);
UIComponent comp= eventFC. getComponent();
comp= button.findComponent("myTable");
assertNotNull("UIComponent was returned null directly from button -
expected an object", comp);
The call to find the component by name (myTable) returns a null object
- is there a way using this framework to simulate something like what I
am attempting?
Thanks for any advice!
Derek