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

Maybe BuildOperateCheck should tell you why?

Expand Messages
  • Michael Feathers
    I ve been using BOC on and off recently, but one thing that occurred to me is that the message you get is not all that useful when something goes wrong. Red
    Message 1 of 4 , Jun 3, 2003
    View Source
    • 0 Attachment
      I've been using BOC on and off recently, but one thing that occurred
      to me is that the message you get is not all that useful when
      something goes wrong. Red false... bad...

      Maybe it would be nice to let the exception propagate on falses so you
      can see why validation failed. Maybe valid() should return a string
      rather than a boolean?

      I think there is a deeper thing though. Having a column for the
      valid() feels wrong to me even though I do it all the time. Kind of
      superfluous. Seems like there ought to be a particular kind of fixture
      for row entry. Maybe a subclass of ColumnFixture which inserts a row
      after rows that couldn't be entered, and gives you a reason why.

      Would anyone here find that useful?

      Michael Feathers
      www.objectmentor.com
    • Robert Martin UncleBob
      You Bastard! I was just thinking this exact same thing last night! A derivative of ColumnFixture that accepted row after row and validated them. I was trying
      Message 2 of 4 , Jun 4, 2003
      View Source
      • 0 Attachment
        You Bastard! I was just thinking this exact same thing last night! A
        derivative of ColumnFixture that accepted row after row and validated them.
        I was trying to figure out how to turn indivdual cells within a row red. I
        thought maybe the valid() function would return the column number of the
        invalid rows. Your idea of a string is much better.

        Write this fixture! I expect to see it by Friday. ;-)

        Bob.

        > -----Original Message-----
        > From: Michael Feathers [mailto:mfeathers@...]
        > Sent: Tuesday, June 03, 2003 8:50 AM
        > To: fitnesse@yahoogroups.com
        > Subject: [fitnesse] Maybe BuildOperateCheck should tell you why?
        >
        >
        >
        >
        > I've been using BOC on and off recently, but one thing that occurred
        > to me is that the message you get is not all that useful when
        > something goes wrong. Red false... bad...
        >
        > Maybe it would be nice to let the exception propagate on falses so you
        > can see why validation failed. Maybe valid() should return a string
        > rather than a boolean?
        >
        > I think there is a deeper thing though. Having a column for the
        > valid() feels wrong to me even though I do it all the time. Kind of
        > superfluous. Seems like there ought to be a particular kind
        > of fixture
        > for row entry. Maybe a subclass of ColumnFixture which inserts a row
        > after rows that couldn't be entered, and gives you a reason why.
        >
        > Would anyone here find that useful?
        >
        > Michael Feathers
        > www.objectmentor.com
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        > ---------------------~-->
        > Get A Free Psychic Reading! Your Online Answer To Life's
        > Important Questions.
        > http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/03wwlB/TM
        > --------------------------------------------------------------
        > -------~->
        >
        > To unsubscribe from this group, send an email to:
        > fitnesse-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        http://docs.yahoo.com/info/terms/
      • Robert Martin UncleBob
        My apologies to the list and to Michael. This was meant to be a private message. Sorry. Bob. ... http://docs.yahoo.com/info/terms/
        Message 3 of 4 , Jun 4, 2003
        View Source
        • 0 Attachment
          My apologies to the list and to Michael. This was meant to be a private
          message.

          Sorry.

          Bob.

          > -----Original Message-----
          > From: Robert Martin UncleBob [mailto:UncleBob@...]
          > Sent: Wednesday, June 04, 2003 8:32 PM
          > To: 'fitnesse@yahoogroups.com'
          > Subject: RE: [fitnesse] Maybe BuildOperateCheck should tell you why?
          >
          >
          > You Bastard! I was just thinking this exact same thing last night! A
          > derivative of ColumnFixture that accepted row after row and
          > validated them.
          > I was trying to figure out how to turn indivdual cells within
          > a row red. I
          > thought maybe the valid() function would return the column
          > number of the
          > invalid rows. Your idea of a string is much better.
          >
          > Write this fixture! I expect to see it by Friday. ;-)
          >
          > Bob.
          >
          > > -----Original Message-----
          > > From: Michael Feathers [mailto:mfeathers@...]
          > > Sent: Tuesday, June 03, 2003 8:50 AM
          > > To: fitnesse@yahoogroups.com
          > > Subject: [fitnesse] Maybe BuildOperateCheck should tell you why?
          > >
          > >
          > >
          > >
          > > I've been using BOC on and off recently, but one thing that occurred
          > > to me is that the message you get is not all that useful when
          > > something goes wrong. Red false... bad...
          > >
          > > Maybe it would be nice to let the exception propagate on
          > falses so you
          > > can see why validation failed. Maybe valid() should return a string
          > > rather than a boolean?
          > >
          > > I think there is a deeper thing though. Having a column for the
          > > valid() feels wrong to me even though I do it all the time. Kind of
          > > superfluous. Seems like there ought to be a particular kind
          > > of fixture
          > > for row entry. Maybe a subclass of ColumnFixture which
          > inserts a row
          > > after rows that couldn't be entered, and gives you a reason why.
          > >
          > > Would anyone here find that useful?
          > >
          > > Michael Feathers
          > > www.objectmentor.com
          > >
          > >
          > > ------------------------ Yahoo! Groups Sponsor
          > > ---------------------~-->
          > > Get A Free Psychic Reading! Your Online Answer To Life's
          > > Important Questions.
          > > http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/03wwlB/TM
          > > --------------------------------------------------------------
          > > -------~->
          > >
          > > To unsubscribe from this group, send an email to:
          > > fitnesse-unsubscribe@yahoogroups.com
          > >
          > >
          > >
          > > Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/
          >
          >
          > ------------------------ Yahoo! Groups Sponsor
          > ---------------------~-->
          > Get A Free Psychic Reading! Your Online Answer To Life's
          > Important Questions.
          > http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/03wwlB/TM
          > --------------------------------------------------------------
          > -------~->
          >
          > To unsubscribe from this group, send an email to:
          > fitnesse-unsubscribe@yahoogroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to
          http://docs.yahoo.com/info/terms/
        • Michael Feathers
          ROTFL!! For people outside the company, that s the way the mentors show each other approval. If any of us seriously has an issue with something someone has
          Message 4 of 4 , Jun 4, 2003
          View Source
          • 0 Attachment
            ROTFL!!

            For people outside the company, that's the way the mentors
            show each other approval. If any of us seriously has an issue with
            something someone has said or done, they start out like this "X, I
            love you like a brother, but..."

            Anyway, I'm about to go to bed, but I glanced at ColumnFixture and
            RowFixture what I have in mind would go something like this..

            (uncompiled, untested, but I'm sleepy):

            public abstract class RowEntryFixture extends ColumnFixture
            {
            protected Parse currentRow;
            protected abstract void enterRow() throws Exception;
            private final static String ERROR_POINTER = "^---";

            public void doRow(Parse row) {
            currentRow = row;
            if (currentRow.parts.body.equals(ERROR_POINTER))
            return;
            super.doRow(row);
            try {
            enterRow();
            } catch (Exception e) {
            reportError(e);
            }
            }

            protected void reportError(Exception e) {
            Parse errorRow = new Parse("tr", null, errorCells(e), null);
            insertRow(errorRow);
            }

            private void insertRow(Parse errorRow) {
            Parse next = currentRow.more;
            currentRow.more = errorRow;
            errorRow.more = next;
            }

            protected Parse errorCells(Exception e) {
            Parse marker = new Parse("td", ERROR_POINTER, null, null);
            marker.more = new Parse("td", e.getMessage(), null, null);
            wrong(marker);
            wrong(marker.more);
            return marker;
            }
            }


            The idea is to override the enterRow method and have it do the work of
            taking the values of the row (via currentRow) and plugging them into
            your application. The code in ColumnFixture takes care of problems
            related to type conversion, so the cells of the current row could be
            marked red if there are problems there. But if the whole row is
            rejected, just throw an exception. The message of the exception is
            placed in a red line of two columns that is inserted between the bad
            row and the next one.

            When we doRow we need to skip over rows we've inserted, so that is why
            we check for the error pointer text.


            Michael (night, night)


            RMU> My apologies to the list and to Michael.  This was meant to be a private
            RMU> message.

            RMU> Sorry.

            RMU> Bob.

            >> -----Original Message-----
            >> From: Robert Martin UncleBob [mailto:UncleBob@...]
            >> Sent: Wednesday, June 04, 2003 8:32 PM
            >> To: 'fitnesse@yahoogroups.com'
            >> Subject: RE: [fitnesse] Maybe BuildOperateCheck should tell you why?
            >>
            >>
            >> You Bastard!  I was just thinking this exact same thing last night!  A
            >> derivative of ColumnFixture that accepted row after row and
            >> validated them.
            >> I was trying to figure out how to turn indivdual cells within
            >> a row red.  I
            >> thought maybe the valid() function would return the column
            >> number of the
            >> invalid rows.  Your idea of a string is much better.
            >>
            >> Write this fixture!  I expect to see it by Friday.  ;-)
            >>
            >> Bob.
            >>
            >> > -----Original Message-----
            >> > From: Michael Feathers [mailto:mfeathers@...]
            >> > Sent: Tuesday, June 03, 2003 8:50 AM
            >> > To: fitnesse@yahoogroups.com
            >> > Subject: [fitnesse] Maybe BuildOperateCheck should tell you why?
            >> >
            >> >
            >> >
            >> >
            >> > I've been using BOC on and off recently, but one thing that occurred
            >> > to me is that the message you get is not all that useful when
            >> > something goes wrong.  Red false... bad...
            >> >
            >> > Maybe it would be nice to let the exception propagate on
            >> falses so you
            >> > can see why validation failed.  Maybe valid() should return a string
            >> > rather than a boolean?
            >> >
            >> > I think there is a deeper thing though.  Having a column for the
            >> > valid() feels wrong to me even though I do it all the time.  Kind of
            >> > superfluous.  Seems like there ought to be a particular kind
            >> > of fixture
            >> > for row entry.  Maybe a subclass of ColumnFixture which
            >> inserts a row
            >> > after rows that couldn't be entered, and gives you a reason why.
            >> >
            >> > Would anyone here find that useful?
            >> >
            >> > Michael Feathers
            >> > www.objectmentor.com
            >> >
            >> >
            >> > ------------------------ Yahoo! Groups Sponsor
            >> > ---------------------~-->
            >> > Get A Free Psychic Reading! Your Online Answer To Life's
            >> > Important Questions.
            >> > http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/03wwlB/TM
            >> > --------------------------------------------------------------
            >> > -------~->
            >> >
            >> > To unsubscribe from this group, send an email to:
            >> > fitnesse-unsubscribe@yahoogroups.com
            >> >
            >> > 
            >> >
            >> > Your use of Yahoo! Groups is subject to
            >> http://docs.yahoo.com/info/terms/
            >>
            >>
            >> ------------------------ Yahoo! Groups Sponsor
            >> ---------------------~-->
            >> Get A Free Psychic Reading! Your Online Answer To Life's
            >> Important Questions.
            >> http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/03wwlB/TM
            >> --------------------------------------------------------------
            >> -------~->
            >>
            >> To unsubscribe from this group, send an email to:
            >> fitnesse-unsubscribe@yahoogroups.com
            >>
            >> 
            >>
            >> Your use of Yahoo! Groups is subject to
            RMU> http://docs.yahoo.com/info/terms/


            RMU> Yahoo! Groups Sponsor
            RMU> To unsubscribe from this group, send an email to:
            RMU> fitnesse-unsubscribe@yahoogroups.com



            RMU> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





            --
            Best regards,
            Michael mailto:mfeathers@...
          Your message has been successfully submitted and would be delivered to recipients shortly.