deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject deltaspike git commit: DELTASPIKE-773 improved support for simple test environments
Date Sun, 09 Nov 2014 19:12:49 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 09c1c0b8d -> e29829306


DELTASPIKE-773 improved support for simple test environments


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

Branch: refs/heads/master
Commit: e29829306980c26c70c9eea302642f7673185b0c
Parents: 09c1c0b
Author: gpetracek <gpetracek@apache.org>
Authored: Sun Nov 9 20:06:39 2014 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Sun Nov 9 20:09:40 2014 +0100

----------------------------------------------------------------------
 .../apache/deltaspike/jsf/api/config/JsfModuleConfig.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e2982930/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
index c6436a2..e777227 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
@@ -140,7 +140,13 @@ public class JsfModuleConfig implements DeltaSpikeConfig
             return false;
         }
 
-        String configuredWindowHandling = FacesContext.getCurrentInstance().getExternalContext()
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+
+        if (facesContext == null) // can happen in case of a very simple test-setup without
a mocked jsf container
+        {
+            return false;
+        }
+        String configuredWindowHandling = facesContext.getExternalContext()
                                 .getInitParameter(CLIENT_WINDOW_CONFIG_KEY);
 
         return !(configuredWindowHandling == null || "none".equalsIgnoreCase(configuredWindowHandling.trim()));


Mime
View raw message