< prev index next >

test/jdk/com/sun/tools/jextract/JextractToolProviderTest.java

Print this page




 412             // check a method for "void func()"
 413             assertNotNull(findMethod(cls, "func", Object[].class));
 414             // check a method for "void junk()"
 415             assertNotNull(findMethod(cls, "junk", Object[].class));
 416         } finally {
 417             deleteFile(helloJar);
 418         }
 419 
 420         // try with --exclude-symbols" this time.
 421         checkSuccess(null, "--exclude-symbols", "junk", "-o", helloJar.toString(), helloH.toString());
 422         try {
 423             Class<?> cls = loadClass("hello", helloJar);
 424             // check a method for "void func()"
 425             assertNotNull(findMethod(cls, "func", Object[].class));
 426             // check a method for "void junk()"
 427             assertNull(findMethod(cls, "junk", Object[].class));
 428         } finally {
 429             deleteFile(helloJar);
 430         }
 431     }





































 432 }


 412             // check a method for "void func()"
 413             assertNotNull(findMethod(cls, "func", Object[].class));
 414             // check a method for "void junk()"
 415             assertNotNull(findMethod(cls, "junk", Object[].class));
 416         } finally {
 417             deleteFile(helloJar);
 418         }
 419 
 420         // try with --exclude-symbols" this time.
 421         checkSuccess(null, "--exclude-symbols", "junk", "-o", helloJar.toString(), helloH.toString());
 422         try {
 423             Class<?> cls = loadClass("hello", helloJar);
 424             // check a method for "void func()"
 425             assertNotNull(findMethod(cls, "func", Object[].class));
 426             // check a method for "void junk()"
 427             assertNull(findMethod(cls, "junk", Object[].class));
 428         } finally {
 429             deleteFile(helloJar);
 430         }
 431     }
 432 
 433     @Test
 434     public void testNestedStructsUnions() {
 435         Path nestedJar = getOutputFilePath("nested.jar");
 436         deleteFile(nestedJar);
 437         Path nestedH = getInputFilePath("nested.h");
 438         try {
 439             checkSuccess(null, "-o", nestedJar.toString(), nestedH.toString());
 440             assertNotNull(loadClass("nested", nestedJar));
 441             Class<?> fooCls = loadClass("nested$Foo", nestedJar);
 442             assertNotNull(fooCls);
 443             // struct Foo has no getters for "x", "y" etc.
 444             assertNull(findMethod(fooCls, "x$get"));
 445             assertNull(findMethod(fooCls, "y$get"));
 446             // struct Foo has getters for bar and color
 447             assertNotNull(findMethod(fooCls, "bar$get"));
 448             assertNotNull(findMethod(fooCls, "color$get"));
 449             // make sure nested types are handled without nested namespace!
 450             assertNotNull(loadClass("nested$Bar", nestedJar));
 451             assertNotNull(loadClass("nested$Color", nestedJar));
 452 
 453             Class<?> uCls = loadClass("nested$U", nestedJar);
 454             assertNotNull(uCls);
 455             // union U has no getters for "x", "y" etc.
 456             assertNull(findMethod(uCls, "x$get"));
 457             assertNull(findMethod(uCls, "y$get"));
 458             // union U has getters for point, rgb, i
 459             assertNotNull(findMethod(uCls, "point$get"));
 460             assertNotNull(findMethod(uCls, "rgb$get"));
 461             assertNotNull(findMethod(uCls, "i$get"));
 462             // make sure nested types are handled without nested namespace!
 463             assertNotNull(loadClass("nested$Point", nestedJar));
 464             assertNotNull(loadClass("nested$RGB", nestedJar));
 465         } finally {
 466             deleteFile(nestedJar);
 467         }
 468     }
 469 }
< prev index next >