|
Struts example source code file (GetOrdersTest.java)
The Struts GetOrdersTest.java source codepackage it.org.apache.struts2.rest.example; import net.sourceforge.jwebunit.junit.WebTestCase; public class GetOrdersTest extends WebTestCase { public void setUp() throws Exception { getTestContext().setBaseUrl(ParameterUtils.getBaseUrl()); } public void testGetOrders() { beginAt("/orders/3"); assertTextPresent("Bob"); assertTextNotPresent("Sarah"); } public void testGetOrdersInHtml() { beginAt("/orders/3.xhtml"); assertTextPresent("Bob"); } public void testGetOrdersInXml() { beginAt("/orders/3.xml"); assertTextPresent("<clientName>Bob"); } public void testGetOrdersInJson() { beginAt("/orders/3.json"); assertTextPresent("\"clientName\":\"Bob\""); } } Other Struts examples (source code examples)Here is a short list of links related to this Struts GetOrdersTest.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.