|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.truth0.subjects.Subject<S,T>
public class Subject<S extends Subject<S,T>,T>
Propositions for arbitrarily typed subjects and for properties of Object
| Field Summary | |
|---|---|
protected FailureStrategy |
failureStrategy
|
| Constructor Summary | |
|---|---|
Subject(FailureStrategy failureStrategy,
T subject)
|
|
| Method Summary | |
|---|---|
protected TestVerb |
check()
|
boolean |
equals(Object o)
Deprecated. This method is not a proposition, but the default Object equality method. Testing code should use "is" or "isEqualTo" propositions for equality tests. |
protected void |
fail(String verb,
Object... messageParts)
Assembles a failure message and passes such to the FailureStrategy |
protected void |
failWithBadResults(String verb,
Object expected,
String failVerb,
Object actual)
Assembles a failure message and passes it to the FailureStrategy |
protected void |
failWithCustomSubject(String verb,
Object expected,
Object actual)
Assembles a failure message with an alternative representation of the wrapped subject and passes it to the FailureStrategy |
protected void |
failWithoutSubject(String verb)
Assembles a failure message wihtout a given subject and passes it to the FailureStrategy |
protected void |
failWithRawMessage(String message,
Object... parameters)
Passes through a failure message verbatim. |
protected T |
getDisplaySubject()
|
protected T |
getSubject()
|
int |
hashCode()
Deprecated. Equals/Hashcode is not supported on Subjects. Their only use is as a holder of propositions. Use of equals() is deprecated and forwards to isEqualTo() and hashCode() is disallowed. |
void |
is(Object other)
|
void |
isEqualTo(Object other)
|
void |
isNotEqualTo(Object other)
|
void |
isNotNull()
|
void |
isNull()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final FailureStrategy failureStrategy
| Constructor Detail |
|---|
public Subject(FailureStrategy failureStrategy,
T subject)
| Method Detail |
|---|
public void is(Object other)
public void isNull()
public void isNotNull()
public void isEqualTo(Object other)
public void isNotEqualTo(Object other)
protected T getSubject()
protected T getDisplaySubject()
protected TestVerb check()
protected void fail(String verb,
Object... messageParts)
verb - the proposition being assertedmessageParts - the expectations against which the subject is compared
protected void failWithBadResults(String verb,
Object expected,
String failVerb,
Object actual)
verb - the proposition being assertedmessageParts - the expectations against which the subject is compared
protected void failWithCustomSubject(String verb,
Object expected,
Object actual)
verb - the proposition being assertedexpected - the expected value of the propositionactual - the custom representation of the subject to be reported in the failure.protected void failWithoutSubject(String verb)
verb - the proposition being asserted
protected void failWithRawMessage(String message,
Object... parameters)
Subject subclasses which
need to provide alternate language for more fit-to-purpose error messages.
message - the full message to be passed to the failure.@Deprecated public boolean equals(Object o)
equals in class Object@Deprecated public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||