SpiderUnit

Overview

An extension to httpunit to test reachability of internal links, external links, images, applets, cgis, frames, etc. It can be used as a standalone tool, along with JUnit tests, and as an ANT Task.

Requirements

1 – JUnit.jar

2 – Httpunit jars

Install

1 - Unzip spiderunit-xx.zip

2 – Set the environment variable CLASSPATH to the spiderunit.jar file.

3 – Execute the UnitTests: java org.spiderunit.tests.AllTests

Using SpiderUnit standalone

Spider spi = new Spider("http://spiderunit.sf.net/spider/frames/frame1.html");

spi.setVerbose(false);

spi.addPagePlugin("org.spiderunit.plugins.images.ImagesAnalyzer");

spi.setMaxLinks(10);

spi.run();

spi.report();

Using SpiderUnit in JUnit tests

...

Using SpiderUnit as an ANT Task

<target depends="init" name="spider">

<taskdef classname="org.spiderunit.ant.SpiderAntTask" name="spider">

<classpath>

<pathelement location="/opt/spiderunit/spiderunit.jar"/>

</classpath>

<classpath>

<fileset dir="/opt/httpunit-1.5.1">

<include name="jars/*.jar"/>

<include name="lib/httpunit.jar"/>

</fileset>

</classpath>

</taskdef>

<spider url="http://www.slashdot.org” verbose="yes" maxlinks="60" linksdepth="1">

</spider>

</target>

Where do I get releases ?

Releases of SpiderUnit are available from the project download page.

Todo List

Priorities are:

1 – fully multi-threaded and finish basic plugins for SpiderUnit (will be version 0.1.0)

2 – develop some plugins to test security of web applications (will be version 0.2.0)



Hosted by