package com.develop.ss.httpunit;
import junit.framework.TestCase;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebResponse;
import com.meterware.httpunit.WebLink;
import com.develop.ss.test.ConfigBean;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.logging.Logger;
import org.xml.sax.SAXException;
public class TestdataTest extends TestCase implements Constants {
WebConversation conversation = new WebConversation();
ConfigBean config;
private static Logger log = Logger.getLogger("com.develop.ss.httpunit");
public TestdataTest(String name) {
super(name);
}
protected void setUp() throws Exception {
config = new ConfigBean();
}
public void testDataPagesPresent() throws IOException, SAXException, MalformedURLException {
WebResponse response = conversation.getResponse(config.getWebappUrl() + "/testdata/default.html");
WebLink[] links = response.getLinks();
for (int i = 0; i < links.length; i++) {
WebLink link = links[i];
link.click();
}
assertEquals(LINKS, links.length);
}
}
|