@Test
 public void testControllerSetting() throws Exception {
   createContorllerConfigSetting(
       "controller1", ControllerConfigurationKey.BSS_ORGANIZATION_ID.name(), "value");
   createContorllerConfigSetting("controller1", "instanceValueKey", "value");
   createContorllerConfigSetting("controller2", "key1", "value");
   createContorllerConfigSetting("controller2", "key2", "value");
   createContorllerConfigSetting("controller3", "key1", "value");
   Map<String, String> result =
       runTX(
           new Callable<Map<String, String>>() {
             @Override
             public Map<String, String> call() throws Exception {
               return cs.getControllerConfigurationSettings("controller1");
             }
           });
   assertNotNull(result);
   assertTrue(result.keySet().size() == 2);
 }
  @Test
  public void testStoreControllerSetting() throws Throwable {
    createContorllerConfigSetting("controller1", "instanceValue", "value");
    createContorllerConfigSetting(
        "controller1", ControllerConfigurationKey.BSS_ORGANIZATION_ID.name(), "value");
    createContorllerConfigSetting("controller1", "leave", "alone");
    createContorllerConfigSetting("controller1", "update", "old");
    createContorllerConfigSetting(
        "controller1", "update_PWD", APPConfigurationServiceBean.CRYPT_PREFIX + "old_crypt");
    createContorllerConfigSetting("controller1", "delete", "old");
    createContorllerConfigSetting("controller2", "instanceValue", "value1_c2");
    createContorllerConfigSetting(
        "controller2", ControllerConfigurationKey.BSS_ORGANIZATION_ID.name(), "value2_c2");
    createContorllerConfigSetting("controller3", "instanceValue", "value1_c3");
    createContorllerConfigSetting(
        "controller3", ControllerConfigurationKey.BSS_ORGANIZATION_ID.name(), "value2_c3");
    final HashMap<String, String> result1 = new HashMap<String, String>();
    final HashMap<String, String> result2 = new HashMap<String, String>();
    final HashMap<String, String> result3 = new HashMap<String, String>();
    try {
      runTX(
          new Callable<Void>() {
            @Override
            public Void call() throws Exception {
              HashMap<String, String> map = new HashMap<String, String>();
              map.put("update", "new");
              map.put("update_PWD", "new_crypt");
              map.put("create", "very_new");
              map.put("create_PWD", "very_new_crypt");
              map.put("delete", null);
              cs.storeControllerConfigurationSettings("controller1", map);
              return null;
            }
          });
      runTX(
          new Callable<Void>() {
            @Override
            public Void call() throws Exception {
              result1.putAll(cs.getControllerConfigurationSettings("controller1"));
              result2.putAll(cs.getControllerConfigurationSettings("controller2"));
              result3.putAll(cs.getControllerConfigurationSettings("controller3"));
              return null;
            }
          });
    } catch (EJBException e) {
      throw e.getCause();
    }
    assertTrue(result1.keySet().size() == 7);
    assertEquals("alone", result1.get("leave"));
    assertEquals("new", result1.get("update"));
    assertEquals("new_crypt", result1.get("update_PWD"));
    assertEquals("very_new", result1.get("create"));
    assertEquals("very_new_crypt", result1.get("create_PWD"));
    assertFalse(result1.containsKey("delete"));

    assertTrue(result2.keySet().size() == 2);
    assertEquals("value1_c2", result2.get("instanceValue"));
    assertEquals("value2_c2", result2.get(ControllerConfigurationKey.BSS_ORGANIZATION_ID.name()));
    assertTrue(result3.keySet().size() == 2);
    assertEquals("value1_c3", result3.get("instanceValue"));
    assertEquals("value2_c3", result3.get(ControllerConfigurationKey.BSS_ORGANIZATION_ID.name()));
  }