use of org.apache.sling.ide.transport.ResourceProxy in project sling by apache.
the class DefaultBatcherTest method identicalsReorderingsAreCompacted.
@Test
public void identicalsReorderingsAreCompacted() {
ReorderChildNodesCommand first = new ReorderChildNodesCommand(mockRepo, credentials, new ResourceProxy("/content"), null);
ReorderChildNodesCommand second = new ReorderChildNodesCommand(mockRepo, credentials, new ResourceProxy("/content"), null);
batcher.add(first);
batcher.add(second);
List<Command<?>> batched = batcher.get();
assertThat(batched, hasSize(1));
Command<?> command = batched.get(0);
assertThat(command, instanceOf(ReorderChildNodesCommand.class));
assertThat(command.getPath(), equalTo("/content"));
}
use of org.apache.sling.ide.transport.ResourceProxy in project sling by apache.
the class ListChildrenCommand method execute0.
@Override
protected ResourceProxy execute0(Session session) throws RepositoryException {
Node node = session.getNode(getPath());
NodeIterator nodes = node.getNodes();
ResourceProxy parent = nodeToResource(node);
while (nodes.hasNext()) {
Node childNode = nodes.nextNode();
// TODO - this should not be needed if we obey the vlt filters
if (childNode.getPath().equals("/jcr:system")) {
continue;
}
parent.addChild(nodeToResource(childNode));
}
return parent;
}
use of org.apache.sling.ide.transport.ResourceProxy in project sling by apache.
the class ContentXmlHandlerTest method escapedBraceAtStartOfPropertyValue.
@Test
public void escapedBraceAtStartOfPropertyValue() throws Exception {
ResourceProxy root = parseContentXmlFile("escaped-braces-at-start-of-property.xml", "/");
assertThat("properties[org.apache.sling.commons.log.pattern]", root.getProperties(), hasEntry("org.apache.sling.commons.log.pattern", (Object) "{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}"));
}
use of org.apache.sling.ide.transport.ResourceProxy in project sling by apache.
the class ContentXmlHandlerTest method parseRootContentXml.
@Test
public void parseRootContentXml() throws ParserConfigurationException, SAXException, IOException {
ResourceProxy root = parseContentXmlFile("root-content.xml", "/");
assertThat("root contains /jcr:system", root.getChildren(), hasChildPath("/jcr:system"));
}
use of org.apache.sling.ide.transport.ResourceProxy in project sling by apache.
the class ContentXmlHandlerTest method parseContentXmlWithBinaryProperty.
@Test
public void parseContentXmlWithBinaryProperty() throws ParserConfigurationException, SAXException, IOException {
ResourceProxy root = parseContentXmlFile("binary-property.xml", "/");
assertThat("root has 1 property, binary property is ignored", root.getProperties().entrySet(), hasSize(1));
}
Aggregations