You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2019/10/12 12:08:44 UTC
[jspwiki] 03/05: new static methods to build TestEngine instances
which do not throw checked Exceptions
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit ac81885fb22a904b9b69188024b0a236a51cec31
Author: juanpablo <ju...@apache.org>
AuthorDate: Sat Oct 12 14:06:22 2019 +0200
new static methods to build TestEngine instances which do not throw checked Exceptions
---
jspwiki-main/src/test/java/org/apache/wiki/TestEngine.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/jspwiki-main/src/test/java/org/apache/wiki/TestEngine.java b/jspwiki-main/src/test/java/org/apache/wiki/TestEngine.java
index 71de8c0..f9cc932 100644
--- a/jspwiki-main/src/test/java/org/apache/wiki/TestEngine.java
+++ b/jspwiki-main/src/test/java/org/apache/wiki/TestEngine.java
@@ -118,6 +118,18 @@ public class TestEngine extends WikiEngine
return m_janneWikiSession;
}
+ public static TestEngine build() {
+ return build( getTestProperties() );
+ }
+
+ public static TestEngine build( final Properties props ) {
+ try {
+ return new TestEngine( props );
+ } catch( WikiException we ) {
+ throw new UnsupportedOperationException( "Unable to build TestEngine: " + we.getMessage(), we );
+ }
+ }
+
public TestEngine() throws WikiException {
this( getTestProperties() );
}