Enhanced Assertions Functionality

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Enhanced Assertions Functionality

pmendelson2

Currently the TestNG Assert class offers a set of the most primitive
Assertions that a tester would need to work with.    This set of
assertions is, by design, identical to Junit's Assert class.

I assume that most users create their own higher level assertions or
get a richer assertions class from somewhere else.

Examples of assertions that I am looking for / propositioning would
be:
  StringAssertions
       assertMatchesPattern(...)
       assertLengthRange(...)

  FileAssertions
      assertIsDirectory(...)
      assertIsWritable(...)
      assertIsReadable(...)

  Numeric Assertiosn
    assertBetween(...)
    assertAtLeast(...)

My questions are:

Is TestNG interested in offering a (few) higher level Assert class?
Do these classes in an different FOSS package?
Is it a better practice for each application team to write their own
assertions?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhanced Assertions Functionality

Cédric Beust ♔
Hi Paul,

Sure, I don't think there is any harm in adding these asserts to the org.testng.Assert class...

--
Cedric


On 1/28/07, Paul <[hidden email]> wrote:

Currently the TestNG Assert class offers a set of the most primitive
Assertions that a tester would need to work with.    This set of
assertions is, by design, identical to Junit's Assert class.

I assume that most users create their own higher level assertions or
get a richer assertions class from somewhere else.

Examples of assertions that I am looking for / propositioning would
be:
  StringAssertions
       assertMatchesPattern(...)
       assertLengthRange(...)

  FileAssertions
      assertIsDirectory(...)
      assertIsWritable(...)
      assertIsReadable(...)

  Numeric Assertiosn
    assertBetween(...)
    assertAtLeast(...)

My questions are:

Is TestNG interested in offering a (few) higher level Assert class?
Do these classes in an different FOSS package?
Is it a better practice for each application team to write their own
assertions?


Cédric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhanced Assertions Functionality

Andreas Guther-2
In reply to this post by pmendelson2
Paul,

I think this can be very helpful.  An interesting question is where to provide such classes in terms of packages etc.

Andreas


On 1/28/07, Paul <[hidden email]> wrote:

Currently the TestNG Assert class offers a set of the most primitive
Assertions that a tester would need to work with.    This set of
assertions is, by design, identical to Junit's Assert class.

I assume that most users create their own higher level assertions or
get a richer assertions class from somewhere else.

Examples of assertions that I am looking for / propositioning would
be:
  StringAssertions
       assertMatchesPattern(...)
       assertLengthRange(...)

  FileAssertions
      assertIsDirectory(...)
      assertIsWritable(...)
      assertIsReadable(...)

  Numeric Assertiosn
    assertBetween(...)
    assertAtLeast(...)

My questions are:

Is TestNG interested in offering a (few) higher level Assert class?
Do these classes in an different FOSS package?
Is it a better practice for each application team to write their own
assertions?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhanced Assertions Functionality

pmendelson2
In reply to this post by pmendelson2

I am ready to check in an assertions change but I lost my SVN
password.  Does anyone know the URL to recover / regenerate it?

On Jan 28, 2:07 pm, "Paul" <[hidden email]> wrote:

> Currently the TestNG Assert class offers a set of the most primitive
> Assertions that a tester would need to work with.    This set of
> assertions is, by design, identical to Junit's Assert class.
>
> I assume that most users create their own higher level assertions or
> get a richer assertions class from somewhere else.
>
> Examples of assertions that I am looking for / propositioning would
> be:
>   StringAssertions
>        assertMatchesPattern(...)
>        assertLengthRange(...)
>
>   FileAssertions
>       assertIsDirectory(...)
>       assertIsWritable(...)
>       assertIsReadable(...)
>
>   Numeric Assertiosn
>     assertBetween(...)
>     assertAtLeast(...)
>
> My questions are:
>
> Is TestNG interested in offering a (few) higher level Assert class?
> Do these classes in an different FOSS package?
> Is it a better practice for each application team to write their own
> assertions?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhanced Assertions Functionality

Cédric Beust ♔
Paul,

Just go to http://code.google.com/hosting/, then "My profile" and "My settings".

--
Cedric


On 1/30/07, Paul <[hidden email]> wrote:

I am ready to check in an assertions change but I lost my SVN
password.  Does anyone know the URL to recover / regenerate it?

On Jan 28, 2:07 pm, "Paul" <[hidden email]> wrote:

> Currently the TestNG Assert class offers a set of the most primitive
> Assertions that a tester would need to work with.    This set of
> assertions is, by design, identical to Junit's Assert class.
>
> I assume that most users create their own higher level assertions or
> get a richer assertions class from somewhere else.
>
> Examples of assertions that I am looking for / propositioning would
> be:
>   StringAssertions
>        assertMatchesPattern(...)
>        assertLengthRange(...)
>
>   FileAssertions
>       assertIsDirectory(...)
>       assertIsWritable(...)
>       assertIsReadable(...)
>
>   Numeric Assertiosn
>     assertBetween(...)
>     assertAtLeast(...)
>
> My questions are:
>
> Is TestNG interested in offering a (few) higher level Assert class?
> Do these classes in an different FOSS package?
> Is it a better practice for each application team to write their own
> assertions?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhanced Assertions Functionality

pmendelson2
In reply to this post by Andreas Guther-2

I posted a new class FileAssert in org.testng  It has the methods you
might expect for a class of that name.
I (mildly) prefer to make distinct Assert classes focused on specific
types it facilitates having fail methods that work well with the
semenatics of the class.
I am also concerned that if we put many more methods in the current
Assert class it could become unwieldy.

Please feel free to comment and/or modify.

On Jan 28, 10:21 pm, "Andreas Guther" <[hidden email]>
wrote:

> Paul,
>
> I think this can be very helpful.  An interesting question is where to
> provide such classes in terms of packages etc.
>
> Andreas
>
> On 1/28/07, Paul <[hidden email]> wrote:
>
>
>
>
>
> > Currently the TestNG Assert class offers a set of the most primitive
> > Assertions that a tester would need to work with.    This set of
> > assertions is, by design, identical to Junit's Assert class.
>
> > I assume that most users create their own higher level assertions or
> > get a richer assertions class from somewhere else.
>
> > Examples of assertions that I am looking for / propositioning would
> > be:
> >   StringAssertions
> >        assertMatchesPattern(...)
> >        assertLengthRange(...)
>
> >   FileAssertions
> >       assertIsDirectory(...)
> >       assertIsWritable(...)
> >       assertIsReadable(...)
>
> >   Numeric Assertiosn
> >     assertBetween(...)
> >     assertAtLeast(...)
>
> > My questions are:
>
> > Is TestNG interested in offering a (few) higher level Assert class?
> > Do these classes in an different FOSS package?
> > Is it a better practice for each application team to write their own
> > assertions?- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---