You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:17:30 UTC

[sling-org-apache-sling-testing-clients] annotated tag org.apache.sling.testing.clients-1.1.2 created (now ef0332f)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.testing.clients-1.1.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git.


      at ef0332f  (tag)
 tagging 68120f2310489878539d078e16d00384915a2aec (commit)
      by Robert Munteanu
      on Thu Jun 15 13:03:52 2017 +0000

- Log -----------------------------------------------------------------
org.apache.sling.testing.clients-1.1.2
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 098e995  SLING-5703 - new http/clients module, extracted and enhanced from testing/tools. Contributed by Andrei Dulvac, thanks!
     new 6f3b69e  SLING-5725 - Remove o.a.s.testing.tools dependency in o.a.s.testing.clients and merge OSGi console clients - contribued by Andrei Dulvac, thanks!
     new 4f93441  trivial - reduced wait time in test
     new 9525b72  SLING-5727 Remove o.a.s.testing.tools dependency in o.a.s.testing.serversetup and adapt http code
     new 58ae43e  SLING-5727 Remove o.a.s.testing.tools dependency in o.a.s.testing.serversetup and adapt http code  * Added TimeoutsProvider
     new 3b0a1ba  SLING-5793 Add client that can leverage hapi client in testing http clients
     new 465aaa9  @trivial Added missing package version
     new 3e93b69  @trivial Added http status code to ClientException
     new 2336236  Rollback release of org.apache.sling.hapi.client
     new 429e5f4  Fix compilation errors
     new c5a1b9b  @releng updated dependency in org.apache.sling.testing.clients to hapi client 1.0.0
     new 8b6bbb4  @releng changed package versions in org.apache.sling.testing.clients
     new 5bfb5cf  @releng changed package versions in org.apache.sling.testing.clients
     new 134249e  [maven-release-plugin] prepare release org.apache.sling.testing.clients-1.0.0
     new c2e4bf3  [maven-release-plugin] prepare for next development iteration
     new ac1c276  Fix broken build - this module relies on an hapi snapshot from contrib, that's not good but at least the build should pass now (I have deployed hapi snapshots)
     new b7333ca  SLING-6405 - Make testing.clients.interceptors.TestDescriptionInterceptor in line with TestLogServlet from junit core
     new 2eefa29  SLING-6431 and some cosmetic changes
     new 5ffc89e  [maven-release-plugin] prepare release org.apache.sling.testing.clients-1.0.1
     new 599b6e0  [maven-release-plugin] prepare for next development iteration
     new cab958b  use Sling Parent 30
     new 7d6589d  use OSGi annotations and remove unused Maven SCR Plugin
     new 0883798  SLING-6853 Improve polling capabilities in o.a.s.testing.clients thanks @volteanu for the contribution!
     new a06ceb1  SLING-6853 Fixed incomplete patch.
     new e3911b9  SLING-6905: Remove commons.json from testing http clients by using already used jackson library. Patch provided by Valentin Olteanu. This closes #235.
     new be1e939  [maven-release-plugin] prepare release org.apache.sling.testing.clients-1.1.0
     new 5a78d74  [maven-release-plugin] prepare for next development iteration
     new 821ed57  SLING-6954 - Add client support for the org.apache.sling.testing.email bundle
     new 588b531  [maven-release-plugin] prepare release org.apache.sling.testing.clients-1.1.2
     new 68120f2  [maven-release-plugin] copy for tag org.apache.sling.testing.clients-1.1.2

The 30 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-testing-clients] 02/04: SLING-6954 - Add client support for the org.apache.sling.testing.email bundle

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.clients-1.1.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git

commit 821ed57457f2adf8edf6051aa2996ad25757be28
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Jun 13 13:13:43 2017 +0000

    SLING-6954 - Add client support for the org.apache.sling.testing.email
    bundle
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/http/clients@1798597 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/testing/clients/email/EmailMessage.java  |  36 +++++++
 .../testing/clients/email/SlingEmailClient.java    | 113 +++++++++++++++++++++
 .../sling/testing/clients/email/package-info.java  |  23 +++++
 3 files changed, 172 insertions(+)

