From commits-return-51-archive-asf-public=cust-asf.ponee.io@zipkin.apache.org Wed Jan 30 14:18:57 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E985A180677 for ; Wed, 30 Jan 2019 15:18:56 +0100 (CET) Received: (qmail 87646 invoked by uid 500); 30 Jan 2019 14:18:48 -0000 Mailing-List: contact commits-help@zipkin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zipkin.apache.org Delivered-To: mailing list commits@zipkin.apache.org Received: (qmail 87611 invoked by uid 99); 30 Jan 2019 14:18:48 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2019 14:18:48 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 75FB58574B; Wed, 30 Jan 2019 14:18:46 +0000 (UTC) Date: Wed, 30 Jan 2019 14:19:20 +0000 To: "commits@zipkin.apache.org" Subject: [incubator-zipkin-brave-karaf] 35/37: Uses implicit versions in itests (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: adriancole@apache.org In-Reply-To: <154885792502.32062.12048213773512385783@gitbox.apache.org> References: <154885792502.32062.12048213773512385783@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-zipkin-brave-karaf X-Git-Refname: refs/heads/rat X-Git-Reftype: branch X-Git-Rev: 8d3d416974117d7bd008faf676df45be86b201ee X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20190130141846.75FB58574B@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. adriancole pushed a commit to branch rat in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-brave-karaf.git commit 8d3d416974117d7bd008faf676df45be86b201ee Author: Adrian Cole AuthorDate: Thu Oct 18 11:36:46 2018 +0800 Uses implicit versions in itests (#8) --- features/pom.xml | 2 -- itests/pom.xml | 8 +++++++ .../java/io/zipkin/brave/itests/BraveTest.java | 27 ++++++++++++++++++---- itests/src/test/resources/exam.properties | 1 + pom.xml | 5 ++++ 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/features/pom.xml b/features/pom.xml index 73b01f3..cc1b1ef 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -38,9 +38,7 @@ - org.apache.maven.plugins maven-resources-plugin - 3.1.0 filter diff --git a/itests/pom.xml b/itests/pom.xml index f100dbf..65addcb 100644 --- a/itests/pom.xml +++ b/itests/pom.xml @@ -151,4 +151,12 @@ test + + + + src/test/resources + true + + + diff --git a/itests/src/test/java/io/zipkin/brave/itests/BraveTest.java b/itests/src/test/java/io/zipkin/brave/itests/BraveTest.java index 7b3f15c..47054f7 100644 --- a/itests/src/test/java/io/zipkin/brave/itests/BraveTest.java +++ b/itests/src/test/java/io/zipkin/brave/itests/BraveTest.java @@ -21,8 +21,9 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDist import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; +import java.io.InputStream; import java.util.Collection; - +import java.util.Properties; import javax.inject.Inject; import org.junit.Assert; @@ -54,12 +55,13 @@ public class BraveTest { BundleContext context; @Configuration - public static Option[] configuration() { + public static Option[] configuration() throws Exception { MavenArtifactUrlReference karaf = maven().groupId("org.apache.karaf").artifactId("apache-karaf") - .type("zip").version("4.1.5"); + .type("zip") + .version(getVersionFromMaven("org.apache.karaf.features/org.apache.karaf.features.core")); MavenUrlReference brave = maven().groupId("io.zipkin.brave.karaf").artifactId("brave-features").type("xml") - .classifier("features").version("0.1.0-SNAPSHOT"); + .classifier("features").version(getBraveKarafVersion()); return new Option[] { karafDistributionConfiguration().frameworkUrl(karaf).useDeployFolder(false), configureConsole().ignoreLocalConsole(), @@ -109,4 +111,21 @@ public class BraveTest { } throw new RuntimeException("Timeout finding service"); } + + static String getVersionFromMaven(String path) throws Exception { + InputStream is = + BraveTest.class.getResourceAsStream("/META-INF/maven/" + path + "/pom.properties"); + Assert.assertNotNull(is); + Properties p = new Properties(); + p.load(is); + return p.getProperty("version"); + } + + static String getBraveKarafVersion() throws Exception { + InputStream is = BraveTest.class.getResourceAsStream("/exam.properties"); + Assert.assertNotNull(is); + Properties p = new Properties(); + p.load(is); + return p.getProperty("brave-karaf.version"); + } } diff --git a/itests/src/test/resources/exam.properties b/itests/src/test/resources/exam.properties index 14f97f7..1c7a353 100644 --- a/itests/src/test/resources/exam.properties +++ b/itests/src/test/resources/exam.properties @@ -11,3 +11,4 @@ # the License. pax.exam.logging = none pax.exam.service.timeout = 5000 +brave-karaf.version=@project.version@ diff --git a/pom.xml b/pom.xml index f176186..3847d1b 100644 --- a/pom.xml +++ b/pom.xml @@ -317,6 +317,11 @@ + maven-resources-plugin + 3.1.0 + + + com.mycila license-maven-plugin ${license-maven-plugin.version}