summaryrefslogtreecommitdiffstats
path: root/runtime/testsrc/org
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-08-09 12:48:11 +0000
committeracolyer <acolyer>2004-08-09 12:48:11 +0000
commitf6436e3fc84f7e140acb3a250a29fe38f9c20c35 (patch)
treed054d6e062fa72f20747d7abe4df4a211b9ccfa5 /runtime/testsrc/org
parent851da68a07bcbfac4414fadc1b9f3bc02fa810a5 (diff)
downloadaspectj-f6436e3fc84f7e140acb3a250a29fe38f9c20c35.tar.gz
aspectj-f6436e3fc84f7e140acb3a250a29fe38f9c20c35.zip
fix for Bugzilla Bug 67592 value in the args[] array of thisJoinPoint can be changed....
Diffstat (limited to 'runtime/testsrc/org')
-rw-r--r--runtime/testsrc/org/aspectj/runtime/reflect/JoinPointImplTest.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/runtime/testsrc/org/aspectj/runtime/reflect/JoinPointImplTest.java b/runtime/testsrc/org/aspectj/runtime/reflect/JoinPointImplTest.java
new file mode 100644
index 000000000..9a2d25b82
--- /dev/null
+++ b/runtime/testsrc/org/aspectj/runtime/reflect/JoinPointImplTest.java
@@ -0,0 +1,40 @@
+/*
+ * Created on 09-Aug-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.aspectj.runtime.reflect;
+
+import junit.framework.TestCase;
+
+/**
+ * @author colyer
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class JoinPointImplTest extends TestCase {
+
+ public void testGetArgs() {
+ String arg1 = "abc";
+ StringBuffer arg2 = new StringBuffer("def");
+ Object arg3 = new Object();
+ Object[] args = new Object[] { arg1, arg2, arg3 };
+ JoinPointImpl jpi = new JoinPointImpl(null,null,null,args);
+
+ Object[] retrievedArgs = jpi.getArgs();
+ assertEquals("First arg unchanged",arg1,retrievedArgs[0]);
+ assertEquals("Second arg unchanged",arg2,retrievedArgs[1]);
+ assertEquals("Third arg unchanged",arg3,retrievedArgs[2]);
+ retrievedArgs[0] = "xyz";
+ ((StringBuffer)retrievedArgs[1]).append("ghi");
+ retrievedArgs[2] = "jkl";
+ Object[] afterUpdateArgs = jpi.getArgs();
+ assertEquals("Object reference not changed",arg1,afterUpdateArgs[0]);
+ assertEquals("Object reference unchanged",arg2,afterUpdateArgs[1]);
+ assertEquals("state of referenced object updated","defghi",afterUpdateArgs[1].toString());
+ assertEquals("Object reference not changed",arg3,afterUpdateArgs[2]);
+ }
+
+}