diff --git a/src/main/java/org/apache/sling/testing/clients/email/EmailMessage.java b/src/main/java/org/apache/sling/testing/clients/email/EmailMessage.java
new file mode 100644
index 0000000..e013e51
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/clients/email/EmailMessage.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.clients.email;
+
+/**
+ * Holds information retrieved from the mock SMTP server deployed in Sling
+ *
+ */
+public final class EmailMessage {
+	
+	private String content;
+
+	public EmailMessage(String content) {
+		this.content = content;
+	}
+	
+	public String getContent() {
+		return content;
+	}
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/testing/clients/email/SlingEmailClient.java b/src/main/java/org/apache/sling/testing/clients/email/SlingEmailClient.java
new file mode 100644
index 0000000..65bdaa1
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/clients/email/SlingEmailClient.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.clients.email;
+
+import static org.apache.http.HttpStatus.SC_NO_CONTENT;
+import static org.apache.http.HttpStatus.SC_OK;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.http.Header;
+import org.apache.http.NameValuePair;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.sling.testing.clients.ClientException;
+import org.apache.sling.testing.clients.SlingClient;
+import org.apache.sling.testing.clients.SlingClientConfig;
+import org.apache.sling.testing.clients.SlingHttpResponse;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.map.ObjectMapper;
+
+/**
+ * Accesses email stored by a mock SMTP server deployed to Sling 
+ *
+ * <p>Requires that the <tt>org.apache.sling.testing.email</tt> bundle is deployed.</p>
+ */
+public final class SlingEmailClient extends SlingClient {
+
+	/**
+	 * The well-known path under which the EmailServlet is deployed
+	 */
+	private static final String EMAIL_SERVLET_PATH = "/system/sling/testing/email";
+	
+	/**
+	 * The well-known property name of the email body contents
+	 */
+	private static final String PN_CONTENT = "-Content-";
+	
+	
+	private final ObjectMapper mapper = new ObjectMapper();
+
+	public SlingEmailClient(CloseableHttpClient http, SlingClientConfig config) throws ClientException {
+		super(http, config);
+	}
+	
+	/**
+	 * Retrieves the actual bind port of the SMTP server
+	 * 
+	 * @return the port value
+	 * @throws ClientException in case of any errors
+	 */
+	public int getBindPort() throws ClientException {
+        try {
+			SlingHttpResponse mockEmailConfig = doGet(EMAIL_SERVLET_PATH + "/config", SC_OK);
+			
+			JsonNode configNode = mapper.readTree(mockEmailConfig.getContent());
+			return configNode.get("bindPort").getIntValue();
+		} catch (IOException e) {
+			throw new ClientException("Failed retrieving configuration", e);
+		}
+	}
+	
+	/**
+	 * Retrieves the list of mail messages currently stored
+	 * 
+	 * @return the list of messages, possibly empty
+	 * @throws ClientException in case of any errors
+	 */
+	public List<EmailMessage> getMessages() throws ClientException {
+    	List<EmailMessage> emails = new ArrayList<>();
+    	
+        try {
+			SlingHttpResponse response = doGet(EMAIL_SERVLET_PATH + "/messages", SC_OK);
+			JsonNode messages = mapper.readTree(response.getContent());
+			for ( JsonNode emailNode : messages.get("messages") ) {
+				EmailMessage msg = new EmailMessage(emailNode.get(PN_CONTENT).getTextValue());
+				emails.add(msg);
+			}
+		} catch (IOException e) {
+			throw new ClientException("Failed retrieving email messages", e);
+		}
+        
+        
+        return emails;		
+	}
+	
+	/**
+	 * Deletes all mail messages currently stored
+	 * 
+	 * @throws ClientException in case of any errors
+	 */
+	public void deleteMessages() throws ClientException {
+		doDelete(EMAIL_SERVLET_PATH, Collections.<NameValuePair>emptyList(), 
+				Collections.<Header> emptyList(), SC_NO_CONTENT);		
+	}
+}
diff --git a/src/main/java/org/apache/sling/testing/clients/email/package-info.java b/src/main/java/org/apache/sling/testing/clients/email/package-info.java
new file mode 100644
index 0000000..373bccc
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/clients/email/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@Version("1.0.0")
+package org.apache.sling.testing.clients.email;
+
+import org.osgi.annotation.versioning.Version;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-clients] 01/04: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.clients-1.1.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git

commit 5a78d74d2c31ea5771cff62be45790bc4162d2e7
Author: Karl Pauls <pa...@apache.org>
AuthorDate: Fri Jun 2 21:22:03 2017 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/http/clients@1797451 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 85aff6b..91ba15f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.clients</artifactId>
-    <version>1.1.0</version>
+    <version>1.1.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Clients</name>
@@ -36,9 +36,9 @@
         Sling testing http clients and utils
     </description>
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.clients-1.1.0</connection>
-        <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.clients-1.1.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.clients-1.1.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/http/clients</connection>
+        <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/http/clients</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/testing/http/clients</url>
     </scm>
     
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-clients] 04/04: [maven-release-plugin] copy for tag org.apache.sling.testing.clients-1.1.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.clients-1.1.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git

commit 68120f2310489878539d078e16d00384915a2aec
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 15 13:03:52 2017 +0000

    [maven-release-plugin] copy for tag org.apache.sling.testing.clients-1.1.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.clients-1.1.2@1798827 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-clients] 03/04: [maven-release-plugin] prepare release org.apache.sling.testing.clients-1.1.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.clients-1.1.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git

commit 588b531c36ed4ce5d8625df05248a91705a200df
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 15 13:03:39 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.testing.clients-1.1.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/http/clients@1798826 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 91ba15f..1ff3322 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.clients</artifactId>
-    <version>1.1.1-SNAPSHOT</version>
+    <version>1.1.2</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Clients</name>
@@ -36,9 +36,9 @@
         Sling testing http clients and utils
     </description>
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/http/clients</connection>
-        <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/http/clients</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/testing/http/clients</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.clients-1.1.2</connection>
+        <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.clients-1.1.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.clients-1.1.2</url>
     </scm>
     
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.