This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi-client.git
commit b4bdab1d443294bc6d3c0000f5fa4daec4fe3d72 Author: Bertrand Delacretaz <[email protected]> AuthorDate: Tue Oct 13 11:55:28 2015 +0000 SLING-5136 - move test classes to Sling packages git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1708359 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/{ => org/apache/sling/hapi/client/test}/FormTest.java | 7 ++++--- .../{ => org/apache/sling/hapi/client/test}/GetPostTest.java | 5 +++-- .../java/{ => org/apache/sling/hapi/client/test}/ItemsTest.java | 9 +++++---- .../apache/sling/hapi/client/test}/util/HttpServerRule.java | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/test/java/FormTest.java b/src/test/java/org/apache/sling/hapi/client/test/FormTest.java similarity index 96% rename from src/test/java/FormTest.java rename to src/test/java/org/apache/sling/hapi/client/test/FormTest.java index e13c20f..5d9b675 100644 --- a/src/test/java/FormTest.java +++ b/src/test/java/org/apache/sling/hapi/client/test/FormTest.java @@ -17,6 +17,8 @@ * under the License. ******************************************************************************/ +package org.apache.sling.hapi.client.test; + import static org.hamcrest.core.IsEqual.equalTo; import java.io.IOException; @@ -38,12 +40,11 @@ import org.apache.sling.hapi.client.ClientException; import org.apache.sling.hapi.client.Document; import org.apache.sling.hapi.client.Items; import org.apache.sling.hapi.client.microdata.MicrodataHtmlClient; +import org.apache.sling.hapi.client.test.util.HttpServerRule; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; -import util.HttpServerRule; - public class FormTest { private static final String GET_URL = "/test1"; private static final String POST_URL = "/testpost1"; @@ -59,7 +60,7 @@ public class FormTest { @Override public void handle(HttpRequest httpRequest, HttpResponse httpResponse, HttpContext httpContext) throws HttpException, IOException { - final String html = IOUtils.toString(ItemsTest.class.getResourceAsStream("items_forms.html"), "UTF-8"); + final String html = IOUtils.toString(ItemsTest.class.getResourceAsStream("/items_forms.html"), "UTF-8"); HttpEntity entity = new StringEntity(html, "UTF-8"); httpResponse.setEntity(entity); } diff --git a/src/test/java/GetPostTest.java b/src/test/java/org/apache/sling/hapi/client/test/GetPostTest.java similarity index 97% rename from src/test/java/GetPostTest.java rename to src/test/java/org/apache/sling/hapi/client/test/GetPostTest.java index 5b13112..4e9b158 100644 --- a/src/test/java/GetPostTest.java +++ b/src/test/java/org/apache/sling/hapi/client/test/GetPostTest.java @@ -18,6 +18,8 @@ * under the License. ******************************************************************************/ +package org.apache.sling.hapi.client.test; + import static org.hamcrest.core.StringContains.containsString; import java.io.IOException; @@ -34,13 +36,12 @@ import org.apache.http.protocol.HttpRequestHandler; import org.apache.sling.hapi.client.ClientException; import org.apache.sling.hapi.client.Document; import org.apache.sling.hapi.client.microdata.MicrodataHtmlClient; +import org.apache.sling.hapi.client.test.util.HttpServerRule; import org.hamcrest.core.StringContains; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; -import util.HttpServerRule; - public class GetPostTest { private static final String GET_URL = "/test"; private static final String GET_AUTH_URL = "/testauth"; diff --git a/src/test/java/ItemsTest.java b/src/test/java/org/apache/sling/hapi/client/test/ItemsTest.java similarity index 95% rename from src/test/java/ItemsTest.java rename to src/test/java/org/apache/sling/hapi/client/test/ItemsTest.java index 8ab5453..66561db 100644 --- a/src/test/java/ItemsTest.java +++ b/src/test/java/org/apache/sling/hapi/client/test/ItemsTest.java @@ -17,6 +17,8 @@ * under the License. ******************************************************************************/ +package org.apache.sling.hapi.client.test; + import static org.hamcrest.core.IsEqual.equalTo; import java.io.IOException; @@ -34,12 +36,11 @@ import org.apache.sling.hapi.client.ClientException; import org.apache.sling.hapi.client.Document; import org.apache.sling.hapi.client.Items; import org.apache.sling.hapi.client.microdata.MicrodataHtmlClient; +import org.apache.sling.hapi.client.test.util.HttpServerRule; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; -import util.HttpServerRule; - public class ItemsTest { private static final String GET_URL = "/test"; private static final String GET_LINKS_URL = "/testlinks"; @@ -48,8 +49,8 @@ public class ItemsTest { public static final HttpServerRule httpServer = new HttpServerRule() { @Override protected void registerHandlers() throws IOException { - final String html = IOUtils.toString(ItemsTest.class.getResourceAsStream("items.html"), "UTF-8"); - final String htmlLinks = IOUtils.toString(ItemsTest.class.getResourceAsStream("items_links.html"), "UTF-8"); + final String html = IOUtils.toString(ItemsTest.class.getResourceAsStream("/items.html"), "UTF-8"); + final String htmlLinks = IOUtils.toString(ItemsTest.class.getResourceAsStream("/items_links.html"), "UTF-8"); serverBootstrap.registerHandler(GET_URL, new HttpRequestHandler() { @Override public void handle(HttpRequest httpRequest, HttpResponse httpResponse, HttpContext httpContext) diff --git a/src/test/java/util/HttpServerRule.java b/src/test/java/org/apache/sling/hapi/client/test/util/HttpServerRule.java similarity index 98% rename from src/test/java/util/HttpServerRule.java rename to src/test/java/org/apache/sling/hapi/client/test/util/HttpServerRule.java index 0822ae4..4e1b069 100644 --- a/src/test/java/util/HttpServerRule.java +++ b/src/test/java/org/apache/sling/hapi/client/test/util/HttpServerRule.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. ******************************************************************************/ -package util; +package org.apache.sling.hapi.client.test.util; import java.io.IOException; import java.net.URI; -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
