@Test public void testGetCurrentDirectory(){ JFileChooser chooser = new MockJFileChooser(); File dir = chooser.getCurrentDirectory(); Assert.assertTrue(dir.exists()); Assert.assertTrue(dir instanceof MockFile); }
public File getCurrentDirectory() { return currentDirectory; }
MockJFileChooser extends  javax.swing.JFileChooser implements OverrideMock { public File getCurrentDirectory() { return currentDirectory; } }
MockJFileChooser extends  javax.swing.JFileChooser implements OverrideMock { public File getCurrentDirectory() { return currentDirectory; } MockJFileChooser();  MockJFileChooser(String currentDirectoryPath);  MockJFileChooser(File currentDirectory);  MockJFileChooser(FileSystemView fsv);  MockJFileChooser(File currentDirectory, FileSystemView fsv);  MockJFileChooser(String currentDirectoryPath, FileSystemView fsv); }
MockJFileChooser extends  javax.swing.JFileChooser implements OverrideMock { public File getCurrentDirectory() { return currentDirectory; } MockJFileChooser();  MockJFileChooser(String currentDirectoryPath);  MockJFileChooser(File currentDirectory);  MockJFileChooser(FileSystemView fsv);  MockJFileChooser(File currentDirectory, FileSystemView fsv);  MockJFileChooser(String currentDirectoryPath, FileSystemView fsv); @Override void setCurrentDirectory(File dir); void setDragEnabled(boolean b); boolean getDragEnabled(); File getSelectedFile(); void setSelectedFile(File file); File[] getSelectedFiles(); void setSelectedFiles(File[] selectedFiles); File getCurrentDirectory(); void changeToParentDirectory(); void rescanCurrentDirectory(); void ensureFileIsVisible(File f); int showOpenDialog(Component parent); int showSaveDialog(Component parent); int showDialog(Component parent, String approveButtonText); boolean getControlButtonsAreShown(); void setControlButtonsAreShown(boolean b); int getDialogType(); void setDialogType(int dialogType); void setDialogTitle(String dialogTitle); String getDialogTitle(); void setApproveButtonToolTipText(String toolTipText); String getApproveButtonToolTipText(); int getApproveButtonMnemonic(); void setApproveButtonMnemonic(int mnemonic); void setApproveButtonMnemonic(char mnemonic); void setApproveButtonText(String approveButtonText); String getApproveButtonText(); FileFilter[] getChoosableFileFilters(); void addChoosableFileFilter(FileFilter filter); boolean removeChoosableFileFilter(FileFilter f); void resetChoosableFileFilters(); FileFilter getAcceptAllFileFilter(); boolean isAcceptAllFileFilterUsed(); void setAcceptAllFileFilterUsed(boolean b); JComponent getAccessory(); void setAccessory(JComponent newAccessory); void setFileSelectionMode(int mode); int getFileSelectionMode(); boolean isFileSelectionEnabled(); boolean isDirectorySelectionEnabled(); void setMultiSelectionEnabled(boolean b); boolean isMultiSelectionEnabled(); boolean isFileHidingEnabled(); void setFileHidingEnabled(boolean b); void setFileFilter(FileFilter filter); FileFilter getFileFilter(); void setFileView(FileView fileView); FileView getFileView(); String getName(File f); String getDescription(File f); String getTypeDescription(File f); Icon getIcon(File f); boolean isTraversable(File f); boolean accept(File f); void setFileSystemView(FileSystemView fsv); FileSystemView getFileSystemView(); void approveSelection(); void cancelSelection(); void addActionListener(ActionListener l); void removeActionListener(ActionListener l); ActionListener[] getActionListeners(); void updateUI(); String getUIClassID(); FileChooserUI getUI(); @Override AccessibleContext getAccessibleContext(); }
MockJFileChooser extends  javax.swing.JFileChooser implements OverrideMock { public File getCurrentDirectory() { return currentDirectory; } MockJFileChooser();  MockJFileChooser(String currentDirectoryPath);  MockJFileChooser(File currentDirectory);  MockJFileChooser(FileSystemView fsv);  MockJFileChooser(File currentDirectory, FileSystemView fsv);  MockJFileChooser(String currentDirectoryPath, FileSystemView fsv); @Override void setCurrentDirectory(File dir); void setDragEnabled(boolean b); boolean getDragEnabled(); File getSelectedFile(); void setSelectedFile(File file); File[] getSelectedFiles(); void setSelectedFiles(File[] selectedFiles); File getCurrentDirectory(); void changeToParentDirectory(); void rescanCurrentDirectory(); void ensureFileIsVisible(File f); int showOpenDialog(Component parent); int showSaveDialog(Component parent); int showDialog(Component parent, String approveButtonText); boolean getControlButtonsAreShown(); void setControlButtonsAreShown(boolean b); int getDialogType(); void setDialogType(int dialogType); void setDialogTitle(String dialogTitle); String getDialogTitle(); void setApproveButtonToolTipText(String toolTipText); String getApproveButtonToolTipText(); int getApproveButtonMnemonic(); void setApproveButtonMnemonic(int mnemonic); void setApproveButtonMnemonic(char mnemonic); void setApproveButtonText(String approveButtonText); String getApproveButtonText(); FileFilter[] getChoosableFileFilters(); void addChoosableFileFilter(FileFilter filter); boolean removeChoosableFileFilter(FileFilter f); void resetChoosableFileFilters(); FileFilter getAcceptAllFileFilter(); boolean isAcceptAllFileFilterUsed(); void setAcceptAllFileFilterUsed(boolean b); JComponent getAccessory(); void setAccessory(JComponent newAccessory); void setFileSelectionMode(int mode); int getFileSelectionMode(); boolean isFileSelectionEnabled(); boolean isDirectorySelectionEnabled(); void setMultiSelectionEnabled(boolean b); boolean isMultiSelectionEnabled(); boolean isFileHidingEnabled(); void setFileHidingEnabled(boolean b); void setFileFilter(FileFilter filter); FileFilter getFileFilter(); void setFileView(FileView fileView); FileView getFileView(); String getName(File f); String getDescription(File f); String getTypeDescription(File f); Icon getIcon(File f); boolean isTraversable(File f); boolean accept(File f); void setFileSystemView(FileSystemView fsv); FileSystemView getFileSystemView(); void approveSelection(); void cancelSelection(); void addActionListener(ActionListener l); void removeActionListener(ActionListener l); ActionListener[] getActionListeners(); void updateUI(); String getUIClassID(); FileChooserUI getUI(); @Override AccessibleContext getAccessibleContext(); static final int OPEN_DIALOG; static final int SAVE_DIALOG; static final int CUSTOM_DIALOG; static final int CANCEL_OPTION; static final int APPROVE_OPTION; static final int ERROR_OPTION; static final int FILES_ONLY; static final int DIRECTORIES_ONLY; static final int FILES_AND_DIRECTORIES; static final String CANCEL_SELECTION; static final String APPROVE_SELECTION; static final String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY; static final String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY; static final String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY; static final String CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY; static final String DIRECTORY_CHANGED_PROPERTY; static final String SELECTED_FILE_CHANGED_PROPERTY; static final String SELECTED_FILES_CHANGED_PROPERTY; static final String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY; static final String FILE_SYSTEM_VIEW_CHANGED_PROPERTY; static final String FILE_VIEW_CHANGED_PROPERTY; static final String FILE_HIDING_CHANGED_PROPERTY; static final String FILE_FILTER_CHANGED_PROPERTY; static final String FILE_SELECTION_MODE_CHANGED_PROPERTY; static final String ACCESSORY_CHANGED_PROPERTY; static final String ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY; static final String DIALOG_TITLE_CHANGED_PROPERTY; static final String DIALOG_TYPE_CHANGED_PROPERTY; static final String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY; }