Package org.robolectric.shadows
Class ShadowDropBoxManager
java.lang.Object
org.robolectric.shadows.ShadowDropBoxManager
Fake dropbox manager that starts with no entries.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds entry to the DropboxManager with the flag indicating data is text.protected void
Adds a text entry to dropbox with the current timestamp using UTF-8 encoding.protected DropBoxManager.Entry
getNextEntry
(String tag, long millis) void
reset()
Clears all entries.
-
Constructor Details
-
ShadowDropBoxManager
public ShadowDropBoxManager()
-
-
Method Details
-
addData
Adds entry to the DropboxManager with the flag indicating data is text.The existing
DropBoxManager.addData(java.lang.String, byte[], int)
andDropBoxManager.addFile(java.lang.String, java.io.File, int)
methods in DropBoxManager are not shadowed (and do not work), butDropBoxManager.addText(java.lang.String, java.lang.String)
is. This method is a convenience for quickly adding multiple historical entries. The entries can be added in any order since this shadow will sort the entries by the specified timestamp.The flag will be set to
DropBoxManager.IS_TEXT
so thatDropBoxManager.Entry.getText(int)
can be used.- Parameters:
tag
- can be any arbitrary stringtimestamp
- a unique timestamp for the entry, relative toSystem.currentTimeMillis()
data
- must not be null
-
addText
Adds a text entry to dropbox with the current timestamp using UTF-8 encoding.If adding multiple entries, it is required to ensure they have unique timestamps by bumping the wall-clock time, using
SystemClock
or similar. -
reset
public void reset()Clears all entries. -
getNextEntry
-