marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject [1/2] git commit: MARMOTTA-508: improved test suite warn up
Date Tue, 16 Sep 2014 16:22:34 GMT
Repository: marmotta
Updated Branches:
  refs/heads/ldp 0a791f426 -> 3bdb2686c


MARMOTTA-508: improved test suite warn up


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/9e73c3c2
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/9e73c3c2
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/9e73c3c2

Branch: refs/heads/ldp
Commit: 9e73c3c2fd04a7e5410129b03eb2d1b9178d4f81
Parents: 0a791f4
Author: Sergio Fernández <wikier@apache.org>
Authored: Tue Sep 16 18:18:56 2014 +0200
Committer: Sergio Fernández <wikier@apache.org>
Committed: Tue Sep 16 18:18:56 2014 +0200

----------------------------------------------------------------------
 .../org/apache/marmotta/platform/ldp/LdpSuiteTest.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/9e73c3c2/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpSuiteTest.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpSuiteTest.java
b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpSuiteTest.java
index 8b90b3e..771be78 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpSuiteTest.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpSuiteTest.java
@@ -17,7 +17,13 @@
 
 package org.apache.marmotta.platform.ldp;
 
+import com.hp.hpl.jena.xmloutput.impl.Basic;
 import org.apache.commons.io.IOUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.marmotta.platform.core.api.triplestore.SesameService;
 import org.apache.marmotta.platform.core.test.base.JettyMarmotta;
 import org.apache.marmotta.platform.ldp.api.LdpService;
@@ -81,6 +87,10 @@ public class LdpSuiteTest {
         try {
             conn.begin();
 
+            //warm up and initialization
+            HttpClient httpClient = HttpClientBuilder.create().build();
+            final HttpResponse response = httpClient.execute(new HttpGet(baseUrl));
+            Assume.assumeTrue(response.getStatusLine().getStatusCode() == 200);
             final String container = ldpService.addResource(conn, baseUrl,
                     UriBuilder.fromUri(baseUrl).path(UUID.randomUUID().toString()).build().toString(),
                     LdpService.InteractionModel.LDPC, RDFFormat.TURTLE.getDefaultMIMEType(),
@@ -91,6 +101,8 @@ public class LdpSuiteTest {
                     IOUtils.toInputStream("<> a <http://example.com/ldp/ResourceInteraction>
. "));
             conn.commit();
 
+            //then actual test suite
+
             log.info("Running W3C official LDP Test Suite against '{}' server", baseUrl);
             log.debug("(using {} as root container)", container);
             Map<String, String> options = new HashMap<>();


Mime
View raw message