diff options
author | David Gageot <david@gageot.net> | 2012-05-22 11:56:58 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-05-22 11:56:58 +0200 |
commit | fd7f6a27f9bfc895298a57be47fe7511d9d004b4 (patch) | |
tree | 038e8769718bb18dbb2091604aa6a3f384f72315 /sonar-testing-harness/src/main/java/org | |
parent | 70a99389ba85ae3e7d20c8f56acb571d2ee915a7 (diff) | |
download | sonarqube-fd7f6a27f9bfc895298a57be47fe7511d9d004b4.tar.gz sonarqube-fd7f6a27f9bfc895298a57be47fe7511d9d004b4.zip |
SONAR-3016 More work on extension point for filter template
Recognize more filter criterias
Diffstat (limited to 'sonar-testing-harness/src/main/java/org')
-rw-r--r-- | sonar-testing-harness/src/main/java/org/sonar/test/MoreConditions.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/MoreConditions.java b/sonar-testing-harness/src/main/java/org/sonar/test/MoreConditions.java index c83e5ff9ec1..c06b78a65e6 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/MoreConditions.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/MoreConditions.java @@ -20,8 +20,11 @@ package org.sonar.test; import com.google.common.base.CharMatcher; +import org.apache.commons.lang.builder.EqualsBuilder; import org.fest.assertions.Condition; +import java.util.Collection; + /** * Conditions for use with FestAssert. */ @@ -42,4 +45,18 @@ public final class MoreConditions { } }.as("equal to " + strippedText); } + + public static Condition<Collection<?>> contains(final Object expected) { + return new Condition<Collection<?>>() { + @Override + public boolean matches(Collection<?> collection) { + for (Object actual : collection) { + if (EqualsBuilder.reflectionEquals(expected, actual)) { + return true; + } + } + return false; + } + }; + } } |