Update of /cvsroot/jwebunit/jWebUnit/src/net/sourceforge/jwebunit/plugin/jacobie
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4688/src/net/sourceforge/jwebunit/plugin/jacobie
Modified Files:
JacobieDialog.java
Log Message:
more changes for release of jacobie and jwebunit.
Index: JacobieDialog.java
===================================================================
RCS file:
/cvsroot/jwebunit/jWebUnit/src/net/sourceforge/jwebunit/plugin/jacobie/JacobieDialog.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** JacobieDialog.java 11 May 2005 12:11:45 -0000 1.7
--- JacobieDialog.java 22 Jul 2005 01:24:56 -0000 1.8
***************
*** 296,299 ****
--- 296,309 ----
}
+ public void clickButton(String buttonId) {
+ throw new UnsupportedOperationException("clickButton");
+ }
+
+ public void clickButtonWithText(String buttonValueText) {
+ throw new UnsupportedOperationException("clickButtonWithText");
+ }
+
+
+
/**
* Patch sumbitted by Alex Chaffee.
***************
*** 368,372 ****
boolean bReturn = false;
Document theDocument = getIe().getDocument();
! if (theDocument != null && theDocument.findLinkByID(anId) !=
null) {
bReturn = true;
}
--- 378,382 ----
boolean bReturn = false;
Document theDocument = getIe().getDocument();
! if (theDocument != null && theDocument.hasLinkByID(anId)) {
bReturn = true;
}
***************
*** 396,404 ****
return bReturn;
}
public boolean isLinkPresentWithText(String linkText) {
boolean bReturn = false;
Document theDocument = getIe().getDocument();
! if (theDocument != null && theDocument.hasLink(linkText)) {
bReturn = true;
}
--- 406,456 ----
return bReturn;
}
+
+ /**
+ * Return true if a link is present in the current response containing
the Exact specified text.
+ * Note. This will call String.trim() to trim all leading / trailing
spaces.
+ *
+ * RFE 996031...
+ *
+ * @param linkText
+ * text to check for in links on the response.
+ */
+ public boolean isLinkPresentWithExactText(String linkText) {
+ boolean bReturn = false;
+ Document theDocument = getIe().getDocument();
+ if (theDocument != null && theDocument.hasLink(linkText)) {
+ bReturn = true;
+ }
+ return bReturn;
+ }
+
+ /**
+ * Return true if a link is present in the current response containing
the Exact specified text.
+ * Note. This will call String.trim() to trim all leading / trailing
spaces.
+ *
+ * RFE 996031...
+ *
+ * @param linkText
+ * text to check for in links on the response.
+ * @param index
+ * The 0-based index, when more than one link with the same
text is expected.
+ */
+ public boolean isLinkPresentWithExactText(String linkText, int index) {
+ int iZeroToOneIndex = index + 1; //converting to jacobie 1
based index.
+
+ boolean bReturn = false;
+ Document theDocument = getIe().getDocument();
+ if (theDocument != null && theDocument.hasLinks()) {
+ bReturn = theDocument.hasLink(linkText,
iZeroToOneIndex);
+ }
+ return bReturn;
+ }
+
+
public boolean isLinkPresentWithText(String linkText) {
boolean bReturn = false;
Document theDocument = getIe().getDocument();
! if (theDocument != null &&
theDocument.hasLinkByInnerHTML(linkText)) {
bReturn = true;
}
***************
*** 412,419 ****
Document theDocument = getIe().getDocument();
if (theDocument != null && theDocument.hasLinks()) {
! A theA = theDocument.findLink(linkText,
iZeroToOneIndex);
! if (theA != null) {
! bReturn = true;
! }
}
return bReturn;
--- 464,468 ----
Document theDocument = getIe().getDocument();
if (theDocument != null && theDocument.hasLinks()) {
! bReturn = theDocument.hasLink(linkText,
iZeroToOneIndex);
}
return bReturn;
***************
*** 579,583 ****
}
! public void clickLinkWithText(String linkText) {
try {
IE theIE = getIe();
--- 628,635 ----
}
! /*
! * @see
net.sourceforge.jwebunit.IJWebUnitDialog#clickLinkWithExactText(java.lang.String)
! */
! public void clickLinkWithExactText(String linkText) {
try {
IE theIE = getIe();
***************
*** 594,598 ****
}
! public void clickLinkWithText(String linkText, int index) {
int iZeroToOneIndex = index + 1; //converting to jacobie 1
based index.
try {
--- 646,654 ----
}
! /*
! * @see
net.sourceforge.jwebunit.IJWebUnitDialog#clickLinkWithExactText(java.lang.String,
! * int)
! */
! public void clickLinkWithExactText(String linkText, int index) {
int iZeroToOneIndex = index + 1; //converting to jacobie 1
based index.
try {
***************
*** 610,613 ****
--- 666,702 ----
}
+
+
+ public void clickLinkWithText(String linkText) {
+ try {
+ IE theIE = getIe();
+ Document theDocument = theIE.getDocument();
+ if (theDocument != null && theDocument.hasLinks()) {
+ A theA =
theDocument.findLinkByInnerText(linkText);
+ clickLink(theIE, theA);
+ }
+ } catch (JacobieException anException) {
+ throw new RuntimeException(ExceptionUtility
+ .stackTraceToString(anException));
+ }
+
+ }
+
+ public void clickLinkWithText(String linkText, int index) {
+ int iZeroToOneIndex = index + 1; //converting to jacobie 1
based index.
+ try {
+ IE theIE = getIe();
+ Document theDocument = theIE.getDocument();
+ if (theDocument != null && theDocument.hasLinks()) {
+ A theA =
theDocument.findLinkByInnerText(linkText, iZeroToOneIndex);
+ clickLink(theIE, theA);
+ }
+ } catch (JacobieException anException) {
+ throw new RuntimeException(ExceptionUtility
+ .stackTraceToString(anException));
+ }
+
+ }
+
protected void clickLink(IE aIE, A aA) throws JacobieException {
if (aA != null) {
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development