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
3adfdd34
Commit
3adfdd34
authored
Oct 09, 2013
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use simplified @Grab where possible
parent
1dd0cca2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
46 deletions
+13
-46
actuator.groovy
spring-boot-cli/samples/actuator.groovy
+1
-1
device.groovy
spring-boot-cli/samples/device.groovy
+5
-5
job.groovy
spring-boot-cli/samples/job.groovy
+1
-1
simpleGrab.groovy
spring-boot-cli/samples/simpleGrab.groovy
+0
-24
tx.groovy
spring-boot-cli/samples/tx.groovy
+1
-1
ui.groovy
spring-boot-cli/samples/ui.groovy
+1
-3
SampleIntegrationTests.java
.../org/springframework/boot/cli/SampleIntegrationTests.java
+3
-10
pom.xml
spring-boot-dependencies/pom.xml
+1
-1
No files found.
spring-boot-cli/samples/actuator.groovy
View file @
3adfdd34
package
org.test
@Grab
(
"
org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT
"
)
@Grab
(
"
spring-boot-starter-actuator
"
)
@Controller
class
SampleController
{
...
...
spring-boot-cli/samples/device.groovy
View file @
3adfdd34
...
...
@@ -6,15 +6,15 @@ class Example {
@RequestMapping
(
"/"
)
@ResponseBody
public
String
helloWorld
(
Device
device
)
{
String
helloWorld
(
Device
device
)
{
if
(
device
.
isNormal
())
{
return
"Hello Normal Device!"
"Hello Normal Device!"
}
else
if
(
device
.
isMobile
())
{
return
"Hello Mobile Device!"
"Hello Mobile Device!"
}
else
if
(
device
.
isTablet
())
{
return
"Hello Tablet Device!"
"Hello Tablet Device!"
}
else
{
return
"Hello Unknown Device!"
"Hello Unknown Device!"
}
}
...
...
spring-boot-cli/samples/job.groovy
View file @
3adfdd34
package
org.test
@Grab
(
"
org.hsqldb:hsqldb-j5:2.0.0
"
)
@Grab
(
"
hsqldb
"
)
@Configuration
@EnableBatchProcessing
class
JobConfig
{
...
...
spring-boot-cli/samples/simpleGrab.groovy
deleted
100644 → 0
View file @
1dd0cca2
package
org.test
@Grab
(
'spring-boot-starter-web'
)
@Component
class
Example
implements
CommandLineRunner
{
@Autowired
private
MyService
myService
void
run
(
String
...
args
)
{
print
"Hello "
+
this
.
myService
.
sayWorld
()
}
}
@Service
class
MyService
{
String
sayWorld
()
{
return
"World!"
}
}
spring-boot-cli/samples/tx.groovy
View file @
3adfdd34
package
org.test
@Grab
(
"
org.hsqldb:hsqldb:2.2.9
"
)
@Grab
(
"
hsqldb
"
)
@Configuration
@EnableTransactionManagement
...
...
spring-boot-cli/samples/ui.groovy
View file @
3adfdd34
package
app
import
groovy.util.logging.Log
@Grab
(
"org.thymeleaf:thymeleaf-spring3:2.0.16"
)
@Grab
(
"thymeleaf-spring3"
)
@Controller
class
Example
{
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java
View file @
3adfdd34
...
...
@@ -16,9 +16,6 @@
package
org
.
springframework
.
boot
.
cli
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.io.File
;
import
java.net.URL
;
import
java.util.concurrent.Callable
;
...
...
@@ -37,6 +34,9 @@ import org.springframework.boot.OutputCapture;
import
org.springframework.boot.cli.command.CleanCommand
;
import
org.springframework.boot.cli.command.RunCommand
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
* Integration tests to exercise the samples.
*
...
...
@@ -95,13 +95,6 @@ public class SampleIntegrationTests {
assertTrue
(
"Wrong output: "
+
output
,
output
.
contains
(
"Hello World"
));
}
@Test
public
void
simpleGrabSample
()
throws
Exception
{
start
(
"samples/simpleGrab.groovy"
);
String
output
=
this
.
outputCapture
.
getOutputAndRelease
();
assertTrue
(
"Wrong output: "
+
output
,
output
.
contains
(
"Hello World"
));
}
@Test
public
void
templateSample
()
throws
Exception
{
start
(
"samples/template.groovy"
);
...
...
spring-boot-dependencies/pom.xml
View file @
3adfdd34
...
...
@@ -33,7 +33,7 @@
<slf4j.version>
1.7.5
</slf4j.version>
<snakeyaml.version>
1.12
</snakeyaml.version>
<spock.version>
0.7-groovy-2.0
</spock.version>
<spring.version>
4.0.0.
M3
</spring.version>
<spring.version>
4.0.0.
BUILD-SNAPSHOT
</spring.version>
<spring-security.version>
3.2.0.RC1
</spring-security.version>
<spring-integration.version>
2.2.4.RELEASE
</spring-integration.version>
<spring-integration-groovydsl.version>
1.0.0.M1
</spring-integration-groovydsl.version>
...
...
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