Class MockRequestFactoryEditorDriver<P,E extends Editor<P>>
java.lang.Object
com.google.web.bindery.requestfactory.gwt.client.testing.MockRequestFactoryEditorDriver<P,E>
- Type Parameters:
P- the Proxy type being editedE- the Editor type
- All Implemented Interfaces:
EditorDriver<RequestContext>,RequestFactoryEditorDriver<P,E>
public class MockRequestFactoryEditorDriver<P,E extends Editor<P>>
extends Object
implements RequestFactoryEditorDriver<P,E>
A no-op implementation of
RequestFactoryEditorDriver that records its
inputs.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(EditorVisitor visitor) A no-op method.voidRecords its arguments.voidedit(P proxy, RequestContext saveRequest) Records its arguments.flush()Returnsnullor the last value recorded.Returnsnullor the last value recorded.Returns an empty list.Returnsnullor the last value recorded.String[]getPaths()Returns a zero-length array.getProxy()Returnsnullor the last value recorded.Returnsnullor the last value recorded.Returnsnullor the last value recorded.booleanReturnsfalse.voidinitialize(EventBus eventBus, RequestFactory requestFactory, E editor) Records its arguments.voidinitialize(RequestFactory requestFactory, E editor) Initializes a driver with the editor it will run, and a RequestFactory to use for subscription services.voidinitialize(E editor) Initializes a driver that will not be able to support subscriptions.booleanisDirty()Returnsfalse.booleansetConstraintViolations(Iterable<ConstraintViolation<?>> violations) A no-op method that always returns false.booleansetViolations(Iterable<Violation> errors) A no-op method that always returns false.
-
Constructor Details
-
MockRequestFactoryEditorDriver
public MockRequestFactoryEditorDriver()
-
-
Method Details
-
accept
A no-op method.- Specified by:
acceptin interfaceEditorDriver<P>
-
display
Records its arguments. -
flush
Returnsnullor the last value recorded.- Specified by:
flushin interfaceEditorDriver<P>- Specified by:
flushin interfaceRequestFactoryEditorDriver<P,E extends Editor<P>> - Returns:
- the RequestContext passed into
RequestFactoryEditorDriver.edit(Object, RequestContext)
-
getEditor
Returnsnullor the last value recorded. -
getErrors
Returns an empty list.- Specified by:
getErrorsin interfaceEditorDriver<P>- Returns:
- a List of
EditorErrorinstances
-
getEventBus
Returnsnullor the last value recorded. -
getPaths
Returns a zero-length array. -
getProxy
Returnsnullor the last value recorded. -
getRequestFactory
Returnsnullor the last value recorded. -
getSaveRequest
Returnsnullor the last value recorded. -
hasErrors
public boolean hasErrors()Returnsfalse.- Specified by:
hasErrorsin interfaceEditorDriver<P>- Returns:
trueif errors are present
-
initialize
Description copied from interface:RequestFactoryEditorDriverInitializes a driver that will not be able to support subscriptions. Calls toEditorDelegate.subscribe()will do nothing.- Specified by:
initializein interfaceRequestFactoryEditorDriver<P,E extends Editor<P>> - Parameters:
editor- anEditorof type E
-
isDirty
public boolean isDirty()Returnsfalse.- Specified by:
isDirtyin interfaceEditorDriver<P>- See Also:
-
setConstraintViolations
A no-op method that always returns false.- Specified by:
setConstraintViolationsin interfaceEditorDriver<P>- Parameters:
violations- an Iterable overConstraintViolationinstances- Returns:
trueif there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-
setViolations
A no-op method that always returns false.- Specified by:
setViolationsin interfaceRequestFactoryEditorDriver<P,E extends Editor<P>> - Parameters:
errors- an Iterable overViolationinstances- Returns:
trueif there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-