/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4682386
* @summary Tests for PropertyChangeSupport refactoring
* @author Mark Davidson
*/
/**
* This class tests the multi-threaded access to PropertyChangeSupport and
* will also use reflection to test propertyChanges on Swing components.
* <p/>
* There is no new functionality from the implementation of this RFE.
* Semantically, it should be equivalent.
*/
public class Test4682386 {
private static final boolean DEBUG = true;
JApplet.class,
JButton.class,
JCheckBox.class,
JComboBox.class,
JLabel.class,
JList.class,
JMenuItem.class,
JProgressBar.class,
JTextArea.class,
JTextPane.class,
JTextField.class,
JToolBar.class,
JTabbedPane.class,
JTree.class,
JTable.class,
};
// tests the multi-threaded access
}
/**
* so that there will be a lot more bound properties.
* <p/>
* This test isn't really appropriate for automated testing.
*/
private static void testSwingProperties() {
try {
for (int k = 0; k < NUM_LISTENERS; k++) {
}
if (DEBUG) {
}
try {
bean,
// do nothing - just move on.
if (DEBUG) {
}
}
}
}
// do nothing - just move on.
if (DEBUG) {
}
}
}
}
/**
* Gets a fake value from a type and old value;
*/
return "test string";
}
}
}
return null;
}
try {
} catch (IntrospectionException exception) {
}
}
try {
} catch (InterruptedException exception) {
}
}
}
public void run() {
for (int i = 0; i < NUM_LISTENERS; i++) {
for (int j = 0; j < 10; j++) {
}
if (DEBUG) {
}
sleep(25L);
}
}
}
}
public void run() {
for (int k = 0; k < NUM_LISTENERS; k++) {
sleep(100L);
}
if (DEBUG) {
}
}
}
}
}
public void run() {
for (int i = 0; i < NUM_LISTENERS; i++) {
if (DEBUG) {
}
sleep(40L);
}
}
}
/**
* Handler for the property change events.
*/
// blank since this should execute as fast as possible.
}
}
/**
* A simple bean to test multi-threaded acccess to the listeners.
*/
public static class TestBean {
private boolean foo;
}
}
return this.pcs.getPropertyChangeListeners();
}
public boolean isFoo() {
return this.foo;
}
}
return this.bar;
}
}
}
}