Package com.google.testing.testify.risk.frontend.client.view

Examples of com.google.testing.testify.risk.frontend.client.view.ComponentsView


  @SuppressWarnings("unchecked")
  public void testInitialization() {

    // Test setup
    ProjectRpcAsync mockProjService = EasyMock.createMock(ProjectRpcAsync.class);
    ComponentsView mockView = EasyMock.createMock(ComponentsView.class);
    SimpleEventBus mockEventBus = EasyMock.createMock(SimpleEventBus.class);
    UserRpcAsync securityService = EasyMock.createMock(UserRpcAsync.class);
    DataRpcAsync dataService = EasyMock.createMock(DataRpcAsync.class);

    List<Component> components = new ArrayList<Component>();
    List<Signoff> signoffs = new ArrayList<Signoff>();
    Collection<String> labels = Lists.newArrayList();

    Project parentProject = new Project();
    parentProject.setProjectId(42L);

    // Verify this initialization sequence
    securityService.hasEditAccess(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(true);
    mockProjService.getProjectComponents(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(components);
    dataService.getSignoffsByType(EasyMock.eq(42L), EasyMock.eq(AccElementType.COMPONENT),
        EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(signoffs);
    mockProjService.getLabels(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(labels);
    mockView.enableEditing();
    mockView.setPresenter((Presenter) EasyMock.anyObject());
    mockView.setProjectComponents(components);
    mockView.setSignoffs(signoffs);
    mockView.setProjectLabels(labels);
    EasyMock.replay(mockView, mockProjService, securityService, dataService);

    ComponentsPresenter testPresenter = new ComponentsPresenter(
        parentProject, mockProjService, securityService, dataService, mockView,
        mockEventBus);
View Full Code Here

TOP

Related Classes of com.google.testing.testify.risk.frontend.client.view.ComponentsView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.