Return-Path: X-Original-To: apmail-marmotta-commits-archive@minotaur.apache.org Delivered-To: apmail-marmotta-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C668E11A30 for ; Thu, 11 Sep 2014 14:55:13 +0000 (UTC) Received: (qmail 46254 invoked by uid 500); 11 Sep 2014 14:55:13 -0000 Delivered-To: apmail-marmotta-commits-archive@marmotta.apache.org Received: (qmail 46221 invoked by uid 500); 11 Sep 2014 14:55:13 -0000 Mailing-List: contact commits-help@marmotta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@marmotta.apache.org Delivered-To: mailing list commits@marmotta.apache.org Received: (qmail 46212 invoked by uid 99); 11 Sep 2014 14:55:13 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2014 14:55:13 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 260819174FE; Thu, 11 Sep 2014 14:55:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: wikier@apache.org To: commits@marmotta.apache.org Message-Id: <4b32aa0d504047c9b5d8bc65eb0bc476@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: MARMOTTA-508: renamed test suite class to follow the surefire conventions Date: Thu, 11 Sep 2014 14:55:13 +0000 (UTC) Repository: marmotta Updated Branches: refs/heads/ldp 4f796496d -> 97778349b MARMOTTA-508: renamed test suite class to follow the surefire conventions Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/97778349 Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/97778349 Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/97778349 Branch: refs/heads/ldp Commit: 97778349b4648a00230544fbf51a3933e5c15672 Parents: 4f79649 Author: Sergio Fernández Authored: Thu Sep 11 16:54:59 2014 +0200 Committer: Sergio Fernández Committed: Thu Sep 11 16:54:59 2014 +0200 ---------------------------------------------------------------------- .../marmotta/platform/ldp/LdpSuiteTest.java | 89 ++++++++++++++++++++ .../marmotta/platform/ldp/LdpTestSuite.java | 88 ------------------- 2 files changed, 89 insertions(+), 88 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/97778349/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 new file mode 100644 index 0000000..8ef68b6 --- /dev/null +++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpSuiteTest.java @@ -0,0 +1,89 @@ +/* + * 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.marmotta.platform.ldp; + +import org.apache.marmotta.platform.core.test.base.JettyMarmotta; +import org.apache.marmotta.platform.ldp.webservices.LdpWebService; +import org.junit.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3.ldp.testsuite.LdpTestSuite; + +import javax.ws.rs.core.UriBuilder; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.HashMap; +import java.util.Map; + +/** + * LDP Test Suite runner, see https://github.com/w3c/ldp-testsuite. + * + * @author Sergio Fernández + * @author Jakob Frank + */ +public class LdpSuiteTest { + + /** @see org.testng.TestNG#HAS_FAILURE */ + private static final int TESTNG_STATUS_HAS_FAILURE = 1; + /** @see org.testng.TestNG#HAS_NO_TEST */ + private static final int TESTNG_STATUS_HAS_NO_TEST = 8; + + private static Logger log = LoggerFactory.getLogger(LdpSuiteTest.class); + + private static JettyMarmotta marmotta; + + private static String baseUrl; + + private LdpTestSuite testSuite; + + @BeforeClass + public static void setup() throws URISyntaxException, IOException { + marmotta = new JettyMarmotta("/marmotta", LdpWebService.class); + baseUrl = UriBuilder.fromUri("http://localhost").port(marmotta.getPort()).path(marmotta.getContext()).build().toString(); + } + + @AfterClass + public static void shutdown() { + marmotta.shutdown(); + marmotta = null; + } + + @Before + public void before() { + log.info("Running W3C official LDP Test Suite against '{}' server", baseUrl); + System.out.println("Running ldp-testsuite against " + baseUrl); + Map options = new HashMap<>(); + options.put("server", baseUrl + "/ldp"); + options.put("basic", null); + options.put("non-rdf", null); + testSuite = new 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); + } + +} http://git-wip-us.apache.org/repos/asf/marmotta/blob/97778349/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 deleted file mode 100644 index 4459e55..0000000 --- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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.marmotta.platform.ldp; - -import org.apache.marmotta.platform.core.test.base.JettyMarmotta; -import org.apache.marmotta.platform.ldp.webservices.LdpWebService; -import org.junit.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.ws.rs.core.UriBuilder; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Map; - -/** - * LDP Test Suite runner, see https://github.com/w3c/ldp-testsuite. - * - * @author Sergio Fernández - * @author Jakob Frank - */ -public class LdpTestSuite { - - /** @see org.testng.TestNG#HAS_FAILURE */ - private static final int TESTNG_STATUS_HAS_FAILURE = 1; - /** @see org.testng.TestNG#HAS_NO_TEST */ - private static final int TESTNG_STATUS_HAS_NO_TEST = 8; - - private static Logger log = LoggerFactory.getLogger(LdpTestSuite.class); - - private static JettyMarmotta marmotta; - - 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); - baseUrl = UriBuilder.fromUri("http://localhost").port(marmotta.getPort()).path(marmotta.getContext()).build().toString(); - } - - @AfterClass - public static void shutdown() { - marmotta.shutdown(); - marmotta = null; - } - - @Before - public void before() { - log.info("Running W3C official LDP Test Suite against '{}' server", baseUrl); - System.out.println("Running ldp-testsuite against " + baseUrl); - Map options = new HashMap<>(); - options.put("server", baseUrl + "/ldp"); - options.put("basic", null); - options.put("non-rdf", null); - 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); - } - -}