Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5cb8e410
Commit
5cb8e410
authored
Mar 18, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish docs
Minoir polish for wrapping at 90 and tabs instead of spaces.
parent
5ce1bdfb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
64 deletions
+60
-64
build-tool-plugins.adoc
spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc
+25
-24
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+12
-13
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+23
-27
No files found.
spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc
View file @
5cb8e410
...
...
@@ -125,8 +125,8 @@ To build and run a project artifact, you can type the following:
$
java
-
jar
target
/
mymodule
-
0.0.1
-
SNAPSHOT
.
jar
----
To
build
a
war
file
that
is
both
executable
and
deployable
into
an
external
container
you
need
to
mark
the
embedded
container
dependencies
as
"provided"
,
e
.
g
.
To
build
a
war
file
that
is
both
executable
and
deployable
into
an
external
container
you
need
to
mark
the
embedded
container
dependencies
as
``
provided
''
,
e
.
g
:
[
source
,
xml
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
----
...
...
@@ -152,6 +152,7 @@ you need to mark the embedded container dependencies as "provided", e.g.
----
[[
build
-
tool
-
plugins
-
maven
-
packaging
-
configuration
]]
===
Repackage
configuration
The
following
configuration
options
are
available
for
the
`
spring
-
boot
:
repackage
`
goal
:
...
...
@@ -374,32 +375,32 @@ To build and run a project artifact, you can type the following:
To
build
a
war
file
that
is
both
executable
and
deployable
into
an
external
container
,
you
need
to
mark
the
embedded
container
dependencies
as
belonging
to
a
configuration
named
"providedRuntime"
,
e
.
g
.
named
"providedRuntime"
,
e
.
g
:
[
source
,
groovy
,
indent
=
0
,
subs
=
"verbatim,attributes"
]
----
...
apply
plugin
:
'war'
...
apply
plugin
:
'war'
war
{
war
{
baseName
=
'myapp'
version
=
'0.5.0'
}
}
repositories
{
repositories
{
mavenCentral
()
maven
{
url
"http://repo.spring.io/libs-snapshot"
}
}
}
configurations
{
configurations
{
providedRuntime
}
}
dependencies
{
dependencies
{
compile
(
"org.springframework.boot:spring-boot-starter-web"
)
providedRuntime
(
"org.springframework.boot:spring-boot-starter-tomcat"
)
...
}
}
----
...
...
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
5cb8e410
...
...
@@ -355,11 +355,10 @@ that and be sure that it has initialized is to add a `@Bean` of type
`ApplicationListener<EmbeddedServletContainerInitializedEvent>` and pull the container
out of the event when it is published.
A really useful thing to do in is to autowire the
`EmbeddedWebApplicationContext` into a test case and use it to
discover the port that the app is running on. In that way you can use
a test profile that chooses a random port (`server.port=0`) and make
your test suite independent of its environment. Example:
A really useful thing to do in is to autowire the `EmbeddedWebApplicationContext` into a
test case and use it to discover the port that the app is running on. In that way you can
use a test profile that chooses a random port (`server.port=0`) and make your test suite
independent of its environment. Example:
[source,java,indent=0,subs="verbatim,quotes,attributes"]
----
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
5cb8e410
...
...
@@ -1430,18 +1430,16 @@ For example:
}
----
TIP: The context loader guesses whether you want to test a web application or not (e.g.
with
`MockMVC`) by looking for the `@WebAppConfiguration` annotation. (`MockMVC` and
TIP: The context loader guesses whether you want to test a web application or not (e.g.
with
`MockMVC`) by looking for the `@WebAppConfiguration` annotation. (`MockMVC` and
`@WebAppConfiguration` are part of `spring-test`).
If you want a web application to start up and listen on its normal
port, so you can test it with HTTP (e.g. using `RestTemplate`)
annotate your test class (or one of its superclasses)
`@IntegrationTest`. This can be very useful because it means you can
test the full stack of your application, but also inject its
components into the test class and use them to assert the internal
state of the application after an HTTP interaction. Example:
If you want a web application to start up and listen on its normal port, so you can test
it with HTTP (e.g. using `RestTemplate`), annotate your test class (or one of its
superclasses) with `@IntegrationTest`. This can be very useful because it means you can
test the full stack of your application, but also inject its components into the test
class and use them to assert the internal state of the application after an HTTP
interaction. For Example:
[source,java,indent=0,subs="verbatim,quotes,attributes"]
----
...
...
@@ -1461,7 +1459,6 @@ state of the application after an HTTP interaction. Example:
}
----
[[boot-features-test-utilities]]
=== Test utilities
A few test utility classes are packaged as part of `spring-boot` that are generally
...
...
@@ -1528,16 +1525,14 @@ public class MyTest {
[[boot-features-rest-templates-test-utility]]
==== RestTemplates
`RestTemplates` is a static convenience factory for instances of
`RestTemplate` that are useful in integration tests. You can get a
vanilla template or one that sends Basic HTTP authentication (with a
username and password). And in either case the template will behave in
a friendly way for testing, not following redirects (so you can assert
the response location), ignoring cookies (so the template is
stateless), and not throwing exceptions on server-side errors. It is
recommended, but not mandatory, to use Apache HTTP Client (version
4.3.2 or better), and if you have that on your classpath the
`RestTemplates` will respond by configuring the client appropriately.
`RestTemplates` is a static convenience factory for instances of `RestTemplate` that are
useful in integration tests. You can get a vanilla template or one that sends Basic HTTP
authentication (with a username and password). And in either case the template will behave
in a friendly way for testing, not following redirects (so you can assert the response
location), ignoring cookies (so the template is stateless), and not throwing exceptions
on server-side errors. It is recommended, but not mandatory, to use Apache HTTP Client
(version 4.3.2 or better), and if you have that on your classpath the `RestTemplates` will
respond by configuring the client appropriately.
[source,java,indent=0]
----
...
...
@@ -1555,6 +1550,7 @@ public class MyTest {
----
[[boot-features-developing-auto-configuration]]
== Developing auto-configuration and using conditions
If you work in a company that develops shared libraries, or if you work on an open-source
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment