From commits-return-105-archive-asf-public=cust-asf.ponee.io@zipkin.apache.org Wed Jan 30 17:41:46 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 5B9DD18077F for ; Wed, 30 Jan 2019 18:41:44 +0100 (CET) Received: (qmail 47547 invoked by uid 500); 30 Jan 2019 17:41:43 -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 47538 invoked by uid 99); 30 Jan 2019 17:41:43 -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 17:41:43 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 7D0B38572F; Wed, 30 Jan 2019 17:41:42 +0000 (UTC) Date: Wed, 30 Jan 2019 17:41:44 +0000 To: "commits@zipkin.apache.org" Subject: [incubator-zipkin-brave-karaf] 03/42: First version of features and test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: abesto@apache.org In-Reply-To: <154887010170.21089.15625992168469906328@gitbox.apache.org> References: <154887010170.21089.15625992168469906328@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-zipkin-brave-karaf X-Git-Refname: refs/heads/test-jenkins-github-integration X-Git-Reftype: branch X-Git-Rev: af6ca7a151475731a70954708f757a25fecd2750 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20190130174142.7D0B38572F@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. abesto pushed a commit to branch test-jenkins-github-integration in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-brave-karaf.git commit af6ca7a151475731a70954708f757a25fecd2750 Author: Christian Schneider AuthorDate: Thu Dec 8 18:35:20 2016 +0100 First version of features and test --- .gitignore | 3 + brave-features/.classpath | 36 +++++ brave-features/pom.xml | 80 +++++++++++ brave-features/src/main/resources/features.xml | 43 ++++++ brave-features/target/classes/features.xml | 43 ++++++ brave-itests/.classpath | 31 +++++ brave-itests/.gitignore | 1 + brave-itests/pom.xml | 153 +++++++++++++++++++++ .../java/io/zipkin/brave/itests/BraveTest.java | 79 +++++++++++ brave-itests/src/test/resources/exam.properties | 2 + brave-itests/src/test/resources/logback.xml | 25 ++++ brave-itests/test.log | 12 ++ pom.xml | 4 +- 13 files changed, 511 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 32858aa..acd2dc3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* + +.project +.settings diff --git a/brave-features/.classpath b/brave-features/.classpath new file mode 100644 index 0000000..fae1a2b --- /dev/null +++ b/brave-features/.classpath @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brave-features/pom.xml b/brave-features/pom.xml new file mode 100644 index 0000000..2a1bb0f --- /dev/null +++ b/brave-features/pom.xml @@ -0,0 +1,80 @@ + + + + 4.0.0 + + io.zipkin.brave.karaf + brave-karaf-parent + 1.0.0-SNAPSHOT + ../pom.xml + + brave-features + pom + + + ${project.basedir}/.. + + + + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + + filter + generate-resources + + resources + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.7 + + + attach-artifacts + package + + attach-artifact + + + + + target/classes/features.xml + xml + features + + + + + + + + + diff --git a/brave-features/src/main/resources/features.xml b/brave-features/src/main/resources/features.xml new file mode 100644 index 0000000..2b70909 --- /dev/null +++ b/brave-features/src/main/resources/features.xml @@ -0,0 +1,43 @@ + + + + + mvn:org.apache.cxf.karaf/apache-cxf/3.1.8/xml/features + + + mvn:io.zipkin.java/zipkin/${zipkin.version} + mvn:io.zipkin.reporter/zipkin-reporter/${zipkin.reporter.version} + mvn:io.zipkin.reporter/zipkin-sender-urlconnection/${zipkin.reporter.version} + mvn:io.zipkin.brave/brave-core/${brave.version} + + + + brave-core + mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.kafka-clients/0.8.2.2_1 + mvn:io.zipkin.reporter/zipkin-sender-kafka08/${zipkin.reporter.version} + + + + brave-core + mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax-inject/1_2 + mvn:io.zipkin.brave/brave-http/${brave.version} + mvn:io.zipkin.brave/brave-jaxrs2/${brave.version} + + + \ No newline at end of file diff --git a/brave-features/target/classes/features.xml b/brave-features/target/classes/features.xml new file mode 100644 index 0000000..dbde578 --- /dev/null +++ b/brave-features/target/classes/features.xml @@ -0,0 +1,43 @@ + + + + + mvn:org.apache.cxf.karaf/apache-cxf/3.1.8/xml/features + + + mvn:io.zipkin.java/zipkin/1.16.0 + mvn:io.zipkin.reporter/zipkin-reporter/${zipkin.reporter.version} + mvn:io.zipkin.reporter/zipkin-sender-urlconnection/${zipkin.reporter.version} + mvn:io.zipkin.brave/brave-core/3.16.0 + + + + brave-core + mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.kafka-clients/0.8.2.2_1 + mvn:io.zipkin.reporter/zipkin-sender-kafka08/${zipkin.reporter.version} + + + + brave-core + mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax-inject/1_2 + mvn:io.zipkin.brave/brave-http/3.16.0 + mvn:io.zipkin.brave/brave-jaxrs2/3.16.0 + + + \ No newline at end of file diff --git a/brave-itests/.classpath b/brave-itests/.classpath new file mode 100644 index 0000000..b2acffc --- /dev/null +++ b/brave-itests/.classpath @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brave-itests/.gitignore b/brave-itests/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/brave-itests/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/brave-itests/pom.xml b/brave-itests/pom.xml new file mode 100644 index 0000000..158a9a7 --- /dev/null +++ b/brave-itests/pom.xml @@ -0,0 +1,153 @@ + + + + 4.0.0 + + io.zipkin.brave.karaf + brave-karaf-parent + 1.0.0-SNAPSHOT + ../pom.xml + + brave-itests + 0.0.1-SNAPSHOT + + + 4.5.0 + 2.1.0 + 1.0.4 + 1.7.4 + 4.0.7 + 4.12 + ${project.basedir}/.. + + + + + io.zipkin.brave + brave-core + ${brave.version} + + + + junit + junit + test + + + + + org.ops4j.pax.exam + pax-exam-junit4 + ${pax.exam.version} + test + + + org.ops4j.pax.exam + pax-exam-invoker-junit + ${pax.exam.version} + test + + + + + org.ops4j.pax.exam + pax-exam-container-karaf + ${pax.exam.version} + test + + + org.ops4j.pax.exam + pax-exam-inject + ${pax.exam.version} + test + + + org.ops4j.pax.exam + pax-exam-extender-service + ${pax.exam.version} + test + + + + + org.ops4j.pax.exam + pax-exam-link-mvn + ${pax.exam.version} + test + + + + org.ops4j.pax.exam + pax-exam-link-assembly + ${pax.exam.version} + test + + + + ch.qos.logback + logback-core + ${logback.version} + test + + + + ch.qos.logback + logback-classic + ${logback.version} + test + + + + org.apache.geronimo.specs + geronimo-atinject_1.0_spec + 1.0 + provided + + + + org.osgi + org.osgi.core + 4.3.1 + provided + + + + org.osgi + org.osgi.compendium + 4.3.1 + provided + + + + + org.apache.karaf.features + standard + ${karaf.version} + xml + features + test + + + org.apache.karaf.features + org.apache.karaf.features.core + ${karaf.version} + test + + + + diff --git a/brave-itests/src/test/java/io/zipkin/brave/itests/BraveTest.java b/brave-itests/src/test/java/io/zipkin/brave/itests/BraveTest.java new file mode 100644 index 0000000..580bf4c --- /dev/null +++ b/brave-itests/src/test/java/io/zipkin/brave/itests/BraveTest.java @@ -0,0 +1,79 @@ +/** + * Copyright 2016 The OpenZipkin Authors + * + * Licensed 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 io.zipkin.brave.itests; + +import static org.hamcrest.core.IsEqual.equalTo; +import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; + +import java.util.ArrayList; +import java.util.List; + +import com.github.kristofa.brave.Brave; +import org.junit.Assert; +import org.junit.Test; +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.karaf.options.LogLevelOption.LogLevel; +import org.ops4j.pax.exam.options.MavenArtifactUrlReference; +import org.ops4j.pax.exam.options.MavenUrlReference; +import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; +import org.ops4j.pax.exam.spi.reactors.PerClass; +import zipkin.Span; +import zipkin.reporter.Reporter; + +@RunWith(PaxExam.class) +@ExamReactorStrategy(PerClass.class) +public class BraveTest { + List spans = new ArrayList<>(); + + @Configuration + public static Option[] configuration() throws Exception { + MavenArtifactUrlReference karaf = maven().groupId("org.apache.karaf").artifactId("apache-karaf") + .type("zip").version("4.0.7"); + MavenUrlReference brave = maven().groupId("net.lr.brave.osgi").artifactId("brave-features").type("xml") + .classifier("features").version("0.0.1-SNAPSHOT"); + return new Option[] // + { + karafDistributionConfiguration().frameworkUrl(karaf).useDeployFolder(false), + configureConsole().ignoreLocalConsole(), // + logLevel(LogLevel.INFO), // + keepRuntimeFolder(), // + features(brave, "brave-core") + }; + } + + @Test + public void shouldHaveBundleContext() { + Reporter local = new Reporter() { + + @Override + public void report(Span span) { + spans.add(span); + } + }; + Brave brave = new Brave.Builder().reporter(local).build(); + brave.localTracer().startNewSpan("test", "testop"); + brave.localTracer().finishSpan(); + Assert.assertThat(1, equalTo(spans.size())); + } + +} diff --git a/brave-itests/src/test/resources/exam.properties b/brave-itests/src/test/resources/exam.properties new file mode 100644 index 0000000..4936b4a --- /dev/null +++ b/brave-itests/src/test/resources/exam.properties @@ -0,0 +1,2 @@ +pax.exam.logging = none +pax.exam.service.timeout = 5000 diff --git a/brave-itests/src/test/resources/logback.xml b/brave-itests/src/test/resources/logback.xml new file mode 100644 index 0000000..c35d3ca --- /dev/null +++ b/brave-itests/src/test/resources/logback.xml @@ -0,0 +1,25 @@ + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + test.log + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/brave-itests/test.log b/brave-itests/test.log new file mode 100644 index 0000000..816493b --- /dev/null +++ b/brave-itests/test.log @@ -0,0 +1,12 @@ +18:31:51.236 [main] INFO o.o.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.5.0) created. +18:31:51.259 [main] INFO o.o.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class io.zipkin.brave.itests.BraveTest +18:31:51.296 [main] INFO o.o.pax.exam.junit.impl.ProbeRunner - running test class io.zipkin.brave.itests.BraveTest +18:31:51.887 [main] INFO o.o.p.e.k.c.i.KarafTestContainer - Wait for test container to finish its initialization [ RelativeTimeout value = 180000 ] +18:31:51.887 [main] INFO o.o.p.e.r.c.RemoteBundleContextClient - Waiting for remote bundle context.. on 21000 name: 8e7b7902-4f23-4c53-b6ce-f0e9726bb409 timout: [ RelativeTimeout value = 180000 ] +18:31:55.829 [main] INFO o.o.p.e.spi.reactors.ReactorManager - suite finished +18:34:24.681 [main] INFO o.o.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.5.0) created. +18:34:24.706 [main] INFO o.o.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class io.zipkin.brave.itests.BraveTest +18:34:24.748 [main] INFO o.o.pax.exam.junit.impl.ProbeRunner - running test class io.zipkin.brave.itests.BraveTest +18:34:25.317 [main] INFO o.o.p.e.k.c.i.KarafTestContainer - Wait for test container to finish its initialization [ RelativeTimeout value = 180000 ] +18:34:25.318 [main] INFO o.o.p.e.r.c.RemoteBundleContextClient - Waiting for remote bundle context.. on 21000 name: a46215d8-24fb-41ee-b43b-6abd9c827388 timout: [ RelativeTimeout value = 180000 ] +18:34:29.355 [main] INFO o.o.p.e.spi.reactors.ReactorManager - suite finished diff --git a/pom.xml b/pom.xml index d31d811..fe8f27a 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,8 @@ pom + brave-features + brave-itests @@ -37,6 +39,7 @@ 2.11 + 3.16.0 1.16.0 0.6.7 @@ -116,7 +119,6 @@ io.zipkin.java zipkin - ${zipkin.version}