Skip to content

Commit

Permalink
fix test up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Feb 3, 2010
1 parent 96ba355 commit 6875568
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Expand Up @@ -34,6 +34,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;

/**
* <p>This test was mostly developed to test the scenario related to WELD-29. Essentially
Expand All @@ -44,7 +45,7 @@
*
*/
@Artifact(addCurrentPackage=false)
@Classes({Storm.class})
@Classes({Storm.class, Rain.class})
@IntegrationTest(runLocally=true)
@Resources({
@Resource(destination=WarArtifactDescriptor.WEB_XML_DESTINATION, source="web.xml"),
Expand All @@ -62,10 +63,12 @@ public void testActionMethodExceptionDoesNotDestroyContext() throws Exception

HtmlPage page = client.getPage(getPath("/storm.jsf"));
HtmlSubmitInput disasterButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "disasterButton");
HtmlTextInput strength = getFirstMatchingElement(page, HtmlTextInput.class, "stormStrength");
strength.setValueAttribute("10");
page = disasterButton.click();
assert "Application Error".equals(page.getTitleText());
HtmlDivision conversationValue = getFirstMatchingElement(page, HtmlDivision.class, "conversation");
assert conversationValue.asText().equals("0");
assert conversationValue.asText().equals("10");
HtmlDivision requestValue = getFirstMatchingElement(page, HtmlDivision.class, "request");
assert requestValue.asText().equals("medium");
}
Expand Down
Expand Up @@ -17,8 +17,10 @@
package org.jboss.weld.tests.contexts.errorpage;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

@RequestScoped
@Named
public class Rain
{
public String getSeverityLevel()
Expand Down
Expand Up @@ -16,8 +16,8 @@
<h1>Application Error</h1>
<p>The following error occurred while processing the request:</p>

<div id="request">${rain.serverityLevel}</div>
<div id="conversation">${storm.strength}</div>
<div id="request">${rain.severityLevel}</div>

</body>
</html>
Expand Down

0 comments on commit 6875568

Please sign in to comment.