blob: b75c672569be59eb0293cc9ddf0f06f09577c08b [file] [log] [blame]
Przemyslaw Szczepaniake8b323c2016-03-11 15:59:10 +00001/*
2 * Written by Doug Lea and Martin Buchholz with assistance from
3 * members of JCP JSR-166 Expert Group and released to the public
4 * domain, as explained at
5 * http://creativecommons.org/publicdomain/zero/1.0/
6 */
7
8package jsr166;
9
10import java.util.Collection;
11
12import junit.framework.Test;
13
14/**
15 * Contains tests applicable to all Collection implementations.
16 */
Nicholas Sauerb30ea052016-05-01 21:22:28 -070017// Android-changed: Made class abstract so it will be ignored by test runners.
18abstract class CollectionTest extends JSR166TestCase {
Przemyslaw Szczepaniake8b323c2016-03-11 15:59:10 +000019 final CollectionImplementation impl;
20
21 /** Tests are parameterized by a Collection implementation. */
22 CollectionTest(CollectionImplementation impl, String methodName) {
23 super(methodName);
24 this.impl = impl;
25 }
26
27 public static Test testSuite(CollectionImplementation impl) {
28 return newTestSuite
29 (parameterizedTestSuite(CollectionTest.class,
30 CollectionImplementation.class,
31 impl),
32 jdk8ParameterizedTestSuite(CollectionTest.class,
33 CollectionImplementation.class,
34 impl));
35 }
36
37 /** A test of the CollectionImplementation implementation ! */
38 public void testEmptyMeansEmpty() {
39 assertTrue(impl.emptyCollection().isEmpty());
40 assertEquals(0, impl.emptyCollection().size());
41 }
42
43 // public void testCollectionDebugFail() { fail(); }
44}