...
Code Block |
---|
language | java |
---|
title | Immutable Class Check |
---|
|
import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
/**
* Checks that the DefaultFlowRule class is immutable.
*/
@Test
public void testImmutability() {
assertThatClassIsImmutable(FlowId.class);
} |
Code Block |
---|
language | java |
---|
title | Immutable Base Class Check |
---|
|
import static */
@Test
org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutableBaseClass;
/**
* Checks that the DefaultFlowRule class is immutable but can be inherited
* from.
*/
@Test
public void testImmutability() {
assertThatClassIsImmutableBaseClass(DefaultFlowRule.class);
} |
Code Block |
---|
language | java |
---|
title | Utility Class Checker |
---|
|
import static org.onlab.junit.UtilityClassChecker.assertThatClassIsUtility;
/**
* Check that the Criteria class is a valid utility class.
*/
@Test
public void assertThatClassIsImmutabletestCriteriaUtility(FlowId.class); {
} |
...
assertThatClassIsUtility(Criteria.class);
} |
We use the Hamcrest matchers, version 1.3.