|
BrokenEvent nanotests | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.brokenevent.nanotests.UrlAssert
public class UrlAssert
Helper class for URL-related asserts.
These methods can be used directly:
UrlAssert.assertUrlProtocol(...)
, however, they read better if they
are referenced through static import:
import static com.brokenevent.nanotests.UrlAssert.*; ... assertUrlProtocol(...);
Constructor Summary | |
---|---|
protected |
UrlAssert()
Protect constructor since it is a static only class |
Method Summary | |
---|---|
static void |
assertUrlDomain(java.lang.String expected,
java.lang.String url)
Asserts that the given URL's domain part is equal to the expected value. |
static void |
assertUrlDomain(java.lang.String message,
java.lang.String expected,
java.lang.String url)
Asserts that the given URL's domain part is equal to the expected value. |
static void |
assertUrlHaveParam(java.lang.String url,
java.lang.String paramName)
Asserts that the given URL have param with the given name. |
static void |
assertUrlHaveParam(java.lang.String message,
java.lang.String url,
java.lang.String paramName)
Asserts that the given URL have param with the given name. |
static void |
assertUrlParam(java.lang.String expectedValue,
java.lang.String url,
java.lang.String paramName)
Asserts that the given URL contains given param and it equals the given value. |
static void |
assertUrlParam(java.lang.String message,
java.lang.String expectedValue,
java.lang.String url,
java.lang.String paramName)
Asserts that the given URL contains given param and it equals the given value. |
static void |
assertUrlProtocol(java.lang.String expected,
java.lang.String url)
Asserts that the given URL's protocol is equal to the expected value. |
static void |
assertUrlProtocol(java.lang.String message,
java.lang.String expected,
java.lang.String url)
Asserts that the given URL's protocol is equal to the expected value. |
static void |
assertUrlResource(java.lang.String expected,
java.lang.String url)
Asserts that the given URL's resource part is equal to the expected value. |
static void |
assertUrlResource(java.lang.String message,
java.lang.String expected,
java.lang.String url)
Asserts that the given URL's resource part is equal to the expected value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected UrlAssert()
Method Detail |
---|
public static void assertUrlProtocol(java.lang.String expected, java.lang.String url)
AssertionError
is thrown.
expected
- expected protocol valueurl
- url to checkpublic static void assertUrlProtocol(java.lang.String message, java.lang.String expected, java.lang.String url)
AssertionError
is thrown with the given message.
message
- the identifying message for the AssertionError
(null
okay)expected
- expected protocol valueurl
- url to checkpublic static void assertUrlDomain(java.lang.String expected, java.lang.String url)
AssertionError
is thrown.
expected
- expected domain valueurl
- url to checkpublic static void assertUrlDomain(java.lang.String message, java.lang.String expected, java.lang.String url)
AssertionError
is thrown with the given message.
message
- the identifying message for the AssertionError
(null
okay)expected
- expected domain valueurl
- url to checkpublic static void assertUrlResource(java.lang.String expected, java.lang.String url)
AssertionError
is thrown.
expected
- expected resource valueurl
- url to checkpublic static void assertUrlResource(java.lang.String message, java.lang.String expected, java.lang.String url)
AssertionError
is thrown with the given message.
message
- the identifying message for the AssertionError
(null
okay)expected
- expected resource valueurl
- url to checkpublic static void assertUrlParam(java.lang.String expectedValue, java.lang.String url, java.lang.String paramName)
AssertionError
is thrown.
expectedValue
- expected param's valueurl
- url to checkparamName
- param name to check its valuepublic static void assertUrlParam(java.lang.String message, java.lang.String expectedValue, java.lang.String url, java.lang.String paramName)
AssertionError
is thrown with the given message.
message
- the identifying message for the AssertionError
(null
okay)expectedValue
- expected param's valueurl
- url to checkparamName
- param name to check its valuepublic static void assertUrlHaveParam(java.lang.String url, java.lang.String paramName)
AssertionError
is thrown.
url
- url to checkparamName
- param name to check its existancepublic static void assertUrlHaveParam(java.lang.String message, java.lang.String url, java.lang.String paramName)
AssertionError
is thrown with the given message.
message
- the identifying message for the AssertionError
(null
okay)url
- url to checkparamName
- param name to check its existance
|
BrokenEvent nanotests | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |