Yi EungJun 2013-04-17
Insert initial data only if in test mode.
@da484b844d9b0ce53fef68f0cf38f929e9921a7c
app/Global.java
--- app/Global.java
+++ app/Global.java
@@ -17,12 +17,14 @@
 
 public class Global extends GlobalSettings {
     public void onStart(Application app) {
-    	insertDefaults();
+        if (app.isTest()) {
+            insertTestData();
+        }
     }
 
-    private static void insertDefaults() {
+    private static void insertTestData() {
         if (Ebean.find(User.class).findRowCount() == 0) {
-            String initFileName = "initial-data.yml";
+            String initFileName = "initial-data.test.yml";
 
             @SuppressWarnings("unchecked")
             Map<String, List<Object>> all = (Map<String, List<Object>>) Yaml
@@ -69,7 +71,7 @@
 
         }
     }
-    
+
     @Override
     public Handler onRouteRequest(RequestHeader request) {
         // Route here these webdav methods to be used for serving Subversion
conf/initial-data.test.yml (Renamed from conf/initial-data.yml)
--- conf/initial-data.yml
+++ conf/initial-data.test.yml
No changes
Add a comment
List