Loading ...
Sorry, an error occurred while loading the content.
 

RE: [junit] JavaBean Tester

Expand Messages
  • Colin Vipurs
    Take a look at JUnitFactory from Agitar- www.junitfactory.com . I agree with what Stephen said about not testing simple
    Message 1 of 6 , May 1, 2007
      Take a look at JUnitFactory from Agitar- www.junitfactory.com
      <http://www.junitfactory.com/> .



      I agree with what Stephen said about not testing simple setters/getters,
      but this will also check your boundary conditions (if you have any),
      null object references (if you check them) and IllegalArgumentExceptions
      (if you throw them).



      ________________________________

      From: junit@yahoogroups.com [mailto:junit@yahoogroups.com] On Behalf Of
      jamurph
      Sent: 30 April 2007 14:50
      To: junit@yahoogroups.com
      Subject: [junit] JavaBean Tester




      Does anyone know of the existence of a JavaBean Tester?

      Basically something that extends TestCase, takes a JavaBean and using
      reflection tests the getter and setter methods.

      Something that would avoid:

      bean.setA(1);
      assertEquals(1,bean.getA());

      for each field / property

      Thanks
      --
      View this message in context:
      http://www.nabble.com/JavaBean-Tester-tf3669734.html#a10253752
      <http://www.nabble.com/JavaBean-Tester-tf3669734.html#a10253752>
      Sent from the JUnit - User mailing list archive at Nabble.com.





      [Non-text portions of this message have been removed]
    • jamurph
      Think it would help in cases where private int x; private int y; int getX() { return this.x } void setX(int value) { this.y = value; } ... -- View this message
      Message 2 of 6 , May 1, 2007
        Think it would help in cases where
        private int x;
        private int y;

        int getX()
        {
        return this.x
        }

        void setX(int value)
        {
        this.y = value;
        }


        Stephen Smith-2 wrote:
        >
        > If your mutators and accessors do nothing other than store/retrieve a
        > value, do you think there's value in testing them?
        >
        > ---
        > Stephen Smith, MEng (Wales).
        > http://www.stephen-smith.co.uk/
        >
        > jamurph wrote:
        >>
        >>
        >>
        >> Does anyone know of the existence of a JavaBean Tester?
        >>
        >> Basically something that extends TestCase, takes a JavaBean and using
        >> reflection tests the getter and setter methods.
        >>
        >> Something that would avoid:
        >>
        >> bean.setA(1);
        >> assertEquals(1,bean.getA());
        >>
        >> for each field / property
        >>
        >> Thanks
        >> --
        >> View this message in context:
        >> http://www.nabble.com/JavaBean-Tester-tf3669734.html#a10253752
        >> <http://www.nabble.com/JavaBean-Tester-tf3669734.html#a10253752>
        >> Sent from the JUnit - User mailing list archive at Nabble.com.
        >>
        >>
        >>
        >>
        >> ------------------------------------------------------------------------
        >>
        >> No virus found in this incoming message.
        >> Checked by AVG Free Edition.
        >> Version: 7.5.467 / Virus Database: 269.6.2/781 - Release Date: 30/04/2007
        >> 09:14
        >
        >

        --
        View this message in context: http://www.nabble.com/JavaBean-Tester-tf3669734.html#a10265571
        Sent from the JUnit - User mailing list archive at Nabble.com.
      • Marvin Toll
        TestUtil does precisely what you are looking for. http://gtcgroup.com/util/index.html _Marvin ... using ... tf3669734.html#a10253752
        Message 3 of 6 , May 1, 2007
          TestUtil does precisely what you are looking for.

          http://gtcgroup.com/util/index.html

          _Marvin

          --- In junit@yahoogroups.com, jamurph <tony_murphy@...> wrote:
          >
          >
          > Does anyone know of the existence of a JavaBean Tester?
          >
          > Basically something that extends TestCase, takes a JavaBean and
          using
          > reflection tests the getter and setter methods.
          >
          > Something that would avoid:
          >
          > bean.setA(1);
          > assertEquals(1,bean.getA());
          >
          > for each field / property
          >
          > Thanks
          > --
          > View this message in context: http://www.nabble.com/JavaBean-Tester-
          tf3669734.html#a10253752
          > Sent from the JUnit - User mailing list archive at Nabble.com.
          >
        • Marvin Toll
          Stephen, The document TestUtil: By Example chronicles the testing of accessors on a project at a Fortune Five (5) company.
          Message 4 of 6 , May 1, 2007
            Stephen,

            The document "TestUtil: By Example" chronicles the testing of accessors
            on a project at a Fortune Five (5) company.

            http://gtcgroup.com/util/TestUtil.By.Example.html

            What was learned about the code base through this seemingly inert
            exercise might be enlightening.

            _Marvin

            --- In junit@yahoogroups.com, Stephen Smith <steve@...> wrote:
            >
            > If your mutators and accessors do nothing other than store/retrieve a
            > value, do you think there's value in testing them?
            >
            > ---
            > Stephen Smith, MEng (Wales).
            > http://www.stephen-smith.co.uk/
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.