MARMOTTA-508: fixed testng setup
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/410b50b6 Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/410b50b6 Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/410b50b6 Branch: refs/heads/develop Commit: 410b50b66424df9d74c062700e60bf2a25c50226 Parents: a55b059 Author: Sergio Fernández <[email protected]> Authored: Thu Sep 11 12:25:42 2014 +0200 Committer: Sergio Fernández <[email protected]> Committed: Thu Sep 11 12:25:42 2014 +0200 ---------------------------------------------------------------------- platform/marmotta-ldp/pom.xml | 12 ----------- .../marmotta/platform/ldp/LdpTestSuite.java | 21 +++++++++++++++----- 2 files changed, 16 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/410b50b6/platform/marmotta-ldp/pom.xml ---------------------------------------------------------------------- diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml index 9dd7a17..83ac5e5 100644 --- a/platform/marmotta-ldp/pom.xml +++ b/platform/marmotta-ldp/pom.xml @@ -69,18 +69,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit47</artifactId> - <version>2.17</version> - </dependency> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-testng</artifactId> - <version>2.17</version> - </dependency> - </dependencies> </plugin> <plugin> http://git-wip-us.apache.org/repos/asf/marmotta/blob/410b50b6/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java index 881edc1..4459e55 100644 --- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java +++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java @@ -48,6 +48,8 @@ public class LdpTestSuite { private static String baseUrl; + private org.w3.ldp.testsuite.LdpTestSuite testSuite; + @BeforeClass public static void setup() throws URISyntaxException, IOException { marmotta = new JettyMarmotta("/marmotta", LdpWebService.class); @@ -60,15 +62,24 @@ public class LdpTestSuite { marmotta = null; } - @Test - public void testSuite() { - log.debug("Running W3C official LDP Test Suite against {} server", baseUrl); + @Before + public void before() { + log.info("Running W3C official LDP Test Suite against '{}' server", baseUrl); System.out.println("Running ldp-testsuite against " + baseUrl); Map<String, String> options = new HashMap<>(); - options.put("server", baseUrl); + options.put("server", baseUrl + "/ldp"); options.put("basic", null); options.put("non-rdf", null); - org.w3.ldp.testsuite.LdpTestSuite testSuite = new org.w3.ldp.testsuite.LdpTestSuite(options); + testSuite = new org.w3.ldp.testsuite.LdpTestSuite(options); + } + + @After + public void after() { + testSuite = null; + } + + @Test + public void testRunSuite() { testSuite.run(); Assert.assertTrue("ldp-testsuite finished with errors", (testSuite.getStatus() & TESTNG_STATUS_HAS_FAILURE) == 0); Assert.assertTrue("ldp-testsuite is empty - no test run", (testSuite.getStatus() & TESTNG_STATUS_HAS_NO_TEST) == 0);
