Vertx plugin test re-implementation (#4624)

* vertx web plugin re-impl attempt
This commit is contained in:
Brandon Fergerson 2020-04-24 07:49:03 -04:00 committed by GitHub
parent 15f1e048e9
commit 776d508018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 1091 additions and 0 deletions

View File

@ -41,6 +41,8 @@ jobs:
- { name: 'spring-4.1.x-scenario', title: 'Spring 4.1.x-4.2.x (20)' }
- { name: 'spring-4.3.x-scenario', title: 'Spring 4.3.x-5.2.x (54)' }
- { name: 'spring-async-scenario', title: 'Spring Async 4.3.x-5.1.x (35)' }
- { name: 'vertx-eventbus-3.x-scenario', title: 'Vert.x EventBus 3.2.x-3.7.x (19)' }
- { name: 'vertx-web-3.x-scenario', title: 'Vert.x Web 3.0.x-3.7.x (21)' }
steps:
- uses: actions/checkout@v2
- name: checkout submodules

View File

@ -0,0 +1,21 @@
#!/bin/bash
#
# 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.
home="$(cd "$(dirname $0)"; pwd)"
java -jar ${agent_opts} ${home}/../libs/vertx-eventbus-3.x-scenario.jar &

View File

@ -0,0 +1,140 @@
# 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.
segmentItems:
- serviceName: vertx-eventbus-3.x-scenario
segmentSize: 7
segments:
- segmentId: not null
spans:
- operationName: local-message-receiver
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- {parentEndpoint: local-message-receiver, networkAddress: '', refType: CrossThread,
parentSpanId: 0, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: vertx-eventbus-3.x-scenario,
traceId: not null}
- segmentId: not null
spans:
- {operationName: local-message-receiver, operationId: 0, parentSpanId: -1, spanId: 0,
spanLayer: RPCFramework, startTime: nq 0, endTime: nq 0, componentId: 59,
isError: false, spanType: Local, peer: '', skipAnalysis: false}
- segmentId: not null
spans:
- operationName: /vertx-eventbus-3-scenario/case/executeTest
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: /vertx-eventbus-3-scenario/case/executeTest}
- operationName: /vertx-eventbus-3-scenario/case/eventbus-case
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: /vertx-eventbus-3-scenario/case/eventbus-case}
- segmentId: not null
spans:
- operationName: '#/vertx-eventbus-3-scenario/case/executeTest'
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- {parentEndpoint: /vertx-eventbus-3-scenario/case/eventbus-case, networkAddress: '',
refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: vertx-eventbus-3.x-scenario,
traceId: not null}
- segmentId: not null
spans:
- operationName: cluster-message-receiver
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
refs:
- {parentEndpoint: cluster-message-receiver, networkAddress: not null,
refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: vertx-eventbus-3.x-scenario,
traceId: not null}
- segmentId: not null
spans:
- {operationName: cluster-message-receiver, operationId: 0, parentSpanId: -1,
spanId: 0, spanLayer: RPCFramework, startTime: nq 0, endTime: nq 0,
componentId: 59, isError: false, spanType: Exit, peer: not null, skipAnalysis: false}
- segmentId: not null
spans:
- operationName: /vertx-eventbus-3-scenario/case/executeTest
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: /vertx-eventbus-3-scenario/case/executeTest}
refs:
- {parentEndpoint: /vertx-eventbus-3-scenario/case/eventbus-case, networkAddress: 'localhost:8080',
refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: vertx-eventbus-3.x-scenario,
traceId: not null}

View File

@ -0,0 +1,20 @@
# 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.
type: jvm
entryService: http://localhost:8080/vertx-eventbus-3-scenario/case/eventbus-case
healthCheck: http://localhost:8080/vertx-eventbus-3-scenario/case/healthCheck
startScript: ./bin/startup.sh

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.apache.skywalking.apm.testcase</groupId>
<artifactId>vertx-eventbus-3.x-scenario</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.8</compiler.version>
<test.framework.version>3.7.0</test.framework.version>
</properties>
<name>skywalking-vertx-eventbus-3.x-scenario</name>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${test.framework.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${test.framework.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-hazelcast</artifactId>
<version>${test.framework.version}</version>
</dependency>
</dependencies>
<build>
<finalName>vertx-eventbus-3.x-scenario</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${compiler.version}</source>
<target>${compiler.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<outputDirectory>./target/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>./bin</directory>
<fileMode>0775</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/vertx-eventbus-3.x-scenario.jar</source>
<outputDirectory>./libs</outputDirectory>
<fileMode>0775</fileMode>
</file>
</files>
</assembly>

View File

@ -0,0 +1,59 @@
/*
* 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.skywalking.apm.testcase.vertxeventbus;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.spi.cluster.ClusterManager;
import io.vertx.spi.cluster.hazelcast.HazelcastClusterManager;
import org.apache.skywalking.apm.testcase.vertxeventbus.controller.ClusterReceiver;
import org.apache.skywalking.apm.testcase.vertxeventbus.controller.VertxEventbusController;
public class Application {
public static void main(String[] args) {
System.setProperty("vertx.disableFileCPResolving", "true");
ClusterManager mgr = new HazelcastClusterManager();
VertxOptions options = new VertxOptions().setClusterManager(mgr);
Vertx.clusteredVertx(options, cluster -> {
if (cluster.succeeded()) {
cluster.result().deployVerticle(new ClusterReceiver(), deploy -> {
if (deploy.succeeded()) {
ClusterManager mgr2 = new HazelcastClusterManager();
VertxOptions options2 = new VertxOptions().setClusterManager(mgr2);
Vertx.clusteredVertx(options2, cluster2 -> {
if (cluster2.succeeded()) {
cluster2.result().deployVerticle(new VertxEventbusController());
} else {
cluster2.cause().printStackTrace();
System.exit(-1);
}
});
} else {
deploy.cause().printStackTrace();
System.exit(-1);
}
});
} else {
cluster.cause().printStackTrace();
System.exit(-1);
}
});
}
}

View File

@ -0,0 +1,35 @@
/*
* 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.skywalking.apm.testcase.vertxeventbus.controller;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.eventbus.EventBus;
import org.apache.skywalking.apm.testcase.vertxeventbus.util.CustomMessage;
import org.apache.skywalking.apm.testcase.vertxeventbus.util.CustomMessageCodec;
public class ClusterReceiver extends AbstractVerticle {
@Override
public void start() {
EventBus eventBus = vertx.eventBus();
eventBus.registerDefaultCodec(CustomMessage.class, new CustomMessageCodec());
eventBus.consumer("cluster-message-receiver",
message -> message.reply(new CustomMessage("cluster-message-receiver reply")));
}
}

View File

@ -0,0 +1,30 @@
/*
* 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.skywalking.apm.testcase.vertxeventbus.controller;
import io.vertx.core.AbstractVerticle;
import org.apache.skywalking.apm.testcase.vertxeventbus.util.CustomMessage;
public class LocalReceiver extends AbstractVerticle {
@Override
public void start() {
vertx.eventBus().consumer("local-message-receiver",
message -> message.reply(new CustomMessage("local-message-receiver reply")));
}
}

View File

@ -0,0 +1,91 @@
/*
* 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.skywalking.apm.testcase.vertxeventbus.controller;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.json.Json;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import org.apache.skywalking.apm.testcase.vertxeventbus.util.CustomMessage;
import org.apache.skywalking.apm.testcase.vertxeventbus.util.CustomMessageCodec;
public class VertxEventbusController extends AbstractVerticle {
@Override
public void start() {
Router router = Router.router(vertx);
router.get("/vertx-eventbus-3-scenario/case/eventbus-case").handler(this::handleCoreCase);
router.get("/vertx-eventbus-3-scenario/case/executeTest").handler(this::executeTest);
router.head("/vertx-eventbus-3-scenario/case/healthCheck").handler(this::healthCheck);
vertx.createHttpServer().requestHandler(router::accept).listen(8080);
vertx.eventBus().registerDefaultCodec(CustomMessage.class, new CustomMessageCodec());
vertx.deployVerticle(LocalReceiver.class.getName());
}
private void handleCoreCase(RoutingContext routingContext) {
vertx.createHttpClient().getNow(8080, "localhost",
"/vertx-eventbus-3-scenario/case/executeTest",
it -> routingContext.response().setStatusCode(it.statusCode()).end());
}
private void executeTest(RoutingContext routingContext) {
Future<Void> localMessageFuture = Future.future();
CustomMessage localMessage = new CustomMessage("local-message-receiver request");
vertx.eventBus().send("local-message-receiver", localMessage, reply -> {
if (reply.succeeded()) {
CustomMessage replyMessage = (CustomMessage) reply.result().body();
System.out.println("Received local reply: " + replyMessage.getMessage());
localMessageFuture.complete();
} else {
localMessageFuture.fail(reply.cause());
}
});
Future<Void> clusterMessageFuture = Future.future();
CustomMessage clusterWideMessage = new CustomMessage("cluster-message-receiver request");
vertx.eventBus().send("cluster-message-receiver", clusterWideMessage, reply -> {
if (reply.succeeded()) {
CustomMessage replyMessage = (CustomMessage) reply.result().body();
System.out.println("Received cluster reply: " + replyMessage.getMessage());
clusterMessageFuture.complete();
} else {
clusterMessageFuture.fail(reply.cause());
}
});
localMessageFuture.setHandler(localHandler -> {
if (localHandler.succeeded()) {
clusterMessageFuture.setHandler(clusterHandler -> {
if (clusterHandler.succeeded()) {
routingContext.response().setStatusCode(200).end();
} else {
routingContext.response().setStatusCode(500).end(Json.encodePrettily(clusterHandler.cause()));
}
});
} else {
routingContext.response().setStatusCode(500).end(Json.encodePrettily(localHandler.cause()));
}
});
}
private void healthCheck(RoutingContext routingContext) {
routingContext.response().setStatusCode(200).end("Success");
}
}

View File

@ -0,0 +1,31 @@
/*
* 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.skywalking.apm.testcase.vertxeventbus.util;
public class CustomMessage {
private final String message;
public CustomMessage(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
}

View File

@ -0,0 +1,56 @@
/*
* 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.skywalking.apm.testcase.vertxeventbus.util;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.eventbus.MessageCodec;
import io.vertx.core.json.Json;
import io.vertx.core.json.JsonObject;
public class CustomMessageCodec implements MessageCodec<CustomMessage, CustomMessage> {
@Override
public void encodeToWire(Buffer buffer, CustomMessage customMessage) {
String jsonStr = Json.encode(customMessage);
int length = jsonStr.getBytes().length;
buffer.appendInt(length);
buffer.appendString(jsonStr);
}
@Override
public CustomMessage decodeFromWire(int position, Buffer buffer) {
int length = buffer.getInt(position);
JsonObject jsonMessage = new JsonObject(buffer.getString(position += 4, position + length));
return new CustomMessage(jsonMessage.getString("message"));
}
@Override
public CustomMessage transform(CustomMessage customMessage) {
return customMessage;
}
@Override
public String name() {
return getClass().getSimpleName();
}
@Override
public byte systemCodecID() {
return -1;
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<Configuration status="debug">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d [%traceId] %-5p %c{1}:%L - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="OFF">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,35 @@
# 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
# "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.
3.7.0
3.6.3
3.6.2
3.6.1
3.6.0
3.5.4
3.5.3
3.5.2
3.5.1
3.5.0
3.4.2
3.4.1
3.4.0
3.3.3
3.3.2
3.3.1
3.3.0
3.2.1
3.2.0

View File

@ -0,0 +1,21 @@
#!/bin/bash
#
# 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.
home="$(cd "$(dirname $0)"; pwd)"
java -jar ${agent_opts} ${home}/../libs/vertx-web-3.x-scenario.jar &

View File

@ -0,0 +1,71 @@
# 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.
segmentItems:
- serviceName: vertx-web-3.x-scenario
segmentSize: 2
segments:
- segmentId: nq 0
spans:
- operationName: /vertx-web-3-scenario/case/healthCheck
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: /vertx-web-3-scenario/case/healthCheck}
- operationName: /vertx-web-3-scenario/case/web-case
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: /vertx-web-3-scenario/case/web-case}
- segmentId: nq 0
spans:
- operationName: '#/vertx-web-3-scenario/case/healthCheck'
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 59
isError: false
spanType: Local
peer: ''
skipAnalysis: false
refs:
- {parentEndpoint: /vertx-web-3-scenario/case/web-case, networkAddress: '',
refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: vertx-web-3.x-scenario,
traceId: not null}

View File

@ -0,0 +1,20 @@
# 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.
type: jvm
entryService: http://localhost:8080/vertx-web-3-scenario/case/web-case
healthCheck: http://localhost:8080/vertx-web-3-scenario/case/healthCheck
startScript: ./bin/startup.sh

View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.apache.skywalking.apm.testcase</groupId>
<artifactId>vertx-web-3.x-scenario</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.8</compiler.version>
<test.framework.version>3.7.0</test.framework.version>
</properties>
<name>skywalking-vertx-web-3.x-scenario</name>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${test.framework.version}</version>
</dependency>
</dependencies>
<build>
<finalName>vertx-web-3.x-scenario</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${compiler.version}</source>
<target>${compiler.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<outputDirectory>./target/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>./bin</directory>
<fileMode>0775</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/vertx-web-3.x-scenario.jar</source>
<outputDirectory>./libs</outputDirectory>
<fileMode>0775</fileMode>
</file>
</files>
</assembly>

View File

@ -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.
*
*/
package org.apache.skywalking.apm.testcase.vertxweb;
import io.vertx.core.Vertx;
import org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Comparator;
public class Application {
public static void main(String[] args) throws IOException {
//ensures .vertx files are uncreated/deleted
System.setProperty("vertx.disableFileCPResolving", "true");
Vertx vertx = Vertx.vertx();
if (new File(".vertx").exists()) {
Files.walk(new File(".vertx").toPath())
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
}
vertx.deployVerticle(new VertxWebController(), it -> {
if (it.failed()) {
it.cause().printStackTrace();
System.exit(-1);
}
});
}
}

View File

@ -0,0 +1,43 @@
/*
* 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.skywalking.apm.testcase.vertxweb.controller;
import io.vertx.core.AbstractVerticle;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
public class VertxWebController extends AbstractVerticle {
@Override
public void start() {
Router router = Router.router(vertx);
router.get("/vertx-web-3-scenario/case/web-case").handler(this::handleCoreCase);
router.head("/vertx-web-3-scenario/case/healthCheck").handler(this::healthCheck);
vertx.createHttpServer().requestHandler(router::accept).listen(8080);
}
private void handleCoreCase(RoutingContext routingContext) {
vertx.createHttpClient().getNow(8080, "localhost",
"/vertx-web-3-scenario/case/healthCheck",
it -> routingContext.response().setStatusCode(it.statusCode()).end());
}
private void healthCheck(RoutingContext routingContext) {
routingContext.response().setStatusCode(200).end("Success");
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<Configuration status="debug">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d [%traceId] %-5p %c{1}:%L - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="OFF">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -0,0 +1,37 @@
# 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
# "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.
3.7.0
3.6.3
3.6.2
3.6.1
3.6.0
3.5.4
3.5.3
3.5.2
3.5.1
3.5.0
3.4.2
3.4.1
3.4.0
3.3.3
3.3.2
3.3.1
3.3.0
3.2.1
3.2.0
3.1.0
3.0.0