Esempio n. 1
0
 @Before
 public void setUp() throws Exception {
   fakeScheduler = new FakeGWTScheduler();
   CommunicationProvider communicationsProvider = new GWTRPCCommunicationProvider(mockService);
   OperationProcessor operationProcessor = new OperationProcessor(communicationsProvider);
   operationProcessor.setScheduler(fakeScheduler);
   VdcOperationManager operationsManager = new VdcOperationManager(operationProcessor);
   operationsManager.setLoggedIn(true);
   frontend =
       new Frontend(
           operationsManager,
           mockCanDoActionErrorsTranslator,
           mockVdsmErrorsTranslator,
           mockEventBus);
   frontend.queryCompleteEvent = queryCompleteEvent;
   frontend.queryStartedEvent = queryStartEvent;
   frontend.frontendFailureEvent = mockFrontendFailureEvent;
   frontend.frontendNotLoggedInEvent = mockFrontendNotLoggedInEvent;
   frontend.subscribe(new VdcQueryType[] {VdcQueryType.Search});
   frontend.setEventsHandler(mockEventsHandler);
   frontend.setConstants(mockConstants);
   when(mockAsyncQuery.getContext()).thenReturn("test"); // $NON-NLS-1$
   when(mockAsyncQuery.getDel()).thenReturn(mockAsyncCallback);
 }