sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1579231 - /sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/DefaultAgentsTest.java
Date Wed, 19 Mar 2014 13:52:00 GMT
Author: tommaso
Date: Wed Mar 19 13:51:59 2014
New Revision: 1579231

URL: http://svn.apache.org/r1579231
Log:
SLING-3456 - added tests for other default agents resources

Modified:
    sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/DefaultAgentsTest.java

Modified: sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/DefaultAgentsTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/DefaultAgentsTest.java?rev=1579231&r1=1579230&r2=1579231&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/DefaultAgentsTest.java
(original)
+++ sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/DefaultAgentsTest.java
Wed Mar 19 13:51:59 2014
@@ -48,4 +48,59 @@ public class DefaultAgentsTest extends S
                         .withCredentials(getServerUsername(), getServerPassword())
         ).assertStatus(200);
     }
+
+    private void assertResourceDoesNotExist(String path) throws IOException {
+        getRequestExecutor().execute(
+                getRequestBuilder().buildGetRequest(path)
+                        .withCredentials(getServerUsername(), getServerPassword())
+        ).assertStatus(404);
+    }
+
+    @Test
+    public void testDefaultPublishAgents() throws IOException {
+        // these agents do not exist as they are bundled to publish runMode
+        String[] defaultPublishAgents = new String[]{
+                "/libs/sling/replication/agent/reverserepo.json",
+                "/libs/sling/replication/agent/author.json",
+                "/libs/sling/replication/agent/cache-flush.json"
+        };
+        for (String path : defaultPublishAgents) {
+            assertResourceDoesNotExist(path);
+        }
+    }
+
+    public void testDefaultAuthorAgents() throws IOException {
+        // these agents exist as they are bundled to author runMode
+        String[] defaultAuthorAgents = new String[]{
+                "/libs/sling/replication/agent/publish.json",
+                "/libs/sling/replication/agent/publish-reverse.json",
+        };
+        for (String path : defaultAuthorAgents) {
+            assertResourceExists(path);
+        }
+    }
+
+    @Test
+    public void testDefaultPublishAgentsQueues() throws IOException {
+        // these agent queues do not exist as they are bundled to publish runMode
+        String[] defaultPublishAgents = new String[]{
+                "/libs/sling/replication/agent/reverserepo/queue.json",
+                "/libs/sling/replication/agent/author/queue.json",
+                "/libs/sling/replication/agent/cache-flush/queue.json"
+        };
+        for (String path : defaultPublishAgents) {
+            assertResourceDoesNotExist(path);
+        }
+    }
+
+    public void testDefaultAuthorAgentsQueues() throws IOException {
+        // these agent queues exist as they are bundled to author runMode
+        String[] defaultAuthorAgents = new String[]{
+                "/libs/sling/replication/agent/publish/queue.json",
+                "/libs/sling/replication/agent/publish-reverse/queue.json",
+        };
+        for (String path : defaultAuthorAgents) {
+            assertResourceExists(path);
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message