Ate Douma pushed to branch master at cms-community / hippo-essentials

Commits:
d99575a2 by Ate Douma at 2017-07-04T11:17:07+02:00
ESSENTIALS-1084 Remove usage and dependency on root node SNS support 
(unit-tests only)

- - - - -
10e1b392 by Ate Douma at 2017-07-04T11:35:41+02:00
ESSENTIALS-1085 disable usage of XmlInstruction.setOverwrite(true)

- - - - -


3 changed files:

- 
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstruction.java
- 
plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstructionTest.java
- 
plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/utils/CndUtilsTest.java


Changes:

=====================================
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstruction.java
=====================================
--- 
a/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstruction.java
+++ 
b/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstruction.java
@@ -230,7 +230,16 @@ public class XmlInstruction extends PluginInstruction {
         return overwrite;
     }
 
-    public void setOverwrite(final boolean overwrite) {
+    /**
+     * Setting overwrite=true is not yet supported!
+     * Invoking this method with value parameter override=true will result in 
an UnsupportedOperationException been thrown
+     * @throws UnsupportedOperationException when invoked with overwrite=true
+     * @param overwrite
+     */
+    public void setOverwrite(final boolean overwrite) throws 
UnsupportedOperationException {
+        if (overwrite) {
+            throw new UnsupportedOperationException("Setting override=true for 
XmlInstruction is currently not supported");
+        }
         this.overwrite = overwrite;
     }
 


=====================================
plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstructionTest.java
=====================================
--- 
a/plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstructionTest.java
+++ 
b/plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/instruction/XmlInstructionTest.java
@@ -62,12 +62,13 @@ public class XmlInstructionTest extends BaseRepositoryTest {
         status = executor.execute(set, getContext());
         assertTrue("Expected SKIPPED but got: " + status, status == 
InstructionStatus.SKIPPED);
         //############################################
-        // OVERRIDE TRUE TEST
+        // OVERRIDE TRUE TEST: NOT SUPPORTED YET
         //############################################
+        /*
         addNodeInstruction.setOverwrite(true);
         status = executor.execute(set, getContext());
         assertTrue("Expected SUCCESS but got: " + status, status == 
InstructionStatus.SUCCESS);
-
+        */
 
         //############################################
         // DELETE


=====================================
plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/utils/CndUtilsTest.java
=====================================
--- 
a/plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/utils/CndUtilsTest.java
+++ 
b/plugin-sdk/implementation/src/test/java/org/onehippo/cms7/essentials/dashboard/utils/CndUtilsTest.java
@@ -41,8 +41,10 @@ public class CndUtilsTest extends BaseRepositoryTest {
     public void testRegisterNamespaceUri() throws Exception {
 
         Session session = getSession();
-        session.getRootNode().addNode(HippoNodeType.NAMESPACES_PATH);
-        session.save();
+        if (!session.nodeExists("/"+HippoNodeType.NAMESPACES_PATH)) {
+            session.getRootNode().addNode(HippoNodeType.NAMESPACES_PATH);
+            session.save();
+        }
         CndUtils.registerNamespace(getContext(), TEST_PREFIX, TEST_URI);
         assertTrue("CndUtils.registerNamespaceUri", true);
         CndUtils.createHippoNamespace(getContext(), TEST_PREFIX);



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-essentials/compare/746f0de6d38a90f620482c1b20b80be62b29420c...10e1b392405bb8b1cb46a06c1ed7aa4d7d7376df
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to