/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6267067 6351336 6389198
* @summary unit test for javac List
*/
public class TList {
}
{ },
{ "1" },
{ "1", "2" },
{ "1", "2" }, // different but equal
{ "1", "2", "3", "4", "X", "X", "X", "8", "9", "10" } // contains duplicates
};
void run() {
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_clear();
test_get_int();
test_isEmpty();
test_size();
test_toArray();
// tests for additional methods
test_reverse();
}
// 6351336
void test_AbstractList() {
throw new AssertionError();
}
void test_add_E() {
try {
l.add("test");
throw new AssertionError();
} catch (UnsupportedOperationException ex) {
}
}
}
void test_add_int_E() {
try {
throw new AssertionError();
} catch (UnsupportedOperationException ex) {
}
}
}
void test_addAll_Collection() {
try {
if (modified)
throw new AssertionError();
} catch (UnsupportedOperationException e) {
}
throw new AssertionError();
}
}
}
void test_addAll_int_Collection() {
try {
if (modified)
throw new AssertionError();
} catch (UnsupportedOperationException e) {
}
throw new AssertionError();
}
}
}
void test_clear() {
try {
l.clear();
if (l_size > 0)
throw new AssertionError();
} catch (UnsupportedOperationException e) {
}
throw new AssertionError();
}
}
void test_contains_Object() {
throw new AssertionError();
}
}
void test_contains_All() {
throw new AssertionError();
}
}
}
// 6389198
void test_equals_Object() {
throw new AssertionError();
}
}
}
}
void test_get_int() {
try {
throw new AssertionError();
} catch (IndexOutOfBoundsException ex) {
if (!expectException)
throw new AssertionError();
}
}
}
}
void test_hashCode() {
throw new AssertionError();
}
}
}
void test_indexOf_Object() {
throw new AssertionError();
}
}
}
void test_isEmpty() {
throw new AssertionError();
}
}
void test_iterator() {
throw new AssertionError();
}
}
void test_lastIndexOf_Object() {
throw new AssertionError();
}
}
}
void test_listIterator() {
throw new AssertionError();
}
}
void test_listIterator_int() {
throw new AssertionError();
}
}
}
void test_remove_int() {
try {
l.remove(0);
throw new AssertionError();
} catch (UnsupportedOperationException ex) {
}
}
}
void test_remove_Object() {
try {
l.remove("X");
if (hasX)
throw new AssertionError();
} catch (UnsupportedOperationException ex) {
}
}
}
void test_removeAll_Collection() {
try {
if (modified)
throw new AssertionError();
} catch (UnsupportedOperationException e) {
}
throw new AssertionError();
}
}
}
void test_retainAll_Collection() {
try {
if (modified)
throw new AssertionError();
} catch (UnsupportedOperationException e) {
}
throw new AssertionError();
}
}
}
void test_set_int_E() {
try {
throw new AssertionError();
} catch (UnsupportedOperationException ex) {
}
}
}
void test_size() {
throw new AssertionError();
}
}
void test_subList_int_int() {
throw new AssertionError();
}
}
}
}
void test_toArray() {
throw new AssertionError();
}
}
void test_toArray_TArray() {
throw new AssertionError();
}
}
void test_prependList_List() {
// verify results, and that original and arg lists are unchanged
throw new AssertionError();
}
throw new AssertionError();
throw new AssertionError();
}
}
}
void test_reverse() {
throw new AssertionError();
throw new AssertionError();
throw new AssertionError();
}
}
return l;
}
l = l.prepend(d[i]);
return l;
}
}
return false;
}
}
return false;
}
}
return false;
return false;
}
return true;
}
r.addAll(l);
return r;
}
for (T t: l)
r.add(0, t);
return r;
}
}