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 2017/03/06 21:48:18 UTC
svn commit: r1785771 [2/2] - in
/sling/trunk/bundles/extensions/fsresource/src:
main/java/org/apache/sling/fsprovider/internal/
main/java/org/apache/sling/fsprovider/internal/mapper/
main/java/org/apache/sling/fsprovider/internal/mapper/jcr/ main/java/...
Modified: sling/trunk/bundles/extensions/fsresource/src/test/java/org/apache/sling/fsprovider/internal/TestUtils.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/src/test/java/org/apache/sling/fsprovider/internal/TestUtils.java?rev=1785771&r1=1785770&r2=1785771&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/fsresource/src/test/java/org/apache/sling/fsprovider/internal/TestUtils.java (original)
+++ sling/trunk/bundles/extensions/fsresource/src/test/java/org/apache/sling/fsprovider/internal/TestUtils.java Mon Mar 6 21:48:18 2017
@@ -28,13 +28,18 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.CharEncoding;
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.observation.ResourceChange;
+import org.apache.sling.api.resource.observation.ResourceChangeListener;
+import org.apache.sling.api.resource.observation.ResourceChange.ChangeType;
import org.apache.sling.hamcrest.ResourceMatchers;
import org.apache.sling.testing.mock.osgi.MapUtil;
import org.apache.sling.testing.mock.osgi.context.AbstractContextPlugin;
@@ -53,6 +58,7 @@ class TestUtils {
config.put("provider.file", "src/test/resources/fs-test");
config.put("provider.root", "/fs-test");
config.put("provider.checkinterval", 0);
+ config.put("provider.fs.mode", FsMode.INITIAL_CONTENT_FILES_FOLDERS.name());
config.putAll(props);
context.registerInjectActivateService(new FsResourceProvider(), config);
}
@@ -94,4 +100,26 @@ class TestUtils {
}
}
+ public static void assertChange(List<ResourceChange> changes, String path, ChangeType changeType) {
+ boolean found = false;
+ for (ResourceChange change : changes) {
+ if (StringUtils.equals(change.getPath(), path) && change.getType() == changeType) {
+ found = true;
+ break;
+ }
+ }
+ assertTrue("Change with path=" + path + ", changeType=" + changeType + " expected", found);
+ }
+
+ public static class ResourceListener implements ResourceChangeListener {
+ private final List<ResourceChange> allChanges = new ArrayList<>();
+ @Override
+ public void onChange(List<ResourceChange> changes) {
+ allChanges.addAll(changes);
+ }
+ public List<ResourceChange> getChanges() {
+ return allChanges;
+ }
+ }
+
}
Modified: sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/META-INF/vault/filter.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/META-INF/vault/filter.xml?rev=1785771&r1=1785770&r2=1785771&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/META-INF/vault/filter.xml (original)
+++ sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/META-INF/vault/filter.xml Mon Mar 6 21:48:18 2017
@@ -19,5 +19,7 @@
-->
<workspaceFilter version="1.0">
<filter root="/content/dam/talk.png" />
- <filter root="/content/samples" />
+ <filter root="/content/samples">
+ <exclude pattern="/content/samples/en/conference(/.*)?"/>
+ </filter>
</workspaceFilter>
Modified: sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/.content.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/.content.xml?rev=1785771&r1=1785770&r2=1785771&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/.content.xml (original)
+++ sling/trunk/bundles/extensions/fsresource/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/.content.xml Mon Mar 6 21:48:18 2017
@@ -39,8 +39,6 @@
dc:format="image/png"
dc:modified="{Date}2014-09-19T21:20:26.812+02:00"
jcr:primaryType="nt:unstructured"
- tiff:ImageLength="{Long}270"
- tiff:ImageWidth="{Long}480"
writebackEnable="{Boolean}true" />
</jcr:content>
</jcr:root>