{
System.out.println("testDecryptFromConfigXML_InMemory");
try {
Configuration config =AppConfig.getConfiguration();
Cryptor auth = new AES128Cryptor();
String encrypt = auth.encrypt("test");
Assert.assertNotNull(encrypt);
Assert.assertNotSame(encrypt, "test");
//add to the config
config.addProperty("testDecryptFromConfigXML", encrypt);
config.addProperty("testDecryptFromConfigXML"+ Property.ENCRYPTED_ATTRIBUTE, "true");
//retrieve it
String pwd = config.getString("testDecryptFromConfigXML");
Assert.assertNotNull(pwd);
//test for encryption
if (config.getBoolean("testDecryptFromConfigXML" + Property.ENCRYPTED_ATTRIBUTE, false))
{
String test=auth.decrypt(pwd);
Assert.assertEquals(test, "test");
}
else
{
Assert.fail("config reports that the setting is not encrypted");