< prev index next >

modules/controls/src/test/java/javafx/scene/control/ControlTest.java

Print this page
rev 10149 : 8201553: Update FX build to use gradle 4.8
Reviewed-by:


 983         assertEquals(0, c.getBaselineOffset(), 0f);
 984     }
 985 
 986     @Test public void baselineOffsetUpdatedWhenTheSkinChanges() {
 987         c.setSkin(s);
 988         assertEquals(BASELINE_OFFSET, c.getBaselineOffset(), 0);
 989     }
 990 
 991     @Test
 992     public void testRT18097() {
 993         try {
 994             File f = System.getProperties().containsKey("CSS_META_DATA_TEST_DIR") ?
 995                     new File(System.getProperties().get("CSS_META_DATA_TEST_DIR").toString()) :
 996                     null;
 997             if (f == null) {
 998                 ClassLoader cl = Thread.currentThread().getContextClassLoader();
 999                 URL base = cl.getResource("javafx/../javafx");
1000                 f = new File(base.toURI());
1001             }
1002             //System.err.println(f.getPath());

1003             recursiveCheck(f, f.getPath().length() - 7);
1004         } catch (Exception ex) {
1005             ex.printStackTrace(System.err);
1006             fail(ex.getMessage());
1007         }
1008     }
1009 
1010     private static void checkClass(Class someClass) {
1011 
1012         // Ignore inner classes
1013         if (someClass.getEnclosingClass() != null) return;
1014 
1015         if (javafx.scene.control.Control.class.isAssignableFrom(someClass) &&
1016                 Modifier.isAbstract(someClass.getModifiers()) == false) {
1017             String what = someClass.getName();
1018             try {
1019                 // should get NoSuchMethodException if ctor is not public
1020 //                Constructor ctor = someClass.getConstructor((Class[])null);
1021                 Method m = someClass.getMethod("getClassCssMetaData", (Class[]) null);
1022 //                Node node = (Node)ctor.newInstance((Object[])null);




 983         assertEquals(0, c.getBaselineOffset(), 0f);
 984     }
 985 
 986     @Test public void baselineOffsetUpdatedWhenTheSkinChanges() {
 987         c.setSkin(s);
 988         assertEquals(BASELINE_OFFSET, c.getBaselineOffset(), 0);
 989     }
 990 
 991     @Test
 992     public void testRT18097() {
 993         try {
 994             File f = System.getProperties().containsKey("CSS_META_DATA_TEST_DIR") ?
 995                     new File(System.getProperties().get("CSS_META_DATA_TEST_DIR").toString()) :
 996                     null;
 997             if (f == null) {
 998                 ClassLoader cl = Thread.currentThread().getContextClassLoader();
 999                 URL base = cl.getResource("javafx/../javafx");
1000                 f = new File(base.toURI());
1001             }
1002             //System.err.println(f.getPath());
1003             assertTrue("" + f.getCanonicalPath() + " is not a directory", f.isDirectory());
1004             recursiveCheck(f, f.getPath().length() - 7);
1005         } catch (Exception ex) {
1006             ex.printStackTrace(System.err);
1007             fail(ex.getMessage());
1008         }
1009     }
1010 
1011     private static void checkClass(Class someClass) {
1012 
1013         // Ignore inner classes
1014         if (someClass.getEnclosingClass() != null) return;
1015 
1016         if (javafx.scene.control.Control.class.isAssignableFrom(someClass) &&
1017                 Modifier.isAbstract(someClass.getModifiers()) == false) {
1018             String what = someClass.getName();
1019             try {
1020                 // should get NoSuchMethodException if ctor is not public
1021 //                Constructor ctor = someClass.getConstructor((Class[])null);
1022                 Method m = someClass.getMethod("getClassCssMetaData", (Class[]) null);
1023 //                Node node = (Node)ctor.newInstance((Object[])null);


< prev index next >