@Test public void testInitThrowsNullPointerException() throws Throwable { SimpleKeyFile simpleKeyFile = new SimpleKeyFile(); try { simpleKeyFile.init(null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull(ex.getMessage(), "ex.getMessage()"); assertNull(simpleKeyFile.file, "simpleKeyFile.file"); assertEquals(0, simpleKeyFile.props.size(), "simpleKeyFile.props.size()"); } }
public void init (String keyFileName) throws SecureKeyStoreException { file = new File(keyFileName); try { if (!file.exists()) file.createNewFile(); load(); } catch (Exception e) { throw new SecureKeyStoreException(e); } }
SimpleKeyFile implements SecureKeyStore, Configurable, LogSource { public void init (String keyFileName) throws SecureKeyStoreException { file = new File(keyFileName); try { if (!file.exists()) file.createNewFile(); load(); } catch (Exception e) { throw new SecureKeyStoreException(e); } } }
SimpleKeyFile implements SecureKeyStore, Configurable, LogSource { public void init (String keyFileName) throws SecureKeyStoreException { file = new File(keyFileName); try { if (!file.exists()) file.createNewFile(); load(); } catch (Exception e) { throw new SecureKeyStoreException(e); } } SimpleKeyFile();  SimpleKeyFile(String keyFileName); }
SimpleKeyFile implements SecureKeyStore, Configurable, LogSource { public void init (String keyFileName) throws SecureKeyStoreException { file = new File(keyFileName); try { if (!file.exists()) file.createNewFile(); load(); } catch (Exception e) { throw new SecureKeyStoreException(e); } } SimpleKeyFile();  SimpleKeyFile(String keyFileName); void init(String keyFileName); @Override void setLogger(Logger logger, String realm); @Override Logger getLogger(); @Override String getRealm(); @Override void setConfiguration(Configuration cfg); @Override synchronized SecureKey getKey(String alias); @Override synchronized void setKey(String alias, SecureKey secureKey); String getProperty(String alias, String subName); void setProperty(String alias, String subName, String value); @Override Map<String, SecureKey> getKeys(); }
SimpleKeyFile implements SecureKeyStore, Configurable, LogSource { public void init (String keyFileName) throws SecureKeyStoreException { file = new File(keyFileName); try { if (!file.exists()) file.createNewFile(); load(); } catch (Exception e) { throw new SecureKeyStoreException(e); } } SimpleKeyFile();  SimpleKeyFile(String keyFileName); void init(String keyFileName); @Override void setLogger(Logger logger, String realm); @Override Logger getLogger(); @Override String getRealm(); @Override void setConfiguration(Configuration cfg); @Override synchronized SecureKey getKey(String alias); @Override synchronized void setKey(String alias, SecureKey secureKey); String getProperty(String alias, String subName); void setProperty(String alias, String subName, String value); @Override Map<String, SecureKey> getKeys();  }