> That looks great! JWebUnit sounds fine for a static import -  but how
> would it interact with WebTestCase? 

JWebUnit.* will be a replacement for WebTestCase for those using JUnit 4 
syntax. 
JWebUnit.* methods will call WebTester.* methods.


> I'd prefer a single release  for
> both JUnit 3 and 4, rather than separate builds for each version -  is
> this possible?

2.5 will contains only JUnit 3 stuff.

For 3.0, I'll try to keep both WebTestCase (JUnit 3) and JWebUnit.* (JUnit 4). 
The main issue I see is that under the hood, both are using WebTester that was 
migrated to JUnit 4. As a result all assertXXX will throw 
java.lang.AssertionError instead of junit.framework.AssertionFailedError.
So in order to keep proper assertion failure reporting for those using JUnit 3, 
I'll have to change the way WebTestCase is generated to have this kind of 
pattern:

public class WebTestCase extends TestCase {

...

    public void assertTablePresent(String id) {
        try {
            newJUnit4WebTester.assertTablePresent(id);
        } catch (org.junit.ComparisonFailure e) {
            throw new junit.framework.ComparisonFailure(e.getMessage, 
e.getExpected(), e.getActual());
        }
        } catch (java.lang.AssertionError e) {
            throw new junit.framework.AssertionFailedError(e.getMessage());
        }
    }

}


WDYT ?

Regards,

Julien



----- Message d'origine ----
> De : Jevon Wright <[email protected]>
> À : JWebUnit Development mail list 
<[email protected]>
> Envoyé le : Mer 20 octobre 2010, 4h 42min 15s
> Objet : Re: [JWebUnit-development] JUnit 4 migration
> 
> Hi Julien,
> 
> That looks great! JWebUnit sounds fine for a static import -  but how
> would it interact with WebTestCase? I'd prefer a single release  for
> both JUnit 3 and 4, rather than separate builds for each version -  is
> this possible?
> 
> Cheers
> Jevon
> 
> On Mon, Oct 18, 2010 at 5:27  PM, Julien HENRY <[email protected]> wrote:
> > Hi  all,
> >
> > I'm working on JUnit 4 migration (we are already depending  on junit-4.jar 
>but
> > still using old JUnit 3 style/api).
> >
> > I  plan to keep old WebTestCase for those still using JUnit 3, and create a 
> >  
>new
> > class called JWebUnit (do you have a better suggestion?). JWebUnit  class 
>will
> > contains the same things than WebTestCase but followin JUnit  4 way, all 
>methods
> > will be static in order to allow writing tests this  way:
> >
> > import static  net.sourceforge.jwebunit.junit.JWebUnit.*;
> >
> > public class MyTest  {
> >
> >  @Test
> >  public void aTest() {
> >    beginAt("http://google.com";);
> >     ...
> >  }
> >
> > }
> >
> > I will also update all  JWebUnit internal tests to use this new syntax.
> >
> > After this work  is done, I suggest to release a version 3.0.
> >
> > I will still try to  release a 2.5 with pre JUnit 4 migration work.
> >
> > If you have any  suggestion, feel free to tell me.
> >
> > Regards,
> >
> >  Julien
> >
> >
> >
> >
> >
> >  
>------------------------------------------------------------------------------
> >  Download new Adobe(R) Flash(R) Builder(TM) 4
> > The new Adobe(R) Flex(R) 4  and Flash(R) Builder(TM) 4 (formerly
> > Flex(R) Builder(TM)) enable the  development of rich applications that run
> > across multiple browsers and  platforms. Download your free trials today!
> > http://p.sf.net/sfu/adobe-dev2dev
> >  _______________________________________________
> > JWebUnit-development  mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jwebunit-development
> >
> 
> ------------------------------------------------------------------------------
> Download  new Adobe(R) Flash(R) Builder(TM) 4
> The new Adobe(R) Flex(R) 4 and Flash(R)  Builder(TM) 4 (formerly 
> Flex(R) Builder(TM)) enable the development of rich  applications that run
> across multiple browsers and platforms. Download your  free trials today!
> http://p.sf.net/sfu/adobe-dev2dev
> _______________________________________________
> JWebUnit-development  mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jwebunit-development
> 


      

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to