|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mutabilitydetector.unittesting.MutabilityAsserter
public class MutabilityAsserter
Performs Mutability Detector's analysis and produces unit-test-friendly
AssertionError
if the result is not as expected.
Instances of this class provide the methods accessed by
MutabilityAssert
. More detailed documentation can be found there.
Method Summary | |
---|---|
void |
assertImmutable(Class<?> expectedImmutableClass)
|
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher)
|
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
Iterable<org.hamcrest.Matcher<MutableReasonDetail>> allowingAll)
|
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowing)
|
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowingFirst,
org.hamcrest.Matcher<MutableReasonDetail> allowingSecond)
|
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowingFirst,
org.hamcrest.Matcher<MutableReasonDetail> allowingSecond,
org.hamcrest.Matcher<MutableReasonDetail> allowingThird)
|
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowingFirst,
org.hamcrest.Matcher<MutableReasonDetail> allowingSecond,
org.hamcrest.Matcher<MutableReasonDetail> allowingThird,
org.hamcrest.Matcher<MutableReasonDetail>... allowingRest)
|
static MutabilityAsserter |
configured(Configuration configuration)
Create a new asserter with an existing Configuration . |
static MutabilityAsserter |
configured(ConfigurationBuilder configuration)
Create a new asserter with a Configuration as built by the given
ConfigurationBuilder . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MutabilityAsserter configured(Configuration configuration)
Configuration
.
Example:
MutabilityAsserter.configured(MyConfigurations.DEFAULT_CONFIGURATIONS);
Configurations
,
Configurations.JDK_CONFIGURATION
,
Configurations.NO_CONFIGURATION
,
Configurations.OUT_OF_THE_BOX_CONFIGURATION
public static MutabilityAsserter configured(ConfigurationBuilder configuration)
Configuration
as built by the given
ConfigurationBuilder
.
Use this method when you want to build a one-time Configuration inline..
Example:
MutabilityAsserter.configured(new ConfigurationBuilder() {
@Override public void configure() {
hardcodeAsDefinitelyImmutable(ActuallyImmutable.class);
}
});
public void assertImmutable(Class<?> expectedImmutableClass)
MutabilityAssert.assertImmutable(Class)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher)
MutabilityAssert.assertInstancesOf(Class, Matcher)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowing)
MutabilityAssert.assertInstancesOf(Class, Matcher, Matcher)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowingFirst, org.hamcrest.Matcher<MutableReasonDetail> allowingSecond)
MutabilityAssert.assertInstancesOf(Class, Matcher, Matcher, Matcher)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowingFirst, org.hamcrest.Matcher<MutableReasonDetail> allowingSecond, org.hamcrest.Matcher<MutableReasonDetail> allowingThird)
MutabilityAssert.assertInstancesOf(Class, Matcher, Matcher, Matcher, Matcher)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowingFirst, org.hamcrest.Matcher<MutableReasonDetail> allowingSecond, org.hamcrest.Matcher<MutableReasonDetail> allowingThird, org.hamcrest.Matcher<MutableReasonDetail>... allowingRest)
MutabilityAssert.assertInstancesOf(Class, Matcher, Matcher, Matcher, Matcher, Matcher...)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, Iterable<org.hamcrest.Matcher<MutableReasonDetail>> allowingAll)
MutabilityAssert.assertInstancesOf(Class, Matcher, Iterable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |