Commit Graph

207 Commits (ed1ce140c090cda138a3b1b15cf7fc77601077f8)

Author SHA1 Message Date
Spring Buildmaster ed1ce140c0 Next Development Version 8 years ago
Andy Wilkinson 0e72ef1a10 Improve diagnostics for in StarterDependenciesIntegrationTests
The root cause of the build failure something has a null message which
means there's no information available about why the build failed.
Instead of calling fail when a BuildException occurs, this commit
wraps it in a RuntimeException and rethrows it. This should make the
entire chain of exceptions available when a failure occurs.
8 years ago
Andy Wilkinson 7c2664f959 Ensure that jar entry names use forward slashes, even on Windows
Previously, in the DevTools integration tests, portions of a File's
path were used to create the name of a jar entry. On Windows this
resulted in the entry containing \ characters. As a result the
directory structure was incorrect and the classes could not be loaded
from the jar.

This commit ensures that any \ characters are replaced with /
characters.

See gh-7782
8 years ago
Spring Buildmaster 9057f9ae1f Next development version 8 years ago
Phillip Webb bd74c3d327 Polish formatting 8 years ago
Andy Wilkinson 6061dd492e Increase timeout in DevTools integration tests and improve diagnostics 8 years ago
Phillip Webb fce17ca6d9 Polish 8 years ago
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
8 years ago
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
8 years ago
Spring Buildmaster e712a9ba8c Next Development Version 8 years ago
Andy Wilkinson 24f8c737fb Make relative PID_FOLDER and LOG_FOLDER absolute using jar's directory
Closes gh-7092
Closes gh-7093
8 years ago
Andy Wilkinson 03deff9a1c Handle relative pid folder correctly in the launch script
Previously, a relative PID folder was not handled correctly when
running stop, status, or force_reload. This meant that a service
could be started when configured to use a relative pid file, but
then could not be stopped.

The PID folder should be treated as relative to the service's jar
file. This commit updates stop, status, and force_reload to push the
jar file's directory so that this is now the case for those three
commands.

Closes gh-7092
8 years ago
Andy Wilkinson 97cf2e9677 Polish new tests for the Gradle plugin's deprecated ID
The output capture for the deprecation warning only appears to work
when the test is run in isolation. I can't figure out why that's the
case, particularly as we have another test class
(BootRunResourceTests) that uses OutputCapture and works reliably.

I'm cutting my loses and removing the use of OutputCapture and the
assertion that the warnings is logged.

See gh-6997
8 years ago
Andy Wilkinson ad3e5c04bb Add a second, portal-compatible ID to the Gradle plugin
To be compatible with Gradle's plugin portal, plugins must have an
ID that uses a reverse domain name. This means that spring-boot is
not compatible.

This commit introduces a new ID, org.springframework.boot, and
deprecates the old ID.

Closes gh-6997
8 years ago
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 8 years ago
Andy Wilkinson f266e8c69d Merge branch '1.3.x' 8 years ago
Andy Wilkinson 5a539ce381 Update launch script integration tests to work with Docker 1.12
Closes gh-6914 (I hope)
8 years ago
Phillip Webb a3c63b9c34 Fix broken Gradle test
Update test broken by recent Jetty changes.

See gh-6692
8 years ago
Spring Buildmaster 334baaeffd Next development version 8 years ago
Spring Buildmaster a89ef5df6e Next Development Version 8 years ago
Phillip Webb a2d8a769ab Fix broken `tomcat-juli` gradle test
Fix Gradle test broken when `tomcat-juli` was removed.

See gh-6192
8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Andy Wilkinson fc78a8de90 Merge branch '1.3.x' 9 years ago
Andy Wilkinson c808de0021 Allow custom repackage task to be used without a global main class
Closes gh-5956
9 years ago
Stephane Nicoll f9288a3af1 Revert "Polish maven repositories definition"
This commit reverts 62fa602fea

See gh-6031
9 years ago
Stephane Nicoll 62fa602fea Polish maven repositories definition
Previously, Maven repositories definition was specified in a profile that
is active by default. It means that as soon as any profile is enabled by
the user, said profile is no longer enabled. This has the nasty
consequences of having copy/paste in several places to make sure our own
profiles still have the proper repositories definition.

This commit creates a single "repositories" profile that is always active
unless a given property is explicitely specified. This allows to remove
the duplication and make things more consistent.

Some Gradle-specific repositories were also hard-coded in two modules
without any profile at all, meaning they were polluting the build of
anybody using it. While the impacted modules are gradle specific, that
repository has been shared in the new "repositories" profile as well.

Closes gh-6031
9 years ago
Johnny Lim 38dc9ec441 Polish 9 years ago
Spring Buildmaster 819a9574a6 Next Development Version 9 years ago
Andy Wilkinson 5d2177038f Merge branch '1.3.x' 9 years ago
Vedran Pavic 3891b242a3 Update launch script integration tests
- Use the latest Docker image for Ubuntu 14.04 LTS based tests
- Add Ubuntu 16.04 LTS based tests

Closes gh-5868
9 years ago
Spring Buildmaster 376bbe68d8 Next Development Version 9 years ago
Andy Wilkinson 3bfc6b1a4b Avoid packaging two versions of same dependency in Gradle repackaging
Previously, the Gradle plugin would include all of the dependencies
from both the compile and runtime configurations in the repackaged
jar. In the unlikely event that the compile and runtime configurations
contained different versions of the same dependency, this would lead
to both versions of the dependency being packaged in the jar file.

The runtime configuration extends the compile configuration so, in
normal circumstances, it will contain a superset of the compile
configuration's dependencies. In the situation described above where
the two configurations contain different versions of the same
dependency the runtime configuration will only contain whichever
version of the two dependencies has "won". By default, this will
be the dependency with the higher version.

This commit updates the Gradle plugin to only include the runtime
configuration's resolved dependencies during repackaging. As explained
above, the runtime configuration extends the compile configuration so
any compile dependencies will still be included, with the added
benefit that duplicate versions of the same dependency will have been
resolved to a single, preferred version.

Closes gh-5749
9 years ago
Andy Wilkinson f1f5066786 Merge branch '1.3.x' 9 years ago
Vedran Pavic 9e287ef611 Improve repeatability of launch script tests
Previously, tags were used for CentOS and Ubuntu images that may
change over time. This commit updates the Dockerfiles to use fixed
base images. For Ubuntu, a fixed tag is available. For CentOS we
have to resort to using the digest.

Closes gh-5397
9 years ago
Phillip Webb b398b3319c Rename @SpringApplicationTest -> @SpringBootTest
Rename @SpringApplicationTest to SpringBootTest and
@SpringApplicationContextLoader to @SpringBootContextLoader.

Fixes gh-5562
9 years ago
Andy Wilkinson 33f0ea3480 Rework SpringApplicationTest to support web modes
Rework the new testing support so that @SpringApplicationTest can be
used for standard integration tests, web integration tests with a
mock Servlet environment and web integration tests with an embedded
servlet container. This means that it a replacement for 1.3's
@IntegrationTest and @WebIntegrationTest and allows all
SpringApplication testing to be configured using a common annotation.

The old @IntegrationTest and @WebIntegrationTest along with their
supporting classes have been reinstated to their previous form (while
remaining deprecated). This should ensure that they continue to work
in 1.4 exactly as they did in 1.3 giving users a smooth path to
@SpringApplicationTest.

See gh-5477
9 years ago
Andy Wilkinson fc463afb89 Merge branch '1.3.x' 9 years ago
Andy Wilkinson 1043239de0 Ignore non-JavaExec run task when finding application's main class
Previously, FindMainClassTask would look for a property named main
on any class named run. This was based on the assumption that the
run task would be a JavaExec task (typically provided by the
application plugin). If the run task was not a JavaExec task (more
accurately, if it did not have a main property) this would result in
a build failure due to trying to read a non-existent property.

This commit updates FindMainClassTask to only use the main property
of the run task if the task is a JavaExec task. This guarantees that
the property will exist on the task, and unlike using any property
named main on a task named run, also guarantee that its value will
refer to a Java class with a main method.

Closes gh-5501
9 years ago
Phillip Webb 0829a1bde8 Drop superfluous annotations
Update internal tests to drop annotations that can now
be inferred.

Fixes gh-5470
9 years ago
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
9 years ago
Phillip Webb 2f815a907a Migrate existing tests from deprecated package
Update the existing tests to use the relocated `spring-boot-test`
classes. Restructuring was achieved using the following command:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\
org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/\
org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.IntegrationTest/\
org.springframework.boot.test.context.IntegrationTest/g \
-e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\
org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \
-e s/org.springframework.boot.test.OutputCapture/\
org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationConfiguration/\
org.springframework.boot.test.context.SpringApplicationConfiguration/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/\
org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/\
org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/\
org.springframework.boot.test.web.client.TestRestTemplate/g \
-e s/org.springframework.boot.test.WebIntegrationTest/\
org.springframework.boot.test.context.web.WebIntegrationTest/g {} \;

See gh-5293
9 years ago
Andy Wilkinson d46c9a28d5 Roll back to docker-java 2.x
This reverts 2ecb33f7 and largely reverts 2c619f8d.

docker-java 3.0 was causing a variety of problems and it appears that
we can get things working with Docker Java 2.2.x and Jackson 2.6.
9 years ago
Andy Wilkinson 2ecb33f7b4 Try to fix problems caused by stricter config checking in docker-java 3.0
Previously, the launch script integration tests ran happily on OS X and
on Bamboo’s Linux instances. With the upgrade to docker-java 3.0 that
is no longer the case with the default DockerClientConfig failing on
Bamboo as the default DOCKER_CERT_PATH location does not exist.

This commit updates the client configuration so that it attempts to
build the configuration once in it default configuration and, if this
fails, it tries again without TLS verification. This skips the check
of DOCKER_CERT_PATH’s validity.
9 years ago
Andy Wilkinson 2c619f8d93 Make launch script integration tests compatible with Spring Framework 4.3
Previously, the launch script integration tests used Jackson 2.1 to
align with the requirements of docker-java 2.x. This stopped working
when we upgraded to Spring Framework 4.3 which requires Jackson 2.6+.

This commit updates the launch script integration tests to use
docker-java 3.0.0-RC1 which is compatible with Jackson 2.6.x. An added
benefit is that 3.0 also adds support for copying an archive to a
container, allowing the custom command that performs this function to
be removed.

Closes gh-5278
9 years ago
Spring Buildmaster 225d877ab9 Next Development Version 9 years ago
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 9 years ago
Andy Wilkinson e04a8ff57d Merge branch '1.3.x' 9 years ago
Vedran Pavic 2641fe8f26 Tag Docker images created by launch script integration tests
Closes gh-5168
9 years ago
Phillip Webb 2baad56108 Fix spring-boot-launch-script-tests dependency
Remove the reference to the spring-boot:test jar since it's not
published.

See gh-5184
9 years ago
Phillip Webb 89b7704977 Extract spring-boot-test.jar
Relocate the `org.springframework.boot.test` package from the
`spring-boot.jar` to `spring-boot-test.jar`.

Fixes gh-5184
9 years ago