Revision: 925
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=925&view=rev
Author: henryju
Date: 2011-09-23 15:03:33 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Improve some tests.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/Frames.html
Modified:
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
===================================================================
---
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
2011-09-23 14:56:50 UTC (rev 924)
+++
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
2011-09-23 15:03:33 UTC (rev 925)
@@ -23,6 +23,9 @@
import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
import static net.sourceforge.jwebunit.junit.JWebUnit.getTestContext;
import static net.sourceforge.jwebunit.junit.JWebUnit.setCustomTester;
+
+import org.junit.Before;
+
import net.sourceforge.jwebunit.junit.WebTester;
import org.junit.After;
@@ -57,6 +60,7 @@
}
+ @Before
public void setUp() throws Exception {
setCustomTester(new MyWebTester());
super.setUp();
Modified:
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
===================================================================
---
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
2011-09-23 14:56:50 UTC (rev 924)
+++
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
2011-09-23 15:03:33 UTC (rev 925)
@@ -24,6 +24,8 @@
import java.io.FileWriter;
import java.io.IOException;
+import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
+
import org.junit.Test;
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
@@ -262,11 +264,10 @@
public void testInvalidButton() {
beginAt("/InvalidActionForm.html");
try {
- submit("button1");
- fail("Should have failed because the target page does not exist");
- } catch (RuntimeException e) {
- // TODO Have a better way to know if 404 happened
- assertTrue("Should return 404 error", true);
+ submit("button1");
+ fail("A TestingEngineResponseException was expected.");
+ } catch (TestingEngineResponseException e) {
+ assertEquals(404, e.getHttpStatusCode());
}
}
Modified:
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/Frames.html
===================================================================
---
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/Frames.html
2011-09-23 14:56:50 UTC (rev 924)
+++
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/Frames.html
2011-09-23 15:03:33 UTC (rev 925)
@@ -19,7 +19,7 @@
-->
<html>
-<head></head>
+<head><title>Frameset</title></head>
<frameset rows="33%, 33%, 33%">
<frame id="frame1" name="TopFrame" src="TopFrame.html">
<frame id="frame2" name="ContentFrame" src="ContentFrame.html">
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development