Update of /cvsroot/jwebunit/jWebUnit/fitplugin/test/net/sourceforge/jwebunit/fit
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13916/fitplugin/test/net/sourceforge/jwebunit/fit
Modified Files:
WebFixtureTest.java
Log Message:
One more try to get the paths working in both Eclipse and Maven.
Index: WebFixtureTest.java
===================================================================
RCS file:
/cvsroot/jwebunit/jWebUnit/fitplugin/test/net/sourceforge/jwebunit/fit/WebFixtureTest.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** WebFixtureTest.java 3 Jan 2006 15:45:03 -0000 1.23
--- WebFixtureTest.java 3 Jan 2006 15:57:55 -0000 1.24
***************
*** 16,19 ****
--- 16,20 ----
import org.mortbay.http.HttpServer;
import org.mortbay.http.SocketListener;
+ import org.mortbay.http.handler.DumpHandler;
import org.mortbay.http.handler.ResourceHandler;
import org.mortbay.util.Resource;
***************
*** 25,29 ****
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 int JETTY_PORT_DEFAULT = 8081;
--- 26,29 ----
***************
*** 33,36 ****
--- 33,37 ----
private HttpServer server = null;
+ private String testRoot = "test/";
// translation between urls used in old .fit files and the urls in jetty
context
***************
*** 78,83 ****
DirectoryRunner testRunner =
DirectoryRunner.parseArgs(new String[]
! {TEST_ROOT + "testInput",
! TEST_ROOT + "testOutput"});
testRunner.run();
testRunner.getResultWriter().write();
--- 79,84 ----
DirectoryRunner testRunner =
DirectoryRunner.parseArgs(new String[]
! {testRoot + "testInput",
! testRoot + "testOutput"});
testRunner.run();
testRunner.getResultWriter().write();
***************
*** 86,90 ****
0 < testRunner.getResultWriter().getTotal());
// report failures to JUnit
! String resultsUrl = TEST_ROOT + "testOutput/index.html";
assertEquals("Failures detected. Check " + resultsUrl + ".", 0,
testRunner.getResultWriter().getCounts().wrong);
--- 87,91 ----
0 < testRunner.getResultWriter().getTotal());
// report failures to JUnit
! String resultsUrl = testRoot + "testOutput/index.html";
assertEquals("Failures detected. Check " + resultsUrl + ".", 0,
testRunner.getResultWriter().getCounts().wrong);
***************
*** 108,115 ****
// add the files in sampleHtml to context
HttpContext context = server.addContext(JETTY_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
--- 109,117 ----
// add the files in sampleHtml to context
HttpContext context = server.addContext(JETTY_CONTEXT);
! setUpPathToStaticContents(context);
if (!context.getResource("index.html").exists()) {
// allow the test to run from parent project
! testRoot = PLUGIN_FOLDER + testRoot;
! setUpPathToStaticContents(context);
}
// check that the context root contains the web pages
***************
*** 119,125 ****
}
private void setUpContextHandlers(HttpContext context) {
// handle static HTML
! context.addHandler(getStaticHTMLResourceHandler());
}
--- 121,132 ----
}
+ private void setUpPathToStaticContents(HttpContext context) {
+ context.setResourceBase(testRoot + TEST_HTML_FOLDER);
+ }
+
private void setUpContextHandlers(HttpContext context) {
// handle static HTML
! context.addHandler(getStaticHTMLResourceHandler());
! //context.addHandler(new DumpHandler());
}
-------------------------------------------------------
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