@Test public final void testOpenInexistentFile() { final File f = PowerMock.createMock(File.class); PowerMock.resetAll(); if (FastOds.desktop != null) { EasyMock.expect(f.exists()).andReturn(false); } PowerMock.replayAll(); Assert.assertFalse(FastOds.openFile(f)); PowerMock.verifyAll(); }
public static boolean openFile(final File f) { if (desktop != null && f.exists() && f.isFile()) { try { desktop.open(f); return true; } catch (final IOException e) { Logger.getLogger(FastOds.class.getName()) .log(Level.SEVERE, "Can't open file " + f + " in appropriate application", e); } } return false; }
FastOds { public static boolean openFile(final File f) { if (desktop != null && f.exists() && f.isFile()) { try { desktop.open(f); return true; } catch (final IOException e) { Logger.getLogger(FastOds.class.getName()) .log(Level.SEVERE, "Can't open file " + f + " in appropriate application", e); } } return false; } }
FastOds { public static boolean openFile(final File f) { if (desktop != null && f.exists() && f.isFile()) { try { desktop.open(f); return true; } catch (final IOException e) { Logger.getLogger(FastOds.class.getName()) .log(Level.SEVERE, "Can't open file " + f + " in appropriate application", e); } } return false; } private  FastOds(); }
FastOds { public static boolean openFile(final File f) { if (desktop != null && f.exists() && f.isFile()) { try { desktop.open(f); return true; } catch (final IOException e) { Logger.getLogger(FastOds.class.getName()) .log(Level.SEVERE, "Can't open file " + f + " in appropriate application", e); } } return false; } private  FastOds(); static XMLUtil getXMLUtil(); static boolean openFile(final File f); }
FastOds { public static boolean openFile(final File f) { if (desktop != null && f.exists() && f.isFile()) { try { desktop.open(f); return true; } catch (final IOException e) { Logger.getLogger(FastOds.class.getName()) .log(Level.SEVERE, "Can't open file " + f + " in appropriate application", e); } } return false; } private  FastOds(); static XMLUtil getXMLUtil(); static boolean openFile(final File f);  }