0001: /*
0002: * $Id$
0003: *
0004: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0005: *
0006: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
0007: *
0008: * The contents of this file are subject to the terms of either the GNU
0009: * General Public License Version 2 only ("GPL") or the Common
0010: * Development and Distribution License("CDDL") (collectively, the
0011: * "License"). You may not use this file except in compliance with the
0012: * License. You can obtain a copy of the License at
0013: * http://www.netbeans.org/cddl-gplv2.html
0014: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
0015: * specific language governing permissions and limitations under the
0016: * License. When distributing the software, include this License Header
0017: * Notice in each file and include the License file at
0018: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
0019: * particular file as subject to the "Classpath" exception as provided
0020: * by Sun in the GPL Version 2 section of the License file that
0021: * accompanied this code. If applicable, add the following below the
0022: * License Header, with the fields enclosed by brackets [] replaced by
0023: * your own identifying information:
0024: * "Portions Copyrighted [year] [name of copyright owner]"
0025: *
0026: * Contributor(s): Manfred Riem (mriem@netbeans.org)
0027: *
0028: * The Original Software is the Jemmy library. The Initial Developer of the
0029: * Original Software is Alexandre Iline. All Rights Reserved.
0030: *
0031: * If you wish your version of this file to be governed by only the CDDL
0032: * or only the GPL Version 2, indicate your decision by adding
0033: * "[Contributor] elects to include this software in this distribution
0034: * under the [CDDL or GPL Version 2] license." If you do not indicate a
0035: * single choice of license, a recipient has the option to distribute
0036: * your version of this file under either the CDDL, the GPL Version 2 or
0037: * to extend the choice of license to its licensees as provided above.
0038: * However, if you add GPL Version 2 code and therefore, elected the GPL
0039: * Version 2 license, then the option applies only if the new code is
0040: * made subject to such option by the copyright holder.
0041: *
0042: */
0043: package org.netbeans.jemmy.operators;
0044:
0045: import java.awt.Dimension;
0046: import java.awt.Insets;
0047: import java.awt.Point;
0048: import java.awt.Rectangle;
0049: import java.awt.event.ActionEvent;
0050: import java.awt.event.ActionListener;
0051: import java.awt.event.MouseEvent;
0052: import java.beans.PropertyChangeEvent;
0053: import java.beans.PropertyVetoException;
0054: import java.beans.VetoableChangeListener;
0055: import javax.swing.JComponent;
0056: import javax.swing.JFrame;
0057: import javax.swing.JPanel;
0058: import javax.swing.KeyStroke;
0059: import javax.swing.event.AncestorEvent;
0060: import javax.swing.event.AncestorListener;
0061: import junit.framework.Test;
0062: import junit.framework.TestCase;
0063: import junit.framework.TestSuite;
0064: import org.netbeans.jemmy.util.NameComponentChooser;
0065:
0066: /**
0067: * A JUnit test for JComponentOperator.
0068: *
0069: * @author Manfred Riem (mriem@netbeans.org)
0070: * @version $Revision$
0071: */
0072: public class JComponentOperatorTest extends TestCase {
0073: /**
0074: * Stores the frame.
0075: */
0076: private JFrame frame;
0077:
0078: /**
0079: * Stores the component.
0080: */
0081: private JComponent component;
0082:
0083: /**
0084: * Constructor.
0085: *
0086: * @param testName the name of the test.
0087: */
0088: public JComponentOperatorTest(String testName) {
0089: super (testName);
0090: }
0091:
0092: /**
0093: * Setup before testing.
0094: */
0095: protected void setUp() throws Exception {
0096: frame = new JFrame();
0097: component = new JPanel();
0098: component.setName("JComponentOperatorTest");
0099: component.setToolTipText("JComponentOperatorTest");
0100: frame.getContentPane().add(component);
0101: frame.setName("JFrameOperatorTest");
0102: frame.setSize(300, 200);
0103: frame.setLocationRelativeTo(null);
0104: }
0105:
0106: /**
0107: * Cleanup after testing.
0108: */
0109: protected void tearDown() throws Exception {
0110: frame.setVisible(false);
0111: frame.dispose();
0112: frame = null;
0113: }
0114:
0115: /**
0116: * Suite method.
0117: */
0118: public static Test suite() {
0119: TestSuite suite = new TestSuite(JComponentOperatorTest.class);
0120:
0121: return suite;
0122: }
0123:
0124: /**
0125: * Test constructor.
0126: */
0127: public void testConstructor() {
0128: frame.setVisible(true);
0129:
0130: JFrameOperator operator = new JFrameOperator();
0131: assertNotNull(operator);
0132:
0133: JComponentOperator operator1 = new JComponentOperator(operator);
0134: assertNotNull(operator1);
0135:
0136: JComponentOperator operator2 = new JComponentOperator(operator,
0137: new NameComponentChooser("JComponentOperatorTest"));
0138: assertNotNull(operator2);
0139: }
0140:
0141: /**
0142: * Test findJComponent method.
0143: */
0144: public void testFindJComponent() {
0145: frame.setVisible(true);
0146:
0147: JComponent component1 = JComponentOperator.findJComponent(
0148: frame, new NameComponentChooser(
0149: "JComponentOperatorTest"));
0150: assertNotNull(component1);
0151:
0152: JComponent component2 = JComponentOperator.findJComponent(
0153: frame, "JComponentOperatorTest", false, false);
0154: assertNotNull(component2);
0155: }
0156:
0157: /**
0158: * Test waitJComponent method.
0159: */
0160: public void testWaitJComponent() {
0161: frame.setVisible(true);
0162:
0163: JComponent component1 = JComponentOperator.waitJComponent(
0164: frame, new NameComponentChooser(
0165: "JComponentOperatorTest"));
0166: assertNotNull(component1);
0167:
0168: JComponent component2 = JComponentOperator.waitJComponent(
0169: frame, "JComponentOperatorTest", false, false);
0170: assertNotNull(component2);
0171: }
0172:
0173: /**
0174: * Test getCenterXForClick method.
0175: */
0176: public void testGetCenterXForClick() {
0177: frame.setVisible(true);
0178:
0179: JFrameOperator operator = new JFrameOperator();
0180: assertNotNull(operator);
0181:
0182: JComponentOperator operator1 = new JComponentOperator(operator);
0183: assertNotNull(operator1);
0184:
0185: operator1.getCenterXForClick();
0186: }
0187:
0188: /**
0189: * Test getCenterYForClick method.
0190: */
0191: public void testGetCenterYForClick() {
0192: frame.setVisible(true);
0193:
0194: JFrameOperator operator = new JFrameOperator();
0195: assertNotNull(operator);
0196:
0197: JComponentOperator operator1 = new JComponentOperator(operator);
0198: assertNotNull(operator1);
0199:
0200: operator1.getCenterYForClick();
0201: }
0202:
0203: /**
0204: * Test showToolTip method.
0205: */
0206: public void testShowToolTip() {
0207: frame.setVisible(true);
0208:
0209: JFrameOperator operator = new JFrameOperator();
0210: assertNotNull(operator);
0211:
0212: JComponentOperator operator1 = new JComponentOperator(operator);
0213: assertNotNull(operator1);
0214:
0215: // TODO: disabled, because this test currently requires user interaction.
0216: // operator1.showToolTip();
0217: }
0218:
0219: /**
0220: * Test waitToolTip method.
0221: */
0222: public void testWaitToolTip() {
0223: frame.setVisible(true);
0224:
0225: JFrameOperator operator = new JFrameOperator();
0226: assertNotNull(operator);
0227:
0228: JComponentOperator operator1 = new JComponentOperator(operator);
0229: assertNotNull(operator1);
0230:
0231: // TODO: disabled, because this test currently requires user interaction.
0232: // operator1.waitToolTip();
0233: }
0234:
0235: /**
0236: * Test getWindowContainerOperator method.
0237: */
0238: public void testGetWindowContainerOperator() {
0239: frame.setVisible(true);
0240:
0241: JFrameOperator operator = new JFrameOperator();
0242: assertNotNull(operator);
0243:
0244: JComponentOperator operator1 = new JComponentOperator(operator);
0245: assertNotNull(operator1);
0246:
0247: operator1.getWindowContainerOperator();
0248: }
0249:
0250: /**
0251: * Test getDump method.
0252: */
0253: public void testGetDump() {
0254: frame.setVisible(true);
0255:
0256: JFrameOperator operator = new JFrameOperator();
0257: assertNotNull(operator);
0258:
0259: JComponentOperator operator1 = new JComponentOperator(operator);
0260: assertNotNull(operator1);
0261:
0262: operator1.getDump();
0263: }
0264:
0265: /**
0266: * Test addAncestorListener method.
0267: */
0268: public void testAddAncestorListener() {
0269: frame.setVisible(true);
0270:
0271: JFrameOperator operator = new JFrameOperator();
0272: assertNotNull(operator);
0273:
0274: JComponentOperator operator1 = new JComponentOperator(operator);
0275: assertNotNull(operator1);
0276:
0277: AncestorListenerTest listener = new AncestorListenerTest();
0278: operator1.addAncestorListener(listener);
0279: operator1.removeAncestorListener(listener);
0280: }
0281:
0282: /**
0283: * Inner class needed for testing.
0284: */
0285: public class AncestorListenerTest implements AncestorListener {
0286: public void ancestorAdded(AncestorEvent event) {
0287: }
0288:
0289: public void ancestorRemoved(AncestorEvent event) {
0290: }
0291:
0292: public void ancestorMoved(AncestorEvent event) {
0293: }
0294: }
0295:
0296: /**
0297: * Test addVetoableChangeListener method.
0298: */
0299: public void testAddVetoableChangeListener() {
0300: frame.setVisible(true);
0301:
0302: JFrameOperator operator = new JFrameOperator();
0303: assertNotNull(operator);
0304:
0305: JComponentOperator operator1 = new JComponentOperator(operator);
0306: assertNotNull(operator1);
0307:
0308: VetoableChangeListenerTest listener = new VetoableChangeListenerTest();
0309: operator1.addVetoableChangeListener(listener);
0310: operator1.removeVetoableChangeListener(listener);
0311: }
0312:
0313: /**
0314: * Inner class needed for testing.
0315: */
0316: public class VetoableChangeListenerTest implements
0317: VetoableChangeListener {
0318: public void vetoableChange(PropertyChangeEvent evt)
0319: throws PropertyVetoException {
0320: }
0321: }
0322:
0323: /**
0324: * Test computeVisibleRect method.
0325: */
0326: public void testComputeVisibleRect() {
0327: frame.setVisible(true);
0328:
0329: JFrameOperator operator = new JFrameOperator();
0330: assertNotNull(operator);
0331:
0332: JComponentOperator operator1 = new JComponentOperator(operator);
0333: assertNotNull(operator1);
0334:
0335: operator1.computeVisibleRect(new Rectangle(0, 0, 100, 100));
0336: }
0337:
0338: /**
0339: * Test createToolTip method.
0340: */
0341: public void testCreateToolTip() {
0342: frame.setVisible(true);
0343:
0344: JFrameOperator operator = new JFrameOperator();
0345: assertNotNull(operator);
0346:
0347: JComponentOperator operator1 = new JComponentOperator(operator);
0348: assertNotNull(operator1);
0349:
0350: operator1.createToolTip();
0351: }
0352:
0353: /**
0354: * Test firePropertyChange method.
0355: */
0356: public void testFirePropertyChange() {
0357: frame.setVisible(true);
0358:
0359: JFrameOperator operator = new JFrameOperator();
0360: assertNotNull(operator);
0361:
0362: JComponentOperator operator1 = new JComponentOperator(operator);
0363: assertNotNull(operator1);
0364:
0365: operator1.firePropertyChange("1", false, false);
0366: operator1.firePropertyChange("1", (byte) 'a', (byte) 'b');
0367: operator1.firePropertyChange("1", 'a', 'b');
0368: operator1.firePropertyChange("1", 0.0, 0.0);
0369: operator1.firePropertyChange("1", 0.0f, 0.0f);
0370: operator1.firePropertyChange("1", 1, 1);
0371: operator1.firePropertyChange("1", 1L, 1L);
0372: operator1.firePropertyChange("1", (short) 1, (short) 1);
0373: }
0374:
0375: /**
0376: * Test getAccessibleContext method.
0377: */
0378: public void testGetAccessibleContext() {
0379: frame.setVisible(true);
0380:
0381: JFrameOperator operator = new JFrameOperator();
0382: assertNotNull(operator);
0383:
0384: JComponentOperator operator1 = new JComponentOperator(operator);
0385: assertNotNull(operator1);
0386:
0387: operator1.getAccessibleContext();
0388: }
0389:
0390: /**
0391: * Test getActionForKeyStroke method.
0392: */
0393: public void testGetActionForKeyStroke() {
0394: frame.setVisible(true);
0395:
0396: JFrameOperator operator = new JFrameOperator();
0397: assertNotNull(operator);
0398:
0399: JComponentOperator operator1 = new JComponentOperator(operator);
0400: assertNotNull(operator1);
0401:
0402: operator1.getActionForKeyStroke(KeyStroke.getKeyStroke('a'));
0403: }
0404:
0405: /**
0406: * Test getAutoscrolls method.
0407: */
0408: public void testGetAutoscrolls() {
0409: frame.setVisible(true);
0410:
0411: JFrameOperator operator = new JFrameOperator();
0412: assertNotNull(operator);
0413:
0414: JComponentOperator operator1 = new JComponentOperator(operator);
0415: assertNotNull(operator1);
0416:
0417: operator1.setAutoscrolls(true);
0418: assertTrue(operator1.getAutoscrolls());
0419:
0420: operator1.setAutoscrolls(false);
0421: assertTrue(!operator1.getAutoscrolls());
0422: }
0423:
0424: /**
0425: * Test getBorder method.
0426: */
0427: public void testGetBorder() {
0428: frame.setVisible(true);
0429:
0430: JFrameOperator operator = new JFrameOperator();
0431: assertNotNull(operator);
0432:
0433: JComponentOperator operator1 = new JComponentOperator(operator);
0434: assertNotNull(operator1);
0435:
0436: operator1.setBorder(null);
0437: assertNull(operator1.getBorder());
0438: }
0439:
0440: /**
0441: * Test getClientProperty method.
0442: */
0443: public void testGetClientProperty() {
0444: frame.setVisible(true);
0445:
0446: JFrameOperator operator = new JFrameOperator();
0447: assertNotNull(operator);
0448:
0449: JComponentOperator operator1 = new JComponentOperator(operator);
0450: assertNotNull(operator1);
0451:
0452: operator1.getClientProperty("1");
0453: }
0454:
0455: /**
0456: * Test getConditionForKeyStroke method.
0457: */
0458: public void testGetConditionForKeyStroke() {
0459: frame.setVisible(true);
0460:
0461: JFrameOperator operator = new JFrameOperator();
0462: assertNotNull(operator);
0463:
0464: JComponentOperator operator1 = new JComponentOperator(operator);
0465: assertNotNull(operator1);
0466:
0467: operator1.getConditionForKeyStroke(KeyStroke.getKeyStroke('a'));
0468: }
0469:
0470: /**
0471: * Test getDebugGraphicsOptions method.
0472: */
0473: public void testGetDebugGraphicsOptions() {
0474: frame.setVisible(true);
0475:
0476: JFrameOperator operator = new JFrameOperator();
0477: assertNotNull(operator);
0478:
0479: JComponentOperator operator1 = new JComponentOperator(operator);
0480: assertNotNull(operator1);
0481:
0482: operator1.setDebugGraphicsOptions(0);
0483: assertEquals(0, operator1.getDebugGraphicsOptions());
0484: }
0485:
0486: /**
0487: * Test getInsets method.
0488: */
0489: public void testGetInsets() {
0490: frame.setVisible(true);
0491:
0492: JFrameOperator operator = new JFrameOperator();
0493: assertNotNull(operator);
0494:
0495: JComponentOperator operator1 = new JComponentOperator(operator);
0496: assertNotNull(operator1);
0497:
0498: operator1.getInsets(new Insets(0, 0, 1, 1));
0499: operator1.getInsets();
0500: }
0501:
0502: /**
0503: * Test getNextFocusableComponent method.
0504: */
0505: public void testGetNextFocusableComponent() {
0506: frame.setVisible(true);
0507:
0508: JFrameOperator operator = new JFrameOperator();
0509: assertNotNull(operator);
0510:
0511: JComponentOperator operator1 = new JComponentOperator(operator);
0512: assertNotNull(operator1);
0513:
0514: operator1.getNextFocusableComponent();
0515: }
0516:
0517: /**
0518: * Test getRegisteredKeyStrokes method.
0519: */
0520: public void testGetRegisteredKeyStrokes() {
0521: frame.setVisible(true);
0522:
0523: JFrameOperator operator = new JFrameOperator();
0524: assertNotNull(operator);
0525:
0526: JComponentOperator operator1 = new JComponentOperator(operator);
0527: assertNotNull(operator1);
0528:
0529: operator1.getRegisteredKeyStrokes();
0530: }
0531:
0532: /**
0533: * Test getRootPane method.
0534: */
0535: public void testGetRootPane() {
0536: frame.setVisible(true);
0537:
0538: JFrameOperator operator = new JFrameOperator();
0539: assertNotNull(operator);
0540:
0541: JComponentOperator operator1 = new JComponentOperator(operator);
0542: assertNotNull(operator1);
0543:
0544: operator1.getRootPane();
0545: }
0546:
0547: /**
0548: * Test getToolTipLocation method.
0549: */
0550: public void testGetToolTipLocation() {
0551: frame.setVisible(true);
0552:
0553: JFrameOperator operator = new JFrameOperator();
0554: assertNotNull(operator);
0555:
0556: JComponentOperator operator1 = new JComponentOperator(operator);
0557: assertNotNull(operator1);
0558:
0559: operator1.getToolTipLocation(new MouseEvent(frame, 0, 0, 0, 0,
0560: 0, 0, false));
0561: }
0562:
0563: /**
0564: * Test getToolTipText method.
0565: */
0566: public void testGetToolTipText() {
0567: frame.setVisible(true);
0568:
0569: JFrameOperator operator = new JFrameOperator();
0570: assertNotNull(operator);
0571:
0572: JComponentOperator operator1 = new JComponentOperator(operator);
0573: assertNotNull(operator1);
0574:
0575: operator1.getToolTipText();
0576: operator1.getToolTipText(new MouseEvent(frame, 0, 0, 0, 0, 0,
0577: 0, false));
0578: }
0579:
0580: /**
0581: * Test getTopLevelAncestor method.
0582: */
0583: public void testGetTopLevelAncestor() {
0584: frame.setVisible(true);
0585:
0586: JFrameOperator operator = new JFrameOperator();
0587: assertNotNull(operator);
0588:
0589: JComponentOperator operator1 = new JComponentOperator(operator);
0590: assertNotNull(operator1);
0591:
0592: operator1.getTopLevelAncestor();
0593: }
0594:
0595: /**
0596: * Test getUIClassID method.
0597: */
0598: public void testGetUIClassID() {
0599: frame.setVisible(true);
0600:
0601: JFrameOperator operator = new JFrameOperator();
0602: assertNotNull(operator);
0603:
0604: JComponentOperator operator1 = new JComponentOperator(operator);
0605: assertNotNull(operator1);
0606:
0607: operator1.getUIClassID();
0608: }
0609:
0610: /**
0611: * Test getVisibleRect method.
0612: */
0613: public void testGetVisibleRect() {
0614: frame.setVisible(true);
0615:
0616: JFrameOperator operator = new JFrameOperator();
0617: assertNotNull(operator);
0618:
0619: JComponentOperator operator1 = new JComponentOperator(operator);
0620: assertNotNull(operator1);
0621:
0622: operator1.getVisibleRect();
0623: }
0624:
0625: /**
0626: * Test grabFocus method.
0627: */
0628: public void testGrabFocus() {
0629: frame.setVisible(true);
0630:
0631: JFrameOperator operator = new JFrameOperator();
0632: assertNotNull(operator);
0633:
0634: JComponentOperator operator1 = new JComponentOperator(operator);
0635: assertNotNull(operator1);
0636:
0637: operator1.grabFocus();
0638: }
0639:
0640: /**
0641: * Test isFocusCycleRoot method.
0642: */
0643: public void testIsFocusCycleRoot() {
0644: frame.setVisible(true);
0645:
0646: JFrameOperator operator = new JFrameOperator();
0647: assertNotNull(operator);
0648:
0649: JComponentOperator operator1 = new JComponentOperator(operator);
0650: assertNotNull(operator1);
0651:
0652: operator1.isFocusCycleRoot();
0653: }
0654:
0655: /**
0656: * Test isManagingFocus method.
0657: */
0658: public void testIsManagingFocus() {
0659: frame.setVisible(true);
0660:
0661: JFrameOperator operator = new JFrameOperator();
0662: assertNotNull(operator);
0663:
0664: JComponentOperator operator1 = new JComponentOperator(operator);
0665: assertNotNull(operator1);
0666:
0667: operator1.isManagingFocus();
0668: }
0669:
0670: /**
0671: * Test isOptimizedDrawingEnabled method.
0672: */
0673: public void testIsOptimizedDrawingEnabled() {
0674: frame.setVisible(true);
0675:
0676: JFrameOperator operator = new JFrameOperator();
0677: assertNotNull(operator);
0678:
0679: JComponentOperator operator1 = new JComponentOperator(operator);
0680: assertNotNull(operator1);
0681:
0682: operator1.isOptimizedDrawingEnabled();
0683: }
0684:
0685: /**
0686: * Test isPaintingTile method.
0687: */
0688: public void testIsPaintingTile() {
0689: frame.setVisible(true);
0690:
0691: JFrameOperator operator = new JFrameOperator();
0692: assertNotNull(operator);
0693:
0694: JComponentOperator operator1 = new JComponentOperator(operator);
0695: assertNotNull(operator1);
0696:
0697: operator1.isPaintingTile();
0698: }
0699:
0700: /**
0701: * Test isRequestFocusEnabled method.
0702: */
0703: public void testIsRequestFocusEnabled() {
0704: frame.setVisible(true);
0705:
0706: JFrameOperator operator = new JFrameOperator();
0707: assertNotNull(operator);
0708:
0709: JComponentOperator operator1 = new JComponentOperator(operator);
0710: assertNotNull(operator1);
0711:
0712: operator1.isRequestFocusEnabled();
0713: }
0714:
0715: /**
0716: * Test isValidateRoot method.
0717: */
0718: public void testIsValidateRoot() {
0719: frame.setVisible(true);
0720:
0721: JFrameOperator operator = new JFrameOperator();
0722: assertNotNull(operator);
0723:
0724: JComponentOperator operator1 = new JComponentOperator(operator);
0725: assertNotNull(operator1);
0726:
0727: operator1.isValidateRoot();
0728: }
0729:
0730: /**
0731: * Test paintImmediately method.
0732: */
0733: public void testPaintImmediately() {
0734: frame.setVisible(true);
0735:
0736: JFrameOperator operator = new JFrameOperator();
0737: assertNotNull(operator);
0738:
0739: JComponentOperator operator1 = new JComponentOperator(operator);
0740: assertNotNull(operator1);
0741:
0742: operator1.paintImmediately(0, 0, 1, 1);
0743: operator1.paintImmediately(new Rectangle(0, 0, 1, 1));
0744: }
0745:
0746: /**
0747: * Test putClientProperty method.
0748: */
0749: public void testPutClientProperty() {
0750: frame.setVisible(true);
0751:
0752: JFrameOperator operator = new JFrameOperator();
0753: assertNotNull(operator);
0754:
0755: JComponentOperator operator1 = new JComponentOperator(operator);
0756: assertNotNull(operator1);
0757:
0758: operator1.putClientProperty("1", "2");
0759: }
0760:
0761: /**
0762: * Test registerKeyboardAction method.
0763: */
0764: public void testRegisterKeyboardAction() {
0765: frame.setVisible(true);
0766:
0767: JFrameOperator operator = new JFrameOperator();
0768: assertNotNull(operator);
0769:
0770: JComponentOperator operator1 = new JComponentOperator(operator);
0771: assertNotNull(operator1);
0772:
0773: operator1.registerKeyboardAction(new ActionListenerTest(),
0774: KeyStroke.getKeyStroke('a'), 1);
0775: operator1.registerKeyboardAction(new ActionListenerTest(), "1",
0776: KeyStroke.getKeyStroke('a'), 1);
0777: }
0778:
0779: /**
0780: * Inner class.
0781: */
0782: public class ActionListenerTest implements ActionListener {
0783: public void actionPerformed(ActionEvent e) {
0784: }
0785: }
0786:
0787: /**
0788: * Test removeAncestorListener method.
0789: */
0790: public void testRemoveAncestorListener() {
0791:
0792: }
0793:
0794: /**
0795: * Test removeVetoableChangeListener method.
0796: */
0797: public void testRemoveVetoableChangeListener() {
0798:
0799: }
0800:
0801: /**
0802: * Test repaint method.
0803: */
0804: public void testRepaint() {
0805: frame.setVisible(true);
0806:
0807: JFrameOperator operator = new JFrameOperator();
0808: assertNotNull(operator);
0809:
0810: JComponentOperator operator1 = new JComponentOperator(operator);
0811: assertNotNull(operator1);
0812:
0813: operator1.repaint();
0814: operator1.repaint(new Rectangle(0, 0, 1, 1));
0815: }
0816:
0817: /**
0818: * Test requestDefaultFocus method.
0819: */
0820: public void testRequestDefaultFocus() {
0821: frame.setVisible(true);
0822:
0823: JFrameOperator operator = new JFrameOperator();
0824: assertNotNull(operator);
0825:
0826: JComponentOperator operator1 = new JComponentOperator(operator);
0827: assertNotNull(operator1);
0828:
0829: operator1.requestDefaultFocus();
0830: }
0831:
0832: /**
0833: * Test resetKeyboardActions method.
0834: */
0835: public void testResetKeyboardActions() {
0836: frame.setVisible(true);
0837:
0838: JFrameOperator operator = new JFrameOperator();
0839: assertNotNull(operator);
0840:
0841: JComponentOperator operator1 = new JComponentOperator(operator);
0842: assertNotNull(operator1);
0843:
0844: operator1.resetKeyboardActions();
0845: }
0846:
0847: /**
0848: * Test revalidate method.
0849: */
0850: public void testRevalidate() {
0851: frame.setVisible(true);
0852:
0853: JFrameOperator operator = new JFrameOperator();
0854: assertNotNull(operator);
0855:
0856: JComponentOperator operator1 = new JComponentOperator(operator);
0857: assertNotNull(operator1);
0858:
0859: operator1.revalidate();
0860: }
0861:
0862: /**
0863: * Test scrollRectToVisible method.
0864: */
0865: public void testScrollRectToVisible() {
0866: frame.setVisible(true);
0867:
0868: JFrameOperator operator = new JFrameOperator();
0869: assertNotNull(operator);
0870:
0871: JComponentOperator operator1 = new JComponentOperator(operator);
0872: assertNotNull(operator1);
0873:
0874: operator1.scrollRectToVisible(new Rectangle(0, 0, 1, 1));
0875: }
0876:
0877: /**
0878: * Test setAlignmentX method.
0879: */
0880: public void testSetAlignmentX() {
0881: frame.setVisible(true);
0882:
0883: JFrameOperator operator = new JFrameOperator();
0884: assertNotNull(operator);
0885:
0886: JComponentOperator operator1 = new JComponentOperator(operator);
0887: assertNotNull(operator1);
0888:
0889: operator1.setAlignmentX(1.0f);
0890: }
0891:
0892: /**
0893: * Test setAlignmentY method.
0894: */
0895: public void testSetAlignmentY() {
0896: frame.setVisible(true);
0897:
0898: JFrameOperator operator = new JFrameOperator();
0899: assertNotNull(operator);
0900:
0901: JComponentOperator operator1 = new JComponentOperator(operator);
0902: assertNotNull(operator1);
0903:
0904: operator1.setAlignmentY(1.0f);
0905: }
0906:
0907: /**
0908: * Test setDoubleBuffered method.
0909: */
0910: public void testSetDoubleBuffered() {
0911: frame.setVisible(true);
0912:
0913: JFrameOperator operator = new JFrameOperator();
0914: assertNotNull(operator);
0915:
0916: JComponentOperator operator1 = new JComponentOperator(operator);
0917: assertNotNull(operator1);
0918:
0919: operator1.setDoubleBuffered(true);
0920: }
0921:
0922: /**
0923: * Test setMaximumSize method.
0924: */
0925: public void testSetMaximumSize() {
0926: frame.setVisible(true);
0927:
0928: JFrameOperator operator = new JFrameOperator();
0929: assertNotNull(operator);
0930:
0931: JComponentOperator operator1 = new JComponentOperator(operator);
0932: assertNotNull(operator1);
0933:
0934: operator1.setMaximumSize(new Dimension(100, 100));
0935: }
0936:
0937: /**
0938: * Test setMinimumSize method.
0939: */
0940: public void testSetMinimumSize() {
0941: frame.setVisible(true);
0942:
0943: JFrameOperator operator = new JFrameOperator();
0944: assertNotNull(operator);
0945:
0946: JComponentOperator operator1 = new JComponentOperator(operator);
0947: assertNotNull(operator1);
0948:
0949: operator1.setMinimumSize(new Dimension(10, 10));
0950: }
0951:
0952: /**
0953: * Test setNextFocusableComponent method.
0954: */
0955: public void testSetNextFocusableComponent() {
0956: frame.setVisible(true);
0957:
0958: JFrameOperator operator = new JFrameOperator();
0959: assertNotNull(operator);
0960:
0961: JComponentOperator operator1 = new JComponentOperator(operator);
0962: assertNotNull(operator1);
0963:
0964: operator1.setNextFocusableComponent(new JPanel());
0965: }
0966:
0967: /**
0968: * Test setOpaque method.
0969: */
0970: public void testSetOpaque() {
0971: frame.setVisible(true);
0972:
0973: JFrameOperator operator = new JFrameOperator();
0974: assertNotNull(operator);
0975:
0976: JComponentOperator operator1 = new JComponentOperator(operator);
0977: assertNotNull(operator1);
0978:
0979: operator1.setOpaque(false);
0980: }
0981:
0982: /**
0983: * Test setPreferredSize method.
0984: */
0985: public void testSetPreferredSize() {
0986: frame.setVisible(true);
0987:
0988: JFrameOperator operator = new JFrameOperator();
0989: assertNotNull(operator);
0990:
0991: JComponentOperator operator1 = new JComponentOperator(operator);
0992: assertNotNull(operator1);
0993:
0994: operator1.setPreferredSize(new Dimension(100, 100));
0995: }
0996:
0997: /**
0998: * Test setRequestFocusEnabled method.
0999: */
1000: public void testSetRequestFocusEnabled() {
1001: frame.setVisible(true);
1002:
1003: JFrameOperator operator = new JFrameOperator();
1004: assertNotNull(operator);
1005:
1006: JComponentOperator operator1 = new JComponentOperator(operator);
1007: assertNotNull(operator1);
1008:
1009: operator1.setRequestFocusEnabled(false);
1010: }
1011:
1012: /**
1013: * Test setToolTipText method.
1014: */
1015: public void testSetToolTipText() {
1016: frame.setVisible(true);
1017:
1018: JFrameOperator operator = new JFrameOperator();
1019: assertNotNull(operator);
1020:
1021: JComponentOperator operator1 = new JComponentOperator(operator);
1022: assertNotNull(operator1);
1023:
1024: operator1.setToolTipText("1234");
1025: }
1026:
1027: /**
1028: * Test unregisterKeyboardAction method.
1029: */
1030: public void testUnregisterKeyboardAction() {
1031: frame.setVisible(true);
1032:
1033: JFrameOperator operator = new JFrameOperator();
1034: assertNotNull(operator);
1035:
1036: JComponentOperator operator1 = new JComponentOperator(operator);
1037: assertNotNull(operator1);
1038:
1039: operator1.unregisterKeyboardAction(KeyStroke.getKeyStroke('a'));
1040: }
1041:
1042: /**
1043: * Test updateUI method.
1044: */
1045: public void testUpdateUI() {
1046: frame.setVisible(true);
1047:
1048: JFrameOperator operator = new JFrameOperator();
1049: assertNotNull(operator);
1050:
1051: JComponentOperator operator1 = new JComponentOperator(operator);
1052: assertNotNull(operator1);
1053:
1054: operator1.updateUI();
1055: }
1056: }
|