diff options
| author | 2015-12-08 02:08:36 +0000 | |
|---|---|---|
| committer | 2015-12-08 02:08:36 +0000 | |
| commit | 6df522ec3d4a2c7ff57d28d3802ec46263c3f2fa (patch) | |
| tree | c3f61c639d5db40810957d496318a40be9116734 /test/044-proxy/src/BasicTest.java | |
| parent | 96c37a70b61360ec0e4aeb9d67b6de08cf131021 (diff) | |
| parent | e8be90a673feb573d53277f42282955cbf7f58e9 (diff) | |
Merge "Replace proxy class names with deterministic ones for test output."
am: e8be90a673
* commit 'e8be90a673feb573d53277f42282955cbf7f58e9':
Replace proxy class names with deterministic ones for test output.
Diffstat (limited to 'test/044-proxy/src/BasicTest.java')
| -rw-r--r-- | test/044-proxy/src/BasicTest.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/044-proxy/src/BasicTest.java b/test/044-proxy/src/BasicTest.java index 15732978aa..445a6cc467 100644 --- a/test/044-proxy/src/BasicTest.java +++ b/test/044-proxy/src/BasicTest.java @@ -84,7 +84,8 @@ public class BasicTest { }); System.out.println("Proxy interfaces: " + Arrays.deepToString(proxy.getClass().getInterfaces())); - System.out.println("Proxy methods: " + Arrays.deepToString(methods)); + System.out.println("Proxy methods: " + + Main.replaceProxyClassNamesForOutput(Arrays.deepToString(methods))); Method meth = methods[methods.length -1]; System.out.println("Decl annos: " + Arrays.deepToString(meth.getDeclaredAnnotations())); Annotation[][] paramAnnos = meth.getParameterAnnotations(); @@ -100,6 +101,7 @@ public class BasicTest { /* create the proxy class */ Class proxyClass = Proxy.getProxyClass(Shapes.class.getClassLoader(), new Class[] { Quads.class, Colors.class, Trace.class }); + Main.registerProxyClassName(proxyClass.getCanonicalName()); /* create a proxy object, passing the handler object in */ Object proxy = null; @@ -262,7 +264,8 @@ class MyInvocationHandler implements InvocationHandler { for (int i = 0; i < stackTrace.length; i++) { StackTraceElement ste = stackTrace[i]; if (ste.getMethodName().equals("getTrace")) { - System.out.println(ste.getClassName() + "." + ste.getMethodName() + " " + + String outputClassName = Main.replaceProxyClassNamesForOutput(ste.getClassName()); + System.out.println(outputClassName + "." + ste.getMethodName() + " " + ste.getFileName() + ":" + ste.getLineNumber()); } } @@ -276,7 +279,8 @@ class MyInvocationHandler implements InvocationHandler { for (int i = 0; i < stackTrace.length; i++) { StackTraceElement ste = stackTrace[i]; if (ste.getMethodName().equals("getTrace")) { - System.out.println(ste.getClassName() + "." + ste.getMethodName() + " " + + String outputClassName = Main.replaceProxyClassNamesForOutput(ste.getClassName()); + System.out.println(outputClassName + "." + ste.getMethodName() + " " + ste.getFileName() + ":" + ste.getLineNumber()); } } |