0

I want to test hbase using its test cases. I downloaded the project from this link and followed the instruction to test the project, which is simply running the command line

mvn test

There is no problem up to here. What I want to do is to run test cases with jvmti agent. The agent works perfectly fine, I tried it on several java files. Normally, I call my agent to test a java file using

java -agentpath:/path/to/agent/agent.so javaProgram

In this case, the project use maven and I am not good at pom files. I tried to use

alias java="java -agentpath:/path/to/agent/agent.so " 

However it did not wok. How can I test hbase with my agent?

4

1 回答 1

1

您可以使用MAVEN_OPTS环境变量将 JVM 参数传递给 maven:

export MAVEN_OPTS=-agentpath:/path/to/agent.so

更通用的解决方案是使用JAVA_TOOL_OPTIONS环境变量。

在linux上:export JAVA_TOOL_OPTIONS=-agentpath:/path/to/agent.so然后运行mvn

于 2014-04-06T08:12:26.800 回答