10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4904067 7129185
27 * @summary Unit test for Collections.checkedSet
28 * @author Josh Bloch
29 * @run testng CheckedSetBash
30 */
31
32 import java.util.*;
33 import java.util.function.Supplier;
34 import org.testng.annotations.Test;
35 import org.testng.annotations.DataProvider;
36
37 import static org.testng.Assert.fail;
38 import static org.testng.Assert.assertTrue;
39
40 public class CheckedSetBash {
41 static final int numItr = 100;
42 static final int setSize = 100;
43 static final Random rnd = new Random();
44
45 @Test(dataProvider = "Supplier<Set<Integer>>")
46 public static void testCheckedSet(String description, Supplier<Set<Integer>> supplier) {
47
48 Set<Integer> s1 = supplier.get();
49 assertTrue(s1.isEmpty());
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4904067 7129185
27 * @summary Unit test for Collections.checkedSet
28 * @author Josh Bloch
29 * @run testng CheckedSetBash
30 * @key randomness
31 */
32
33 import java.util.*;
34 import java.util.function.Supplier;
35 import org.testng.annotations.Test;
36 import org.testng.annotations.DataProvider;
37
38 import static org.testng.Assert.fail;
39 import static org.testng.Assert.assertTrue;
40
41 public class CheckedSetBash {
42 static final int numItr = 100;
43 static final int setSize = 100;
44 static final Random rnd = new Random();
45
46 @Test(dataProvider = "Supplier<Set<Integer>>")
47 public static void testCheckedSet(String description, Supplier<Set<Integer>> supplier) {
48
49 Set<Integer> s1 = supplier.get();
50 assertTrue(s1.isEmpty());
|