*/
package org.sonar.plugins.findbugs;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.internal.matchers.StringContains.containsString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.File;
-
+import com.google.common.collect.Lists;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.sonar.api.CoreProperties;
import org.sonar.api.resources.ProjectFileSystem;
import org.sonar.api.utils.SonarException;
+import java.io.File;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.internal.matchers.StringContains.containsString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
public class FindbugsExecutorTest {
@Test
when(conf.getFindbugsProject()).thenReturn(project);
when(conf.saveExcludeConfigXml()).thenReturn(new File("test-resources/findbugs-exclude.xml"));
when(conf.saveIncludeConfigXml()).thenReturn(new File("test-resources/findbugs-include.xml"));
+ when(conf.getExcludesFilters()).thenReturn(Lists.newArrayList(new File("test-resources/findbugs-exclude.xml"), new File("test-resources/fake-file.xml")));
when(conf.getEffort()).thenReturn("default");
when(conf.getTimeout()).thenReturn(CoreProperties.FINDBUGS_TIMEOUT_DEFAULT_VALUE);
return conf;
import org.sonar.api.config.Settings;
import org.sonar.core.review.workflow.condition.Condition;
import org.sonar.core.review.workflow.function.Function;
-import org.sonar.core.review.workflow.review.*;
+import org.sonar.core.review.workflow.review.DefaultReview;
+import org.sonar.core.review.workflow.review.DefaultWorkflowContext;
+import org.sonar.core.review.workflow.review.MutableReview;
+import org.sonar.core.review.workflow.review.Review;
+import org.sonar.core.review.workflow.review.WorkflowContext;
import org.sonar.core.review.workflow.screen.Screen;
import javax.annotation.Nullable;
+
import java.util.List;
import java.util.Map;
}
private boolean verifyConditionsQuietly(@Nullable Review review, WorkflowContext context, List<Condition> conditions) {
- for (Condition condition : conditions) {
- if (!condition.doVerify(review, context)) {
- return false;
- }
+ for (Condition condition : conditions) {
+ if (!condition.doVerify(review, context)) {
+ return false;
}
- return true;
}
+ return true;
+ }
private void verifyConditions(@Nullable Review review, WorkflowContext context, List<Condition> conditions) {
for (Condition condition : conditions) {