freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [5/5] incubator-freemarker git commit: (Test error message quality fix)
Date Tue, 16 May 2017 17:40:37 GMT
(Test error message quality fix)


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/c448bcd8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/c448bcd8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/c448bcd8

Branch: refs/heads/3
Commit: c448bcd873ec7e0480bf52def10f9c92c9058457
Parents: abfcac8
Author: ddekany <ddekany@apache.org>
Authored: Tue May 16 19:40:22 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Tue May 16 19:40:22 2017 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/freemarker/test/TemplateTest.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/c448bcd8/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTest.java
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTest.java
b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTest.java
index 2119734..ca40b09 100644
--- a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTest.java
+++ b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTest.java
@@ -22,6 +22,7 @@ package org.apache.freemarker.test;
 import static org.hamcrest.Matchers.*;
 import static org.junit.Assert.*;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringWriter;
@@ -228,7 +229,12 @@ public abstract class TemplateTest {
 
     protected Properties loadPropertiesFile(String name) throws IOException {
         Properties props = new Properties();
-        InputStream in = getClass().getResourceAsStream(name);
+        Class<? extends TemplateTest> baseClass = getClass();
+        InputStream in = baseClass.getResourceAsStream(name);
+        if (in == null) {
+            throw new FileNotFoundException(
+                    "Classpath resource not found: baseClass=" + baseClass.getName() + ",
name=" + name);
+        }
         try {
             props.load(in);
         } finally {


Mime
View raw message