[Httpunit-commit] SF.net SVN: httpunit: [928] trunk/httpunit/test/com/meterware/httpunit/ WebLinkTe
Brought to you by:
russgold
|
From: <wol...@us...> - 2008-04-19 10:46:52
|
Revision: 928
http://httpunit.svn.sourceforge.net/httpunit/?rev=928&view=rev
Author: wolfgang_fahl
Date: 2008-04-19 03:46:48 -0700 (Sat, 19 Apr 2008)
Log Message:
-----------
test for bug report
[ 1232591 ] getTarget() gives "_top" even if target is not present by Rifi added - no change yet
Modified Paths:
--------------
trunk/httpunit/test/com/meterware/httpunit/WebLinkTest.java
Modified: trunk/httpunit/test/com/meterware/httpunit/WebLinkTest.java
===================================================================
--- trunk/httpunit/test/com/meterware/httpunit/WebLinkTest.java 2008-04-19 10:24:27 UTC (rev 927)
+++ trunk/httpunit/test/com/meterware/httpunit/WebLinkTest.java 2008-04-19 10:46:48 UTC (rev 928)
@@ -70,6 +70,7 @@
assertEquals( 0, links.length );
}
+
/**
* test for bug report [ 1156972 ] isWebLink doesn't recognize all anchor tags
* by fregienj
@@ -282,8 +283,28 @@
link.click();
assertEquals( "Title of next page", "Initial", wc.getFrameContents( link.getTarget() ).getTitle() );
}
+
+ /**
+ * test for bug report
+ * [ 1232591 ] getTarget() gives "_top" even if target is not present
+ * by Rifi
+ */
+ public void testGetTarget_top() throws Exception {
+ WebConversation wc = new WebConversation();
+ defineWebPage( "target", "<a href=\"a.html\">" );
+ WebResponse targetPage = wc.getResponse( getHostPath() + "/target.html" );
+ assertEquals( "Num links in initial page", 1,targetPage.getLinks().length );
+ WebLink link = targetPage.getLinks()[0];
+ String target=link.getTarget();
+ // the bug report _top is NOT what we expect
+ // but for the time being this is how httpunit behaves ...
+ String expected="_top";
+ //System.err.println(target);
+ assertTrue(target.equals(expected));
+ }
+
public void testLinksWithFragmentsAndParameters() throws Exception {
WebConversation wc = new WebConversation();
defineResource( "Initial.html?age=3", "<html><head><title>Initial</title></head><body>" +
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|