@Test public void onOpenTest() { final Path path = mock(Path.class); final WorkspaceProject workspaceProject = mock(WorkspaceProject.class); authoringPerspective.projectPathString = "git: doReturn(promises.resolve(true)).when(projectController).canReadBranch(workspaceProject); doReturn(true).when(vfsServices).isRegularFile(authoringPerspective.projectPathString); doReturn(path).when(vfsServices).get(authoringPerspective.projectPathString); doReturn(workspaceProject).when(workspaceProjectService).resolveProject(path); authoringPerspective.onOpen(); verify(placeManager).closeAllPlaces(); verify(workspaceProjectContextChangeEvent).fire(new WorkspaceProjectContextChangeEvent(workspaceProject)); verify(placeManager).goTo(same(path)); }
@OnOpen public void onOpen() { placeManager.closeAllPlaces(); if (!projectPathString.isEmpty()) { vfsServices.call((RemoteCallback<Boolean>) isRegularFile -> { if (isRegularFile) { vfsServices.call((RemoteCallback<Path>) path -> { setWorkspaceContext(path, () -> placeManager.goTo(path)); }).get(projectPathString); } }).isRegularFile(projectPathString); } }
AuthoringPerspective { @OnOpen public void onOpen() { placeManager.closeAllPlaces(); if (!projectPathString.isEmpty()) { vfsServices.call((RemoteCallback<Boolean>) isRegularFile -> { if (isRegularFile) { vfsServices.call((RemoteCallback<Path>) path -> { setWorkspaceContext(path, () -> placeManager.goTo(path)); }).get(projectPathString); } }).isRegularFile(projectPathString); } } }
AuthoringPerspective { @OnOpen public void onOpen() { placeManager.closeAllPlaces(); if (!projectPathString.isEmpty()) { vfsServices.call((RemoteCallback<Boolean>) isRegularFile -> { if (isRegularFile) { vfsServices.call((RemoteCallback<Path>) path -> { setWorkspaceContext(path, () -> placeManager.goTo(path)); }).get(projectPathString); } }).isRegularFile(projectPathString); } } @Inject  AuthoringPerspective(final PlaceManager placeManager,
                                final Caller<VFSService> vfsServices,
                                final Event<WorkspaceProjectContextChangeEvent> workspaceProjectContextChangeEvent,
                                final Caller<WorkspaceProjectService> workspaceProjectService,
                                final ProjectController projectController,
                                final Promises promises,
                                final Event<NotificationEvent> notificationEvent); }
AuthoringPerspective { @OnOpen public void onOpen() { placeManager.closeAllPlaces(); if (!projectPathString.isEmpty()) { vfsServices.call((RemoteCallback<Boolean>) isRegularFile -> { if (isRegularFile) { vfsServices.call((RemoteCallback<Path>) path -> { setWorkspaceContext(path, () -> placeManager.goTo(path)); }).get(projectPathString); } }).isRegularFile(projectPathString); } } @Inject  AuthoringPerspective(final PlaceManager placeManager,
                                final Caller<VFSService> vfsServices,
                                final Event<WorkspaceProjectContextChangeEvent> workspaceProjectContextChangeEvent,
                                final Caller<WorkspaceProjectService> workspaceProjectService,
                                final ProjectController projectController,
                                final Promises promises,
                                final Event<NotificationEvent> notificationEvent); @PostConstruct void init(); @Perspective PerspectiveDefinition getPerspective(); @OnOpen void onOpen(); }
AuthoringPerspective { @OnOpen public void onOpen() { placeManager.closeAllPlaces(); if (!projectPathString.isEmpty()) { vfsServices.call((RemoteCallback<Boolean>) isRegularFile -> { if (isRegularFile) { vfsServices.call((RemoteCallback<Path>) path -> { setWorkspaceContext(path, () -> placeManager.goTo(path)); }).get(projectPathString); } }).isRegularFile(projectPathString); } } @Inject  AuthoringPerspective(final PlaceManager placeManager,
                                final Caller<VFSService> vfsServices,
                                final Event<WorkspaceProjectContextChangeEvent> workspaceProjectContextChangeEvent,
                                final Caller<WorkspaceProjectService> workspaceProjectService,
                                final ProjectController projectController,
                                final Promises promises,
                                final Event<NotificationEvent> notificationEvent); @PostConstruct void init(); @Perspective PerspectiveDefinition getPerspective(); @OnOpen void onOpen(); static final String IDENTIFIER; }