test_class.declarator: dispatcher
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private CommandDispatcher dispatcher;
test_class.type: CommandDispatcher
test_class.var_name: dispatcher
test_class.declarator: recorder
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private TestRecorder recorder;
test_class.type: TestRecorder
test_class.var_name: recorder
test_class.file: command/src/test/java/org/geomajas/command/configuration/RefreshConfigurationCommandTest.java
test_class.identifier: RefreshConfigurationCommandTest
test_case.body: @Test
  	@DirtiesContext
  	public void testRefreshConfiguration() throws Exception {
  		Assert.assertEquals("", recorder.matches("test", "postConstruct"));
  		recorder.clear();
  
  		RefreshConfigurationRequest request = new RefreshConfigurationRequest();
  		request.setConfigLocations(new String[] {});
  		RefreshConfigurationResponse response = (RefreshConfigurationResponse) dispatcher.execute(
  				RefreshConfigurationRequest.COMMAND, request, null, "en");
  		/* @todo test commented because test runner does not build a ReconfigurableApplicationContext
  		if (response.isError()) {
  			response.getErrors().get(0).printStackTrace();
  		}
  		Assert.assertFalse(response.isError());
  		Assert.assertEquals("", recorder.matches("test", "postConstruct"));
  		*/
  	}
test_case.class_method_signature: RefreshConfigurationCommandTest.testRefreshConfiguration()
test_case.full_signature: @Test @DirtiesContext public void testRefreshConfiguration()
test_case.identifier: testRefreshConfiguration
test_case.invocations: assertEquals matches clear setConfigLocations execute
test_case.modifiers: @Test @DirtiesContext public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRefreshConfiguration()
focal_class.declarator: context
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private ApplicationContext context;
focal_class.type: ApplicationContext
focal_class.var_name: context
focal_class.declarator: log = LoggerFactory.getLogger(RefreshConfigurationCommand.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(RefreshConfigurationCommand.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: command/src/main/java/org/geomajas/command/configuration/RefreshConfigurationCommand.java
focal_class.identifier: RefreshConfigurationCommand
focal_class.interfaces: implements CommandHasRequest<RefreshConfigurationRequest, RefreshConfigurationResponse>
focal_class.class_method_signature: RefreshConfigurationCommand.getEmptyCommandRequest()
focal_class.full_signature: @Override public RefreshConfigurationRequest getEmptyCommandRequest()
focal_class.identifier: getEmptyCommandRequest
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: RefreshConfigurationRequest
focal_class.signature: RefreshConfigurationRequest getEmptyCommandRequest()
focal_class.class_method_signature: RefreshConfigurationCommand.getEmptyCommandResponse()
focal_class.full_signature: @Override public RefreshConfigurationResponse getEmptyCommandResponse()
focal_class.identifier: getEmptyCommandResponse
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: RefreshConfigurationResponse
focal_class.signature: RefreshConfigurationResponse getEmptyCommandResponse()
focal_class.class_method_signature: RefreshConfigurationCommand.execute(RefreshConfigurationRequest request, RefreshConfigurationResponse response)
focal_class.full_signature: @Override public void execute(RefreshConfigurationRequest request, RefreshConfigurationResponse response)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (RefreshConfigurationRequest request, RefreshConfigurationResponse response)
focal_class.return: void
focal_class.signature: void execute(RefreshConfigurationRequest request, RefreshConfigurationResponse response)
focal_method.body: @Override
  	public void execute(RefreshConfigurationRequest request, RefreshConfigurationResponse response) throws Exception {
  		if (context instanceof ReconfigurableApplicationContext) {
  			ReconfigurableApplicationContext rollback = (ReconfigurableApplicationContext) context;
  			if (request.getConfigLocations() != null) {
  				ArrayList<String> configLocations = new ArrayList<String>();
  				configLocations.add("org/geomajas/spring/geomajasContext.xml");
  
  				configLocations.addAll(Arrays.asList(request.getConfigLocations()));
  				try {
  					rollback.refresh(configLocations.toArray(new String[configLocations.size()]));
  				} catch (GeomajasException e) {
  					log.error("Could not refresh context", e);
  					rollback.rollback();
  					response.setApplicationNames(context.getBeanNamesForType(ClientApplicationInfo.class));
  					throw e;
  				}
  				response.setApplicationNames(context.getBeanNamesForType(ClientApplicationInfo.class));
  			}
  		} else {
  			response.setApplicationNames(context.getBeanNamesForType(ClientApplicationInfo.class));
  			throw new GeomajasException(ExceptionCode.REFRESH_CONFIGURATION_FAILED);
  		}
  	}
focal_method.class_method_signature: RefreshConfigurationCommand.execute(RefreshConfigurationRequest request, RefreshConfigurationResponse response)
focal_method.full_signature: @Override public void execute(RefreshConfigurationRequest request, RefreshConfigurationResponse response)
focal_method.identifier: execute
focal_method.invocations: getConfigLocations add addAll asList getConfigLocations refresh toArray size error rollback setApplicationNames getBeanNamesForType setApplicationNames getBeanNamesForType setApplicationNames getBeanNamesForType
focal_method.modifiers: @Override public
focal_method.parameters: (RefreshConfigurationRequest request, RefreshConfigurationResponse response)
focal_method.return: void
focal_method.signature: void execute(RefreshConfigurationRequest request, RefreshConfigurationResponse response)