Package com.vaadin.testbench.uiunittest
Class AbstractUIUnitTest.QueryResult<T extends com.vaadin.server.ClientConnector>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
com.vaadin.testbench.uiunittest.AbstractUIUnitTest.QueryResult<T>
- Type Parameters:
T- Component type
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess,SequencedCollection<T>
- Enclosing class:
AbstractUIUnitTest
public static class AbstractUIUnitTest.QueryResult<T extends com.vaadin.server.ClientConnector>
extends ArrayList<T>
Result type for component searches.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFind components by matching caption, using partial matching.first()Return the first component in the list.Find the component by id using exact match.last()Return the last component in the list.single()Return the only component in the list if it exists, otherwise fail with assertion.Find components by matching style name, using partial matching.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Constructor Details
-
QueryResult
-
QueryResult
public QueryResult()
-
-
Method Details
-
id
Find the component by id using exact match. Returns the first matching component by id within the search results assuming ids are unique.- Parameters:
id- The id as String- Returns:
- Component instance, can be null
- Throws:
AssertionError- if more than one component is found with the given id
-
styleName
Find components by matching style name, using partial matching. Result can contain many components.- Parameters:
styleName- Style name as String- Returns:
- Result set of components
-
caption
Find components by matching caption, using partial matching. Result can contain many components.- Parameters:
caption- Caption as String- Returns:
- Result set of components
-
first
Return the first component in the list.Note, if you assume there is only one component, use single() method.
- Returns:
- Component, null if the list was empty.
-
last
Return the last component in the list.- Returns:
- Component, null if the list was empty.
-
single
Return the only component in the list if it exists, otherwise fail with assertion.- Returns:
- Component.
-