Update of /cvsroot/jwebunit/jWebUnit/fitplugin/test/net/sourceforge/jwebunit/fit
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7381/fitplugin/test/net/sourceforge/jwebunit/fit
Modified Files:
WebFixtureTest.java
Log Message:
Allow the test to run from parent project and from maven in the fitplugin
folder.
Index: WebFixtureTest.java
===================================================================
RCS file:
/cvsroot/jwebunit/jWebUnit/fitplugin/test/net/sourceforge/jwebunit/fit/WebFixtureTest.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** WebFixtureTest.java 3 Jan 2006 13:53:57 -0000 1.20
--- WebFixtureTest.java 3 Jan 2006 15:28:20 -0000 1.21
***************
*** 23,28 ****
public static final int MINIMUM_TESTS = 50;
! public static final String TEST_ROOT = "fitplugin/test/";
public static final String TEST_HTML_FOLDER = "sampleHtml/";
public static final int JETTY_PORT_DEFAULT = 8081;
public static final String JETTY_PORT_PROPERTY = "jetty.port";
--- 23,30 ----
public static final int MINIMUM_TESTS = 50;
! public static final String PLUGIN_FOLDER = "fitplugin/";
! public static final String TEST_ROOT = "test/";
public static final String TEST_HTML_FOLDER = "sampleHtml/";
+ public static final String TEST_CONTEXT = "/";
public static final int JETTY_PORT_DEFAULT = 8081;
public static final String JETTY_PORT_PROPERTY = "jetty.port";
***************
*** 57,64 ****
server.addListener(listener);
// add the files in sampleHtml to context
! final HttpContext context = server.addContext("/");
context.setResourceBase(TEST_ROOT + TEST_HTML_FOLDER);
assertTrue("Should find index.html in the configured jetty context: "
+ context.getResourceBase(),
context.getResource("index.html").exists());
context.addHandler(new ResourceHandler() {
protected Resource getResource(String pathInContext) throws
IOException {
--- 59,72 ----
server.addListener(listener);
// add the files in sampleHtml to context
! HttpContext context = server.addContext(TEST_CONTEXT);
context.setResourceBase(TEST_ROOT + TEST_HTML_FOLDER);
+ if (!context.getResource("index.html").exists()) {
+ // allow the test to run from parent project
+ context.setResourceBase(PLUGIN_FOLDER + TEST_ROOT +
TEST_HTML_FOLDER);
+ }
+ // check that the context root contains the web pages
assertTrue("Should find index.html in the configured jetty context: "
+ context.getResourceBase(),
context.getResource("index.html").exists());
+ // handle static HTML
context.addHandler(new ResourceHandler() {
protected Resource getResource(String pathInContext) throws
IOException {
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development