Woonsan Ko pushed to branch feature/spaplus at cms-community / 
hippo-site-toolkit


Commits:
b1cb72f0 by Woonsan Ko at 2018-03-12T11:31:38-04:00
HSTTWO-4227: fixing unit tests

- - - - -


7 changed files:

- 
client-modules/cms-rest/src/test/resources/org/hippoecm/hst/cmsrest/AbstractCmsRestTest.xml
- 
client-modules/page-composer/src/test/resources/org/hippoecm/hst/pagecomposer/jaxrs/AbstractPageComposerTest.xml
- 
components/core/src/main/java/org/hippoecm/hst/site/request/HstRequestContextImpl.java
- 
components/core/src/test/resources/org/hippoecm/hst/test/AbstractTestConfigurations.xml
- 
components/jaxrs/src/test/resources/org/hippoecm/hst/jaxrs/services/content/TestContentServices.xml
- 
components/restapi/src/test/resources/org/hippoecm/hst/restapi/AbstractRestApiIT.xml
- 
integration/tests/src/test/resources/org/hippoecm/hst/integration/AbstractHstIntegrationTest.xml


Changes:

=====================================
client-modules/cms-rest/src/test/resources/org/hippoecm/hst/cmsrest/AbstractCmsRestTest.xml
=====================================
--- 
a/client-modules/cms-rest/src/test/resources/org/hippoecm/hst/cmsrest/AbstractCmsRestTest.xml
+++ 
b/client-modules/cms-rest/src/test/resources/org/hippoecm/hst/cmsrest/AbstractCmsRestTest.xml
@@ -32,6 +32,7 @@
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-container.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-invoker.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-esi.xml"
 />
+  <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pagemodel.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pipelines.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-request.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-resourcebundle.xml"
 />


=====================================
client-modules/page-composer/src/test/resources/org/hippoecm/hst/pagecomposer/jaxrs/AbstractPageComposerTest.xml
=====================================
--- 
a/client-modules/page-composer/src/test/resources/org/hippoecm/hst/pagecomposer/jaxrs/AbstractPageComposerTest.xml
+++ 
b/client-modules/page-composer/src/test/resources/org/hippoecm/hst/pagecomposer/jaxrs/AbstractPageComposerTest.xml
@@ -32,6 +32,7 @@
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-container.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-invoker.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-esi.xml"
 />
+  <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pagemodel.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pipelines.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-request.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-resourcebundle.xml"
 />


=====================================
components/core/src/main/java/org/hippoecm/hst/site/request/HstRequestContextImpl.java
=====================================
--- 
a/components/core/src/main/java/org/hippoecm/hst/site/request/HstRequestContextImpl.java
+++ 
b/components/core/src/main/java/org/hippoecm/hst/site/request/HstRequestContextImpl.java
@@ -345,27 +345,37 @@ public class HstRequestContextImpl implements 
HstMutableRequestContext {
     @SuppressWarnings("unchecked")
     @Override
     public <T> T getModel(String name) {
+        checkStateValidity();
+
         return (T) getModelsMap().get(name);
     }
 
     @Override
     public Iterable<String> getModelNames() {
+        checkStateValidity();
+
         return Collections.unmodifiableSet(getModelsMap().keySet());
     }
 
     @Override
     public Map<String, Object> getModelsMap() {
+        checkStateValidity();
+
         return unmodifiableModelsMap;
     }
 
     @Override
     public Object setModel(String name, Object model) {
+        checkStateValidity();
+
         setAttribute(name, model);
         return modelsMap.put(name, model);
     }
 
     @Override
     public void removeModel(String name) {
+        checkStateValidity();
+
         if (modelsMap.remove(name) != null) {
             removeAttribute(name);
         }


=====================================
components/core/src/test/resources/org/hippoecm/hst/test/AbstractTestConfigurations.xml
=====================================
--- 
a/components/core/src/test/resources/org/hippoecm/hst/test/AbstractTestConfigurations.xml
+++ 
b/components/core/src/test/resources/org/hippoecm/hst/test/AbstractTestConfigurations.xml
@@ -33,6 +33,7 @@
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-container.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-invoker.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-esi.xml"
 />
+  <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pagemodel.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pipelines.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-request.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-resourcebundle.xml"
 />


=====================================
components/jaxrs/src/test/resources/org/hippoecm/hst/jaxrs/services/content/TestContentServices.xml
=====================================
--- 
a/components/jaxrs/src/test/resources/org/hippoecm/hst/jaxrs/services/content/TestContentServices.xml
+++ 
b/components/jaxrs/src/test/resources/org/hippoecm/hst/jaxrs/services/content/TestContentServices.xml
@@ -42,6 +42,7 @@
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-container.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-invoker.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-esi.xml"
 />
+  <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pagemodel.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pipelines.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-request.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-cache.xml"
 />


=====================================
components/restapi/src/test/resources/org/hippoecm/hst/restapi/AbstractRestApiIT.xml
=====================================
--- 
a/components/restapi/src/test/resources/org/hippoecm/hst/restapi/AbstractRestApiIT.xml
+++ 
b/components/restapi/src/test/resources/org/hippoecm/hst/restapi/AbstractRestApiIT.xml
@@ -33,6 +33,7 @@
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-container.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-invoker.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-esi.xml"
 />
+  <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pagemodel.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pipelines.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-request.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-resourcebundle.xml"
 />


=====================================
integration/tests/src/test/resources/org/hippoecm/hst/integration/AbstractHstIntegrationTest.xml
=====================================
--- 
a/integration/tests/src/test/resources/org/hippoecm/hst/integration/AbstractHstIntegrationTest.xml
+++ 
b/integration/tests/src/test/resources/org/hippoecm/hst/integration/AbstractHstIntegrationTest.xml
@@ -32,6 +32,7 @@
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-container.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-invoker.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-esi.xml"
 />
+  <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pagemodel.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-pipelines.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-request.xml"
 />
   <import 
resource="classpath:/org/hippoecm/hst/site/container/SpringComponentManager-resourcebundle.xml"
 />



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-site-toolkit/commit/b1cb72f069565e3c6ecdc0ce5d27dd3930ee33b9

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-site-toolkit/commit/b1cb72f069565e3c6ecdc0ce5d27dd3930ee33b9
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to