Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleImmutable 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
languagejava
titleImmutable 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
languagejava
titleUtility 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.