You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2018/09/05 09:01:49 UTC
[sling-whiteboard] branch master updated: Cleaner cleanup + feature
tags
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz 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 42317ec Cleaner cleanup + feature tags
42317ec is described below
commit 42317ecabf8fbc4d274268c4a0cf499eaeab2f0c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Sep 5 11:01:32 2018 +0200
Cleaner cleanup + feature tags
---
.../src/test/java/sling/filestorage/uploadImage.feature | 8 +++-----
.../src/test/java/sling/postservlet/createContent.feature | 8 +++-----
.../src/test/java/sling/postservlet/importContent.feature | 8 +++-----
.../src/test/java/sling/setup/initialContent.feature | 1 +
.../util/{cleanup-test-content.feature => cleanup-path.feature} | 8 +++-----
karate-http-testing/src/test/java/util/cleanup-paths.js | 7 +++++++
6 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/karate-http-testing/src/test/java/sling/filestorage/uploadImage.feature b/karate-http-testing/src/test/java/sling/filestorage/uploadImage.feature
index 3dee7b8..c9f74da 100644
--- a/karate-http-testing/src/test/java/sling/filestorage/uploadImage.feature
+++ b/karate-http-testing/src/test/java/sling/filestorage/uploadImage.feature
@@ -1,4 +1,5 @@
# ------------------------------------------------------------------------
+@filestorage @postservlet @images
Feature: Upload an image in Sling and check the result
# ------------------------------------------------------------------------
@@ -50,8 +51,5 @@ And match response == read("classpath:images/testimage.jpg")
And match header Content-Length == "10102"
# Cleanup test content
-* table paths
- | path |
- | imagePath |
- | testFolderPath |
-* def result = call read('classpath:util/cleanup-test-content.feature') paths
\ No newline at end of file
+* def toDelete = ([ imagePath, testFolderPath ])
+* def result = call read('classpath:util/cleanup-paths.js') toDelete
\ No newline at end of file
diff --git a/karate-http-testing/src/test/java/sling/postservlet/createContent.feature b/karate-http-testing/src/test/java/sling/postservlet/createContent.feature
index b859c7e..97adfd0 100644
--- a/karate-http-testing/src/test/java/sling/postservlet/createContent.feature
+++ b/karate-http-testing/src/test/java/sling/postservlet/createContent.feature
@@ -1,4 +1,5 @@
# ------------------------------------------------------------------------
+@postservlet
Feature: create content using the Sling POST Servlet
# ------------------------------------------------------------------------
@@ -54,8 +55,5 @@ And match response.f2 == 'v2B'
And match response.f3 == 'v3B'
# Cleanup test content
-* table paths
- | path |
- | resourcePath |
- | testFolderPath |
-* def result = call read('classpath:util/cleanup-test-content.feature') paths
\ No newline at end of file
+* def toDelete = ([ resourcePath, testFolderPath ])
+* def result = call read('classpath:util/cleanup-paths.js') toDelete
\ No newline at end of file
diff --git a/karate-http-testing/src/test/java/sling/postservlet/importContent.feature b/karate-http-testing/src/test/java/sling/postservlet/importContent.feature
index e418569..003f15a 100644
--- a/karate-http-testing/src/test/java/sling/postservlet/importContent.feature
+++ b/karate-http-testing/src/test/java/sling/postservlet/importContent.feature
@@ -1,4 +1,5 @@
# ------------------------------------------------------------------------
+@importcontent @postservlet
Feature: Import content using the Sling POST Servlet
# ------------------------------------------------------------------------
@@ -51,8 +52,5 @@ And match $ == newContent
And match $.p2[2] == testID
# Cleanup test content
-* table paths
- | path |
- | testFolderPath + '/' + testID |
- | testFolderPath |
-* def result = call read('classpath:util/cleanup-test-content.feature') paths
\ No newline at end of file
+* def toDelete = ([ testFolderPath + '/' + testID, testFolderPath ])
+* def result = call read('classpath:util/cleanup-paths.js') toDelete
\ No newline at end of file
diff --git a/karate-http-testing/src/test/java/sling/setup/initialContent.feature b/karate-http-testing/src/test/java/sling/setup/initialContent.feature
index 614d3e0..fcefe79 100644
--- a/karate-http-testing/src/test/java/sling/setup/initialContent.feature
+++ b/karate-http-testing/src/test/java/sling/setup/initialContent.feature
@@ -1,4 +1,5 @@
# ------------------------------------------------------------------------
+@slingsetup @initialcontent
Feature: Test the Sling initial content and demonstrate Scenario Outline
# ------------------------------------------------------------------------
diff --git a/karate-http-testing/src/test/java/util/cleanup-test-content.feature b/karate-http-testing/src/test/java/util/cleanup-path.feature
similarity index 78%
rename from karate-http-testing/src/test/java/util/cleanup-test-content.feature
rename to karate-http-testing/src/test/java/util/cleanup-path.feature
index 57abc10..4fc2c21 100644
--- a/karate-http-testing/src/test/java/util/cleanup-test-content.feature
+++ b/karate-http-testing/src/test/java/util/cleanup-path.feature
@@ -1,7 +1,5 @@
# ------------------------------------------------------------------------
-Feature: Cleanup content by DELETEing a set of paths
-# The 'path' parameter must be passed in when calling, optionally
-# using a table to delete multiple paths
+Feature: DELETE a path and verify that it's gone
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
@@ -16,11 +14,11 @@ Background:
# ------------------------------------------------------------------------
Scenario: Delete a given path and verify that it's gone
# ------------------------------------------------------------------------
-Given path path
+Given path pathToDelete
When method DELETE
Then status 204
# Use HEAD to avoid an XML parsing warning
-Given path path
+Given path pathToDelete
When method HEAD
Then status 404
\ No newline at end of file
diff --git a/karate-http-testing/src/test/java/util/cleanup-paths.js b/karate-http-testing/src/test/java/util/cleanup-paths.js
new file mode 100644
index 0000000..baad096
--- /dev/null
+++ b/karate-http-testing/src/test/java/util/cleanup-paths.js
@@ -0,0 +1,7 @@
+function(paths) {
+ // Cleanup a set of paths
+ for(i in paths) {
+ var args = { "pathToDelete" : paths[i] }
+ karate.call("classpath:util/cleanup-path.feature", args);
+ }
+}
\ No newline at end of file