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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(EditorVisitor visitor) A no-op method.void
Records its arguments.void
edit
(P proxy, RequestContext saveRequest) Records its arguments.flush()
Returnsnull
or the last value recorded.Returnsnull
or the last value recorded.Returns an empty list.Returnsnull
or the last value recorded.String[]
getPaths()
Returns a zero-length array.getProxy()
Returnsnull
or the last value recorded.Returnsnull
or the last value recorded.Returnsnull
or the last value recorded.boolean
Returnsfalse
.void
initialize
(EventBus eventBus, RequestFactory requestFactory, E editor) Records its arguments.void
initialize
(RequestFactory requestFactory, E editor) Initializes a driver with the editor it will run, and a RequestFactory to use for subscription services.void
initialize
(E editor) Initializes a driver that will not be able to support subscriptions.boolean
isDirty()
Returnsfalse
.boolean
setConstraintViolations
(Iterable<ConstraintViolation<?>> violations) A no-op method that always returns false.boolean
setViolations
(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:
accept
in interfaceEditorDriver<P>
-
display
Records its arguments. -
flush
Returnsnull
or the last value recorded.- Specified by:
flush
in interfaceEditorDriver<P>
- Specified by:
flush
in interfaceRequestFactoryEditorDriver<P,
E extends Editor<P>> - Returns:
- the RequestContext passed into
RequestFactoryEditorDriver.edit(Object, RequestContext)
-
getEditor
Returnsnull
or the last value recorded. -
getErrors
Returns an empty list.- Specified by:
getErrors
in interfaceEditorDriver<P>
- Returns:
- a List of
EditorError
instances
-
getEventBus
Returnsnull
or the last value recorded. -
getPaths
Returns a zero-length array. -
getProxy
Returnsnull
or the last value recorded. -
getRequestFactory
Returnsnull
or the last value recorded. -
getSaveRequest
Returnsnull
or the last value recorded. -
hasErrors
public boolean hasErrors()Returnsfalse
.- Specified by:
hasErrors
in interfaceEditorDriver<P>
- Returns:
true
if errors are present
-
initialize
Description copied from interface:RequestFactoryEditorDriver
Initializes a driver that will not be able to support subscriptions. Calls toEditorDelegate.subscribe()
will do nothing.- Specified by:
initialize
in interfaceRequestFactoryEditorDriver<P,
E extends Editor<P>> - Parameters:
editor
- anEditor
of type E
-
isDirty
public boolean isDirty()Returnsfalse
.- Specified by:
isDirty
in interfaceEditorDriver<P>
- See Also:
-
setConstraintViolations
A no-op method that always returns false.- Specified by:
setConstraintViolations
in interfaceEditorDriver<P>
- Parameters:
violations
- an Iterable overConstraintViolation
instances- Returns:
true
if there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-
setViolations
A no-op method that always returns false.- Specified by:
setViolations
in interfaceRequestFactoryEditorDriver<P,
E extends Editor<P>> - Parameters:
errors
- an Iterable overViolation
instances- Returns:
true
if there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-