/** *Testcallsthemethod.<p> *Has<b>OK</b>statusinthreecases: *<ol> *<li>Anobjecthaslocationstoredin.Thenifmethoddoesnotreturn *null,ithas<b>OK</b>status</li> *<li>Anobjecthasnolocationstoredin.ThenmethodstoreAsURL()is *called,andifurlisnotnullandequalstoaurlwherecomponent *wasstored,methodhas<b>OK</b>status</li> *<li>Anobjecthasnolocationstoredin.ThenmethodstoreAsURL()is *called,andifurlisnullandmethodreturnsnulltoo,method *has<b>OK</b>status</li> *</ol><p> *Thefollowingmethodtestsaretobecompletedsuccessfullybefore: *<ul> *<li><code>storeAsURL()</code>:storestheobject'spersistentdata *toaURLandletstheobjectbecometherepresentationofthisnew *URL</li> *</ul>
*/ publicvoid _getLocation() { if (oObj.hasLocation()) { // if it has location it should know it
tRes.tested("getLocation()", oObj.getLocation() != null);
} else { // else try to obtain location
requiredMethod("storeAsURL()"); if (storeUrl != null) { // if stored successfully - check location
log.println(oObj.getLocation() + "--" + storeUrl);
tRes.tested("getLocation()",
storeUrl.equals(oObj.getLocation()));
} else { // if not - it should not have a location
tRes.tested("getLocation()", oObj.getLocation() == null);
}
}
}
/** *Testcallsthemethod,thenresultischecked.<p> *Has<b>OK</b>statusifstoredurlisnotnullandmethoddoesnot *returnnullorifstoredurlisnullandthemethodreturnsnull.<p> *Thefollowingmethodtestsaretobecompletedsuccessfullybefore: *<ul> *<li><code>storeAsURL()</code>:storestheobject'spersistentdata *toaURLandletstheobjectbecometherepresentationofthisnew *URL</li> *</ul>
*/ publicvoid _hasLocation() {
requiredMethod("storeAsURL()"); if (storeUrl != null) { // if stored successfully - it should have a location
tRes.tested("hasLocation()", oObj.hasLocation());
} else { // if not - it should not
tRes.tested("hasLocation()", !oObj.hasLocation());
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.