Skip to content

Commit

Permalink
Avoid using collection as bean type in ManagedBeanTypesTest
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn committed Jul 12, 2023
1 parent d22bf17 commit d6b6296
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,119 +25,10 @@
import java.util.ListIterator;

@Dependent
public class Flock implements List<Vulture<Integer>> {

@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<Vulture<Integer>> {

@Override
public Iterator<Vulture<Integer>> iterator() {
return null;
}

@Override
public Object[] toArray() {
return null;
}

@Override
public <T> T[] toArray(T[] a) {
return null;
}

@Override
public boolean add(Vulture<Integer> e) {
return false;
}

@Override
public boolean remove(Object o) {
return false;
}

@Override
public boolean containsAll(Collection<?> c) {
return false;
}

@Override
public boolean addAll(Collection<? extends Vulture<Integer>> c) {
return false;
}

@Override
public boolean addAll(int index, Collection<? extends Vulture<Integer>> 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<Integer> get(int index) {
return null;
}

@Override
public Vulture<Integer> set(int index, Vulture<Integer> element) {
return null;
}

@Override
public void add(int index, Vulture<Integer> element) {
}

@Override
public Vulture<Integer> remove(int index) {
return null;
}

@Override
public int indexOf(Object o) {
return 0;
}

@Override
public int lastIndexOf(Object o) {
return 0;
}

@Override
public ListIterator<Vulture<Integer>> listIterator() {
return null;
}

@Override
public ListIterator<Vulture<Integer>> listIterator(int index) {
return null;
}

@Override
public List<Vulture<Integer>> subList(int fromIndex, int toIndex) {
return null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.jboss.cdi.tck.tests.definition.bean.types;

public interface Gathering<T> extends Iterable<T>{
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ public void testGenericHierarchyBeanTypes() {
// Nested generic class inheritance
Bean<Flock> flockBean = getUniqueBean(Flock.class);
assertNotNull(flockBean);
// Object, Flock, List<Vulture<Integer>>, Collection<Vulture<Integer>>, Iterable<Vulture<Integer>>
assertTypeSetMatches(flockBean.getTypes(), Object.class, Flock.class, new TypeLiteral<List<Vulture<Integer>>>() {
}.getType(), new TypeLiteral<Collection<Vulture<Integer>>>() {
// Object, Flock, Gathering<Vulture<Integer>>, Iterable<Vulture<Integer>>
assertTypeSetMatches(flockBean.getTypes(), Object.class, Flock.class, new TypeLiteral<Gathering<Vulture<Integer>>>() {
}.getType(), new TypeLiteral<Iterable<Vulture<Integer>>>() {
}.getType());
}
Expand Down

0 comments on commit d6b6296

Please sign in to comment.