From fe7b110577a930c897a24857bea3bf37e0cd507d Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Tue, 10 Nov 2015 09:47:33 +1300 Subject: [PATCH] #457 - When ebean.properties does not exist do not log error message --- .../avaje/ebean/config/PropertyMapLoader.java | 13 ++-- .../avaje/ebean/config/PropertyMapTest.java | 65 +------------------ 2 files changed, 7 insertions(+), 71 deletions(-) diff --git a/src/main/java/com/avaje/ebean/config/PropertyMapLoader.java b/src/main/java/com/avaje/ebean/config/PropertyMapLoader.java index 6f5e3f201..822a8d078 100644 --- a/src/main/java/com/avaje/ebean/config/PropertyMapLoader.java +++ b/src/main/java/com/avaje/ebean/config/PropertyMapLoader.java @@ -18,7 +18,7 @@ final class PropertyMapLoader { * Load the test-ebean.properties. */ public static PropertyMap loadTestProperties() { - return load(null, "test-ebean.properties", false); + return load(null, "test-ebean.properties"); } /** @@ -36,10 +36,10 @@ final class PropertyMapLoader { } } - PropertyMap map = load(null, fileName, true); + PropertyMap map = load(null, fileName); if (loadTestProperties) { // load test properties if present in classpath - load(map, "test-ebean.properties", false); + load(map, "test-ebean.properties"); } return map; } @@ -52,13 +52,10 @@ final class PropertyMapLoader { * @param fileName * the name of the properties file to load. */ - public static PropertyMap load(PropertyMap p, String fileName, boolean errorOnNull) { + public static PropertyMap load(PropertyMap p, String fileName) { InputStream is = findInputStream(fileName); if (is == null) { - if (errorOnNull) { - logger.error(fileName + " not found"); - } return p; } else { return load(p, is); @@ -66,7 +63,7 @@ final class PropertyMapLoader { } /** - * Load the inputstream returning the property map. + * Load the InputStream returning the property map. * * @param p * an existing property map to load into. diff --git a/src/test/java/com/avaje/ebean/config/PropertyMapTest.java b/src/test/java/com/avaje/ebean/config/PropertyMapTest.java index f94d9a029..78ff20143 100644 --- a/src/test/java/com/avaje/ebean/config/PropertyMapTest.java +++ b/src/test/java/com/avaje/ebean/config/PropertyMapTest.java @@ -2,24 +2,14 @@ package com.avaje.ebean.config; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; public class PropertyMapTest { @Test public void testDefaultProperties() throws Exception { - } - - - @Test - public void testAsProperties() throws Exception { - - } - - @Test - public void testEvaluateProperties() throws Exception { - + PropertyMap.defaultProperties(); } @Test @@ -28,57 +18,6 @@ public class PropertyMapTest { String home = System.getenv("HOME"); PropertyMap map = new PropertyMap(); assertEquals(home, map.eval("${HOME}")); - - } - @Test - public void testGetBoolean() throws Exception { - - } - - @Test - public void testGetInt() throws Exception { - - } - - @Test - public void testGetLong() throws Exception { - - } - - @Test - public void testGet() throws Exception { - - } - - @Test - public void testGet1() throws Exception { - - } - - @Test - public void testPutEvalAll() throws Exception { - - } - - @Test - public void testPutEval() throws Exception { - - } - - @Test - public void testPut() throws Exception { - - } - - @Test - public void testRemove() throws Exception { - - } - - @Test - public void testEntrySet() throws Exception { - - } } \ No newline at end of file