CollectionDriverManager { public synchronized void changeCollectionSwitchStatus(boolean enabled) { if (driver != null) { logger.debug("In method changeCollectionSwitchStatus of class CollectionDriverManager, enabled is: " + enabled); try { new PropertiesUtil(getConfigurationFile()).setProperty( driver.getCollectionSwitchName(), String.valueOf(enabled)) .saveLastKey(); } catch (IOException e) { logger.warn("Fail to change configuration file of data collection: " + e.getLocalizedMessage()); } } else { logger.error("In the method changeCollectionSwitchStatus of class CollectionDriverManager, driver is null."); } }  void init(); CollectionDriver getDriver(); synchronized void changeCollectionSwitchStatus(boolean enabled); boolean getCollectionSwitchStatus(); static File getConfigurationFile(); void setDriver(CollectionDriver driver); static void setFile(File file); void setCollectionInitializerService(ICollectionInitializerService collectionInitializerService); void setCollectOperationManager(CollectOperationManager collectOperationManager); void setDataContainer(DataContainer dataContainer); void setDriverClass(String driverClass);  }
@Test(groups = { "TestCollectionDriverManager" }) public void testChangeCollectionSwitchStatus() { collectionDriverManager.changeCollectionSwitchStatus(true); try { String propertiesStr = CommonUtil.dataFromFile(FILE_PATH); assertTrue(propertiesStr.contains("serengeti.ph.enable=true")); } catch (IOException e) { } }