@Test public void testReload() { Response response = cut.reload(); assertNotNull(response.getEntity()); System.setProperty("log4j.configuration", "testlog4j.xml"); response = cut.reload(); assertNotNull(response.getEntity()); System.setProperty("log4j.configuration", "testlog4j.properties"); response = cut.reload(); assertNotNull(response.getEntity()); System.setProperty("log4j.configuration", "testlog4j_NO_SUCH_FILE.xml"); response = cut.reload(); assertNotNull(response.getEntity()); System.clearProperty("log4j.configuration"); }
@Override public Response reload() { ApplicationProperties.reload(); Properties copyToReturn = ApplicationProperties.getProperties(); configurer.setProperties(copyToReturn); filesConfiguration.reload(); LogManager.resetConfiguration(); DOMConfigurator.configure("../data/conf/log4j.xml"); copyToReturn.put("logging-reload-state", "Property reload complete"); return ResponseBuilder.ok(new TreeMap<>(copyToReturn)); }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response reload() { ApplicationProperties.reload(); Properties copyToReturn = ApplicationProperties.getProperties(); configurer.setProperties(copyToReturn); filesConfiguration.reload(); LogManager.resetConfiguration(); DOMConfigurator.configure("../data/conf/log4j.xml"); copyToReturn.put("logging-reload-state", "Property reload complete"); return ResponseBuilder.ok(new TreeMap<>(copyToReturn)); } }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response reload() { ApplicationProperties.reload(); Properties copyToReturn = ApplicationProperties.getProperties(); configurer.setProperties(copyToReturn); filesConfiguration.reload(); LogManager.resetConfiguration(); DOMConfigurator.configure("../data/conf/log4j.xml"); copyToReturn.put("logging-reload-state", "Property reload complete"); return ResponseBuilder.ok(new TreeMap<>(copyToReturn)); } AdminServiceRestImpl(FilesConfiguration theFilesConfiguration, ResourceService resourceService); }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response reload() { ApplicationProperties.reload(); Properties copyToReturn = ApplicationProperties.getProperties(); configurer.setProperties(copyToReturn); filesConfiguration.reload(); LogManager.resetConfiguration(); DOMConfigurator.configure("../data/conf/log4j.xml"); copyToReturn.put("logging-reload-state", "Property reload complete"); return ResponseBuilder.ok(new TreeMap<>(copyToReturn)); } AdminServiceRestImpl(FilesConfiguration theFilesConfiguration, ResourceService resourceService); @Override Response reload(); @Override Response view(); @Override Response encrypt(String cleartext); @Override Response manifest(ServletContext context); @Override Response isJwalaAuthorizationEnabled(); @Override Response getAuthorizationDetails(); }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response reload() { ApplicationProperties.reload(); Properties copyToReturn = ApplicationProperties.getProperties(); configurer.setProperties(copyToReturn); filesConfiguration.reload(); LogManager.resetConfiguration(); DOMConfigurator.configure("../data/conf/log4j.xml"); copyToReturn.put("logging-reload-state", "Property reload complete"); return ResponseBuilder.ok(new TreeMap<>(copyToReturn)); } AdminServiceRestImpl(FilesConfiguration theFilesConfiguration, ResourceService resourceService); @Override Response reload(); @Override Response view(); @Override Response encrypt(String cleartext); @Override Response manifest(ServletContext context); @Override Response isJwalaAuthorizationEnabled(); @Override Response getAuthorizationDetails(); static final String JSON_RESPONSE_TRUE; static final String JSON_RESPONSE_FALSE; }