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
2ed24ddc
Commit
2ed24ddc
authored
Aug 21, 2014
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.1.x'
parents
0e7757de
9717b7d8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
161 additions
and
4 deletions
+161
-4
MultiProjectRepackagingTests.java
...ngframework/boot/gradle/MultiProjectRepackagingTests.java
+1
-4
ProjectCreator.java
.../java/org/springframework/boot/gradle/ProjectCreator.java
+2
-0
SpringLoadedTests.java
...va/org/springframework/boot/gradle/SpringLoadedTests.java
+98
-0
foo.jar
...test/resources/multi-project-repackage/common/lib/foo.jar
+0
-0
build.gradle
...ts/src/test/resources/spring-loaded-jvm-args/build.gradle
+30
-0
Application.java
...pring-loaded-jvm-args/src/main/java/test/Application.java
+25
-0
AgentTasksEnhancer.java
...springframework/boot/gradle/agent/AgentTasksEnhancer.java
+5
-0
No files found.
spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/MultiProjectRepackagingTests.java
View file @
2ed24ddc
...
@@ -24,7 +24,6 @@ import org.gradle.tooling.ProjectConnection;
...
@@ -24,7 +24,6 @@ import org.gradle.tooling.ProjectConnection;
import
org.junit.BeforeClass
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.dependency.tools.ManagedDependencies
;
import
org.springframework.boot.dependency.tools.ManagedDependencies
;
import
org.springframework.util.FileCopyUtils
;
import
static
org
.
hamcrest
.
Matchers
.
notNullValue
;
import
static
org
.
hamcrest
.
Matchers
.
notNullValue
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertThat
;
...
@@ -48,10 +47,8 @@ public class MultiProjectRepackagingTests {
...
@@ -48,10 +47,8 @@ public class MultiProjectRepackagingTests {
@Test
@Test
public
void
repackageWithTransitiveFileDependency
()
throws
Exception
{
public
void
repackageWithTransitiveFileDependency
()
throws
Exception
{
FileCopyUtils
.
copy
(
new
File
(
"src/test/resources/foo.jar"
),
new
File
(
"target/multi-project-repackage/foo.jar"
));
project
.
newBuild
().
forTasks
(
"clean"
,
"build"
)
project
.
newBuild
().
forTasks
(
"clean"
,
"build"
)
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
,
"-Prepackage=true"
).
run
();
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
,
"-Prepackage=true"
).
run
();
File
buildLibs
=
new
File
(
"target/multi-project-repackage/main/build/libs"
);
File
buildLibs
=
new
File
(
"target/multi-project-repackage/main/build/libs"
);
JarFile
jarFile
=
new
JarFile
(
new
File
(
buildLibs
,
"main.jar"
));
JarFile
jarFile
=
new
JarFile
(
new
File
(
buildLibs
,
"main.jar"
));
assertThat
(
jarFile
.
getEntry
(
"lib/commons-logging-1.1.3.jar"
),
notNullValue
());
assertThat
(
jarFile
.
getEntry
(
"lib/commons-logging-1.1.3.jar"
),
notNullValue
());
...
...
spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/ProjectCreator.java
View file @
2ed24ddc
...
@@ -46,6 +46,8 @@ public class ProjectCreator {
...
@@ -46,6 +46,8 @@ public class ProjectCreator {
}
}
GradleConnector
gradleConnector
=
GradleConnector
.
newConnector
();
GradleConnector
gradleConnector
=
GradleConnector
.
newConnector
();
gradleConnector
.
useGradleVersion
(
"1.12"
);
((
DefaultGradleConnector
)
gradleConnector
).
embedded
(
true
);
((
DefaultGradleConnector
)
gradleConnector
).
embedded
(
true
);
return
gradleConnector
.
forProjectDirectory
(
projectDirectory
).
connect
();
return
gradleConnector
.
forProjectDirectory
(
projectDirectory
).
connect
();
}
}
...
...
spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/SpringLoadedTests.java
0 → 100644
View file @
2ed24ddc
/*
* Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
gradle
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.gradle.tooling.ProjectConnection
;
import
org.junit.Test
;
import
org.springframework.boot.dependency.tools.ManagedDependencies
;
import
static
org
.
junit
.
Assert
.
fail
;
/**
* Integration tests for the Gradle plugin's Spring Loaded support
*
* @author Andy Wilkinson
*/
public
class
SpringLoadedTests
{
private
static
final
String
BOOT_VERSION
=
ManagedDependencies
.
get
()
.
find
(
"spring-boot"
).
getVersion
();
private
static
final
String
SPRING_LOADED_VERSION
=
ManagedDependencies
.
get
()
.
find
(
"springloaded"
).
getVersion
();
@Test
public
void
defaultJvmArgsArePreservedWhenLoadedAgentIsConfigured
()
throws
IOException
{
ProjectConnection
project
=
new
ProjectCreator
()
.
createProject
(
"spring-loaded-jvm-args"
);
project
.
newBuild
()
.
forTasks
(
"bootRun"
)
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
,
"-PspringLoadedVersion="
+
SPRING_LOADED_VERSION
,
"--stacktrace"
)
.
run
();
List
<
String
>
output
=
getOutput
();
assertOutputContains
(
"-DSOME_ARG=someValue"
,
output
);
assertOutputContains
(
"-Xverify:none"
,
output
);
assertOutputMatches
(
"-javaagent:.*springloaded-"
+
SPRING_LOADED_VERSION
+
".jar"
,
output
);
}
private
List
<
String
>
getOutput
()
throws
IOException
{
BufferedReader
reader
=
new
BufferedReader
(
new
FileReader
(
new
File
(
"target/spring-loaded-jvm-args/build/output.txt"
)));
try
{
List
<
String
>
lines
=
new
ArrayList
<
String
>();
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
lines
.
add
(
line
);
}
return
lines
;
}
finally
{
reader
.
close
();
}
}
private
void
assertOutputContains
(
String
requiredOutput
,
List
<
String
>
actualOutput
)
{
for
(
String
line
:
actualOutput
)
{
if
(
line
.
equals
(
requiredOutput
))
{
return
;
}
}
fail
(
"Required output '"
+
requiredOutput
+
"' not found in "
+
actualOutput
);
}
private
void
assertOutputMatches
(
String
requiredPattern
,
List
<
String
>
actualOutput
)
{
for
(
String
line
:
actualOutput
)
{
if
(
line
.
matches
(
requiredPattern
))
{
return
;
}
}
fail
(
"Required pattern '"
+
requiredPattern
+
"' not matched in "
+
actualOutput
);
}
}
spring-boot-integration-tests/src/test/resources/multi-project-repackage/common/lib/foo.jar
0 → 100644
View file @
2ed24ddc
File added
spring-boot-integration-tests/src/test/resources/spring-loaded-jvm-args/build.gradle
0 → 100644
View file @
2ed24ddc
buildscript
{
repositories
{
mavenLocal
()
mavenCentral
()
}
dependencies
{
classpath
(
"org.springframework.boot:spring-boot-gradle-plugin:${project.bootVersion}"
)
classpath
(
"org.springframework:springloaded:${project.springLoadedVersion}"
)
}
}
apply
plugin:
'java'
apply
plugin:
'spring-boot'
repositories
{
mavenLocal
()
mavenCentral
()
}
dependencies
{
compile
(
"org.springframework.boot:spring-boot-starter"
)
}
applicationDefaultJvmArgs
=
[
"-DSOME_ARG=someValue"
]
jar
{
baseName
=
'spring-loaded-jvm-args'
}
\ No newline at end of file
spring-boot-integration-tests/src/test/resources/spring-loaded-jvm-args/src/main/java/test/Application.java
0 → 100644
View file @
2ed24ddc
package
test
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.PrintWriter
;
import
java.lang.management.ManagementFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.Assert
;
public
class
Application
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
PrintWriter
writer
=
new
PrintWriter
(
new
FileWriter
(
new
File
(
"build/output.txt"
)));
for
(
String
argument:
ManagementFactory
.
getRuntimeMXBean
().
getInputArguments
())
{
writer
.
println
(
argument
);
}
writer
.
close
();
}
}
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/agent/AgentTasksEnhancer.java
View file @
2ed24ddc
...
@@ -108,6 +108,11 @@ public class AgentTasksEnhancer implements Action<Project> {
...
@@ -108,6 +108,11 @@ public class AgentTasksEnhancer implements Action<Project> {
if
(
this
.
noverify
!=
null
&&
this
.
noverify
)
{
if
(
this
.
noverify
!=
null
&&
this
.
noverify
)
{
exec
.
jvmArgs
(
"-noverify"
);
exec
.
jvmArgs
(
"-noverify"
);
}
}
Iterable
<?>
defaultJvmArgs
=
exec
.
getConventionMapping
().
getConventionValue
(
null
,
"jvmArgs"
,
false
);
if
(
defaultJvmArgs
!=
null
)
{
exec
.
jvmArgs
(
defaultJvmArgs
);
}
}
}
}
}
...
...
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