test & fix for Bug 32604 - [otmodel] JavaModelException when hovering over a callout to field
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java
index d5010ca..c199052 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/CalloutMappingTest.java
@@ -26,6 +26,7 @@
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
@@ -229,5 +230,18 @@
assertEquals("Wrong number of pairs", 1, memberValuePairs.length);
assertEquals("Wrong value", "decapsulation", memberValuePairs[0].getValue());
}
-
+
+
+ public void testCtfExceptions() throws JavaModelException
+ {
+ IRoleType roleOTElem = getRoleOTElem();
+ assertNotNull(roleOTElem);
+ IMethodMapping[] calloutMethodMappings = roleOTElem.getMethodMappings(IRoleType.CALLOUTS);
+
+ IMethodMapping mapping = calloutMethodMappings[3];
+ assertNotNull(mapping);
+
+ assertEquals("Wrong number of declared exceptions", 0, ((IMethod)mapping).getExceptionTypes().length); // and don't NPE
+ }
+
}