mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-19 01:35:58 +10:00
fix package name & delete dependency profiler & fix tab to space
This commit is contained in:
+10
-10
@@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.navercorp.pinpoint.plugin.json.lib;
|
||||
package com.navercorp.pinpoint.plugin.json_lib;
|
||||
|
||||
import static com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier.ExpectedAnnotation.*;
|
||||
|
||||
@@ -46,11 +46,11 @@ public class JsonLibJSONArrayIT {
|
||||
|
||||
@Test
|
||||
public void fromObjecttest() throws Exception {
|
||||
|
||||
String test = "[{'string':'JSON'}]";
|
||||
|
||||
String test = "[{'string':'JSON'}]";
|
||||
|
||||
JSONArray jsn = new JSONArray();
|
||||
jsn.fromObject(test);
|
||||
jsn.fromObject(test);
|
||||
|
||||
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
|
||||
verifier.printCache(System.out);
|
||||
@@ -58,18 +58,18 @@ public class JsonLibJSONArrayIT {
|
||||
|
||||
Method targetMethod = JSONArray.class.getMethod("fromObject", Object.class);
|
||||
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyTraceBlockCount(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toArraytest() throws Exception {
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
JSONArray test = new JSONArray();
|
||||
test.add(obj);
|
||||
JSONObject obj = new JSONObject();
|
||||
JSONArray test = new JSONArray();
|
||||
test.add(obj);
|
||||
|
||||
JSONArray.toArray(test);
|
||||
JSONArray.toArray(test);
|
||||
|
||||
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
|
||||
verifier.printCache(System.out);
|
||||
@@ -77,7 +77,7 @@ public class JsonLibJSONArrayIT {
|
||||
|
||||
Method targetMethod = JSONArray.class.getMethod("toArray", JSONArray.class);
|
||||
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyTraceBlockCount(1);
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.navercorp.pinpoint.plugin.json.lib;
|
||||
package com.navercorp.pinpoint.plugin.json_lib;
|
||||
|
||||
import static com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier.ExpectedAnnotation.*;
|
||||
|
||||
@@ -46,10 +46,10 @@ public class JsonLibJSONObjectIT {
|
||||
@Test
|
||||
public void fromObjecttest() throws Exception {
|
||||
|
||||
String test = "{'string':'JSON'}";
|
||||
String test = "{'string':'JSON'}";
|
||||
|
||||
JSONObject jsn = new JSONObject();
|
||||
jsn.fromObject(test);
|
||||
jsn.fromObject(test);
|
||||
|
||||
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
|
||||
verifier.printCache(System.out);
|
||||
@@ -57,17 +57,17 @@ public class JsonLibJSONObjectIT {
|
||||
|
||||
Method targetMethod = JSONObject.class.getMethod("fromObject", Object.class);
|
||||
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyTraceBlockCount(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toBeantest() throws Exception {
|
||||
|
||||
JSONObject test = new JSONObject();
|
||||
test.put("string", "JSON");
|
||||
JSONObject test = new JSONObject();
|
||||
test.put("string", "JSON");
|
||||
|
||||
JSONObject.toBean(test);
|
||||
JSONObject.toBean(test);
|
||||
|
||||
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
|
||||
verifier.printCache(System.out);
|
||||
@@ -75,7 +75,7 @@ public class JsonLibJSONObjectIT {
|
||||
|
||||
Method targetMethod = JSONObject.class.getMethod("toBean", JSONObject.class);
|
||||
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyTraceBlockCount(0);
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.navercorp.pinpoint.plugin.json.lib;
|
||||
package com.navercorp.pinpoint.plugin.json_lib;
|
||||
|
||||
import static com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier.ExpectedAnnotation.*;
|
||||
|
||||
@@ -46,10 +46,10 @@ public class JsonLibJSONSerializerIT {
|
||||
@Test
|
||||
public void toJSONtest() throws Exception {
|
||||
|
||||
String test = "{'string':'JSON'}";
|
||||
String test = "{'string':'JSON'}";
|
||||
|
||||
JSONSerializer jsn = new JSONSerializer();
|
||||
jsn.toJSON(test);
|
||||
jsn.toJSON(test);
|
||||
|
||||
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
|
||||
verifier.printCache(System.out);
|
||||
@@ -57,18 +57,18 @@ public class JsonLibJSONSerializerIT {
|
||||
|
||||
Method targetMethod = JSONSerializer.class.getMethod("toJSON", Object.class);
|
||||
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyTraceBlockCount(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toJAVAtest() throws Exception {
|
||||
|
||||
JSONObject test = new JSONObject();
|
||||
test.put("string", "JSON");
|
||||
JSONObject test = new JSONObject();
|
||||
test.put("string", "JSON");
|
||||
|
||||
JSONSerializer jsn = new JSONSerializer();
|
||||
jsn.toJava(test);
|
||||
JSONSerializer jsn = new JSONSerializer();
|
||||
jsn.toJava(test);
|
||||
|
||||
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
|
||||
verifier.printCache(System.out);
|
||||
@@ -76,7 +76,7 @@ public class JsonLibJSONSerializerIT {
|
||||
|
||||
Method targetMethod = JSONSerializer.class.getMethod("toJava", JSON.class);
|
||||
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyApi("JsonLib", targetMethod);
|
||||
verifier.verifyTraceBlockCount(1);
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,7 @@
|
||||
<artifactId>pinpoint-bootstrap</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.navercorp.pinpoint</groupId>
|
||||
<artifactId>pinpoint-profiler</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>com.navercorp.pinpoint</groupId>
|
||||
<artifactId>pinpoint-test</artifactId>
|
||||
<scope>test</scope>
|
||||
|
||||
+5
-7
@@ -41,11 +41,9 @@ public class JsonLibPlugin implements ProfilerPlugin {
|
||||
|
||||
private void addJSONSerializerInterceptor(ProfilerPluginContext context) {
|
||||
ClassFileTransformerBuilder builder = context.getClassFileTransformerBuilder("net.sf.json.JSONSerializer");
|
||||
builder.editMethod("toJSON", "java.lang.Object").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
|
||||
builder.editMethod("toJSON", "java.lang.Object").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
|
||||
builder.editMethod("toJava", "net.sf.json.JSON").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
|
||||
builder.editMethod("toJava", "net.sf.json.JSON").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
ClassFileTransformer transformer = builder.build();
|
||||
context.addClassFileTransformer(transformer);
|
||||
}
|
||||
@@ -53,9 +51,9 @@ public class JsonLibPlugin implements ProfilerPlugin {
|
||||
private void addJSONObjectInterceptor(ProfilerPluginContext context) {
|
||||
ClassFileTransformerBuilder builder = context.getClassFileTransformerBuilder("net.sf.json.JSONObject");
|
||||
|
||||
builder.editMethod("fromObject", "java.lang.Object").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
builder.editMethod("fromObject", "java.lang.Object").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
|
||||
builder.editMethod("toBean", "net.sf.json.JSONObject").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
builder.editMethod("toBean", "net.sf.json.JSONObject").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
|
||||
ClassFileTransformer transformer = builder.build();
|
||||
context.addClassFileTransformer(transformer);
|
||||
@@ -65,7 +63,7 @@ public class JsonLibPlugin implements ProfilerPlugin {
|
||||
ClassFileTransformerBuilder builder = context.getClassFileTransformerBuilder("net.sf.json.JSONArray");
|
||||
builder.editMethod("fromObject", "java.lang.Object").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
|
||||
builder.editMethod("toArray", "net.sf.json.JSONArray").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
builder.editMethod("toArray", "net.sf.json.JSONArray").injectInterceptor("com.navercorp.pinpoint.bootstrap.interceptor.BasicMethodInterceptor", JsonLibConstants.SERVICE_TYPE);
|
||||
|
||||
ClassFileTransformer transformer = builder.build();
|
||||
context.addClassFileTransformer(transformer);
|
||||
|
||||
Reference in New Issue
Block a user