@Test public void testSetConfigurationThrowsConfigurationException() throws Throwable { SimpleKeyFile simpleKeyFile = new SimpleKeyFile(); Configuration cfg = new SimpleConfiguration(new Properties()); try { simpleKeyFile.setConfiguration(cfg); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertEquals("", simpleKeyFile.file.getName(), "simpleKeyFile.file.getName()"); assertEquals("Key File", simpleKeyFile.header, "simpleKeyFile.header"); assertEquals(0, simpleKeyFile.props.size(), "simpleKeyFile.props.size()"); } }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { try { init(cfg.get("key-file")); header = cfg.get("file-header", header); } catch (Exception e) { throw new ConfigurationException(e); } }
SimpleKeyFile implements SecureKeyStore, Configurable, LogSource { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { try { init(cfg.get("key-file")); header = cfg.get("file-header", header); } catch (Exception e) { throw new ConfigurationException(e); } } }
SimpleKeyFile implements SecureKeyStore, Configurable, LogSource { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { try { init(cfg.get("key-file")); header = cfg.get("file-header", header); } catch (Exception e) { throw new ConfigurationException(e); } } SimpleKeyFile();  SimpleKeyFile(String keyFileName); }
SimpleKeyFile implements SecureKeyStore, Configurable, LogSource { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { try { init(cfg.get("key-file")); header = cfg.get("file-header", header); } catch (Exception e) { throw new ConfigurationException(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 { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { try { init(cfg.get("key-file")); header = cfg.get("file-header", header); } catch (Exception e) { throw new ConfigurationException(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();  }