Permalink
Browse files

Added: Assert#assertEquals() methods for Sets and Maps

  • Loading branch information...
1 parent 6006c86 commit 99b4d6c265461884836106022c6ed4d22b822a13 cbeust committed Nov 3, 2009
Showing with 23 additions and 2 deletions.
  1. +1 −0 CHANGES.txt
  2. +1 −1 build.properties
  3. +21 −1 src/main/org/testng/Assert.java
View
@@ -2,6 +2,7 @@ Current:
Added: dataProviderThreadCount can be set from the command line and from ant (Adrian Grealish)
Added: ITestAnnotation#setDataProvider
+Added: Assert#assertEquals() methods for Sets and Maps
Fixed: Inner test classes were not excluded properly (Carsten Gubernator)
Fixed: threadPoolSize without invocationCount was causing reporters not to be invoked
Fixed: A @Factory throwing an exception did not cause any error
View
@@ -23,7 +23,7 @@ concurrent.jar=backport-util-concurrent-2.2.jar
# Names of distributions
#
testng.basename=testng
-testng.version=5.10.1
+testng.version=5.10.1beta
jdk14.testng.jar=${testng.basename}-${testng.version}-jdk14.jar
jdk15.testng.jar=${testng.basename}-${testng.version}-jdk15.jar
sources.testng.jar=${testng.basename}-${testng.version}-sources.jar
@@ -3,9 +3,10 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
@@ -614,4 +615,23 @@ static public void assertEquals(final byte[] actual, final byte[] expected, fina
}
}
}
+
+ /**
+ * Asserts that two sets are equal.
+ */
+ static public void assertEquals(Set actual, Set expected) {
+ if (!actual.equals(expected)) {
+ fail("Sets differ: expected " + expected + " but got " + actual);
+ }
+ }
+
+ /**
+ * Asserts that two maps are equal.
+ */
+ static public void assertEquals(Map actual, Map expected) {
+ if (!actual.equals(expected)) {
+ fail("Maps differ: expected " + expected + " but got " + actual);
+ }
+ }
+
}

0 comments on commit 99b4d6c

Please sign in to comment.