MARMOTTA-508: updated to ldp test suite 0.1.1, for being to use a custom output 
directory compatible with the surefire plugin


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

Branch: refs/heads/develop
Commit: 8d0ebc560c8089b479674aad3740a769af2be906
Parents: f1c65db
Author: Sergio Fernández <[email protected]>
Authored: Thu Sep 18 16:35:36 2014 +0200
Committer: Sergio Fernández <[email protected]>
Committed: Thu Sep 18 16:35:36 2014 +0200

----------------------------------------------------------------------
 platform/marmotta-ldp/pom.xml                   |  2 +-
 .../marmotta/platform/ldp/LdpSuiteTest.java     | 47 +++++++++++---------
 2 files changed, 27 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/8d0ebc56/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index 9da2775..8675e32 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -281,7 +281,7 @@
         <dependency>
             <groupId>org.w3</groupId>
             <artifactId>ldp-testsuite</artifactId>
-            <version>0.1.0</version>
+            <version>0.1.1</version>
             <scope>test</scope>
             <exclusions>
                 <exclusion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/8d0ebc56/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 e9f2579..527906f 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,23 +17,12 @@
 
 package org.apache.marmotta.platform.ldp;
 
-import com.hp.hpl.jena.xmloutput.impl.Basic;
 import com.jayway.restassured.RestAssured;
-import com.jayway.restassured.response.Response;
-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.commons.vocabulary.LDP;
-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;
 import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
 import org.hamcrest.CoreMatchers;
 import org.junit.*;
-import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.rio.RDFFormat;
 import org.openrdf.rio.RDFParseException;
@@ -45,11 +34,11 @@ import 
org.w3.ldp.testsuite.matcher.HttpStatusSuccessMatcher;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Link;
 import javax.ws.rs.core.UriBuilder;
+import java.io.File;
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * LDP Test Suite runner, see <a 
href="https://github.com/w3c/ldp-testsuite";>https://github.com/w3c/ldp-testsuite</a>.
@@ -74,6 +63,8 @@ public class LdpSuiteTest {
 
     private LdpTestSuite testSuite;
 
+    private String reportPath;
+
     @BeforeClass
     public static void setup() throws URISyntaxException, IOException {
         marmotta = new JettyMarmotta("/marmotta", LdpWebService.class);
@@ -124,7 +115,6 @@ public class LdpSuiteTest {
 
         //configure 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<>();
         options.put("server", container);
         options.put("basic", null);
@@ -137,14 +127,20 @@ public class LdpSuiteTest {
         options.put("skipLogging", null);
         options.put("excludedGroups", "MANUAL");
 
-        //reporting stuff
-        //options.put("earl", null);
-        //options.put("software", "Apache Marmotta");
-        //options.put("language", "Java");
-        //options.put("homepage", "http://marmotta.apache.org";);
-        //options.put("assertor", "http://marmotta.apache.org";);
-        //options.put("shortname", "Marmotta");
-        //options.put("developer", "Jakob Frank, Sergio Fernández");
+        reportPath = targetWorkingDir().getAbsolutePath();
+        options.put("output", reportPath);
+        log.debug("You can find LDP Test Suite outputs at {}", reportPath);
+
+        //w3c reporting stuff
+        /*
+        options.put("earl", null);
+        options.put("software", "Apache Marmotta");
+        options.put("language", "Java");
+        options.put("homepage", "http://marmotta.apache.org";);
+        options.put("assertor", "http://marmotta.apache.org";);
+        options.put("shortname", "Marmotta");
+        options.put("developer", "Jakob Frank, Sergio Fernández");
+        */
 
         testSuite = new LdpTestSuite(options);
     }
@@ -164,4 +160,13 @@ public class LdpSuiteTest {
         }
     }
 
+    private File targetWorkingDir(){
+        String relPath = 
getClass().getProtectionDomain().getCodeSource().getLocation().getFile();
+        File targetDir = new File(relPath, "ldp-testsuite");
+        if(!targetDir.exists()) {
+            targetDir.mkdir();
+        }
+        return targetDir;
+    }
+
 }

Reply via email to