⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testdatatest.java

📁 simple spider 源码 better light faster java 书籍源码.
💻 JAVA
字号:
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);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -