Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#10149] Update plugin test launcher #10242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.pinpoint.test.plugin;

import com.navercorp.pinpoint.pluginit.utils.LogUtils;
import com.navercorp.pinpoint.it.plugin.utils.LogUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.pinpoint.test.plugin;

import com.navercorp.pinpoint.pluginit.utils.LogUtils;
import com.navercorp.pinpoint.it.plugin.utils.LogUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public static void checkParameterType(final Class[] classes) {
// if (clazz.getClassLoader() == Object.class.getClassLoader()) {
// return;
// }
if (clazz.getClassLoader() != Object.class.getClassLoader()) {
throw new IllegalArgumentException("unsupported classloader " + clazz);
}
// if (clazz.getClassLoader() != Object.class.getClassLoader()) {
// throw new IllegalArgumentException("unsupported classloader " + clazz);
// }

clazz = getRawComponentType(clazz);
if (clazz.isPrimitive()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2014 NAVER Corp.
* 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 com.navercorp.pinpoint.bootstrap.plugin.test;

/**
* @author Jongho Moon
*/
public class ExpectedNotNull extends ExpectedAnnotation {
public ExpectedNotNull(String name) {
super(name, null);
}

Check warning on line 23 in bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/test/ExpectedNotNull.java

View check run for this annotation

Codecov / codecov/patch

bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/test/ExpectedNotNull.java#L22-L23

Added lines #L22 - L23 were not covered by tests

@Override
public String toString() {
return "ExpectedNotNull{}";

Check warning on line 27 in bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/test/ExpectedNotNull.java

View check run for this annotation

Codecov / codecov/patch

bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/test/ExpectedNotNull.java#L27

Added line #L27 was not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ private void prepareAgentModule(final ClassLoader classLoader, JavaModule agentM
// because module pinpoint.agent does not export com.navercorp.pinpoint.profiler to unnamed module @7bfcd12c
agentModule.addExports("com.navercorp.pinpoint.profiler", bootstrapModule);

// Error:class com.navercorp.pinpoint.bootstrap.AgentBootLoader$1 cannot access class com.navercorp.pinpoint.test.PluginTestAgent (in module pinpoint.agent)
// Error:class com.navercorp.pinpoint.bootstrap.AgentBootLoader$1 cannot access class com.navercorp.pinpoint.profiler.test.PluginTestAgent (in module pinpoint.agent)
// because module pinpoint.agent does not export com.navercorp.pinpoint.test to unnamed module @4b9e13df
final String pinpointTestModule = "com.navercorp.pinpoint.test";
final String pinpointTestModule = "com.navercorp.pinpoint.profiler.test";
if (agentModule.getPackages().contains(pinpointTestModule)) {
agentModule.addExports(pinpointTestModule, bootstrapModule);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public enum AgentType {
DEFAULT_AGENT( "com.navercorp.pinpoint.profiler.DefaultAgent"),
PLUGIN_TEST("com.navercorp.pinpoint.test.PluginTestAgent");
PLUGIN_TEST("com.navercorp.pinpoint.profiler.test.PluginTestAgent");

Check warning on line 26 in bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/AgentType.java

View check run for this annotation

Codecov / codecov/patch

bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/AgentType.java#L26

Added line #L26 was not covered by tests

private final String className;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PinpointStarter {
public static final String BOOT_CLASS = "com.navercorp.pinpoint.profiler.DefaultAgent";

public static final String PLUGIN_TEST_AGENT = "PLUGIN_TEST";
public static final String PLUGIN_TEST_BOOT_CLASS = "com.navercorp.pinpoint.test.PluginTestAgent";
public static final String PLUGIN_TEST_BOOT_CLASS = "com.navercorp.pinpoint.profiler.test.PluginTestAgent";

private SimpleProperty systemProperty = SystemProperty.INSTANCE;

Expand Down
74 changes: 74 additions & 0 deletions plugins-it/activemq-it/activemq-5-15-it/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 NAVER Corp.
~
~ 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.
-->

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-activemq-plugin-it</artifactId>
<version>2.6.0-SNAPSHOT</version>
</parent>

<artifactId>pinpoint-activemq-5-15-plugin-it</artifactId>

<packaging>jar</packaging>

<properties>
<jdk.version>1.8</jdk.version>
<jdk.home>${env.JAVA_8_HOME}</jdk.home>
</properties>

<dependencies>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-activemq-client-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-user-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-plugin-it-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.13.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
* limitations under the License.
*/

package com.navercorp.pinpoint.plugin.activemq.client;
package com.navercorp.pinpoint.it.plugin.activemq.client;

import com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedTrace;
import com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier;
import com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifierHolder;
import com.navercorp.pinpoint.common.trace.ServiceType;
import com.navercorp.pinpoint.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.plugin.activemq.client.util.MessageConsumerBuilder;
import com.navercorp.pinpoint.plugin.activemq.client.util.MessageProducerBuilder;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.MessageConsumerBuilder;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.MessageProducerBuilder;
import com.navercorp.test.pinpoint.plugin.activemq.MessagePrinter;
import com.navercorp.test.pinpoint.plugin.activemq.MessageReceiveHandler;
import com.navercorp.test.pinpoint.plugin.activemq.MessageReceiver;
Expand Down Expand Up @@ -60,6 +59,10 @@ public abstract class ActiveMQClientITBase {
public static final String ACTIVEMQ_CLIENT = "ACTIVEMQ_CLIENT";
public static final String ACTIVEMQ_CLIENT_INTERNAL = "ACTIVEMQ_CLIENT_INTERNAL";

public static final String ASYNC = "ASYNC";
public static final String STAND_ALONE = "STAND_ALONE";
public static final String INTERNAL_METHOD = "INTERNAL_METHOD";

protected abstract String getProducerBrokerName();

protected abstract String getProducerBrokerUrl();
Expand Down Expand Up @@ -116,13 +119,13 @@ public void run() {
verifyConsumerConsumeEvent(verifier, testQueue, consumerSession);

// Separate transaction for the consumer's request to receive the message
verifier.verifyTrace(root(ServiceType.STAND_ALONE.getName(), "Entry Point Process", null, null, null, null));
verifier.verifyTrace(root(STAND_ALONE, "Entry Point Process", null, null, null, null));
Method receiveMessageMethod = MessageReceiver.class.getDeclaredMethod("receiveMessage", long.class);
verifier.verifyTrace(event(ServiceType.INTERNAL_METHOD.getName(), receiveMessageMethod));
verifier.verifyTrace(event(INTERNAL_METHOD, receiveMessageMethod));
Method receiveMethod = ActiveMQMessageConsumer.class.getDeclaredMethod("receive", long.class);
verifier.verifyTrace(event(ACTIVEMQ_CLIENT_INTERNAL, receiveMethod, annotation("activemq.message", getMessageAsString(expectedTextMessage))));
Method printMessageMethod = MessagePrinter.class.getDeclaredMethod("printMessage", Message.class);
verifier.verifyTrace(event(ServiceType.INTERNAL_METHOD.getName(), printMessageMethod));
verifier.verifyTrace(event(INTERNAL_METHOD, printMessageMethod));

verifier.verifyTraceCount(0);
}
Expand Down Expand Up @@ -176,7 +179,7 @@ public void onMessage(Message message) {
verifyConsumerConsumeEvent(verifier, testQueue, consumerSession);

Method printMessageMethod = MessagePrinter.class.getDeclaredMethod("printMessage", Message.class);
verifier.verifyTrace(event(ServiceType.INTERNAL_METHOD.getName(), printMessageMethod));
verifier.verifyTrace(event(INTERNAL_METHOD, printMessageMethod));

verifier.verifyTraceCount(0);
}
Expand Down Expand Up @@ -216,11 +219,11 @@ public void testQueuePoll() throws Exception {
verifyProducerSendEvent(verifier, testQueue, producerSession);
verifyConsumerConsumeEvent(verifier, testQueue, consumerSession);

verifier.verifyTrace(event(ServiceType.ASYNC.getName(), "Asynchronous Invocation"));
verifier.verifyTrace(event(ASYNC, "Asynchronous Invocation"));
Method handleMessageMethod = MessageReceiveHandler.class.getDeclaredMethod("handleMessage", Message.class);
verifier.verifyTrace(event(ServiceType.INTERNAL_METHOD.getName(), handleMessageMethod));
verifier.verifyTrace(event(INTERNAL_METHOD, handleMessageMethod));
Method printMessageMethod = MessagePrinter.class.getDeclaredMethod("printMessage", Message.class);
verifier.verifyTrace(event(ServiceType.INTERNAL_METHOD.getName(), printMessageMethod));
verifier.verifyTrace(event(INTERNAL_METHOD, printMessageMethod));

verifier.verifyTraceCount(0);
}
Expand Down Expand Up @@ -294,10 +297,10 @@ public void run() {
Method printMessageMethod = MessagePrinter.class.getDeclaredMethod("printMessage", Message.class);
for (int i = 0; i < 2; ++i) {
verifier.verifyDiscreteTrace(
root(ServiceType.STAND_ALONE.getName(), "Entry Point Process", null, null, null, null),
event(ServiceType.INTERNAL_METHOD.getName(), receiveMessageMethod),
root(STAND_ALONE, "Entry Point Process", null, null, null, null),
event(INTERNAL_METHOD, receiveMessageMethod),
event(ACTIVEMQ_CLIENT_INTERNAL, receiveMethod, annotation("activemq.message", getMessageAsString(expectedTextMessage))),
event(ServiceType.INTERNAL_METHOD.getName(), printMessageMethod));
event(INTERNAL_METHOD, printMessageMethod));
}

verifier.verifyTraceCount(0);
Expand Down Expand Up @@ -360,7 +363,7 @@ public void onMessage(Message message) {

Method printMessageMethod = MessagePrinter.class.getDeclaredMethod("printMessage", Message.class);
for (int i = 0; i < 2; ++i) {
verifier.verifyTrace(event(ServiceType.INTERNAL_METHOD.getName(), printMessageMethod));
verifier.verifyTrace(event(INTERNAL_METHOD, printMessageMethod));
}

verifier.verifyTraceCount(0);
Expand Down Expand Up @@ -412,11 +415,11 @@ public void testTopicPoll() throws Exception {
verifyConsumerConsumeEvent(verifier, testTopic, consumer1Session);
verifyConsumerConsumeEvent(verifier, testTopic, consumer2Session);

ExpectedTrace asyncTrace = event(ServiceType.ASYNC.getName(), "Asynchronous Invocation");
ExpectedTrace asyncTrace = event(ASYNC, "Asynchronous Invocation");
Method handleMessageMethod = MessageReceiveHandler.class.getDeclaredMethod("handleMessage", Message.class);
ExpectedTrace handleMessageTrace = event(ServiceType.INTERNAL_METHOD.getName(), handleMessageMethod);
ExpectedTrace handleMessageTrace = event(INTERNAL_METHOD, handleMessageMethod);
Method printMessageMethod = MessagePrinter.class.getDeclaredMethod("printMessage", Message.class);
ExpectedTrace printMessageTrace = event(ServiceType.INTERNAL_METHOD.getName(), printMessageMethod);
ExpectedTrace printMessageTrace = event(INTERNAL_METHOD, printMessageMethod);
for (int i = 0; i < 2; ++i) {
verifier.verifyDiscreteTrace(asyncTrace, handleMessageTrace, printMessageTrace);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

package com.navercorp.pinpoint.plugin.activemq.client;
package com.navercorp.pinpoint.it.plugin.activemq.client;

import com.navercorp.pinpoint.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.plugin.activemq.client.util.PortUtils;
import com.navercorp.pinpoint.plugin.activemq.client.util.TestBroker;
import com.navercorp.pinpoint.pluginit.utils.AgentPath;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.PortUtils;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.TestBroker;
import com.navercorp.pinpoint.it.plugin.utils.AgentPath;
import com.navercorp.pinpoint.test.plugin.Dependency;
import com.navercorp.pinpoint.test.plugin.ImportPlugin;
import com.navercorp.pinpoint.test.plugin.PinpointAgent;
import com.navercorp.pinpoint.test.plugin.PinpointConfig;
import com.navercorp.pinpoint.test.plugin.PluginTest;
import com.navercorp.pinpoint.testcase.util.SocketUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -33,9 +33,9 @@
/**
* @author HyunGil Jeong
*/
@PluginTest
@PinpointAgent(AgentPath.PATH)
@PinpointConfig("activemq/client/pinpoint-activemq-client.config")
@ImportPlugin({"com.navercorp.pinpoint:pinpoint-activemq-client-plugin", "com.navercorp.pinpoint:pinpoint-user-plugin"})
// 5.4.1 bug creates activemq-data directory even if persistence is set to false - skip it
// 5.5.x activemq-all missing slf4j binder - just skip instead of supplying one
@Dependency({"org.apache.activemq:activemq-all:[5.1.0,5.4.1),[5.4.2,5.4.max],[5.6.0,5.14.max]"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
* limitations under the License.
*/

package com.navercorp.pinpoint.plugin.activemq.client;
package com.navercorp.pinpoint.it.plugin.activemq.client;

import com.navercorp.pinpoint.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.plugin.activemq.client.util.PortUtils;
import com.navercorp.pinpoint.plugin.activemq.client.util.TestBroker;
import com.navercorp.pinpoint.pluginit.utils.AgentPath;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.PortUtils;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.TestBroker;
import com.navercorp.pinpoint.it.plugin.utils.AgentPath;
import com.navercorp.pinpoint.test.plugin.Dependency;
import com.navercorp.pinpoint.test.plugin.ImportPlugin;
import com.navercorp.pinpoint.test.plugin.JvmVersion;
import com.navercorp.pinpoint.test.plugin.PinpointAgent;
import com.navercorp.pinpoint.test.plugin.PinpointConfig;
import com.navercorp.pinpoint.test.plugin.PluginTest;
import com.navercorp.pinpoint.testcase.util.SocketUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -34,12 +33,9 @@
/**
* @author HyunGil Jeong
*/
@PluginTest
@PinpointAgent(AgentPath.PATH)
@PinpointConfig("activemq/client/pinpoint-activemq-client.config")
@JvmVersion(8)
@ImportPlugin({"com.navercorp.pinpoint:pinpoint-activemq-client-plugin", "com.navercorp.pinpoint:pinpoint-user-plugin"})
// 5.4.1 bug creates activemq-data directory even if persistence is set to false - skip it
// 5.5.x activemq-all missing slf4j binder - just skip instead of supplying one
@Dependency({"org.apache.activemq:activemq-all:[5.15.0,5.17.0)"})
public class ActiveMQClientMultipleBrokers_5_15_x_IT extends ActiveMQClientITBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

package com.navercorp.pinpoint.plugin.activemq.client;
package com.navercorp.pinpoint.it.plugin.activemq.client;

import com.navercorp.pinpoint.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.plugin.activemq.client.util.PortUtils;
import com.navercorp.pinpoint.plugin.activemq.client.util.TestBroker;
import com.navercorp.pinpoint.pluginit.utils.AgentPath;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.ActiveMQClientITHelper;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.PortUtils;
import com.navercorp.pinpoint.it.plugin.activemq.client.util.TestBroker;
import com.navercorp.pinpoint.it.plugin.utils.AgentPath;
import com.navercorp.pinpoint.test.plugin.Dependency;
import com.navercorp.pinpoint.test.plugin.ImportPlugin;
import com.navercorp.pinpoint.test.plugin.PinpointAgent;
import com.navercorp.pinpoint.test.plugin.PinpointConfig;
import com.navercorp.pinpoint.test.plugin.PluginTest;
import com.navercorp.pinpoint.testcase.util.SocketUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -33,9 +33,9 @@
/**
* @author HyunGil Jeong
*/
@PluginTest
@PinpointAgent(AgentPath.PATH)
@PinpointConfig("activemq/client/pinpoint-activemq-client.config")
@ImportPlugin({"com.navercorp.pinpoint:pinpoint-activemq-client-plugin", "com.navercorp.pinpoint:pinpoint-user-plugin"})
// 5.4.1 bug creates activemq-data directory even if persistence is set to false - skip it
// 5.5.x activemq-all missing slf4j binder - just skip instead of supplying one
@Dependency({"org.apache.activemq:activemq-all:[5.1.0,5.4.1),[5.4.2,5.4.max],[5.6.0,5.14.max]"})
Expand Down
Loading