From d6b62962cefa7fcb0c4fd2659db1f65d3781c2f7 Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Wed, 12 Jul 2023 08:01:37 +0200 Subject: [PATCH] Avoid using collection as bean type in ManagedBeanTypesTest --- .../tests/definition/bean/types/Flock.java | 111 +----------------- .../definition/bean/types/Gathering.java | 4 + .../bean/types/ManagedBeanTypesTest.java | 5 +- 3 files changed, 7 insertions(+), 113 deletions(-) create mode 100644 impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Gathering.java diff --git a/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Flock.java b/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Flock.java index 824a368ace..01c4d7d6e3 100644 --- a/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Flock.java +++ b/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Flock.java @@ -25,119 +25,10 @@ import java.util.ListIterator; @Dependent -public class Flock implements List> { - - @Override - public int size() { - return 0; - } - - @Override - public boolean isEmpty() { - return false; - } - - @Override - public boolean contains(Object o) { - return false; - } +public class Flock implements Gathering> { @Override public Iterator> iterator() { return null; } - - @Override - public Object[] toArray() { - return null; - } - - @Override - public T[] toArray(T[] a) { - return null; - } - - @Override - public boolean add(Vulture e) { - return false; - } - - @Override - public boolean remove(Object o) { - return false; - } - - @Override - public boolean containsAll(Collection c) { - return false; - } - - @Override - public boolean addAll(Collection> c) { - return false; - } - - @Override - public boolean addAll(int index, Collection> c) { - return false; - } - - @Override - public boolean removeAll(Collection c) { - return false; - } - - @Override - public boolean retainAll(Collection c) { - return false; - } - - @Override - public void clear() { - } - - @Override - public Vulture get(int index) { - return null; - } - - @Override - public Vulture set(int index, Vulture element) { - return null; - } - - @Override - public void add(int index, Vulture element) { - } - - @Override - public Vulture remove(int index) { - return null; - } - - @Override - public int indexOf(Object o) { - return 0; - } - - @Override - public int lastIndexOf(Object o) { - return 0; - } - - @Override - public ListIterator> listIterator() { - return null; - } - - @Override - public ListIterator> listIterator(int index) { - return null; - } - - @Override - public List> subList(int fromIndex, int toIndex) { - return null; - } - } diff --git a/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Gathering.java b/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Gathering.java new file mode 100644 index 0000000000..68822bd99b --- /dev/null +++ b/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/Gathering.java @@ -0,0 +1,4 @@ +package org.jboss.cdi.tck.tests.definition.bean.types; + +public interface Gathering extends Iterable{ +} diff --git a/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/ManagedBeanTypesTest.java b/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/ManagedBeanTypesTest.java index 967987f9d4..e7c56a93d0 100644 --- a/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/ManagedBeanTypesTest.java +++ b/impl/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/ManagedBeanTypesTest.java @@ -76,9 +76,8 @@ public void testGenericHierarchyBeanTypes() { // Nested generic class inheritance Bean flockBean = getUniqueBean(Flock.class); assertNotNull(flockBean); - // Object, Flock, List>, Collection>, Iterable> - assertTypeSetMatches(flockBean.getTypes(), Object.class, Flock.class, new TypeLiteral>>() { - }.getType(), new TypeLiteral>>() { + // Object, Flock, Gathering>, Iterable> + assertTypeSetMatches(flockBean.getTypes(), Object.class, Flock.class, new TypeLiteral>>() { }.getType(), new TypeLiteral>>() { }.getType()); }