You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2019/05/22 15:14:08 UTC
[sling-org-apache-sling-testing-sling-mock-oak] branch feature/SLING-8428-mixin-linkedfile updated: SLING-8428 apply additional patch provided by Dominique Jäggi
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-8428-mixin-linkedfile
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock-oak.git
The following commit(s) were added to refs/heads/feature/SLING-8428-mixin-linkedfile by this push:
new 6c2ad04 SLING-8428 apply additional patch provided by Dominique Jäggi
6c2ad04 is described below
commit 6c2ad0405ec97a1f96ad0e96af5c7cf9d6cd463a
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Wed May 22 15:55:27 2019 +0200
SLING-8428 apply additional patch provided by Dominique Jäggi
---
.../oak/contentimport/ContentLoaderJsonTest.java | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
index 3a00285..ada741f 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/oak/contentimport/ContentLoaderJsonTest.java
@@ -26,6 +26,8 @@ import java.util.Arrays;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
@@ -68,7 +70,7 @@ public class ContentLoaderJsonTest extends AbstractContentLoaderJsonTest {
Resource resource = context.resourceResolver().getResource(path + "/sample/en/jcr:content/par/image/ntLinkedFileTargetWithMixin/" + JcrConstants.JCR_CONTENT);
ValueMap props = ResourceUtil.getValueMap(resource);
- assertMixinNodeType(resource, "mix:referenceable");
+ assertMixinNodeType(resource, JcrConstants.MIX_REFERENCEABLE);
assertNotNull(props.get(JcrConstants.JCR_UUID));
}
@@ -84,23 +86,11 @@ public class ContentLoaderJsonTest extends AbstractContentLoaderJsonTest {
}
private void assertMixinNodeType(final Resource resource, final String mixinNodeType) throws RepositoryException {
- ArrayList<NodeType> mixinNodeTypes = Lists.newArrayList();
Node node = resource.adaptTo(Node.class);
if (node != null) {
- mixinNodeTypes.addAll(Arrays.asList(node.getMixinNodeTypes()));
+ assertTrue(node.isNodeType(mixinNodeType));
} else {
- ValueMap props = ResourceUtil.getValueMap(resource);
- mixinNodeTypes.addAll(Arrays.asList((NodeType[]) props.get(JcrConstants.JCR_MIXINTYPES)));
+ fail();
}
-
- Object hit = CollectionUtils.find(mixinNodeTypes, new Predicate() {
- @Override
- public boolean evaluate(Object o) {
- NodeType nodeType = (NodeType) o;
- return nodeType.getName().equals(mixinNodeType);
- }
- });
- assertNotNull(hit);
}
-
}