Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF94C17FEA for ; Wed, 26 Aug 2015 13:03:16 +0000 (UTC) Received: (qmail 59134 invoked by uid 500); 26 Aug 2015 13:03:16 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 59092 invoked by uid 500); 26 Aug 2015 13:03:16 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 59083 invoked by uid 99); 26 Aug 2015 13:03:16 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2015 13:03:16 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id ADB5AAC0479 for ; Wed, 26 Aug 2015 13:03:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1697923 - in /httpcomponents/httpcore/trunk/httpcore-osgi: pom.xml src/test/java/org/apache/http/osgi/ActuallyConnectIT.java src/test/java/org/apache/http/osgi/Common.java src/test/resources/ src/test/resources/logback.xml Date: Wed, 26 Aug 2015 13:03:16 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150826130316.ADB5AAC0479@hades.apache.org> Author: olegk Date: Wed Aug 26 13:03:16 2015 New Revision: 1697923 URL: http://svn.apache.org/r1697923 Log: HTTPCORE-406: PAX-EXAM tests with an embedded HTTP server Contributed by Benson Margulies Added: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java (with props) httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/ httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml (with props) Modified: httpcomponents/httpcore/trunk/httpcore-osgi/pom.xml httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java Modified: httpcomponents/httpcore/trunk/httpcore-osgi/pom.xml URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-osgi/pom.xml?rev=1697923&r1=1697922&r2=1697923&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-osgi/pom.xml (original) +++ httpcomponents/httpcore/trunk/httpcore-osgi/pom.xml Wed Aug 26 13:03:16 2015 @@ -39,9 +39,10 @@ http://hc.apache.org/httpcomponents-core-ga bundle - 2.0.0 - 3.5.0 - 1.5.4 + 2.0.0 + 3.5.0 + 1.5.4 + 1.0.1 @@ -50,63 +51,88 @@ ${project.version} - org.apache.httpcomponents - httpcore - ${project.version} - test-jar - test + org.apache.httpcomponents + httpcore + ${project.version} + test-jar + test org.apache.httpcomponents httpcore-nio ${project.version} - - org.ops4j.pax.exam - pax-exam-container-native - ${pax.exam.version} - test - - - org.ops4j.pax.exam - pax-exam-junit4 - test - ${pax.exam.version} - - - org.ops4j.pax.exam - pax-exam-link-mvn - test - ${pax.exam.version} - - - org.ops4j.pax.url - pax-url-aether - ${pax.url.version} - test - - - org.slf4j - slf4j-api - test - ${slf4j.version} - - - org.slf4j - slf4j-log4j12 - test - ${slf4j.version} - - - org.mockito - mockito-core - test - - - commons-logging - commons-logging - test - + + org.ops4j.pax.exam + pax-exam-container-native + ${pax.exam.version} + + + org.osgi + org.osgi.core + + + test + + + org.ops4j.pax.exam + pax-exam-junit4 + test + ${pax.exam.version} + + + org.ops4j.pax.exam + pax-exam-link-mvn + test + ${pax.exam.version} + + + org.ops4j.pax.url + pax-url-aether + ${pax.url.version} + test + + + org.ops4j.pax.url + pax-url-wrap + ${pax.url.version} + test + + + org.osgi + org.osgi.core + + + + + org.slf4j + slf4j-api + 1.6.4 + test + + + ch.qos.logback + logback-classic + ${logback.version} + test + + + ch.qos.logback + logback-core + ${logback.version} + test + + + org.apache.felix + org.apache.felix.framework + 4.2.0 + test + + + org.mockito + mockito-core + test + Added: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java?rev=1697923&view=auto ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java (added) +++ httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java Wed Aug 26 13:03:16 2015 @@ -0,0 +1,49 @@ +/* + * ==================================================================== + * 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. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + */ + +package org.apache.http.osgi; + +import org.apache.http.integration.TestSyncHttp; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.PaxExam; +import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; +import org.ops4j.pax.exam.spi.reactors.PerClass; + +/** + * Use the test methods from TestSyncHttp. + */ +@RunWith(PaxExam.class) +@ExamReactorStrategy(PerClass.class) +public class ActuallyConnectIT extends TestSyncHttp { + + @Configuration + public static Option[] options() { + return Common.config(); + } +} Propchange: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java?rev=1697923&r1=1697922&r2=1697923&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java (original) +++ httpcomponents/httpcore/trunk/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java Wed Aug 26 13:03:16 2015 @@ -27,8 +27,13 @@ package org.apache.http.osgi; +import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.PaxExam; +import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; +import org.ops4j.pax.exam.spi.reactors.PerClass; +import org.ops4j.pax.exam.util.PathUtils; import java.io.IOException; import java.net.URL; @@ -38,17 +43,18 @@ import static org.ops4j.pax.exam.CoreOpt import static org.ops4j.pax.exam.CoreOptions.junitBundles; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.systemPackages; import static org.ops4j.pax.exam.CoreOptions.systemProperty; import static org.ops4j.pax.exam.CoreOptions.wrappedBundle; /** * Test inherit from this. */ +@RunWith(PaxExam.class) +@ExamReactorStrategy(PerClass.class) public class Common { public static String getDependencyVersion(final String groupId, final String artifactId) { - final URL depPropsUrl = BasicIT.class.getResource("META-INF/maven/dependencies.properties"); + final URL depPropsUrl = Common.class.getResource("/META-INF/maven/dependencies.properties"); final Properties depProps = new Properties(); try { depProps.load(depPropsUrl.openStream()); @@ -65,26 +71,36 @@ public class Common { @Configuration - public Option[] config() { + public static Option[] config() { final String projectVersion = System.getProperty("project.version"); final String buildDir = System.getProperty("project.build.directory", "target"); final String paxLoggingLevel = System.getProperty("bt.osgi.pax.logging.level", "WARN"); return options( - bundle(String.format("%s/org.apache.httpcomponents.httpcore_%s", + bundle(String.format("file:%s/org.apache.httpcomponents.httpcore_%s.jar", buildDir, projectVersion)), wrappedBundle(mavenBundle().groupId("org.apache.httpcomponents") - .artifactId("httpcore") - .version(projectVersion) - .type("test-jar")), - mavenBundle("org.mockito", "mockito-core", getDependencyVersion("org.mockito", "mockito-core")), - systemPackages( - String.format("org.slf4j;version=\"%s\"", getDependencyVersion("org.slf4j", "slf4j-api")) - ), + .artifactId("httpcore") + .version(projectVersion) + .classifier("tests")) + .exports("org.apache.http.integration") + .imports("org.apache.http.protocol", + "org.apache.http", + "org.apache.http.config", + "org.apache.http.entity", + "org.apache.http.impl", + "org.apache.http.impl.bootstrap", + "org.apache.http.util", + "org.apache.http.message", + "org.apache.commons.logging; provider=paxlogging", + "org.junit"), junitBundles(), systemProperty("pax.exam.osgi.unresolved.fail").value("true"), - systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(paxLoggingLevel) + systemProperty("pax.exam.logging").value("none"), + systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(paxLoggingLevel), + systemProperty("logback.configurationFile") + .value("file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml") ); } } Added: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml?rev=1697923&view=auto ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml (added) +++ httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml Wed Aug 26 13:03:16 2015 @@ -0,0 +1,36 @@ + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n + + + + + + Propchange: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: httpcomponents/httpcore/trunk/httpcore-osgi/src/test/resources/logback.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml