use of org.sonar.java.se.checks.NullDereferenceCheck in project sonar-java by SonarSource.
the class CheckerDispatcherTest method test_only_one_execution_of_post_statement_by_check.
@Test
public void test_only_one_execution_of_post_statement_by_check() {
List<SECheck> checks = Lists.newArrayList(new NullDereferenceCheck(), new CheckTest(), new CheckTest(), new CheckTest());
CheckerDispatcher checkerDispatcher = new CheckerDispatcher(mockExplodedGraphWalker(), checks);
checkerDispatcher.executeCheckPostStatement(mock(Tree.class));
for (SECheck check : checks) {
if (check instanceof CheckTest) {
assertThat(((CheckTest) check).postStatementExecution).isEqualTo(1);
}
}
}
use of org.sonar.java.se.checks.NullDereferenceCheck in project sonar-java by SonarSource.
the class RelationalSymbolicValueTest method too_many_relationship_should_stop_se_engine.
@Test
public void too_many_relationship_should_stop_se_engine() throws Exception {
SETestUtils.createSymbolicExecutionVisitor("src/test/files/se/ExceedTransitiveLimit.java", new NullDereferenceCheck());
assertThat(logTester.logs(LoggerLevel.DEBUG)).contains("Could not complete symbolic execution: ");
}
Aggregations