aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/testsrc
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-03-19 20:48:01 +0000
committeracolyer <acolyer>2004-03-19 20:48:01 +0000
commitc298ef779c6430ca130ca6749b60818b71bd0275 (patch)
tree0bcfed374b6c778719206f15efc7df2f9e524ea4 /runtime/testsrc
parent4907ede37a5688c7d4b35785bcf9b3da54c80c15 (diff)
downloadaspectj-c298ef779c6430ca130ca6749b60818b71bd0275.tar.gz
aspectj-c298ef779c6430ca130ca6749b60818b71bd0275.zip
fix for Bugzilla Bug 54721
add this to API (Signature.getDeclaringTypeName())
Diffstat (limited to 'runtime/testsrc')
-rw-r--r--runtime/testsrc/RuntimeModuleTests.java4
-rw-r--r--runtime/testsrc/org/aspectj/runtime/reflect/SignatureTest.java23
2 files changed, 27 insertions, 0 deletions
diff --git a/runtime/testsrc/RuntimeModuleTests.java b/runtime/testsrc/RuntimeModuleTests.java
index ff7560c8e..b8f2d7408 100644
--- a/runtime/testsrc/RuntimeModuleTests.java
+++ b/runtime/testsrc/RuntimeModuleTests.java
@@ -16,6 +16,7 @@
import java.io.*;
import org.aspectj.lang.*;
+import org.aspectj.runtime.reflect.SignatureTest;
import junit.framework.*;
@@ -24,6 +25,7 @@ public class RuntimeModuleTests extends TestCase {
public static TestSuite suite() {
TestSuite suite = new TestSuite(RuntimeModuleTests.class.getName());
suite.addTestSuite(RuntimeModuleTests.class); // minimum 1 test (testNothing)
+ suite.addTestSuite(SignatureTest.class);
return suite;
}
@@ -70,6 +72,8 @@ public class RuntimeModuleTests extends TestCase {
System.setErr(systemErr);
}
}
+
+
static void checkSoftExceptionString(String s) {
assertTrue(-1 != s.indexOf("SoftException"));
assertTrue(-1 != s.indexOf("Caused by: java.lang.Error"));
diff --git a/runtime/testsrc/org/aspectj/runtime/reflect/SignatureTest.java b/runtime/testsrc/org/aspectj/runtime/reflect/SignatureTest.java
new file mode 100644
index 000000000..b8170d649
--- /dev/null
+++ b/runtime/testsrc/org/aspectj/runtime/reflect/SignatureTest.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.runtime.reflect;
+
+import junit.framework.TestCase;
+
+/**
+ */
+public class SignatureTest extends TestCase {
+ public void testGetDeclaringTypeName() {
+ FieldSignatureImpl fsi = new FieldSignatureImpl(0,"x",SignatureTest.class,String.class);
+ assertEquals(SignatureTest.class.getName(),fsi.getDeclaringTypeName());
+ assertSame(fsi.getDeclaringTypeName(),fsi.getDeclaringTypeName()); // should be cached.
+ }
+}