This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new c7af2aa Adding list tests
c7af2aa is described below
commit c7af2aa549b00d5a8bbe618a423fcfff2d405822
Author: Dan Klco <[email protected]>
AuthorDate: Fri Jul 16 14:50:50 2021 -0400
Adding list tests
---
.../sling/thumbnails/internal/RenditionSupportImplTest.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git
a/org.apache.sling.thumbnails/src/test/java/org/apache/sling/thumbnails/internal/RenditionSupportImplTest.java
b/org.apache.sling.thumbnails/src/test/java/org/apache/sling/thumbnails/internal/RenditionSupportImplTest.java
index 2fe9ed5..6083713 100644
---
a/org.apache.sling.thumbnails/src/test/java/org/apache/sling/thumbnails/internal/RenditionSupportImplTest.java
+++
b/org.apache.sling.thumbnails/src/test/java/org/apache/sling/thumbnails/internal/RenditionSupportImplTest.java
@@ -16,6 +16,7 @@
*/
package org.apache.sling.thumbnails.internal;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -132,6 +133,18 @@ public class RenditionSupportImplTest {
assertNotNull(renditionSupport.getRenditionContent(slingFileResource,
"myrendition.png"));
}
+ @Test
+ public void testListRenditions() throws PersistenceException {
+ renditionSupport.setRendition(slingFileResource, "myrendition.png",
+ new ByteArrayInputStream(new byte[] { 0, 1 }));
+ renditionSupport.setRendition(slingFileResource, "myrendition.jpeg",
+ new ByteArrayInputStream(new byte[] { 0, 1 }));
+ context.create().resource(slingFileResource.getPath() +
"/jcr:content/renditions/jcr:content");
+ assertNotNull(renditionSupport.listRenditions(slingFileResource));
+ assertEquals(2,
renditionSupport.listRenditions(slingFileResource).size());
+ assertNotNull(renditionSupport.listRenditions(ntFileresource));
+ }
+
@Test(expected = PersistenceException.class)
public void testLoginFailure() throws PersistenceException, LoginException
{