From 79827ec4c8245507e4ecbdda7a855d4bacafbd66 Mon Sep 17 00:00:00 2001 From: liqiangqiang Date: Mon, 6 Feb 2017 15:20:25 +0800 Subject: [PATCH] first commit --- README | 0 pom.xml | 18 +++++++++++ springboot-helloworld/pom.xml | 32 +++++++++++++++++++ .../org/spring/springboot/Application.java | 20 ++++++++++++ .../web/HelloWorldControllerTest.java | 18 +++++++++++ 5 files changed, 88 insertions(+) create mode 100644 README create mode 100644 pom.xml create mode 100755 springboot-helloworld/pom.xml create mode 100644 springboot-helloworld/src/main/java/org/spring/springboot/Application.java create mode 100644 springboot-helloworld/src/test/java/org/spring/springboot/web/HelloWorldControllerTest.java diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7aa5304 --- /dev/null +++ b/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + springdream + springboot-learning-example + 0.0.1-SNAPSHOT + + springboot + springboot + springboot :: Examples + pom + + + springboot-helloworld + + diff --git a/springboot-helloworld/pom.xml b/springboot-helloworld/pom.xml new file mode 100755 index 0000000..84f6fb8 --- /dev/null +++ b/springboot-helloworld/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + springboot + springboot-helloworld + 0.0.1-SNAPSHOT + springboot-helloworld :: HelloWorld Demo + + + + org.springframework.boot + spring-boot-starter-parent + 1.3.3.RELEASE + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + junit + junit + 4.12 + + + diff --git a/springboot-helloworld/src/main/java/org/spring/springboot/Application.java b/springboot-helloworld/src/main/java/org/spring/springboot/Application.java new file mode 100644 index 0000000..bc792ef --- /dev/null +++ b/springboot-helloworld/src/main/java/org/spring/springboot/Application.java @@ -0,0 +1,20 @@ +package org.spring.springboot; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Spring Boot应用启动类 + * + * Created by bysocket on 16/4/26. + */ +// Spring Boot 应用的标识 +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + // 程序启动入口 + // 启动嵌入式的Tomcat并初始化Spring环境及其各Spring组件 + SpringApplication.run(Application.class,args); + } +} diff --git a/springboot-helloworld/src/test/java/org/spring/springboot/web/HelloWorldControllerTest.java b/springboot-helloworld/src/test/java/org/spring/springboot/web/HelloWorldControllerTest.java new file mode 100644 index 0000000..559364b --- /dev/null +++ b/springboot-helloworld/src/test/java/org/spring/springboot/web/HelloWorldControllerTest.java @@ -0,0 +1,18 @@ +package org.spring.springboot.web; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * Spring Boot HelloWorldController 测试 - {@link HelloWorldController} + * + * Created by bysocket on 16/4/26. + */ +public class HelloWorldControllerTest { + + @Test + public void testSayHello() { + assertEquals("Hello,World!",new HelloWorldController().sayHello()); + } +}