Search in sources :

Example 1 with CommunicationProvider

use of org.ovirt.engine.ui.frontend.communication.CommunicationProvider in project ovirt-engine by oVirt.

the class FrontendActionTest method setUp.

@Before
public void setUp() throws Exception {
    mockService = mock(GenericApiGWTServiceAsync.class, withSettings().extraInterfaces(ServiceDefTarget.class));
    fakeScheduler = new FakeGWTScheduler();
    CommunicationProvider communicationsProvider = new GWTRPCCommunicationProvider(mockService, mockXsrfService, mockXsrfRpcRequestBuilder);
    // $NON-NLS-1$
    when(mockXsrfRpcRequestBuilder.getXsrfToken()).thenReturn(new XsrfToken("Something"));
    OperationProcessor operationProcessor = new OperationProcessor(communicationsProvider);
    operationProcessor.setScheduler(fakeScheduler);
    VdcOperationManager operationsManager = new VdcOperationManager(mockEventBus, operationProcessor);
    frontend = new Frontend(operationsManager, mockValidateErrorsTranslator, mockVdsmErrorsTranslator, mockEventBus);
    frontend.setEventsHandler(mockEventsHandler);
    frontend.setConstants(mockConstants);
    frontend.frontendFailureEvent = mockFrontendFailureEvent;
    when(mockConstants.noValidateMessage()).thenReturn(NO_MESSAGE);
}
Also used : GenericApiGWTServiceAsync(org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync) CommunicationProvider(org.ovirt.engine.ui.frontend.communication.CommunicationProvider) GWTRPCCommunicationProvider(org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider) GWTRPCCommunicationProvider(org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider) OperationProcessor(org.ovirt.engine.ui.frontend.communication.OperationProcessor) XsrfToken(com.google.gwt.user.client.rpc.XsrfToken) VdcOperationManager(org.ovirt.engine.ui.frontend.communication.VdcOperationManager) Before(org.junit.Before)

Example 2 with CommunicationProvider

use of org.ovirt.engine.ui.frontend.communication.CommunicationProvider in project ovirt-engine by oVirt.

the class FrontendTest method setUp.

@Before
public void setUp() throws Exception {
    mockService = mock(GenericApiGWTServiceAsync.class, withSettings().extraInterfaces(ServiceDefTarget.class));
    fakeScheduler = new FakeGWTScheduler();
    CommunicationProvider communicationsProvider = new GWTRPCCommunicationProvider(mockService, mockXsrfService, mockXsrfRpcRequestBuilder);
    // $NON-NLS-1$
    when(mockXsrfRpcRequestBuilder.getXsrfToken()).thenReturn(new XsrfToken("Something"));
    OperationProcessor operationProcessor = new OperationProcessor(communicationsProvider);
    operationProcessor.setScheduler(fakeScheduler);
    VdcOperationManager operationsManager = new VdcOperationManager(mockEventBus, operationProcessor);
    frontend = new Frontend(operationsManager, mockValidateErrorsTranslator, mockVdsmErrorsTranslator, mockEventBus);
    frontend.frontendFailureEvent = mockFrontendFailureEvent;
    frontend.frontendNotLoggedInEvent = mockFrontendNotLoggedInEvent;
    frontend.setEventsHandler(mockEventsHandler);
    frontend.setConstants(mockConstants);
    when(mockAsyncQuery.getModel()).thenReturn(ASYNC_OPERATION_TARGET);
    when(mockAsyncQuery.getAsyncCallback()).thenReturn(mockAsyncCallback);
}
Also used : GenericApiGWTServiceAsync(org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync) CommunicationProvider(org.ovirt.engine.ui.frontend.communication.CommunicationProvider) GWTRPCCommunicationProvider(org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider) GWTRPCCommunicationProvider(org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider) OperationProcessor(org.ovirt.engine.ui.frontend.communication.OperationProcessor) XsrfToken(com.google.gwt.user.client.rpc.XsrfToken) VdcOperationManager(org.ovirt.engine.ui.frontend.communication.VdcOperationManager) Before(org.junit.Before)

Aggregations

XsrfToken (com.google.gwt.user.client.rpc.XsrfToken)2 Before (org.junit.Before)2 CommunicationProvider (org.ovirt.engine.ui.frontend.communication.CommunicationProvider)2 GWTRPCCommunicationProvider (org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider)2 OperationProcessor (org.ovirt.engine.ui.frontend.communication.OperationProcessor)2 VdcOperationManager (org.ovirt.engine.ui.frontend.communication.VdcOperationManager)2 GenericApiGWTServiceAsync (org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync)2