Class MessageListTester
-
- All Implemented Interfaces:
-
com.vaadin.browserless.Clickable
public class MessageListTester<T extends MessageList> extends ComponentTester<T>
Tester for MessageList components.
- Since:
1.0
-
-
Constructor Summary
Constructors Constructor Description MessageListTester(T component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description intsize()Get amount of messages in the messageList. MessageListItemgetMessage(int index)Get message in given index. List<MessageListItem>getMessages()Get all messages in list. List<MessageListItem>getMessages(Instant start, Instant end)Get messages between given Instant (excluding). List<MessageListItem>getMessagesAfter(Instant start)Get messages after given Instant (excluding). List<MessageListItem>getMessagesBefore(Instant end)Get messages before given Instant (excluding). List<MessageListItem.Attachment>getAttachments(int index)Get the attachments of the message in given index. MessageListItem.AttachmentgetAttachmentByName(int index, String name)Get the attachment with the given name from the message in given index. List<MessageListItem>getMessages(String userName)Get all messages for a given userName. -
Methods inherited from class com.vaadin.browserless.ComponentTester
ensureComponentIsUsable, find, getComponent, isUsable, setModal -
Methods inherited from class com.vaadin.browserless.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClick -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MessageListTester
MessageListTester(T component)
Wrap given component for testing.
- Parameters:
component- target component
-
-
Method Detail
-
size
int size()
Get amount of messages in the messageList.
- Returns:
message count
-
getMessage
MessageListItem getMessage(int index)
Get message in given index. index is 0 based.
- Parameters:
index- item index- Returns:
message in index
-
getMessages
List<MessageListItem> getMessages()
Get all messages in list.
- Returns:
all available messages
-
getMessages
List<MessageListItem> getMessages(Instant start, Instant end)
Get messages between given Instant (excluding).
- Parameters:
start- start timeend- end time- Returns:
messages falling between start an end time
-
getMessagesAfter
List<MessageListItem> getMessagesAfter(Instant start)
Get messages after given Instant (excluding).
- Parameters:
start- start time- Returns:
messages after start time
-
getMessagesBefore
List<MessageListItem> getMessagesBefore(Instant end)
Get messages before given Instant (excluding).
- Parameters:
end- end time- Returns:
messages before end time
-
getAttachments
List<MessageListItem.Attachment> getAttachments(int index)
Get the attachments of the message in given index. index is 0 based.
- Parameters:
index- item index- Returns:
attachments of the message in index, empty list if the message has no attachments
- Since:
1.1
-
getAttachmentByName
MessageListItem.Attachment getAttachmentByName(int index, String name)
Get the attachment with the given name from the message in given index. index is 0 based.
- Parameters:
index- item indexname- attachment name to look for, notnull- Returns:
attachment with the given name, or
nullif the message has no attachment with the given name- Since:
1.1
-
getMessages
List<MessageListItem> getMessages(String userName)
Get all messages for a given userName.
- Parameters:
userName- user to get messages for (nullable)- Returns:
messages for user, for
nullmessages without defined userName
-
-
-
-