harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject Re: [classlib][test] isHarmony method in the swing tests
Date Sat, 25 Nov 2006 21:11:33 GMT
The only upside I can *imagine* is that you can validate the test on a 
'known good' implementation.

We've seen cases with threading tests where it was very illustrative to 
also run it on the RI and see differing behavior.

That said, if we have tests that *will fail*, and we're using 
"isHarmony()" simply to short-circuit the test, I'd suggest simply 
using an exclude list rather than burying in the code.

geir


Mikhail Loenko wrote:
> 2006/11/24, Alexei Zakharov <alexei.zakharov@gmail.com>:
>> I agree that it is convenient but someone needs to waste his/her time
>> on it. IMHO making any test passing on RI at any conditions is a
>> rather strange effort unless you are going to sell your test suite to
>> Sun. Moreover, it will complicate the test logic.
> 
> +1
> 
> Thanks,
> Mikhail
> 
> 
>>
>> Thanks,
>>
>> 2006/11/24, Ivanov, Alexey A <alexey.a.ivanov@intel.com>:
>> > >-----Original Message-----
>> > >From: Alexei Zakharov [mailto:alexei.zakharov@gmail.com]
>> > >Sent: Friday, November 24, 2006 5:23 PM
>> > >To: dev@harmony.apache.org
>> > >Subject: Re: [classlib][test] isHarmony method in the swing tests
>> > >
>> > >> If Harmony implementation is more reasonable, it's ok to write a 
>> test
>> > >> which passes against Harmony while breaks RI.
>> > >
>> > >I also do not completely understand why we should force our tests to
>> > >pass on RI even if we have non-bug-diff JIRAs filed. There are a lot
>> > >of tests in our classlib repository that fail on RI.
>> >
>> > IMHO, it's just more convenient: all tests should pass both on Harmony
>> > and RI.
>> >
>> > Regards,
>> > Alexey.
>> >
>> > >
>> > >Thanks,
>> > >
>> > >2006/11/23, Andrew Zhang <zhanghuangzhu@gmail.com>:
>> > >> On 11/23/06, Mikhail Loenko <mloenko@gmail.com> wrote:
>> > >> >
>> > >> > Why we expect different exceptions? I think this test
>> > >> > discovers incompatibility and should be just fixed to expect the
>> > same
>> > >> > exception
>> > >>
>> > >>
>> > >> Agree. If Harmony implementation is more reasonable, it's ok to 
>> write
>> > a
>> > >test
>> > >> which passes against Harmony while breaks RI. And actually there're
>> > so
>> > >many
>> > >> such tests existings in current code, and we mark it as "Non
>> > difference
>> > >bug
>> > >> from RI".  So IMO, making test pass on both Harmony and RI makes no
>> > sense.
>> > >>
>> > >>
>> > >> Thanks,
>> > >> > Mikhail
>> > >> >
>> > >> > 2006/11/23, Ivanov, Alexey A <alexey.a.ivanov@intel.com>:
>> > >> > > Yeah, I remember about TestNG. Yet I think it won't solve
all 
>> the
>> > >cases
>> > >> > > where isHarmony used.
>> > >> > >
>> > >> > > For example, look at the tests in
>> > >> > > https://issues.apache.org/jira/browse/HARMONY-2198
>> > >> > > The isHarmony() method is used in if-else context there which
>> > >> > > demonstrates the difference between Harmony and RI. And 
>> mostly it
>> > is
>> > >> > > if-else context that isHarmony() is used.
>> > >> > >
>> > >> > > Regards,
>> > >> > > --
>> > >> > > Alexey A. Ivanov
>> > >> > > Intel Enterprise Solutions Software Division
>> > >> > >
>> > >> > >
>> > >> > > >-----Original Message-----
>> > >> > > >From: Mikhail Loenko [mailto:mloenko@gmail.com]
>> > >> > > >Sent: Thursday, November 23, 2006 2:39 PM
>> > >> > > >To: dev@harmony.apache.org
>> > >> > > >Subject: Re: [classlib][test] isHarmony method in the
swing
>> > tests
>> > >> > > >
>> > >> > > >We are going to swith to TestNG.
>> > >> > > >
>> > >> > > >So we will be able to handle all that stuff there, won't
we?
>> > >> > > >
>> > >> > > >Thanks,
>> > >> > > >Mikhail
>> > >> > > >
>> > >> > > >2006/11/23, Ivanov, Alexey A <alexey.a.ivanov@intel.com>:
>> > >> > > >> Mikhail,
>> > >> > > >>
>> > >> > > >> Here it's not a temporary solution.
>> > >> > > >>
>> > >> > > >> javax.swing.text.PlainViewI18N is for bidirectional
text
>> > support.
>> > >It
>> > >> > > is
>> > >> > > >> a package-private class, and it's not present in
public API
>> > spec.
>> > >> > > >>
>> > >> > > >> Sun doesn't reveal its implementation of bidirectional

>> text. I
>> > >guess
>> > >> > > >> it's fully implemented yet: there are problems with
it. 
>> What I
>> > can
>> > >> > > >> remember at once is you can't go through all the
text using
>> > right
>> > >or
>> > >> > > >> left arrows on keyboard because the caret jumps
back.
>> > >> > > >>
>> > >> > > >> In general this method is used to differentiate
our
>> > implementation
>> > >> > > from
>> > >> > > >> Sun. These differences are intentional. To make
the tests 
>> pass
>> > >both
>> > >> > > on
>> > >> > > >> RI and Harmony, it is checked which classlib is
used. Also
>> > looking
>> > >at
>> > >> > > >> the tests one sees the expected difference.
>> > >> > > >>
>> > >> > > >> Regards,
>> > >> > > >> Alexey.
>> > >> > > >>
>> > >> > > >> P.S. We can get rid of using this method and sort
out the
>> > tests to
>> > >> > > >> separate implementation specific tests, but it requires
lots
>> > of
>> > >> > > effort.
>> > >> > > >> On the other hand, some tests will lose the information
about
>> > the
>> > >> > > >> difference. Subsequent releases of Java may change
the
>> > behavior
>> > >and
>> > >> > > >> we'll see it because of failing tests. This way
we can adjust
>> > our
>> > >> > > >> implementation to the new RI impl.
>> > >> > > >>
>> > >> > > >> --
>> > >> > > >> Alexey A. Ivanov
>> > >> > > >> Intel Enterprise Solutions Software Division
>> > >> > > >>
>> > >> > > >>
>> > >> > > >> >-----Original Message-----
>> > >> > > >> >From: Mikhail Loenko [mailto:mloenko@gmail.com]
>> > >> > > >> >Sent: Thursday, November 23, 2006 10:22 AM
>> > >> > > >> >To: dev@harmony.apache.org
>> > >> > > >> >Subject: [classlib][test] isHarmony method in
the swing 
>> tests
>> > >> > > >> >
>> > >> > > >> >Did I understand correctly that it's a temporary
solution to
>> > >> > > >> >differentiate between
>> > >> > > >> >"api" and "impl" tests?
>> > >> > > >> >
>> > >> > > >> >package javax.swing.text;
>> > >> > > >> ><...>
>> > >> > > >> >public class PlainViewI18N_LineViewTest extends

>> SwingTestCase
>> > {
>> > >> > > >> ><...>
>> > >> > > >> >    public void testGetPreferredSpan01() throws
Exception {
>> > >> > > >> >        if (!isHarmony()) {
>> > >> > > >> >            return;
>> > >> > > >> >        }
>>
>> -- 
>> Alexei Zakharov,
>> Intel Enterprise Solutions Software Division
>>

Mime
View raw message