<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/jfcunit-2/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/jfcunit-2/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/jfcunit-2/bugs/</id><updated>2008-01-21T07:57:42Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>WaitTask thread doesn't stop after timeout</title><link href="https://sourceforge.net/p/jfcunit-2/bugs/6/" rel="alternate"/><published>2008-01-21T07:57:42Z</published><updated>2008-01-21T07:57:42Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net787d0d9272ea1afb8b918374a70d786ae2511fbf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In case if Waiter.doWait(timeout, wc) exits with timeout exception, thread that performs checks doesn't stop and continues performing checks.&lt;/p&gt;
&lt;p&gt;Here is example of such behavior:&lt;br /&gt;
--------------------------------&lt;br /&gt;
public class WaiterCheck {&lt;br /&gt;
public static void main(String[] args) throws Exception{&lt;br /&gt;
try {&lt;br /&gt;
WCActiveBase base = new WCActiveBase() {&lt;br /&gt;
public boolean check() throws Exception {&lt;br /&gt;
System.out.println("checking");&lt;br /&gt;
Thread.sleep(500);&lt;br /&gt;
return false;&lt;br /&gt;
}&lt;br /&gt;
};&lt;br /&gt;
Waiter.doWait(2 * 1000, base);&lt;br /&gt;
} catch (Exception e) {&lt;br /&gt;
System.out.println("waiter timed out");&lt;br /&gt;
}&lt;br /&gt;
System.out.println("finish");&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
--------------------------------&lt;/p&gt;
&lt;p&gt;Suggested solution is to put failure() invocation in TimeoutException handling in WaitCallback.waitUntil&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>JLabelFinder::setText, setCaseIndependent don't work</title><link href="https://sourceforge.net/p/jfcunit-2/bugs/5/" rel="alternate"/><published>2007-12-07T17:58:15Z</published><updated>2007-12-07T17:58:15Z</updated><author><name>A.Safonov</name><uri>https://sourceforge.net/u/asafonov/</uri></author><id>https://sourceforge.neta0eff4a8a1ef891e931b4708758cff9f36764467</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, just've found it:&lt;br /&gt;
JLabelFinder has two wrong methods:&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt;
* Set the finder into a case independent mode.&lt;br /&gt;
* @param ignoreCase true if case should be ignored.&lt;br /&gt;
*/&lt;br /&gt;
public void setCaseIndependent(final boolean ignoreCase) {&lt;br /&gt;
super.setCaseIndependent(ignoreCase);&lt;br /&gt;
m_caseIndependent = ignoreCase;&lt;br /&gt;
createPatternMatcher(m_text, m_caseIndependent);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt;
* Set the label text to be matched.&lt;br /&gt;
* @param text Text to be matched.&lt;br /&gt;
*/&lt;br /&gt;
public final void setText(final String text) {&lt;br /&gt;
m_text = text;&lt;br /&gt;
createPatternMatcher(m_text, m_caseIndependent);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Everywhere should be NOT createPatternMatcher but recreatePatternMatcher&lt;br /&gt;
Because createPatternMatcher has a check for m_patternMatcher == null - that's why after constuctor calicn call of setText and setCaseIndependent are useless.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>NullPointerException in JComboBoxMouseED::prepareComponent</title><link href="https://sourceforge.net/p/jfcunit-2/bugs/4/" rel="alternate"/><published>2007-07-19T14:17:26Z</published><updated>2007-07-19T14:17:26Z</updated><author><name>A.Safonov</name><uri>https://sourceforge.net/u/asafonov/</uri></author><id>https://sourceforge.net9c67aa2ada4bbcd05d4faf4f481872bec8dfe155</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Pavel.&lt;br /&gt;
As designed, JFCTestCase may be used without TestHelper, so getHelper method may return NULL sometimes :)&lt;br /&gt;
JComboBoxMouseEventData::prepareComponent calls methods of helper without verification on null. I guess it is not correct.&lt;/p&gt;
&lt;p&gt;It would be better &lt;br /&gt;
- if default JFCTestCase constructor has mandatory TestHelper parameter&lt;br /&gt;
or&lt;br /&gt;
- such calls as:&lt;br /&gt;
...&lt;br /&gt;
if (comp != null) {&lt;br /&gt;
MouseEventData data = new MouseEventData(testCase, comp);&lt;br /&gt;
testCase.getHelper().enterClickAndLeave(data);&lt;/p&gt;
&lt;p&gt;should be changed with "comp.clickButton()" and so on...&lt;/p&gt;
&lt;p&gt;Really it is not a problem, just a correction in design.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>AbstractWindowFinder::findAll should allow negative "wait"</title><link href="https://sourceforge.net/p/jfcunit-2/bugs/3/" rel="alternate"/><published>2007-04-25T08:14:38Z</published><updated>2007-04-25T08:14:38Z</updated><author><name>A.Safonov</name><uri>https://sourceforge.net/u/asafonov/</uri></author><id>https://sourceforge.net4dc7fe1d3faf07fbf646146f7ca2cc8178552b3e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;AbstractWindowFinder::findAll should allow negative "wait" timeouts to let search _only_ one time.&lt;br /&gt;
"0" value doesn't provide such guarantee in case of time synchronization (time goes back), and Integer.MIN_VALUE - provides... (I notice that find methods use absolute timers)&lt;/p&gt;
&lt;p&gt;=====================&lt;br /&gt;
public List findAll(final Container[] owners) {&lt;br /&gt;
List retSet = new ArrayList();&lt;br /&gt;
int wait = Math.max(&lt;br /&gt;
0,&lt;br /&gt;
getWait());&lt;br /&gt;
...&lt;br /&gt;
====================&lt;br /&gt;
should be changed with&lt;br /&gt;
====================&lt;br /&gt;
public List findAll(final Container[] owners) {&lt;br /&gt;
List retSet = new ArrayList();&lt;br /&gt;
int wait = getWait();&lt;br /&gt;
...&lt;br /&gt;
====================&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Wrong work of MouseEventData::insureVisibleLocation</title><link href="https://sourceforge.net/p/jfcunit-2/bugs/2/" rel="alternate"/><published>2007-04-25T08:02:35Z</published><updated>2007-04-25T08:02:35Z</updated><author><name>A.Safonov</name><uri>https://sourceforge.net/u/asafonov/</uri></author><id>https://sourceforge.net9d2a1c0663bf3d288f9eea3716fa9577d260e631</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Function insureVisibleLocation doesn't scroll correctly when manipulated component is under hierarhy:&lt;br /&gt;
JViewport - SomeOtherComp(Jpanel) - ManipulatedComp.&lt;br /&gt;
Reason: wrong calculating of relative coordinates:&lt;/p&gt;
&lt;p&gt;===================================================&lt;br /&gt;
public void insureVisibleLocation(final Point p) {&lt;br /&gt;
// Need to get the parent viewport.&lt;br /&gt;
Component parent = m_comp.getParent();&lt;br /&gt;
while (parent != null&lt;br /&gt;
&amp;amp;&amp;amp; !(parent instanceof JViewport)) {&lt;br /&gt;
parent = parent.getParent();&lt;br /&gt;
}&lt;br /&gt;
if (parent != null &amp;amp;&amp;amp; parent instanceof JViewport) {&lt;br /&gt;
JViewport port = (JViewport) parent;&lt;/p&gt;
&lt;p&gt;Rectangle r = port.getViewRect();&lt;br /&gt;
r.x = p.x - (r.width / 2);&lt;br /&gt;
r.y = p.y - (r.height / 2);&lt;/p&gt;
&lt;p&gt;port.scrollRectToVisible(r);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
===================================================&lt;br /&gt;
should be changed with&lt;br /&gt;
===================================================&lt;br /&gt;
public void insureVisibleLocation(final Point p) {&lt;br /&gt;
// Need to get the parent viewport.&lt;br /&gt;
Component parent = m_comp.getParent();&lt;br /&gt;
Point real_p = (Point)p.clone();&lt;/p&gt;
&lt;p&gt;while (parent != null&lt;br /&gt;
&amp;amp;&amp;amp; !(parent instanceof JViewport)) {&lt;br /&gt;
real_p.translate(parent.getX(), parent.getY());&lt;br /&gt;
parent = parent.getParent();&lt;br /&gt;
}&lt;br /&gt;
if (parent != null &amp;amp;&amp;amp; parent instanceof JViewport) {&lt;br /&gt;
JViewport port = (JViewport) parent;&lt;br /&gt;
real_p.translate(port.getX(), port.getY());&lt;/p&gt;
&lt;p&gt;Rectangle r = port.getViewRect();&lt;br /&gt;
r.x = real_p.x - (r.width / 2);&lt;br /&gt;
r.y = real_p.y - (r.height / 2);&lt;/p&gt;
&lt;p&gt;port.scrollRectToVisible(r);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
===================================================&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Tests extending JFCTestCase never fail</title><link href="https://sourceforge.net/p/jfcunit-2/bugs/1/" rel="alternate"/><published>2006-12-05T15:29:49Z</published><updated>2006-12-05T15:29:49Z</updated><author><name>Carsten Drossel</name><uri>https://sourceforge.net/u/drossel/</uri></author><id>https://sourceforge.netcb70f5d6b3159641a6867bba5237a98b2e8741f5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In version 2.10 it appears to be impossible to get any test extending JFCTestCase to fail.&lt;/p&gt;
&lt;p&gt;The following code snippet that lead to a failure using JFCUnit 2.08 does not fail when using JFCUnit 2.10:&lt;/p&gt;
&lt;p&gt;public class JFCTestCaseTest extends JFCTestCase {&lt;br /&gt;
public void testFail() {&lt;br /&gt;
fail();&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;In JFCTestCase exceptions are caught and setError(Throwable) is called. In Version 2.08 there was the following code at the end of the runCode(Runnable) method:&lt;/p&gt;
&lt;p&gt;if (hasError()) {&lt;br /&gt;
throw getError();&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;In Version 2.10 some equivalent code appears to be missing. hasError() is never called.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>