Added %javamethodmodifiers check
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5558 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
574d1db50b
commit
0116de6769
2 changed files with 21 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
// This is the java_typemaps_proxy runtime testcase. Contrived example checks that the pure Java code from the Java typemaps compiles.
|
||||
|
||||
import java_typemaps_proxy.*;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
public class java_typemaps_proxy_runme {
|
||||
|
||||
|
|
@ -43,6 +44,20 @@ public class java_typemaps_proxy_runme {
|
|||
|
||||
// Create a NULL pointer for Farewell using the constructor with changed modifiers
|
||||
Farewell nullFarewell = new Farewell(0, false);
|
||||
|
||||
// Check the %javamethodmodifiers feature
|
||||
try {
|
||||
|
||||
Method methodmodifiertest = nullFarewell.getClass().getDeclaredMethod("methodmodifiertest", null);
|
||||
if ( !Modifier.isPrivate(methodmodifiertest.getModifiers()) )
|
||||
throw new RuntimeException("NS::Farewell::methodmodifiertest not private" );
|
||||
|
||||
} catch (NoSuchMethodException n) {
|
||||
throw new RuntimeException("NoSuchmethodException caught. Test failed.");
|
||||
} catch (SecurityException s) {
|
||||
throw new RuntimeException("SecurityException caught. Test failed.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue