Skip to content

Commit

Permalink
[#2789] Update library versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xylus authored and minwoo-jung committed May 24, 2017
1 parent 910651f commit 5f4f533
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
<httpcomponents.version>4.3</httpcomponents.version>
<jedis.version>2.4.2</jedis.version>
<cloverLicenseLocation>${basedir}/clover.license</cloverLicenseLocation>
<spring.version>4.1.9.RELEASE</spring.version>
<spring.batch.version>2.2.7.RELEASE</spring.batch.version>
<spring.security.version>4.0.4.RELEASE</spring.security.version>
<spring.version>4.3.8.RELEASE</spring.version>
<spring.batch.version>3.0.7.RELEASE</spring.batch.version>
<spring.security.version>4.2.2.RELEASE</spring.security.version>
<docker.maven.plugin.version>0.4.3</docker.maven.plugin.version>
<cassandra.driver.version>2.1.7.1</cassandra.driver.version>
<sniffer.artifactid>java16</sniffer.artifactid>
Expand All @@ -101,7 +101,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -538,7 +538,7 @@
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
<version>1.9.3</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -569,13 +569,13 @@
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-debug-all</artifactId>
<version>5.1</version>
<version>5.2</version>
</dependency>

<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.9</version>
<version>1.8.10</version>
</dependency>


Expand Down Expand Up @@ -621,8 +621,8 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<artifactId>mockito-core</artifactId>
<version>2.7.22</version>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
Expand Down Expand Up @@ -679,7 +679,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>20.0</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public static ASMClassNodeAdapter get(final InstrumentContext pluginContext, fin
}

public static ASMClassNodeAdapter get(final InstrumentContext pluginContext, final ClassLoader classLoader, final String classInternalName, final boolean skipCode) {
if (pluginContext == null || classInternalName == null) {
throw new IllegalArgumentException("plugin context or class name must not be null.");
if (pluginContext == null) {
throw new NullPointerException("pluginContext must not be null");
}
if (classInternalName == null) {
throw new NullPointerException("classInternalName must not be null");
}

InputStream in = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public void handle(ClassNode classNode) {

@Test
public void hasAnnotation() throws Exception {
ASMClassNodeAdapter classNodeAdapter = ASMClassNodeAdapter.get(pluginContext, null, "com/navercorp/pinpoint/profiler/instrument/mock/AnnotationClass");
ASMClassNodeAdapter classNodeAdapter = ASMClassNodeAdapter.get(pluginContext, ASMClassNodeLoader.getClassLoader(), "com/navercorp/pinpoint/profiler/instrument/mock/AnnotationClass");
Assert.assertTrue(classNodeAdapter.hasAnnotation(Aspect.class));
Assert.assertFalse(classNodeAdapter.hasAnnotation(Override.class));
}
Expand All @@ -243,7 +243,7 @@ public void handle(ClassNode classNode) {

@Test
public void subclassOf() {
ASMClassNodeAdapter adapter = ASMClassNodeAdapter.get(pluginContext, null, "com/navercorp/pinpoint/profiler/instrument/mock/ExtendedClass");
ASMClassNodeAdapter adapter = ASMClassNodeAdapter.get(pluginContext, ASMClassNodeLoader.getClassLoader(), "com/navercorp/pinpoint/profiler/instrument/mock/ExtendedClass");
// self
assertEquals(true, adapter.subclassOf("com/navercorp/pinpoint/profiler/instrument/mock/ExtendedClass"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.navercorp.pinpoint.profiler.util.JavaAssistUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentMatchers;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.objectweb.asm.tree.ClassNode;
Expand All @@ -28,6 +29,7 @@
import java.io.PrintWriter;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand All @@ -42,7 +44,7 @@ public class ASMClassWriterTest {

@Before
public void setUp() {
when(pluginContext.injectClass(any(ClassLoader.class), any(String.class))).thenAnswer(new Answer<Class<?>>() {
when(pluginContext.injectClass(ArgumentMatchers.<ClassLoader>isNull(), anyString())).thenAnswer(new Answer<Class<?>>() {

@Override
public Class<?> answer(InvocationOnMock invocation) throws Throwable {
Expand All @@ -53,7 +55,7 @@ public Class<?> answer(InvocationOnMock invocation) throws Throwable {
}

});
when(pluginContext.getResourceAsStream(any(ClassLoader.class), any(String.class))).thenAnswer(new Answer<InputStream>() {
when(pluginContext.getResourceAsStream(ArgumentMatchers.<ClassLoader>isNull(), anyString())).thenAnswer(new Answer<InputStream>() {

@Override
public InputStream answer(InvocationOnMock invocation) throws Throwable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.navercorp.pinpoint.profiler.sender.DataSender;
import com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder;
import com.navercorp.pinpoint.thrift.dto.TAgentStat;
import com.navercorp.pinpoint.thrift.dto.TAgentStatBatch;
import org.junit.Test;
import org.mockito.Mockito;

Expand All @@ -52,7 +53,7 @@ public void run() throws Exception {
CollectJob job = new CollectJob(dataSender, "agent", 0, agentStatMetricCollector, 1);
job.run();

Mockito.verify(dataSender).send(any(TAgentStat.class));
Mockito.verify(dataSender).send(any(TAgentStatBatch.class));

}

Expand Down

0 comments on commit 5f4f533

Please sign in to comment.