BaseEditor { public String getTitleText() { return getTitleText(versionRecordManager.getCurrentPath()); } BaseEditor(VersionRecordManager versionRecordManager,
               BaseEditorView baseView,
               BasicFileMenuBuilder menuBuilder,
               Event<ChangeTitleWidgetEvent> changeTitleNotification); protected  BaseEditor(); protected  BaseEditor(final BaseEditorView baseView); Validator getRenameValidator(); Validator getCopyValidator(); void setOriginalHash(Integer originalHash); String getTitleText(); RemoteCallback<Path> getSaveSuccessCallback(final int newHash); void onRestore(@Observes RestoreEvent restore); void reload(); void disableMenuItem(final MenuItems menuItem); void enableMenuItem(final MenuItems menuItem); void getMenus(final Consumer<Menus> menusConsumer); Command getValidateCommand(); boolean mayClose(Integer currentHash); boolean isDirty(Integer currentHash); VersionRecordManager getVersionRecordManager(); void setMetadataOriginalHash(final Integer metadataOriginalHash);  }
@Test public void testGetTitleText() { final String expectedTitle = "file.drl - DRL"; final ObservablePath path = mock(ObservablePath.class); final ClientResourceType type = mock(ClientResourceType.class); doReturn(type).when(editor).getType(); when(path.getFileName()).thenReturn("file.drl"); when(type.getDescription()).thenReturn("DRL"); final String actualTitle = editor.getTitleText(path); assertEquals(expectedTitle, actualTitle); }