}
public void testResourceBundleServiceUpdate() throws Exception
{
//-------getResourceBundle have loaded from property file to database--------
ResourceBundle res = service_.getResourceBundle(fileRes, Locale.ENGLISH);
// //------------create ressource bundle in database------------------
createResourceBundle(databaseRes, PROPERTIES, Locale.ENGLISH);
createResourceBundle(databaseRes, PROPERTIES_FR, Locale.FRANCE);
res = service_.getResourceBundle(databaseRes, Locale.ENGLISH);
assertTrue("Expect to find the ResourceBundle", res != null);
res = service_.getResourceBundle(databaseRes, Locale.FRANCE);
assertTrue("Expect to find the ResourceBundle", res != null);
assertEquals("Expect French locale bundle", "fr", res.getString("language"));
assertEquals("Expect French locale bundle", "property", res.getString("property"));
//--------- Update a databseRes resource bundle in database ----------------
createResourceBundle(databaseRes, PROPERTIES_FR_UPDATE, Locale.FRANCE);
res = service_.getResourceBundle(databaseRes, Locale.FRANCE);
assertEquals("Expect French locale bundle", "fr-property", res.getString("property"));
//--------Update fileRes resource bundle in databse--------------
String datas = "key1=fileSystem\nlanguage=french";
createResourceBundle(fileRes, datas, Locale.FRANCE);
res = service_.getResourceBundle(fileRes, Locale.FRANCE);
assertTrue("Expect to find the ResourceBundle", res != null);
assertTrue("Expect 'fileRes' is updated", res.getString("key1").equals("fileSystem"));
assertEquals("Expect languge property is:", "french", res.getString("language"));
//--------Update fileRes resource bundle in databse--------------
datas = "key1=fileSystemUpdate\nlanguage=french";
createResourceBundle(fileRes, datas, Locale.FRANCE);
res = service_.getResourceBundle(fileRes, Locale.FRANCE);
assertTrue("Expect to find the ResourceBundle", res != null);
assertTrue("Expect 'fileRes' is updated", res.getString("key1").equals("fileSystemUpdate"));
assertEquals("Expect languge property is:", "french", res.getString("language"));
}