Revision: 553
Author: solsson
Date: 2006-08-02 04:31:42 -0700 (Wed, 02 Aug 2006)
ViewCVS: http://svn.sourceforge.net/jwebunit/?rev=553&view=rev
Log Message:
-----------
The tests compile and run now, with no functional changes. There are test
failures so the suite must be adapted to the refactored jwebunit.
Removed folders from the old fitplugin.
Modified Paths:
--------------
trunk/jwebfit/pom.xml
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/WebFixtureTest.java
Removed Paths:
-------------
trunk/jwebfit/doc/
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoRow.java
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoTableFixture.java
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PseudoWebApp.java
trunk/jwebfit/test/
trunk/jwebfit/testdata/
Modified: trunk/jwebfit/pom.xml
===================================================================
--- trunk/jwebfit/pom.xml 2006-08-02 09:07:05 UTC (rev 552)
+++ trunk/jwebfit/pom.xml 2006-08-02 11:31:42 UTC (rev 553)
@@ -23,8 +23,27 @@
<scope>system</scope>
<systemPath>${basedir}/lib/fit.jar</systemPath>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- the engine used when running tests -->
+ <dependency>
+ <groupId>net.sourceforge.jwebunit</groupId>
+ <artifactId>jwebunit-htmlunit-plugin</artifactId>
+ <version>${pom.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<properties>
- <topDirectoryLocation>..</topDirectoryLocation>
+ <topDirectoryLocation>..</topDirectoryLocation>
+ <jetty-version>4.2.9</jetty-version>
</properties>
</project>
\ No newline at end of file
Deleted:
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoRow.java
===================================================================
---
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoRow.java
2006-08-02 09:07:05 UTC (rev 552)
+++
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoRow.java
2006-08-02 11:31:42 UTC (rev 553)
@@ -1,22 +0,0 @@
-package net.sourceforge.jwebunit.fit;
-
-/**
- * Class to represent a data row of the personal info (by columns) table.
- *
- * @author Jim Weaver
- */
-public class PersonalInfoRow extends TableRow {
-
- public String name;
- public String citizenship;
- public String state;
- public String sex;
-
- public PersonalInfoRow(String[] rowCells) {
- super(rowCells);
- this.name = rowCells[0];
- this.citizenship = rowCells[1];
- this.state = rowCells[2];
- this.sex = rowCells[3];
- }
-}
Deleted:
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoTableFixture.java
===================================================================
---
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoTableFixture.java
2006-08-02 09:07:05 UTC (rev 552)
+++
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PersonalInfoTableFixture.java
2006-08-02 11:31:42 UTC (rev 553)
@@ -1,20 +0,0 @@
-package net.sourceforge.jwebunit.fit;
-
-/**
- * Subclass TableFixture to allow testing of the PersonalInfoTable - provide
- * table summary value and class of test object to be built for each data row
- * in the table.
- *
- * @author Jim Weaver
- */
-public class PersonalInfoTableFixture extends TableFixture {
-
- protected String getSourceTableSummaryOrId() {
- return "infoTableColHeaders";
- }
-
- public Class getTargetClass() {
- return PersonalInfoRow.class;
- }
-
-}
Deleted:
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PseudoWebApp.java
===================================================================
--- trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PseudoWebApp.java
2006-08-02 09:07:05 UTC (rev 552)
+++ trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/PseudoWebApp.java
2006-08-02 11:31:42 UTC (rev 553)
@@ -1,137 +0,0 @@
-package net.sourceforge.jwebunit.fit;
-
-import com.meterware.pseudoserver.PseudoServer;
-import com.meterware.pseudoserver.PseudoServlet;
-import com.meterware.pseudoserver.WebResource;
-
-import java.io.*;
-
-/**
- * @deprecated Jetty and servlets is used instead.
- */
-public class PseudoWebApp {
-
- private PseudoServer server;
- private static String htmldir = "fitplugin/test/sampleHtml/";
-
- public static void main (String argv[]) throws Exception {
- System.out.println("Starting up Pseudo Server...");
- htmldir = System.getProperty("user.dir") + "/" + htmldir;
- PseudoWebApp app = new PseudoWebApp();
- System.out.println("Pseudo Server started on port " +
app.getServer().getConnectedPort());
- while (true) { Thread.sleep(1); } //loop until process terminated.
- }
-
- public PseudoServer getServer() {
- return server;
- }
-
- public PseudoWebApp() throws Exception {
- buildSite();
- }
-
- private void buildSite() throws Exception {
- server = new PseudoServer();
-
- server.setResource("/menu", read(new File(htmldir +
"SampleMenu.html")));
- server.setResource("/colorForm", read(new File(htmldir +
"ColorForm.html")));
- server.setResource("/personalInfoForm", read(new File(htmldir +
"PersonalInfoForm.html")));
- server.setResource("/enterMoria", read(new File(htmldir +
"MoriaDoorForm.html")));
- server.setResource("/moria_door.jpeg", readBytes(new File(htmldir +
"moria_door.jpeg")), "jpeg image");
- server.setResource("/pageWithPopupLink", read(new File(htmldir +
"pageWithPopupLink.html")));
- server.setResource("/popupWindow.html", read(new File(htmldir +
"popupWindow.html")));
-
- server.setResource("colorPost", new PseudoServlet() {
- public WebResource getPostResponse() {
- WebResource result = new WebResource("<html><head><title>Color
Page</title></head>" +
- "<body style=\"color:
rgb(0,0,0); background-color: " + getParm("color") + ";\" link=\"#000099\"
vlink=\"#990099\" alink=\"#000099\">" +
- "Your chosen color was "
+ getParm("color") + "." +
- "</body></html>");
- return result;
- }
- public WebResource getGetResponse() throws IOException {
- return getPostResponse();
- }
-
- public String getParm(String s) {
- return super.getParameter(s) != null? getParameter(s)[0] : "";
- }
- });
-
- server.setResource("moriaPost", new PseudoServlet() {
- public WebResource getPostResponse() {
- WebResource result = null;
- if ((!getParm("EnterButton").equals("")) &&
- (getParm("password").toLowerCase().equals("friend"))) {
- result = new
WebResource("<html><head><title>Moria</title></head>" +
- "<body style=\"background-color:
beige\">" +
- "You made it!" + "</body></html>");
- }
- else {
- result = new WebResource("<html><head><title>Moria Entry
Failure</title></head>" +
- "<body style=\"background-color:
beige\">" +
- "Nope! <a href=\"/enterMoria\">Try
again!</a>" + "</body></html>");
-
- }
- return result;
- }
- public WebResource getGetResponse() throws IOException {
- return getPostResponse();
- }
-
- public String getParm(String s) {
- return super.getParameter(s) != null? getParameter(s)[0] : "";
- }
- });
-
-
- server.setResource("personalInfoPost", new PseudoServlet() {
- public WebResource getPostResponse() {
- String citizenship = "not a citizen";
- if (getParameter("citizenCheckbox") != null &&
- getParameter("citizenCheckbox")[0].equals("on")) {
- citizenship = "a citizen";
- }
- WebResource result = new
WebResource("<html><head><title>Personal Info Results</title></head>" +
- "<body
style=\"background-color: beige\"><br>" +
- "<table
id=\"infoTable\"><tr><td colspan=2>Personal Information Table</td></tr>" +
-
"<tr><td>Name</td><td>Name given is " + getParm("fullName") + ".</td></tr>" +
-
"<tr><td>Citizenship</td><td>You indicated that you are " + citizenship +
".</td></tr>" +
- "<tr><td>State of
Residence</td><td>You live in " + getParm("state") + ".</td></tr>" +
- "<tr><td>Sex</td><td>You
are " + getParm("sex") + ".</td></tr></table>" + "<br><br>" +
- "<table
id=\"infoTableColHeaders\"><tr><td colspan=3>Personal Information Table -
Column Headers</td></tr>" +
-
"<tr><td>Name</td><td>Citizenship</td><td>State of
Residence</td><td>Sex</td></tr>" +
- "<tr><td>" +
getParm("fullName") + "</td><td>" + citizenship + "</td><td>" +
getParm("state") + "</td><td>" + getParm("sex") + "</td></tr>" +
- "<tr><td>Fred
Evans</td><td>a citizen</td><td>Tennessee</td><td>male</td></tr>" +
- "<tr><td>Rebecca
VonStavoren</td><td>not a citizen</td><td>North
Carolina</td><td>female</td></tr></table>" +
- "</body></html>");
- return result;
- }
- public WebResource getGetResponse() throws IOException {
- return getPostResponse();
- }
-
- public String getParm(String s) {
- return super.getParameter(s) != null? getParameter(s)[0] :
"none indicated";
- }
- });
-
- }
-
-
- byte [] readBytes(File input) throws IOException {
- byte bytes[] = new byte[(int)(input.length())];
- FileInputStream in = new FileInputStream(input);
- in.read(bytes);
- in.close();
- return bytes;
- }
-
- String read(File input) throws IOException {
- char chars[] = new char[(int)(input.length())];
- FileReader in = new FileReader(input);
- in.read(chars);
- in.close();
- return new String(chars);
- }
-}
Modified:
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/WebFixtureTest.java
===================================================================
---
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/WebFixtureTest.java
2006-08-02 09:07:05 UTC (rev 552)
+++
trunk/jwebfit/src/test/java/net/sourceforge/jwebunit/fit/WebFixtureTest.java
2006-08-02 11:31:42 UTC (rev 553)
@@ -27,7 +27,7 @@
public class WebFixtureTest extends TestCase {
public static final int MINIMUM_TESTS = 50;
- public static final String PLUGIN_FOLDER = "fitplugin/";
+ public static final String SRC_FOLDER = "src/";
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";
@@ -35,7 +35,7 @@
public static final String JETTY_HOST = "localhost";
private HttpServer server = null;
- private String testRoot = "test/";
+ private String testRoot = "test/resources/";
// translation between urls used in old .fit files and the urls in jetty
context
private static Map oldUrls = null;
@@ -117,7 +117,7 @@
setUpPathToStaticContents(context);
if (!context.getResource("readme.html").exists()) {
// allow the test to run from parent project
- testRoot = PLUGIN_FOLDER + testRoot;
+ testRoot = SRC_FOLDER + testRoot;
setUpPathToStaticContents(context);
}
// check that the context root contains the web pages
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development