@Override public void onOpen() { super.onOpen(); nativeEditor.onOpen(path.toURI()); }
private ObservablePath createPath(final String uri) { final ObservablePath path = mock(ObservablePath.class); doReturn(uri).when(path).toURI(); return path; } }
private ObservablePath createPath() { final ObservablePath path = mock(ObservablePath.class); doReturn(ASSET_PATH).when(path).toURI(); observablePathImpl.wrap(path); return path; }
public VersionHistoryScreenPlace(ObservablePath pathToFile, String filename, String version) { super("versionHistoryScreen"); addParameter(URI, pathToFile.toURI()); addParameter(FILENAME, filename); addParameter(VERSION, version); }
public VersionHistoryScreenPlace(ObservablePath pathToFile, String filename, String version) { super("versionHistoryScreen"); addParameter(URI, pathToFile.toURI()); addParameter(FILENAME, filename); addParameter(VERSION, version); }
private String getCurrentVersionRecordUri() { VersionRecord record = getCurrentVersionRecord(); if (record == null) { return getPathToLatest().toURI(); } else { return record.uri(); } }
@Override public boolean matches( Object argument ) { if ( argument instanceof ObservablePath ) { final ObservablePath that = (ObservablePath) argument; return that.toURI().equals( path.toURI() ); } return false; }
private ObservablePath createPath() { final ObservablePath path = mock(ObservablePath.class); doReturn(ASSET_PATH).when(path).toURI(); observablePathImpl.wrap(path); return path; }
private String getCurrentVersionRecordUri() { VersionRecord record = getCurrentVersionRecord(); if (record == null) { return getPathToLatest().toURI(); } else { return record.uri(); } }
@Override public void onStartup(final ObservablePath path, final PlaceRequest place) { super.onStartup(path, place); setupObservablePathCallBacks(); nativeEditor.onStartup(path.toURI()); }
private void setUpUtil() { util = mock(RestoreUtil.class); pathTo111 = mock(ObservablePath.class); pathTo222 = mock(ObservablePath.class); pathTo333 = mock(ObservablePath.class); when(pathTo111.toURI()).thenReturn("hehe//111"); when(pathTo222.toURI()).thenReturn("hehe//222"); when(pathTo333.toURI()).thenReturn("hehe//333"); when(util.createObservablePath(pathTo333, "hehe//111")).thenReturn(pathTo111); when(util.createObservablePath(pathTo333, "hehe//222")).thenReturn(pathTo222); when(util.createObservablePath(pathTo333, "hehe//333")).thenReturn(pathTo333); }
private void setUpUtil() { util = mock(RestoreUtil.class); pathTo111 = mock(ObservablePath.class); pathTo222 = mock(ObservablePath.class); pathTo333 = mock(ObservablePath.class); when(pathTo111.toURI()).thenReturn("hehe//111"); when(pathTo222.toURI()).thenReturn("hehe//222"); when(pathTo333.toURI()).thenReturn("hehe//333"); when(util.createObservablePath(pathTo333, "hehe//111")).thenReturn(pathTo111); when(util.createObservablePath(pathTo333, "hehe//222")).thenReturn(pathTo222); when(util.createObservablePath(pathTo333, "hehe//333")).thenReturn(pathTo333); }
private void setUpUtil() { util = mock(RestoreUtil.class); pathTo111 = mock(ObservablePath.class); pathTo222 = mock(ObservablePath.class); pathTo333 = mock(ObservablePath.class); when(pathTo111.toURI()).thenReturn("hehe//111"); when(pathTo222.toURI()).thenReturn("hehe//222"); when(pathTo333.toURI()).thenReturn("hehe//333"); when(util.createObservablePath(pathTo333, "hehe//111")).thenReturn(pathTo111); when(util.createObservablePath(pathTo333, "hehe//222")).thenReturn(pathTo222); when(util.createObservablePath(pathTo333, "hehe//333")).thenReturn(pathTo333); }
private void setUpUtil() { util = mock(RestoreUtil.class); pathTo111 = mock(ObservablePath.class); pathTo222 = mock(ObservablePath.class); pathTo333 = mock(ObservablePath.class); when(pathTo111.toURI()).thenReturn("hehe//111"); when(pathTo222.toURI()).thenReturn("hehe//222"); when(pathTo333.toURI()).thenReturn("hehe//333"); when(util.createObservablePath(pathTo333, "hehe//111")).thenReturn(pathTo111); when(util.createObservablePath(pathTo333, "hehe//222")).thenReturn(pathTo222); when(util.createObservablePath(pathTo333, "hehe//333")).thenReturn(pathTo333); }
private String getLabel(final WorkspaceProject project, final PlaceRequest place) { if (place instanceof PathPlaceRequest) { return getAssetPath(project, ((PathPlaceRequest) place).getPath().toURI()); } if (place.getIdentifier().equals(PROJECT_SCREEN)) { return translationService.format(ProjectScreenSettings, project.getName()); } return place.getFullIdentifier(); }
private void assertContains(final Set<GuidedDecisionTableGraphEntry> entries, final ObservablePath path, final Double x, final Double y) { if (entries.stream().filter((e) -> e.getPathHead().equals(path) && x.equals(e.getX()) && y.equals(e.getY())).collect(Collectors.toList()).isEmpty()) { fail("Path [" + path.toURI() + " not found in GuidedDecisionTableEditorGraphModel.entries()"); } }
private void checkDoSave(final ParameterizedCommand<OnSaveSetupDataHolder> setup, final Command assertion) { final ObservablePath dtGraphPath = mock(ObservablePath.class); final PlaceRequest dtGraphPlaceRequest = mock(PlaceRequest.class); final GuidedDecisionTableEditorGraphContent dtGraphContent = makeDecisionTableGraphContent(); when(dtGraphPath.toURI()).thenReturn("dtGraphPath"); when(dtGraphPath.getFileName()).thenReturn("filename"); when(dtGraphService.loadContent(eq(dtGraphPath))).thenReturn(dtGraphContent); when(versionRecordManager.getCurrentPath()).thenReturn(dtGraphPath); setup.execute(new OnSaveSetupDataHolder(dtGraphPath, dtGraphPlaceRequest)); presenter.doSave(); assertion.execute(); }
private void checkMayClose(final int uiModelHashCode, final Command assertion) { final ObservablePath dtGraphPath = mock(ObservablePath.class); final PlaceRequest dtGraphPlaceRequest = mock(PlaceRequest.class); final GuidedDecisionTableEditorGraphContent dtGraphContent = makeDecisionTableGraphContent(0); when(dtGraphPath.toURI()).thenReturn("dtGraphPath"); when(dtGraphPath.getFileName()).thenReturn("filename"); when(dtGraphService.loadContent(eq(dtGraphPath))).thenReturn(dtGraphContent); when(versionRecordManager.getCurrentPath()).thenReturn(dtGraphPath); doReturn(makeDecisionTableGraphContent(uiModelHashCode).getModel()).when(presenter).buildModelFromEditor(); presenter.onStartup(dtGraphPath, dtGraphPlaceRequest); assertion.execute(); }
@Test public void testReload() throws Exception { versions.add(getVersionRecord("444")); ObservablePath pathTo444 = mock(ObservablePath.class); when(pathTo444.toURI()).thenReturn("hehe//444"); when(util.createObservablePath(pathTo444, "hehe//444")).thenReturn(pathTo444); manager.reloadVersions(pathTo444); assertEquals(pathTo444, manager.getPathToLatest()); assertEquals(pathTo444, manager.getCurrentPath()); assertEquals("444", manager.getVersion()); }
@Test public void testReload() throws Exception { versions.add(getVersionRecord("444")); ObservablePath pathTo444 = mock(ObservablePath.class); when(pathTo444.toURI()).thenReturn("hehe//444"); when(util.createObservablePath(pathTo444, "hehe//444")).thenReturn(pathTo444); manager.reloadVersions(pathTo444); assertEquals(pathTo444, manager.getPathToLatest()); assertEquals(pathTo444, manager.getCurrentPath()); assertEquals("444", manager.getVersion()); }