Merge branch 'master' into zipkin-v2
diff --git a/geronimo-opentracing/pom.xml b/geronimo-opentracing/pom.xml
index 71f5f41..15dbac0 100644
--- a/geronimo-opentracing/pom.xml
+++ b/geronimo-opentracing/pom.xml
@@ -122,6 +122,12 @@
       <version>1.2</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>io.zipkin.zipkin2</groupId>
+      <artifactId>zipkin-junit</artifactId>
+      <version>2.12.9</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/BasicZipkinTest.java b/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/BasicZipkinTest.java
new file mode 100644
index 0000000..fa367ce
--- /dev/null
+++ b/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/BasicZipkinTest.java
@@ -0,0 +1,97 @@
+/*
+ * 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.geronimo.microprofile.opentracing.tck.setup;
+
+
+import io.opentracing.tag.Tags;
+import org.eclipse.microprofile.config.spi.ConfigSource;
+import org.eclipse.microprofile.opentracing.tck.OpenTracingBaseTests;
+import org.eclipse.microprofile.opentracing.tck.OpenTracingSkipPatternTests;
+import org.eclipse.microprofile.opentracing.tck.application.WildcardClassService;
+import org.eclipse.microprofile.opentracing.tck.tracer.TestSpan;
+import org.eclipse.microprofile.opentracing.tck.tracer.TestSpanTree;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Rule;
+import org.testng.annotations.Test;
+import zipkin2.junit.ZipkinRule;
+
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.core.Response;
+import java.util.Collections;
+
+public class BasicZipkinTest extends Arquillian {
+
+    @Rule
+    private ZipkinRule zipkin = new ZipkinRule();
+
+    @Deployment
+    public static WebArchive createDeployment() {
+        return ShrinkWrap.create(WebArchive.class)
+                .addClasses(SimpleService.class);
+    }
+
+    /**
+     * Test that server endpoint is adding standard tags
+     */
+    @Test
+    @RunAsClient
+    private void testSimpleService() throws InterruptedException {
+
+        zipkin.httpUrl()
+
+
+        /*
+
+        Response response = executeRemoteWebServiceRaw("wildcard/10/foo",
+                "getFoo/ten", Response.Status.OK);
+        response.close();
+
+        TestSpanTree spans = executeRemoteWebServiceTracerTree();
+
+        TestSpanTree expectedTree = new TestSpanTree(
+                new TestSpanTree.TreeNode<>(
+                        new TestSpan(
+                                getOperationName(
+                                        Tags.SPAN_KIND_SERVER,
+                                        HttpMethod.GET,
+                                        WildcardClassService.class,
+                                        getEndpointMethod(WildcardClassService.class, WildcardClassService.REST_FOO_PATH)
+                                ),
+                                getExpectedSpanTags(
+                                        Tags.SPAN_KIND_SERVER,
+                                        HttpMethod.GET,
+                                        "wildcard/10/foo",
+                                        "getFoo/ten",
+                                        null,
+                                        Response.Status.OK.getStatusCode(),
+                                        JAXRS_COMPONENT
+                                ),
+                                Collections.emptyList()
+                        )
+                )
+        );
+        assertEqualTrees(spans, expectedTree);
+
+        */
+    }
+
+
+}
diff --git a/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/SimpleService.java b/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/SimpleService.java
new file mode 100644
index 0000000..8d933e6
--- /dev/null
+++ b/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/SimpleService.java
@@ -0,0 +1,21 @@
+package org.apache.geronimo.microprofile.opentracing.tck.setup;
+
+import org.eclipse.microprofile.opentracing.Traced;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Traced
+@Path("hello")
+public class SimpleService {
+
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public String sayHello() throws Exception {
+        return "Hello, world!";
+    }
+
+
+}
diff --git a/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/SkipOpentracingApiSetup.java b/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/SkipOpentracingApiSetup.java
index 788d6a4..01cfef1 100644
--- a/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/SkipOpentracingApiSetup.java
+++ b/geronimo-opentracing/src/test/java/org/apache/geronimo/microprofile/opentracing/tck/setup/SkipOpentracingApiSetup.java
@@ -21,6 +21,9 @@
 import org.jboss.arquillian.core.spi.LoadableExtension;
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.Filters;
+import org.jboss.shrinkwrap.api.Node;
+
+import java.util.Collection;
 
 // the tck put the opentracing-api in the war but not our impl, let's fix it by using the apploader api jar!
 public class SkipOpentracingApiSetup implements LoadableExtension {
@@ -34,8 +37,10 @@
 
         public void clean(@Observes final BeforeDeploy beforeDeploy) {
             final Archive<?> archive = beforeDeploy.getDeployment().getArchive();
-            archive.delete(archive.getContent(Filters.include("\\/WEB-INF\\/lib\\/opentracing\\-api\\-.*\\.jar")).values()
-                    .iterator().next().getPath());
+            final Collection<Node> opentracingApi = archive.getContent(Filters.include("\\/WEB-INF\\/lib\\/opentracing\\-api\\-.*\\.jar")).values();
+            if (opentracingApi != null && !opentracingApi.isEmpty()) {
+                archive.delete(opentracingApi.iterator().next().getPath());
+            }
         }
     }
 }