You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2010/05/26 11:31:15 UTC
svn commit: r948377 [9/21] - in /harmony/enhanced/java/branches/mrh:
classlib/make/ classlib/modules/accessibility/make/
classlib/modules/annotation/make/ classlib/modules/applet/make/
classlib/modules/archive/make/ classlib/modules/archive/src/test/ja...
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFileChooserTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFileChooserTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFileChooserTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFileChooserTest.java Wed May 26 09:31:07 2010
@@ -29,6 +29,7 @@ import javax.swing.filechooser.FileSyste
import javax.swing.filechooser.FileView;
import javax.swing.plaf.FileChooserUI;
import javax.swing.plaf.basic.BasicFileChooserUI;
+import tests.support.Support_Excludes;
public class JFileChooserTest extends SwingTestCase {
private JFileChooser chooser;
@@ -54,6 +55,10 @@ public class JFileChooserTest extends Sw
}
public void testJFileChooser() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNotNull(chooser.getCurrentDirectory());
assertEquals(FileSystemView.getFileSystemView().getDefaultDirectory(), chooser
.getCurrentDirectory());
@@ -102,6 +107,10 @@ public class JFileChooserTest extends Sw
}
public void testJFileChooser_FSV() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
File testDir = new File("testDir");
testDir.deleteOnExit();
testDir.mkdir();
@@ -140,6 +149,10 @@ public class JFileChooserTest extends Sw
//TODO
public void testSetup() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
chooser = new JFileChooser();
assertEquals(FileSystemView.getFileSystemView(), chooser.getFileSystemView());
chooser.setup(FileSystemView.getFileSystemView());
@@ -179,6 +192,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetDragEnabled() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse(chooser.getDragEnabled());
chooser.setDragEnabled(true);
assertTrue(chooser.getDragEnabled());
@@ -186,6 +203,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetSelectedFile() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(chooser.getSelectedFile());
File selectedFile = new File("testFile");
chooser.setSelectedFile(selectedFile);
@@ -200,6 +221,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetSelectedFiles() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(0, chooser.getSelectedFiles().length);
chooser.setSelectedFile(new File("c"));
assertEquals(0, chooser.getSelectedFiles().length);
@@ -227,6 +252,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetCurrentDirectory() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(FileSystemView.getFileSystemView().getDefaultDirectory(), chooser
.getCurrentDirectory());
File dir = new File("testDir");
@@ -253,12 +282,20 @@ public class JFileChooserTest extends Sw
}
public void testChangeToParentDirectory() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
chooser.changeToParentDirectory();
assertEquals(FileSystemView.getFileSystemView().getDefaultDirectory().getParentFile(),
chooser.getCurrentDirectory());
}
public void testGetSetControlButtonsAreShown() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(chooser.getControlButtonsAreShown());
chooser.setControlButtonsAreShown(false);
assertFalse(chooser.getControlButtonsAreShown());
@@ -266,6 +303,10 @@ public class JFileChooserTest extends Sw
}
public void testgetSetDialogType() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(JFileChooser.OPEN_DIALOG, chooser.getDialogType());
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
assertEquals(JFileChooser.SAVE_DIALOG, chooser.getDialogType());
@@ -281,6 +322,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetDialogTitle() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(chooser.getDialogTitle());
assertEquals("Open", chooser.getUI().getDialogTitle(chooser));
chooser.setDialogTitle("title");
@@ -290,6 +335,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetApproveButtonToolTipText() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(chooser.getApproveButtonToolTipText());
chooser.setApproveButtonToolTipText("text");
assertEquals("text", chooser.getApproveButtonToolTipText());
@@ -300,6 +349,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetApproveButtonText() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(chooser.getApproveButtonText());
assertEquals("Open", chooser.getUI().getApproveButtonText(chooser));
chooser.setApproveButtonText("text");
@@ -313,6 +366,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetApproveButtonMnemonic() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(0, chooser.getApproveButtonMnemonic());
chooser.setApproveButtonMnemonic('c');
assertEquals(KeyEvent.VK_C, chooser.getApproveButtonMnemonic());
@@ -322,6 +379,10 @@ public class JFileChooserTest extends Sw
}
public void testGetAddRemoveResetChoosableFileFilters() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(1, chooser.getChoosableFileFilters().length);
FileFilter fileFilter = new FileFilter() {
@Override
@@ -354,6 +415,10 @@ public class JFileChooserTest extends Sw
}
public void testGetAcceptAllFileFilter() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
FileFilter acceptAllFilter = chooser.getAcceptAllFileFilter();
assertNotNull(acceptAllFilter);
assertEquals(acceptAllFilter, chooser.getUI().getAcceptAllFileFilter(chooser));
@@ -364,6 +429,10 @@ public class JFileChooserTest extends Sw
}
public void testIsSetAcceptAllFilterUsed() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(chooser.isAcceptAllFileFilterUsed());
chooser.setAcceptAllFileFilterUsed(false);
assertFalse(chooser.isAcceptAllFileFilterUsed());
@@ -375,6 +444,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetAccessory() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(chooser.getAccessory());
JComponent accessory = new JButton();
chooser.setAccessory(accessory);
@@ -383,6 +456,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetFileSelectionMode_isSelectionEnabled() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(JFileChooser.FILES_ONLY, chooser.getFileSelectionMode());
assertTrue(chooser.isFileSelectionEnabled());
assertFalse(chooser.isDirectorySelectionEnabled());
@@ -404,6 +481,10 @@ public class JFileChooserTest extends Sw
}
public void testIsSetMultiSelectionEnabled() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse(chooser.isMultiSelectionEnabled());
chooser.setMultiSelectionEnabled(true);
assertTrue(chooser.isMultiSelectionEnabled());
@@ -411,6 +492,10 @@ public class JFileChooserTest extends Sw
}
public void testIsSetFileHidingEnabled() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(chooser.isFileHidingEnabled());
chooser.setFileHidingEnabled(false);
assertFalse(chooser.isFileHidingEnabled());
@@ -418,6 +503,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetFileFilter() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(chooser.getAcceptAllFileFilter(), chooser.getFileFilter());
FileFilter fileFilter = new FileFilter() {
@Override
@@ -436,6 +525,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetFileView() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(chooser.getFileView());
assertNotNull(chooser.getUI().getFileView(chooser));
FileView view = new FileView() {
@@ -447,6 +540,10 @@ public class JFileChooserTest extends Sw
}
public void testGetName_Description_TypeDescription_Icon_Traversable() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
File f = new File(".");
assertEquals(chooser.getUI().getFileView(chooser).getName(f), chooser.getName(f));
assertEquals(chooser.getUI().getFileView(chooser).getDescription(f), chooser
@@ -494,6 +591,10 @@ public class JFileChooserTest extends Sw
}
public void testAccept() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
File f = new File(".");
assertTrue(chooser.accept(f));
chooser.setFileFilter(new FileFilter() {
@@ -513,6 +614,10 @@ public class JFileChooserTest extends Sw
}
public void testGetSetFileSystemView() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(FileSystemView.getFileSystemView(), chooser.getFileSystemView());
FileSystemView fileSystemView = new FileSystemView() {
@Override
@@ -526,6 +631,10 @@ public class JFileChooserTest extends Sw
}
public void testApproveSelection() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestActionListener listener = new TestActionListener();
chooser.addActionListener(listener);
chooser.approveSelection();
@@ -535,6 +644,10 @@ public class JFileChooserTest extends Sw
}
public void testCancelSelection() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestActionListener listener = new TestActionListener();
chooser.addActionListener(listener);
chooser.cancelSelection();
@@ -544,6 +657,10 @@ public class JFileChooserTest extends Sw
}
public void testGetAddRemoveFireActionListeners() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(0, chooser.getActionListeners().length);
TestActionListener listener = new TestActionListener();
chooser.addActionListener(listener);
@@ -556,6 +673,10 @@ public class JFileChooserTest extends Sw
}
public void testGetUpdateUI() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
FileChooserUI ui = chooser.getUI();
assertNotNull(ui);
FileChooserUI customUI = new BasicFileChooserUI(chooser);
@@ -567,14 +688,26 @@ public class JFileChooserTest extends Sw
}
public void testGetUIClassID() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals("FileChooserUI", chooser.getUIClassID());
}
public void testgetAccessibleContext() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(chooser.getAccessibleContext() instanceof JFileChooser.AccessibleJFileChooser);
}
public void testGetName() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JFileChooser fc = new JFileChooser();
assertNull(fc.getName());
}
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextFieldTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextFieldTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextFieldTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextFieldTest.java Wed May 26 09:31:07 2010
@@ -36,6 +36,7 @@ import javax.swing.text.DefaultFormatter
import javax.swing.text.InternationalFormatter;
import javax.swing.text.NumberFormatter;
import javax.swing.text.TextAction;
+import tests.support.Support_Excludes;
public class JFormattedTextFieldTest extends SwingTestCase {
JFrame jf;
@@ -178,6 +179,10 @@ public class JFormattedTextFieldTest ext
}
public void testJFormattedTextFieldObject() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
Object value = Color.RED;
JFormattedTextField tf1 = new JFormattedTextField(value);
assertEquals(value, tf1.getValue());
@@ -192,6 +197,10 @@ public class JFormattedTextFieldTest ext
}
public void testJFormattedTextFieldObject_NullToString() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final Object value = new Object() {
@Override
public String toString() {
@@ -203,6 +212,10 @@ public class JFormattedTextFieldTest ext
}
public void testJFormattedTextFieldAbstractFormatter() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
InternationalFormatter formatter = new InternationalFormatter();
JFormattedTextField tf1 = new JFormattedTextField(formatter);
assertNull(tf1.getValue());
@@ -217,6 +230,10 @@ public class JFormattedTextFieldTest ext
}
public void testJFormattedTextFieldFormat() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
Format format = new SimpleDateFormat();
InternationalFormatter formatter;
DefaultFormatterFactory factory;
@@ -246,6 +263,10 @@ public class JFormattedTextFieldTest ext
}
public void testJFormattedTextFieldAbstractFormatterFactory() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JFormattedTextField.AbstractFormatterFactory factory = new DefaultFormatterFactory();
JFormattedTextField tf1 = new JFormattedTextField(factory);
assertNull(tf1.getValue());
@@ -255,6 +276,10 @@ public class JFormattedTextFieldTest ext
}
public void testJFormattedTextFieldAbstractFormatterFactoryObject() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
Object value = Color.RED;
JFormattedTextField.AbstractFormatterFactory factory = new DefaultFormatterFactory();
JFormattedTextField tf1 = new JFormattedTextField(factory, value);
@@ -265,6 +290,10 @@ public class JFormattedTextFieldTest ext
}
public void testSetGetValue() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
String propertyName = "value";
listener.setInterestingPropertyName(propertyName);
assertNull(tf.getValue());
@@ -280,6 +309,10 @@ public class JFormattedTextFieldTest ext
}
public void testSetGetFormatter() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
String propertyName = "textFormatter";
listener.setInterestingPropertyName(propertyName);
assertNull(tf.getFormatter());
@@ -297,6 +330,10 @@ public class JFormattedTextFieldTest ext
}
public void testSetGetFocusLostBehavior() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(JFormattedTextField.COMMIT_OR_REVERT, tf.getFocusLostBehavior());
tf.setFocusLostBehavior(JFormattedTextField.COMMIT);
assertEquals(JFormattedTextField.COMMIT, tf.getFocusLostBehavior());
@@ -327,6 +364,10 @@ public class JFormattedTextFieldTest ext
}
public void testSetGetFormatterFactory() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
String propertyName = "formatterFactory";
listener.setInterestingPropertyName(propertyName);
assertNull(tf.getFormatterFactory());
@@ -337,6 +378,10 @@ public class JFormattedTextFieldTest ext
}
public void testProcessFocusEventFocusEvent() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
Long value = new Long(56);
tf.setValue(new Integer(345));
tf.setFocusLostBehavior(JFormattedTextField.COMMIT);
@@ -387,9 +432,17 @@ public class JFormattedTextFieldTest ext
}
public void testSetDocumentDocument() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
}
public void testGetActions() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
Action[] actions = tf.getActions();
Action[] defaultActions = new DefaultEditorKit().getActions();
assertEquals(defaultActions.length + 2, actions.length);
@@ -421,6 +474,10 @@ public class JFormattedTextFieldTest ext
}
public void testCommitEdit() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
tf.setFormatter(new NumberFormatter());
assertNull(tf.getValue());
tf.setText("678");
@@ -433,6 +490,10 @@ public class JFormattedTextFieldTest ext
}
public void testIsEditValid() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
String propertyName = "editValid";
listener.setInterestingPropertyName(propertyName);
tf.setValue(new Integer(90000000));
@@ -448,6 +509,10 @@ public class JFormattedTextFieldTest ext
}
public void testConstants() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(0, JFormattedTextField.COMMIT);
assertEquals(1, JFormattedTextField.COMMIT_OR_REVERT);
assertEquals(2, JFormattedTextField.REVERT);
@@ -455,6 +520,10 @@ public class JFormattedTextFieldTest ext
}
public void testGetUIClassID() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals("FormattedTextFieldUI", tf.getUIClassID());
}
@@ -479,6 +548,10 @@ public class JFormattedTextFieldTest ext
}
public void testCreateFormattersFactory() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
DefaultFormatterFactory factory;
tf.setValue(new Integer(34));
factory = getFactoryIfDefault(tf.getFormatterFactory());
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextField_CommitActionRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextField_CommitActionRTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextField_CommitActionRTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFormattedTextField_CommitActionRTest.java Wed May 26 09:31:07 2010
@@ -26,6 +26,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import junit.framework.TestCase;
+import tests.support.Support_Excludes;
public class JFormattedTextField_CommitActionRTest extends TestCase {
private JFrame frame;
@@ -50,6 +51,10 @@ public class JFormattedTextField_CommitA
}
public void testActionPerformed() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
c = new JPanel();
Container parent = new Panel();
textField = new JFormattedTextField(" ");
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameRTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameRTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameRTest.java Wed May 26 09:31:07 2010
@@ -20,6 +20,7 @@
package javax.swing;
import javax.swing.plaf.metal.MetalLookAndFeel;
+import tests.support.Support_Excludes;
public class JFrameRTest extends SwingTestCase {
public JFrameRTest(final String name) {
@@ -27,6 +28,10 @@ public class JFrameRTest extends SwingTe
}
public void testInitDecorations() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
UIManager.setLookAndFeel(new MetalLookAndFeel() {
private static final long serialVersionUID = 1L;
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JFrameTest.java Wed May 26 09:31:07 2010
@@ -36,6 +36,7 @@ import javax.accessibility.AccessibleCon
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleState;
import org.apache.harmony.x.swing.StringConstants;
+import tests.support.Support_Excludes;
public class JFrameTest extends SwingTestCase {
/*
@@ -120,6 +121,10 @@ public class JFrameTest extends SwingTes
* Class under test for void JFrame()
*/
public void testJFrame() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
frame = new JFrame();
assertEquals("title is empty", "", frame.getTitle());
assertFalse("JFrame is invisible by default", frame.isVisible());
@@ -130,6 +135,10 @@ public class JFrameTest extends SwingTes
}
public void testFrameInit() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
assertTrue("rootPaneCheckingEnabled is true", frame.isRootPaneCheckingEnabled());
assertTrue("layout is not null", frame.getLayout() != null);
@@ -166,6 +175,10 @@ public class JFrameTest extends SwingTes
* int getDefaultCloseOperation()
*/
public void testSetGetDefaultCloseOperation() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// default value is JFrame.HIDE_ON_CLOSE
assertEquals(WindowConstants.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
// test setting valid value
@@ -217,6 +230,10 @@ public class JFrameTest extends SwingTes
* static boolean isDefaultLookAndFeelDecorated()
*/
public void testSetIsDefaultLookAndFeelDecorated() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// test for default value
assertFalse(JFrame.isDefaultLookAndFeelDecorated());
JFrame.setDefaultLookAndFeelDecorated(true);
@@ -231,6 +248,10 @@ public class JFrameTest extends SwingTes
* boolean isRootPaneCheckingEnabled()
*/
public void testSetIsRootPaneCheckingEnabled() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
assertTrue("rootPaneCheckingEnabled is true by default", frame
.isRootPaneCheckingEnabled());
@@ -243,6 +264,10 @@ public class JFrameTest extends SwingTes
* Class under test for void JFrame(String, GraphicsConfiguration)
*/
public void testJFrameStringGraphicsConfiguration() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test frame.";
final GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration();
@@ -267,6 +292,10 @@ public class JFrameTest extends SwingTes
* Class under test for void JFrame(String)
*/
public void testJFrameString() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test frame.";
// test with valid title
frame = new JFrame(title);
@@ -286,6 +315,10 @@ public class JFrameTest extends SwingTes
* Class under test for void JFrame(GraphicsConfiguration)
*/
public void testJFrameGraphicsConfiguration() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration();
// test with valid gc
@@ -309,6 +342,10 @@ public class JFrameTest extends SwingTes
* Class under test for void addImpl(Component, Object, int)
*/
public void testAddImpl() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JComponent comp = new JPanel();
// rootPaneCheckingEnabled is true, exception must be thrown
frame.setRootPaneCheckingEnabled(true);
@@ -342,6 +379,10 @@ public class JFrameTest extends SwingTes
* JRootPane getRootPane()
*/
public void testSetGetRootPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
assertTrue("setRootPane() is called from the constructor", TestFrame.setRootPaneCalled);
MyPropertyChangeListener listener = new MyPropertyChangeListener();
@@ -360,6 +401,10 @@ public class JFrameTest extends SwingTes
* Class under test for JRootPane createRootPane()
*/
public void testCreateRootPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
assertTrue("createRootPane() is called from the constructor",
TestFrame.createRootPaneCalled);
@@ -373,6 +418,10 @@ public class JFrameTest extends SwingTes
* JMenuBar getJMenuBar()
*/
public void testSetGetJMenuBar() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(frame.getJMenuBar());
JMenuBar menuBar = new JMenuBar();
frame.setJMenuBar(menuBar);
@@ -387,6 +436,10 @@ public class JFrameTest extends SwingTes
* JLayeredPane getLayeredPane()
*/
public void testSetGetLayeredPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener("layeredPane", listener);
JLayeredPane pane = new JLayeredPane();
@@ -412,6 +465,10 @@ public class JFrameTest extends SwingTes
* Class under test for AccessibleContext getAccessibleContext()
*/
public void testGetAccessibleContext() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
AccessibleContext c = frame.getAccessibleContext();
assertTrue("class is ok", c instanceof JFrame.AccessibleJFrame);
assertTrue("AccessibleRole is ok", c.getAccessibleRole() == AccessibleRole.FRAME);
@@ -433,6 +490,10 @@ public class JFrameTest extends SwingTes
* Class under test for String paramString()
*/
public void testParamString() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
assertTrue("paramString() cannot return null", frame.paramString() != null);
}
@@ -441,6 +502,10 @@ public class JFrameTest extends SwingTes
* Class under test for void processWindowEvent(WindowEvent)
*/
public void testProcessWindowEvent() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
frame.setVisible(true);
WindowEvent e = new WindowEvent(frame, WindowEvent.WINDOW_CLOSING);
@@ -470,6 +535,10 @@ public class JFrameTest extends SwingTes
* Class under test for void setLayout(LayoutManager)
*/
public void testSetLayout() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
LayoutManager contentLayout = frame.getContentPane().getLayout();
LayoutManager frameLayout = frame.getLayout();
@@ -506,6 +575,10 @@ public class JFrameTest extends SwingTes
* Class under test for void update(Graphics)
*/
public void testUpdate() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// Note: painting code, cannot test
}
@@ -515,6 +588,10 @@ public class JFrameTest extends SwingTes
* Container getContentPane()
*/
public void testSetGetContentPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener("contentPane", listener);
JPanel pane = new JPanel();
@@ -542,6 +619,10 @@ public class JFrameTest extends SwingTes
* Component getGlassPane()
*/
public void testSetGetGlassPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener("glassPane", listener);
JPanel pane = new JPanel();
@@ -567,6 +648,10 @@ public class JFrameTest extends SwingTes
* Class under test for void remove(Component)
*/
public void testRemove() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestFrame frame = new TestFrame();
JComponent comp = new JPanel();
frame.getContentPane().add(comp);
@@ -604,6 +689,10 @@ public class JFrameTest extends SwingTes
* Class under test for void setIconImage(Image image)
*/
public void testSetIconImage() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
Image image = new BufferedImage(5, 5, BufferedImage.TYPE_BYTE_INDEXED);
PropertyChangeController cont = new PropertyChangeController();
frame.addPropertyChangeListener(cont);
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrameTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrameTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrameTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrameTest.java Wed May 26 09:31:07 2010
@@ -39,6 +39,7 @@ import javax.swing.event.InternalFrameEv
import javax.swing.event.InternalFrameListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicInternalFrameUI;
+import tests.support.Support_Excludes;
@SuppressWarnings("serial")
public class JInternalFrameTest extends SwingTestCase {
@@ -228,6 +229,10 @@ public class JInternalFrameTest extends
* instead.
*/
public void testReshape() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final Point location = new Point(20, 21);
final int width = 22;
final int height = 23;
@@ -242,6 +247,10 @@ public class JInternalFrameTest extends
* Class under test for void updateUI()
*/
public void testUpdateUI() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
frame.updateUI();
ComponentUI ui1 = frame.getUI();
ComponentUI ui2 = UIManager.getUI(frame);
@@ -280,6 +289,10 @@ public class JInternalFrameTest extends
* Class under test for void JInternalFrame()
*/
public void testJInternalFrame() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
frame = new JInternalFrame();
checkJInternalFrameCorrectness("", false, false, false, false);
}
@@ -288,6 +301,10 @@ public class JInternalFrameTest extends
* Class under test for void doDefaultCloseAction()
*/
public void testDoDefaultCloseAction() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
MyInternalFrameListener listener = new MyInternalFrameListener();
frame.addInternalFrameListener(listener);
@@ -321,6 +338,10 @@ public class JInternalFrameTest extends
* Class under test for void pack()
*/
public void testPack() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final JComponent comp1 = new JPanel();
final JComponent comp2 = new JPanel();
comp2.setPreferredSize(new Dimension(60, 20));
@@ -338,6 +359,10 @@ public class JInternalFrameTest extends
* Class under test for void moveToBack()
*/
public void testMoveToBack() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// test without JDesktopPane set
frame.moveToBack();
// test with JDesktopPane set
@@ -359,6 +384,10 @@ public class JInternalFrameTest extends
* Class under test for void moveToFront()
*/
public void testMoveToFront() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// test without JDesktopPane set
frame.moveToFront();
// test with JDesktopPane set
@@ -381,6 +410,10 @@ public class JInternalFrameTest extends
* Class under test for void toBack()
*/
public void testToBack() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// test without JDesktopPane set
frame.toBack();
// test with JDesktopPane set
@@ -402,6 +435,10 @@ public class JInternalFrameTest extends
* Class under test for void toFront()
*/
public void testToFront() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// test without JDesktopPane set
frame.toFront();
// test with JDesktopPane set
@@ -423,6 +460,10 @@ public class JInternalFrameTest extends
* Class under test for void fireInternalFrameEvent(int)
*/
public void testFireInternalFrameEvent() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
MyInternalFrameListener l = new MyInternalFrameListener();
frame.addInternalFrameListener(l);
@@ -458,6 +499,10 @@ public class JInternalFrameTest extends
* int getDefaultCloseOperation()
*/
public void testSetGetDefaultCloseOperation() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// default value is JInternalFrame.DISPOSE_ON_CLOSE
assertEquals(WindowConstants.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
// test setting valid value
@@ -484,6 +529,10 @@ public class JInternalFrameTest extends
* int getLayer()
*/
public void testSetGetLayer() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue("default level is 0", frame.getLayer() == 0);
// test setLayer() without JDesktopPane set
frame.setLayer(1);
@@ -501,6 +550,10 @@ public class JInternalFrameTest extends
* Class under test for void setLayer(Integer)
*/
public void testSetLayerInteger() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// test setLayer() without JDesktopPane set
frame.setLayer(new Integer(1));
assertTrue("layer is set", frame.getLayer() == 1);
@@ -519,6 +572,10 @@ public class JInternalFrameTest extends
* boolean isClosable()
*/
public void testSetIsClosable() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse("closable is false by default", frame.isClosable());
frame.setClosable(true);
assertTrue("closable is set", frame.isClosable());
@@ -530,6 +587,10 @@ public class JInternalFrameTest extends
* boolean isClosed()
*/
public void testSetIsClosed() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyInternalFrameListener frameListener = new MyInternalFrameListener();
frame.addInternalFrameListener(frameListener);
MyPropertyChangeListener l = new MyPropertyChangeListener();
@@ -606,6 +667,10 @@ public class JInternalFrameTest extends
* boolean isIcon()
*/
public void testSetIsIcon() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JDesktopPane desktop = new JDesktopPane();
desktop.add(frame);
MyPropertyChangeListener listener = new MyPropertyChangeListener();
@@ -673,6 +738,10 @@ public class JInternalFrameTest extends
* boolean isIconifiable()
*/
public void testSetIsIconifiable() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse("iconable is false by default", frame.isIconifiable());
frame.setIconifiable(true);
assertTrue("iconable is set", frame.isIconifiable());
@@ -684,6 +753,10 @@ public class JInternalFrameTest extends
* boolean isMaximizable()
*/
public void testSetIsMaximizable() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse("maximizable is false by default", frame.isMaximizable());
frame.setMaximizable(true);
assertTrue("maximizable is set", frame.isMaximizable());
@@ -695,6 +768,10 @@ public class JInternalFrameTest extends
* boolean isMaximum()
*/
public void testSetIsMaximum() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JDesktopPane desktop = new JDesktopPane();
desktop.add(frame);
MyPropertyChangeListener listener = new MyPropertyChangeListener();
@@ -752,6 +829,10 @@ public class JInternalFrameTest extends
* boolean isResizable()
*/
public void testSetIsResizable() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse("resizable is false by default", frame.isResizable());
frame.setResizable(true);
assertTrue("resizable is set", frame.isResizable());
@@ -763,6 +844,10 @@ public class JInternalFrameTest extends
* boolean isRootPaneCheckingEnabled()
*/
public void testSetIsRootPaneCheckingEnabled() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
assertTrue("rootPaneCheckingEnabled is true by default", frame
.isRootPaneCheckingEnabled());
@@ -777,6 +862,10 @@ public class JInternalFrameTest extends
* boolean isSelected()
*/
public void testSetIsSelected() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
createAndShowRootFrame();
rootFrame.getContentPane().add(new JInternalFrame()); // to make 'frame' not selectable by default
//rootFrame.getContentPane().add(frame);
@@ -888,6 +977,10 @@ public class JInternalFrameTest extends
* Class under test for void JInternalFrame(String, boolean, boolean, boolean, boolean)
*/
public void testJInternalFrameStringbooleanbooleanbooleanboolean() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test title";
frame = new JInternalFrame(title, true, true, true, true);
checkJInternalFrameCorrectness(title, true, true, true, true);
@@ -901,6 +994,10 @@ public class JInternalFrameTest extends
* Class under test for void JInternalFrame(String, boolean, boolean, boolean)
*/
public void testJInternalFrameStringbooleanbooleanboolean() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test title";
frame = new JInternalFrame(title, true, true, true);
checkJInternalFrameCorrectness(title, true, true, true, false);
@@ -914,6 +1011,10 @@ public class JInternalFrameTest extends
* Class under test for void JInternalFrame(String, boolean, boolean)
*/
public void testJInternalFrameStringbooleanboolean() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test title";
frame = new JInternalFrame(title, true, true);
checkJInternalFrameCorrectness(title, true, true, false, false);
@@ -927,6 +1028,10 @@ public class JInternalFrameTest extends
* Class under test for void JInternalFrame(String, boolean)
*/
public void testJInternalFrameStringboolean() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test title";
frame = new JInternalFrame(title, false);
checkJInternalFrameCorrectness(title, false, false, false, false);
@@ -938,6 +1043,10 @@ public class JInternalFrameTest extends
* Class under test for void JInternalFrame(String)
*/
public void testJInternalFrameString() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test title";
frame = new JInternalFrame(title);
checkJInternalFrameCorrectness(title, false, false, false, false);
@@ -947,6 +1056,10 @@ public class JInternalFrameTest extends
* Class under test for void addImpl(Component, Object, int)
*/
public void testAddImpl() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
JComponent comp = new JPanel();
// rootPaneCheckingEnabled is true, no exception since 1.5
@@ -981,6 +1094,10 @@ public class JInternalFrameTest extends
* InternalFrameUI getUI()
*/
public void testSetGetUI() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
BasicInternalFrameUI ui = new BasicInternalFrameUI(frame);
frame.setUI(ui);
assertTrue(frame.getUI() == ui);
@@ -1007,6 +1124,10 @@ public class JInternalFrameTest extends
* InternalFrameListener[] getInternalFrameListeners()
*/
public void testAddRemoveGetInternalFrameListener() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
InternalFrameListener l = new MyInternalFrameListener();
frame.addInternalFrameListener(l);
InternalFrameListener[] listeners = frame.getInternalFrameListeners();
@@ -1022,6 +1143,10 @@ public class JInternalFrameTest extends
* JRootPane getRootPane()
*/
public void testSetGetRootPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
assertTrue("setRootPane() is called from the constructor",
TestInternalFrame.setRootPaneCalled);
@@ -1041,6 +1166,10 @@ public class JInternalFrameTest extends
* Class under test for JRootPane createRootPane()
*/
public void testCreateRootPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
assertTrue("createRootPane() is called from the constructor",
TestInternalFrame.createRootPaneCalled);
@@ -1055,6 +1184,10 @@ public class JInternalFrameTest extends
*/
@SuppressWarnings("deprecation")
public void testSetGetMenuBar() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(frame.getMenuBar());
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener(JInternalFrame.MENU_BAR_PROPERTY, listener);
@@ -1072,6 +1205,10 @@ public class JInternalFrameTest extends
* JMenuBar getJMenuBar()
*/
public void testSetGetJMenuBar() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(frame.getJMenuBar());
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener(JInternalFrame.MENU_BAR_PROPERTY, listener);
@@ -1089,6 +1226,10 @@ public class JInternalFrameTest extends
* JLayeredPane getLayeredPane()
*/
public void testSetGetLayeredPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener(JInternalFrame.LAYERED_PANE_PROPERTY, listener);
JLayeredPane pane = new JLayeredPane();
@@ -1116,6 +1257,10 @@ public class JInternalFrameTest extends
* JDesktopIcon getDesktopIcon()
*/
public void testSetGetDesktopIcon() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue("desktopIcon is not null by default", frame.getDesktopIcon() != null);
JInternalFrame.JDesktopIcon icon = new JInternalFrame.JDesktopIcon(frame);
assertTrue("desktopIcon is not set", frame.getDesktopIcon() != icon);
@@ -1129,6 +1274,10 @@ public class JInternalFrameTest extends
* Class under test for JDesktopPane getDesktopPane()
*/
public void testGetDesktopPane() throws NullPointerException {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// no desktopPane
assertNull("desktopPane is null by default", frame.getDesktopPane());
//JInternalFrame.JDesktopIcon icon = new JInternalFrame.JDesktopIcon(frame);
@@ -1161,6 +1310,10 @@ public class JInternalFrameTest extends
* Icon getFrameIcon()
*/
public void testSetGetFrameIcon() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
Icon icon = new ImageIcon();
assertTrue("frameIcon is not null by default", frame.getFrameIcon() != null);
frame.setFrameIcon(icon);
@@ -1173,6 +1326,10 @@ public class JInternalFrameTest extends
* Class under test for AccessibleContext getAccessibleContext()
*/
public void testGetAccessibleContext() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
AccessibleContext c = frame.getAccessibleContext();
assertTrue("instanceof AccessibleJInternalFrame",
c instanceof JInternalFrame.AccessibleJInternalFrame);
@@ -1216,6 +1373,10 @@ public class JInternalFrameTest extends
* String getTitle()
*/
public void testSetGetTitle() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final String title = "Test title";
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener(JInternalFrame.TITLE_PROPERTY, listener);
@@ -1233,6 +1394,10 @@ public class JInternalFrameTest extends
* Class under test for String paramString()
*/
public void testParamString() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
assertTrue("paramString() cannot return null", frame.paramString() != null);
}
@@ -1241,6 +1406,10 @@ public class JInternalFrameTest extends
* Class under test for String getUIClassID()
*/
public void testGetUIClassID() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue("InternalFrameUI" == frame.getUIClassID());
}
@@ -1250,6 +1419,10 @@ public class JInternalFrameTest extends
* Rectangle getNormalBounds()
*/
public void testSetGetNormalBounds() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener(listener);
JDesktopPane desktopPane = new JDesktopPane();
@@ -1284,6 +1457,10 @@ public class JInternalFrameTest extends
* Class under test for void setLayout(LayoutManager)
*/
public void testSetLayout() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestInternalFrame frame = new TestInternalFrame();
LayoutManager contentLayout = frame.getContentPane().getLayout();
LayoutManager frameLayout = frame.getLayout();
@@ -1320,6 +1497,10 @@ public class JInternalFrameTest extends
* Class under test for void paintComponent(Graphics)
*/
public void testPaintComponent() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// Note: painting code, cannot test
}
@@ -1329,6 +1510,10 @@ public class JInternalFrameTest extends
* Container getContentPane()
*/
public void testSetGetContentPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener(JInternalFrame.CONTENT_PANE_PROPERTY, listener);
JPanel pane = new JPanel();
@@ -1356,6 +1541,10 @@ public class JInternalFrameTest extends
* Component getGlassPane()
*/
public void testSetGetGlassPane() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyPropertyChangeListener listener = new MyPropertyChangeListener();
frame.addPropertyChangeListener(JInternalFrame.GLASS_PANE_PROPERTY, listener);
JPanel pane = new JPanel();
@@ -1381,6 +1570,10 @@ public class JInternalFrameTest extends
* Class under test for void remove(Component)
*/
public void testRemove() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JComponent comp = new JPanel();
frame.getContentPane().add(comp);
assertTrue("label is in contentPane", frame.isAncestorOf(comp));
@@ -1451,6 +1644,10 @@ public class JInternalFrameTest extends
* Class under test for String getWarningString()
*/
public void testGetWarningString() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull("getWarningString() always returns null", frame.getWarningString());
}
@@ -1460,6 +1657,10 @@ public class JInternalFrameTest extends
* boolean isFocusCycleRoot()
*/
public void testFocusCycleRoot() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue("isFocusCycleRoot is always true", frame.isFocusCycleRoot());
frame.setFocusCycleRoot(false);
assertTrue("isFocusCycleRoot is always true", frame.isFocusCycleRoot());
@@ -1471,6 +1672,10 @@ public class JInternalFrameTest extends
* Class under test for Container getFocusCycleRootAncestor()
*/
public void testGetFocusCycleRootAncestor() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull("always returns null", frame.getFocusCycleRootAncestor());
}
@@ -1478,6 +1683,10 @@ public class JInternalFrameTest extends
* Class under test for void hide()
*/
public void testHide() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
frame.setVisible(true);
frame.hide();
assertFalse("frame is hided", frame.isVisible());
@@ -1490,6 +1699,10 @@ public class JInternalFrameTest extends
* Class under test for void show()
*/
public void testShow() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
MyInternalFrameListener l = new MyInternalFrameListener();
frame.addInternalFrameListener(l);
frame.show();
@@ -1533,6 +1746,10 @@ public class JInternalFrameTest extends
* Class under test for void dispose()
*/
public void testDispose() {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
createAndShowRootFrame();
MyInternalFrameListener l = new MyInternalFrameListener();
frame.addInternalFrameListener(l);
@@ -1557,6 +1774,10 @@ public class JInternalFrameTest extends
}
public void testSetBounds() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
// Regression for HARMONY-1801
final Marker validateMarker = new Marker();
final Marker revalidateMarker = new Marker();
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrame_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrame_MultithreadedTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrame_MultithreadedTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JInternalFrame_MultithreadedTest.java Wed May 26 09:31:07 2010
@@ -25,6 +25,7 @@ import java.awt.Container;
import java.beans.PropertyVetoException;
import java.lang.reflect.InvocationTargetException;
import java.util.Comparator;
+import tests.support.Support_Excludes;
/**
* Tests for JInternalFrame class that cannot be run in Event Dispatch Thread.
@@ -75,6 +76,10 @@ public class JInternalFrame_Multithreade
*/
public void testRestoreSubcomponentFocus() throws InterruptedException,
InvocationTargetException {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final Component comp1 = new JPanel();
final Component comp2 = new JPanel();
final Component comp3 = new JPanel();
@@ -129,6 +134,10 @@ public class JInternalFrame_Multithreade
*/
public void testGetMostRecentFocusOwner() throws PropertyVetoException,
InterruptedException, InvocationTargetException {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final Component initial = new JPanel(); // initial focus component
final Component def = new JPanel(); // default focus component
final Component some = new JPanel(); // some another component
@@ -186,6 +195,10 @@ public class JInternalFrame_Multithreade
* Class under test for Component getFocusOwner()
*/
public void testGetFocusOwner() throws InterruptedException, InvocationTargetException {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
final Component comp1 = new JPanel();
final Component comp2 = new JPanel();
final Component comp3 = new JPanel();
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JListTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JListTest.java?rev=948377&r1=948376&r2=948377&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JListTest.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/swing/src/test/api/java.injected/javax/swing/JListTest.java Wed May 26 09:31:07 2010
@@ -38,6 +38,7 @@ import javax.swing.event.ListSelectionEv
import javax.swing.event.ListSelectionListener;
import javax.swing.plaf.ListUI;
import javax.swing.text.Position;
+import tests.support.Support_Excludes;
public class JListTest extends SwingTestCase {
private JList list;
@@ -76,6 +77,10 @@ public class JListTest extends SwingTest
}
public void testJList() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list = new JList();
assertNotNull(list.getModel());
assertTrue(list.getSelectionModel() instanceof DefaultListSelectionModel);
@@ -111,6 +116,10 @@ public class JListTest extends SwingTest
}
public void testAddGetRemoveListSelectionListener() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(0, list.getListSelectionListeners().length);
TestListSelectionListener l = new TestListSelectionListener();
list.addListSelectionListener(l);
@@ -122,6 +131,10 @@ public class JListTest extends SwingTest
}
public void testAddSelectionInterval() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(list.isSelectionEmpty());
assertTrue(list.getSelectionModel().isSelectionEmpty());
list.addSelectionInterval(1, 2);
@@ -142,6 +155,10 @@ public class JListTest extends SwingTest
}
public void testClearSelection() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(list.isSelectionEmpty());
assertTrue(list.getSelectionModel().isSelectionEmpty());
list.setSelectedIndex(1);
@@ -153,10 +170,18 @@ public class JListTest extends SwingTest
}
public void testCreateSelectionModel() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(new TestList().createSelectionModel() instanceof DefaultListSelectionModel);
}
public void testEnsureIndexIsVisible() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JScrollPane scroller = insertListToFrame();
assertNotNull(scroller);
Rectangle bounds = list.getCellBounds(1, 1);
@@ -175,6 +200,10 @@ public class JListTest extends SwingTest
}
public void testFireSelectionValueChanged() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
TestListSelectionListener l1 = new TestListSelectionListener();
TestListSelectionListener l2 = new TestListSelectionListener();
TestListSelectionListener l3 = new TestListSelectionListener();
@@ -209,16 +238,28 @@ public class JListTest extends SwingTest
}
public void testGetAccssibleContext() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(list.getAccessibleContext() instanceof JList.AccessibleJList);
}
public void testGetAnchorSelectionIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list.addSelectionInterval(2, 1);
assertEquals(2, list.getAnchorSelectionIndex());
assertEquals(2, list.getSelectionModel().getAnchorSelectionIndex());
}
public void testGetCellBounds() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list.setUI(new ListUI() {
@Override
public Point indexToLocation(final JList arg0, final int arg1) {
@@ -239,6 +280,10 @@ public class JListTest extends SwingTest
}
public void testGetSetCellRenderer() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(list.getCellRenderer() instanceof DefaultListCellRenderer);
ListCellRenderer testRenderer = new ListCellRenderer() {
public Component getListCellRendererComponent(final JList list, final Object value,
@@ -251,12 +296,20 @@ public class JListTest extends SwingTest
}
public void testGetSetDragEnabled() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse(list.getDragEnabled());
list.setDragEnabled(true);
assertTrue(list.getDragEnabled());
}
public void testGetFirstVisibleIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JScrollPane scroller = insertListToFrame();
Rectangle bounds = list.getCellBounds(1, 1);
assertNotNull(bounds);
@@ -266,6 +319,10 @@ public class JListTest extends SwingTest
}
public void testGetSetFixedCellHeight() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(-1, list.getFixedCellHeight());
list.setFixedCellHeight(10);
assertEquals(10, list.getFixedCellHeight());
@@ -273,6 +330,10 @@ public class JListTest extends SwingTest
}
public void testGetSetFixedCellWidth() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(-1, list.getFixedCellWidth());
list.setFixedCellWidth(10);
assertEquals(10, list.getFixedCellWidth());
@@ -280,6 +341,10 @@ public class JListTest extends SwingTest
}
public void testGetLastVisibleIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JScrollPane scroller = insertListToFrame();
Rectangle bounds = list.getCellBounds(1, 1);
assertNotNull(bounds);
@@ -289,6 +354,10 @@ public class JListTest extends SwingTest
}
public void testGetSetLayoutOrientation() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(JList.VERTICAL, list.getLayoutOrientation());
list.setLayoutOrientation(JList.VERTICAL_WRAP);
assertEquals(JList.VERTICAL_WRAP, list.getLayoutOrientation());
@@ -304,24 +373,40 @@ public class JListTest extends SwingTest
}
public void testGetLeadSelectionIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list.addSelectionInterval(2, 1);
assertEquals(1, list.getLeadSelectionIndex());
assertEquals(1, list.getSelectionModel().getLeadSelectionIndex());
}
public void testGetMaxSelectionIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list.addSelectionInterval(2, 1);
assertEquals(2, list.getMaxSelectionIndex());
assertEquals(2, list.getSelectionModel().getMaxSelectionIndex());
}
public void testGetMinSelectionIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list.addSelectionInterval(2, 1);
assertEquals(1, list.getMinSelectionIndex());
assertEquals(1, list.getSelectionModel().getMinSelectionIndex());
}
public void testGetSetModel() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNotNull(list.getModel());
ListModel m = new DefaultListModel();
list.setModel(m);
@@ -330,6 +415,10 @@ public class JListTest extends SwingTest
}
public void testGetNextMatch() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list = new JList(new Object[] { "a1", "b1", "c1", "a2", "B2", "c2" });
assertEquals(0, list.getNextMatch("a", 0, Position.Bias.Forward));
assertEquals(3, list.getNextMatch("a", 1, Position.Bias.Forward));
@@ -360,6 +449,10 @@ public class JListTest extends SwingTest
}
public void testGetPreferredScrollableViewportSize() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list.setFixedCellHeight(10);
list.setFixedCellWidth(100);
list.setVisibleRowCount(5);
@@ -380,6 +473,10 @@ public class JListTest extends SwingTest
}
public void testGetSetPrototypeCellValue() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(list.getPrototypeCellValue());
list.setFixedCellHeight(1);
list.setFixedCellWidth(1);
@@ -394,6 +491,10 @@ public class JListTest extends SwingTest
//TODO
public void testGetScrollableBlockIncrement() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
list.setListData(new Object[] { "a", "b", "c", "d", "e", "f", "g", "h" });
JScrollPane scroller = insertListToFrame(50);
int lastVisibleIndex = list.getLastVisibleIndex();
@@ -424,6 +525,10 @@ public class JListTest extends SwingTest
}
public void testGetScrollableTracksViewportHeight() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JScrollPane scroller = insertListToFrame();
assertNotNull(scroller);
list.setPreferredSize(new Dimension(1000, 10));
@@ -439,6 +544,10 @@ public class JListTest extends SwingTest
}
public void testGetScrollableTracksViewportWidth() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JScrollPane scroller = insertListToFrame();
assertNotNull(scroller);
list.setPreferredSize(new Dimension(10, 1000));
@@ -454,6 +563,10 @@ public class JListTest extends SwingTest
}
public void testGetScrollableUnitIncrement() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
JScrollPane scroller = insertListToFrame();
assertEquals(0, list.getFirstVisibleIndex());
int rowHeight = list.getCellBounds(0, 0).height;
@@ -505,6 +618,10 @@ public class JListTest extends SwingTest
}
public void testGetSetSelectedIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(-1, list.getSelectedIndex());
list.setSelectedIndex(2);
assertEquals(2, list.getSelectedIndex());
@@ -514,6 +631,10 @@ public class JListTest extends SwingTest
}
public void testGetSetSelectedIndices() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(0, list.getSelectedIndices().length);
list.setSelectedIndices(new int[] { 0, 2 });
assertEquals(2, list.getSelectedIndices().length);
@@ -525,6 +646,10 @@ public class JListTest extends SwingTest
}
public void testGetSetSelectedValue() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNull(list.getSelectedValue());
list.setSelectedIndex(1);
assertEquals("b", list.getSelectedValue());
@@ -538,6 +663,10 @@ public class JListTest extends SwingTest
}
public void testGetSelectedValues() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(0, list.getSelectedValues().length);
list.setSelectedIndex(1);
assertEquals(1, list.getSelectedValues().length);
@@ -551,6 +680,10 @@ public class JListTest extends SwingTest
}
public void testGetSetSelectionBackground() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNotNull(list.getSelectionBackground());
list.setSelectionBackground(Color.red);
assertEquals(Color.red, list.getSelectionBackground());
@@ -558,6 +691,10 @@ public class JListTest extends SwingTest
}
public void testGetSetSelectionForeground() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertNotNull(list.getSelectionForeground());
list.setSelectionForeground(Color.red);
assertEquals(Color.red, list.getSelectionForeground());
@@ -565,6 +702,10 @@ public class JListTest extends SwingTest
}
public void testGetSetSelectionMode() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, list.getSelectionMode());
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
assertEquals(ListSelectionModel.SINGLE_SELECTION, list.getSelectionMode());
@@ -573,6 +714,10 @@ public class JListTest extends SwingTest
}
public void testGetSetSelectionModel() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(list.getSelectionModel() instanceof DefaultListSelectionModel);
ListSelectionModel model = new DefaultListSelectionModel();
list.setSelectionModel(model);
@@ -581,6 +726,10 @@ public class JListTest extends SwingTest
}
public void testGetToolTipText() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
insertListToFrame();
assertNull(list.getToolTipText());
list.setToolTipText("list tooltip");
@@ -606,6 +755,10 @@ public class JListTest extends SwingTest
}
public void testGetSetUpdateUI() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
ListUI ui = new ListUI() {
@Override
public Point indexToLocation(final JList arg0, final int arg1) {
@@ -629,10 +782,18 @@ public class JListTest extends SwingTest
}
public void testGetUICalssID() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals("ListUI", list.getUIClassID());
}
public void testGetSetValueIsAdjusting() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse(list.getValueIsAdjusting());
list.setValueIsAdjusting(true);
assertTrue(list.getValueIsAdjusting());
@@ -640,6 +801,10 @@ public class JListTest extends SwingTest
}
public void testGetSetVisibleRowCount() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertEquals(8, list.getVisibleRowCount());
list.setVisibleRowCount(10);
assertEquals(10, list.getVisibleRowCount());
@@ -651,6 +816,10 @@ public class JListTest extends SwingTest
}
public void testIndexToLocation() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
ListUI ui = new ListUI() {
@Override
public Point indexToLocation(final JList arg0, final int arg1) {
@@ -672,6 +841,10 @@ public class JListTest extends SwingTest
}
public void testIsSelectedIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertFalse(list.isSelectedIndex(0));
list.setSelectedIndex(0);
assertTrue(list.isSelectedIndex(0));
@@ -679,6 +852,10 @@ public class JListTest extends SwingTest
}
public void testIsSelectionEmpty() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(list.isSelectionEmpty());
list.setSelectedIndex(1);
assertFalse(list.isSelectionEmpty());
@@ -686,6 +863,10 @@ public class JListTest extends SwingTest
}
public void testLocationToIndex() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
ListUI ui = new ListUI() {
@Override
public Point indexToLocation(final JList arg0, final int arg1) {
@@ -707,6 +888,10 @@ public class JListTest extends SwingTest
}
public void testRemoveSelectionInterval() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
assertTrue(list.isSelectionEmpty());
assertTrue(list.getSelectionModel().isSelectionEmpty());
list.addSelectionInterval(0, 2);
@@ -720,6 +905,10 @@ public class JListTest extends SwingTest
}
public void testSetListData() throws Exception {
+ if (Support_Excludes.isExcluded()) {
+ return;
+ }
+
ListModel model = list.getModel();
assertEquals(3, model.getSize());
list.setListData(new Object[] { "1", "2" });