Commit Graph

6 Commits

Author SHA1 Message Date
Phillip Webb 9e18021e8c Merge branch '1.4.x' into 1.5.x 2016-11-18 15:59:05 -08:00
Phillip Webb fce17ca6d9 Polish 2016-11-18 15:50:19 -08:00
Andy Wilkinson cd3f951d35 Merge branch '1.4.x' into 1.5.x 2016-11-17 20:43:06 +00:00
Andy Wilkinson 5dea4c5a03 Wait for server port to be written in a more robust manner
Previously, we just waited for the file to exist before trying to read
the port from it. This left a window where the file existed but its
contents had not be written which could result in a
NumberFormatException.

This commit now waits for the file to have a length that is greater
than zero.

See gh-7379
2016-11-17 20:41:25 +00:00
Andy Wilkinson eff0fc0221 Merge branch '1.4.x' into 1.5.x 2016-11-17 19:28:01 +00:00
Andy Wilkinson 918e122ddc Fix remote DevTools' support for adding and removing classes
Previously, remote DevTools only correctly supported modifying
existing classes. New classes that were added would be missed, and
deleted classes could cause a failure as they would be found by
component scanning but hidden by RestartClassLoader.

This commit introduces a DevTools-specific ResourcePatternResolver
that is installed as the application context's resource loader. This
custom resolver is aware of the files that have been added and
deleted and modifies the result returned from getResource and
getResources accordingly.

New intergration tests have been introduced to verify DevTools'
behaviour. The tests cover four scenarios:

- Adding a new controller
- Removing an existing controller
- Adding a request mapping to a controller
- Removing a request mapping from a controller

These four scenarios are tested with:

- DevTools updating a local application
- DevTools updating a remote application packaged in a jar file
- DevTools updating a remote application that's been exploded

Closes gh-7379
2016-11-17 19:19:54 +00:00