OCInvocationCallbacks { protected String methodSignatureForSelector(String selectorName) { Method method = methodForSelector(selectorName); return method == null ? null : ocMethodSignatureAsString(method); } OCInvocationCallbacks(Object javaObject);  final RococoaLibrary.MethodSignatureCallback methodSignatureCallback; final RococoaLibrary.SelectorInvokedCallback selectorInvokedCallback; }
@Test public void testMethodSignatureForSelector() { assertNull(callbacks.methodSignatureForSelector("nosuch")); assertEquals("v@:", callbacks.methodSignatureForSelector("returnsVoidTakesVoid")); assertEquals("v@:i", callbacks.methodSignatureForSelector("returnsVoidTakesInt:")); assertEquals("@@:", callbacks.methodSignatureForSelector("returnsIDTakesVoid")); assertEquals("v@:ii", callbacks.methodSignatureForSelector("returnsVoidTakesInt:andInt:")); assertEquals("v@:@", callbacks.methodSignatureForSelector("returnsVoidTakesOCObject:")); assertEquals("c@:@", callbacks.methodSignatureForSelector("returnsByteTakesOCObject:")); if (Native.LONG_SIZE == 4) assertEquals("l@:l", callbacks.methodSignatureForSelector("returnsNativeLongTakesNativeLong:")); else assertEquals("q@:q", callbacks.methodSignatureForSelector("returnsNativeLongTakesNativeLong:")); assertEquals("@@:@", callbacks.methodSignatureForSelector("returnsStringTakesString:")); assertEquals("@@:@", callbacks.methodSignatureForSelector("returnsNSStringTakesNSString:")); }
@Test public void testMethodSignatureForSelectorForStructures() { assertEquals("v@:^{TestStruct=id}", callbacks.methodSignatureForSelector("returnsVoidTakesStruct:")); assertEquals("v@:{ByValue=id}", callbacks.methodSignatureForSelector("returnsVoidTakesStructByValue:")); assertEquals("^{TestStruct=id}@:", callbacks.methodSignatureForSelector("returnsStructTakesVoid")); assertEquals("{ByValue=id}@:", callbacks.methodSignatureForSelector("returnsStructByValueTakesVoid")); }