Relocate projects to spring-boot-project

Move projects to better reflect the way that Spring Boot is released.

The following projects are under `spring-boot-project`:

  - `spring-boot`
  - `spring-boot-autoconfigure`
  - `spring-boot-tools`
  - `spring-boot-starters`
  - `spring-boot-actuator`
  - `spring-boot-actuator-autoconfigure`
  - `spring-boot-test`
  - `spring-boot-test-autoconfigure`
  - `spring-boot-devtools`
  - `spring-boot-cli`
  - `spring-boot-docs`

See gh-9316
This commit is contained in:
Phillip Webb
2017-09-19 14:29:46 -07:00
parent 0419d42b7c
commit 0ba4830b4f
4023 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
@Configuration
class App {
@Bean
MyService myService() {
return new MyService()
}
}
class MyService {
String sayWorld() {
return "World!"
}
}

View File

@@ -0,0 +1,4 @@
class Book {
String author
String title
}

View File

@@ -0,0 +1,12 @@
class Book {
String author
String title
}
class BookTests {
@Test
void testBooks() {
Book book = new Book(author: "Tom Clancy", title: "Threat Vector")
assertEquals("Tom Clancy", book.author)
}
}

View File

@@ -0,0 +1,36 @@
class FailingJUnitTests {
@Test
void passingTest() {
assertTrue(true)
}
@Test
void failureByAssertion() {
assertTrue(false)
}
@Test
void failureByException() {
throw new RuntimeException("This should also be handled")
}
}
class FailingSpockTest extends Specification {
def "this should pass"() {
expect:
name.size() == length
where:
name | length
"Spock" | 5
}
def "this should fail on purpose as well"() {
when:
String text = "Greetings"
then:
//throw new RuntimeException("This should fail!")
true == false
}
}

View File

@@ -0,0 +1,22 @@
@SpringBootTest(classes=Application)
class BookTests {
@Autowired
Book book
@Test
void testBooks() {
assertEquals("Tom Clancy", book.author)
}
}
@Configuration
class Application {
@Bean
Book book() {
new Book(author: "Tom Clancy", title: "Threat Vector")
}
}
class Book {
String author
String title
}

View File

@@ -0,0 +1,21 @@
package com.example
@SpringBootApplication
@SpringBootTest(classes=RestTests, webEnvironment=WebEnvironment.RANDOM_PORT)
class RestTests {
@Autowired
TestRestTemplate testRestTemplate;
@Test
void testHome() {
assertEquals('Hello', testRestTemplate.getForObject('/', String))
}
@RestController
static class Application {
@RequestMapping('/')
String hello() { 'Hello' }
}
}

View File

@@ -0,0 +1,12 @@
@SpringBootTest(classes=App)
class AppTests {
@Autowired
MyService myService
@Test
void test() {
assertNotNull(myService)
}
}

View File

@@ -0,0 +1,31 @@
@Grab("spring-boot-starter-artemis")
@Grab("artemis-jms-server")
import java.util.concurrent.CountDownLatch
@Log
@Configuration
@EnableJms
class JmsExample implements CommandLineRunner {
private CountDownLatch latch = new CountDownLatch(1)
@Autowired
JmsTemplate jmsTemplate
void run(String... args) {
def messageCreator = { session ->
session.createObjectMessage("Greetings from Spring Boot via Artemis")
} as MessageCreator
log.info "Sending JMS message..."
jmsTemplate.send("spring-boot", messageCreator)
log.info "Send JMS message, waiting..."
latch.await()
}
@JmsListener(destination = 'spring-boot')
def receive(String message) {
log.info "Received ${message}"
latch.countDown()
}
}

View File

@@ -0,0 +1,12 @@
class HelloSpock extends Specification {
def "length of Spock's and his friends' names"() {
expect:
name.size() == length
where:
name | length
"Spock" | 5
"Kirk" | 4
"Scotty" | 6
}
}

View File

@@ -0,0 +1,7 @@
class BookTests {
@Test
void testBooks() {
Book book = new Book(author: "Tom Clancy", title: "Threat Vector")
assertEquals("Tom Clancy", book.author)
}
}