From: "Roman Kennke" <roman.kennke@aicas.com>
To: mauve-patches@sources.redhat.com
Subject: FYI: Added test for JComponent.getPreferredSize()
Date: Thu, 15 Dec 2005 17:46:00 -0000 [thread overview]
Message-ID: <Cdvoh6vF.1134668739.3543220.roman.kennke@aicas.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 411 bytes --]
I added a test for the JComponent.getPreferredSize() testsuite that
checks if it is possible to modify a JComponent's preferredSize setting
by modifying the returned Dimension object, or if this should be
protected.
2005-12-15 Roman Kennke <kennke@aicas.com>
* gnu/testlet/javax/swing/JComponent/getPreferredSize.java:
Added test for changing the value of preferred size.
/Roman
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch; name="patch.diff", Size: 1246 bytes --]
Index: gnu/testlet/javax/swing/JComponent/getPreferredSize.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/JComponent/getPreferredSize.java,v
retrieving revision 1.1
diff -u -r1.1 getPreferredSize.java
--- gnu/testlet/javax/swing/JComponent/getPreferredSize.java 12 Dec 2005 13:13:20 -0000 1.1
+++ gnu/testlet/javax/swing/JComponent/getPreferredSize.java 15 Dec 2005 17:42:27 -0000
@@ -120,6 +120,7 @@
testWithAll(harness);
testSmallerThanMinSize(harness);
+ testChangeValue(harness);
}
/**
@@ -261,4 +262,21 @@
c.setPreferredSize(new Dimension(50, 50));
h.check(c.getPreferredSize(), new Dimension(50, 50));
}
+
+ /**
+ * Tests if it is possible to change to actual setting or preferredSize by
+ * changing the values of the returned Dimension object.
+ *
+ * @param h the test harness
+ */
+ private void testChangeValue(TestHarness h)
+ {
+ h.checkPoint("changeValue");
+ TestComponent c = new TestComponent();
+ c.setPreferredSize(new Dimension(100, 100));
+ Dimension d = c.getPreferredSize();
+ d.width = 200;
+ d.height = 200;
+ h.check(c.getPreferredSize(), new Dimension(100, 100));
+ }
}
reply other threads:[~2005-12-15 17:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Cdvoh6vF.1134668739.3543220.roman.kennke@aicas.de \
--to=roman.kennke@aicas.com \
--cc=mauve-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).