< prev index next >

test/jdk/java/awt/Toolkit/DesktopProperties/rfe4758438.java

Print this page
rev 59106 : imported patch client


  98     /**
  99      * Implementation of PropertyChangeListener method
 100      */
 101     public void propertyChange(PropertyChangeEvent event) {
 102         changedProperty = event.getPropertyName();
 103         changedValue = toolkit.getDesktopProperty(changedProperty);
 104         System.out.println("Property "+changedProperty+" changed. Changed value: "+changedValue);
 105         synchronized(lock) {
 106             try {
 107                 lock.notifyAll();
 108             } catch (Exception e) {
 109             }
 110         }
 111     }
 112 
 113     public static void main(String[] args) throws Exception {
 114         useGsettings = System.getProperty("useGsettings").equals("true");
 115         tool = System.getProperty("tool");
 116 
 117         String osName = System.getProperty("os.name");
 118         if (!"Linux".equals(osName) && !"SunOS".equals(osName))
 119             System.out.println("This test need not be run on this platform");
 120         else
 121             new rfe4758438().doTest();
 122     }
 123 
 124     void doTest() throws Exception {
 125         for (PROPS p : PROPS.values())
 126             toolkit.addPropertyChangeListener(p.java, this);
 127 
 128         for (PROPS p : PROPS.values()) {
 129             Thread.sleep(1000);
 130             doTest(p);
 131         }
 132         System.out.println("Test passed");
 133     }
 134 
 135     /**
 136      * Do the test for each property. Find the current value
 137      * of the property, set the property to a value not equal
 138      * to the current value, check if the propertyChange event




  98     /**
  99      * Implementation of PropertyChangeListener method
 100      */
 101     public void propertyChange(PropertyChangeEvent event) {
 102         changedProperty = event.getPropertyName();
 103         changedValue = toolkit.getDesktopProperty(changedProperty);
 104         System.out.println("Property "+changedProperty+" changed. Changed value: "+changedValue);
 105         synchronized(lock) {
 106             try {
 107                 lock.notifyAll();
 108             } catch (Exception e) {
 109             }
 110         }
 111     }
 112 
 113     public static void main(String[] args) throws Exception {
 114         useGsettings = System.getProperty("useGsettings").equals("true");
 115         tool = System.getProperty("tool");
 116 
 117         String osName = System.getProperty("os.name");
 118         if (!"Linux".equals(osName))
 119             System.out.println("This test need not be run on this platform");
 120         else
 121             new rfe4758438().doTest();
 122     }
 123 
 124     void doTest() throws Exception {
 125         for (PROPS p : PROPS.values())
 126             toolkit.addPropertyChangeListener(p.java, this);
 127 
 128         for (PROPS p : PROPS.values()) {
 129             Thread.sleep(1000);
 130             doTest(p);
 131         }
 132         System.out.println("Test passed");
 133     }
 134 
 135     /**
 136      * Do the test for each property. Find the current value
 137      * of the property, set the property to a value not equal
 138      * to the current value, check if the propertyChange event


< prev index next >