Browse Source

优化tests

zhouhao 8 years ago
parent
commit
2959a0e4cd

+ 5 - 0
.travis.yml

@@ -0,0 +1,5 @@
+language: java
+jdk: oraclejdk8
+sudo: false
+install: false
+script: mvn test

+ 6 - 0
hsweb-system/hsweb-system-config/hsweb-system-config-starter/src/test/java/org/hswebframework/web/starter/config/ConfigTests.java

@@ -9,6 +9,7 @@ import org.hswebframework.web.commons.beans.param.QueryParamBean;
 import org.hswebframework.web.id.IDGenerator;
 import org.hswebframework.web.service.config.ConfigService;
 import org.hswebframework.web.tests.SimpleWebApplicationTests;
+import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +31,11 @@ public class ConfigTests extends SimpleWebApplicationTests {
     @Autowired
     private ConfigService<QueryParamBean> configService;
 
+    @After
+    public void clear() throws SQLException {
+        executor.delete("delete from s_config");
+    }
+
     @Test
     public void testMvc() throws Exception {
         //创建bean

+ 35 - 0
pom.xml

@@ -152,6 +152,18 @@
                 </configuration>
             </plugin>
 
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.17</version>
+                <configuration>
+                    <includes>
+                        <include>
+                            **/org/hswebframework/**/*Tests.java
+                        </include>
+                    </includes>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 
@@ -221,4 +233,27 @@
 
         </dependencies>
     </dependencyManagement>
+
+    <repositories>
+        <repository>
+            <id>hsweb-nexus</id>
+            <name>Nexus Release Repository</name>
+            <url>http://nexus.hsweb.me/content/groups/public/</url>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+    <distributionManagement>
+        <repository>
+            <id>releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://nexus.hsweb.me/content/repositories/releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>snapshots</id>
+            <name>Nexus Snapshot Repository</name>
+            <url>http://nexus.hsweb.me/content/repositories/snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
 </project>