This content has been marked as final.
Show 5 replies
-
1. Re: server.server.getManagedBeanValue always return null
ssilvert Oct 13, 2009 7:44 AM (in response to sonya_ling1947)Hi,
Can you post your full source for the test and the xhtml or jsp pages?
Also, I don't understand this line:
assertEquals("#{LoginBean.username}", "Daisy_test2");
In that line of code, "#{LoginBean.username}" is a string constant. The assertEquals() JUnit method doesn't know anything about EL.
Stan -
2. Re: server.server.getManagedBeanValue always return null
sonya_ling1947 Oct 13, 2009 1:57 PM (in response to sonya_ling1947)Hi Stan:
Sorry for my typo. I means to say the followings:
junit.framework.AssertionFailedError
expected:<Daisy_test2> but was:assertEquals("/jsp/login.jsp", server.getCurrentViewID()); client.setValue("username", "Daisy_test2"); client.setValue("password", "Password2"); client.click("submit"); assertEquals("Daisy_test2", server.getManagedBeanValue("#{LoginBean.username}")); assertEquals("/jsp/home.jsp", server.getCurrentViewID());
<div class="form_login"> <div class="formItem"> <label>username</label><h:inputText id="username"value="#{LoginBean.username}" styleClass="textbox"/> </div> <div class="formItem"> <label>password</label><h:inputSecret id="password" value="#{LoginBean.password}" styleClass="textbox"/> </div> <div class="formItem buttonRow"> <h:commandButton id="submit" action="#{LoginBean.authenticate}" value="" type="submit" styleClass="buttonL" /> </div> </div>
The other is
junit.framework.AssertionFailedError, nullassertEquals("/jsp/product_edit.jsp", server.getCurrentViewID()); assertNotNull(server.getManagedBeanValue("#{ProductBean.productTypes}")); List<SelectItem> selectItems = (List<SelectItem>)obj; <h:selectOneListbox id="producttypeSelect" value="#{ProductBean.newMediaProduct.productType}" size="1" styleClass="dropdown simpleborder"> <f:selectItems id="producttypeSelectItems" value="#{ProductBean.productTypes}"/> </h:selectOneListbox> [code/] Thanks for your help.
-
3. Re: server.server.getManagedBeanValue always return null
ssilvert Oct 13, 2009 3:11 PM (in response to sonya_ling1947)I don't see anything wrong off hand.
What kind of managed beans are these? Request, session, Seam/EJB, Spring, etc.?
Stan -
4. Re: server.server.getManagedBeanValue always return null
sonya_ling1947 Oct 13, 2009 4:01 PM (in response to sonya_ling1947)Both are managed beans of session scope
-
5. Re: server.server.getManagedBeanValue always return null
ssilvert Oct 16, 2009 8:08 AM (in response to sonya_ling1947)I still don't see anything wrong, but you haven't posted all your source. If you want to send me a simple project to recreate this I'll take a look at it.
Stan