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

Re: ArrayFixture args

Expand Messages
  • Jeff
    I m wondering how many shops still use fitlibrary under Java, given the lack of any responses to this and another fitlibrary question last week. Has everyone
    Message 1 of 7 , Jun 3, 2013
    • 0 Attachment
      I'm wondering how many shops still use fitlibrary under Java, given the lack of any responses to this and another fitlibrary question last week.

      Has everyone moved on to Slim? Should I push (even more) to get my customer to do the same?

      Regards,
      Jeff L.

      --- In fitnesse@yahoogroups.com, "Jeff" <jeff@...> wrote:
      >
      > Greetings,
      >
      > I'm using fitlibrary-2.0.jar in conjunction with fitnesse v20111026.
      >
      > I'm calling super.getArgs() in the constructor of a Java fixture that extends fitlibrary.ArrayFixture. It returns null. The table passes a single argument to the right of the table name. (I also tried creating a constructor that takes a single parameter.)
      >
      > How do I properly pass/access arguments passed to the fitlibrary.ArrayFixture?
      >
      > Thanks,
      > Jeff
      >
    • Andy McMullan
      ... If you re still looking for an answer to this, I think the arguments are initialised after construction, so you can t access them from the constructor.
      Message 2 of 7 , Jun 3, 2013
      • 0 Attachment
        > I'm calling super.getArgs() in the constructor of a Java fixture that extends fitlibrary.ArrayFixture.

        If you're still looking for an answer to this, I think the arguments
        are initialised after construction, so you can't access them from the
        constructor.
      • Jeff
        ... Thanks for the response Andy, Per the user s guide, Initialise that collection in the constructor of your fixture to the actual results that should be
        Message 3 of 7 , Jun 3, 2013
        • 0 Attachment
          --- In fitnesse@yahoogroups.com, Andy McMullan <andymcm@...> wrote:
          >
          > > I'm calling super.getArgs() in the constructor of a Java fixture that extends fitlibrary.ArrayFixture.
          >
          > If you're still looking for an answer to this, I think the arguments
          > are initialised after construction, so you can't access them from the
          > constructor.

          Thanks for the response Andy,

          Per the user's guide, "Initialise that collection in the constructor of your fixture to the actual results that should be compared to the table." That makes getting the args post-construction just a bit late. :-)

          I've been searching a bit for a code example that incorporates args but haven't found one yet. I'll look at the source code and see what I can glean.

          Jeff
        • Jeff
          Based on a little digging, I think the only hook available is interpretAfterFirstRow, defined in FitLibraryFixture. The following code works for me in
          Message 4 of 7 , Jun 3, 2013
          • 0 Attachment
            Based on a little digging, I think the only hook available is interpretAfterFirstRow, defined in FitLibraryFixture. The following code works for me in FitLibrary-2.0:

            @Override
            public Object interpretAfterFirstRow(Table table, TestResults testResults) {
            String filter = filterFromArgs(getArgs());
            setActualCollection(retrieveOrderedCollection(filter));
            return super.interpretAfterFirstRow(table, testResults);
            }

            (filterFromArgs is a simple helper method.)

            --- In fitnesse@yahoogroups.com, "Jeff" <jeff@...> wrote:

            > Per the user's guide, "Initialise that collection in the constructor of your fixture to the actual results that should be compared to the table." That makes getting the args post-construction just a bit late. :-)
          • Mike Stockdale
            Best way to use ArrayFixture is via auto wrapping. not ... but ... -- Cheers, Mike Stockdale /fit/Sharp Syterra Software Inc.
            Message 5 of 7 , Jun 4, 2013
            • 0 Attachment
              Best way to use ArrayFixture is via auto wrapping.

              not

              |myarrayfixture|hard to use args|
              |expected results...|

              but

              |mydofixture|
              |myarraymethod|easy to use args|
              |expected results ...|

              On 2013-06-03 21:29, Jeff wrote:
               

              --- In fitnesse@yahoogroups.com, Andy McMullan <andymcm@...> wrote:
              >
              > > I'm calling super.getArgs() in the constructor of a Java fixture that extends fitlibrary.ArrayFixture.
              >
              > If you're still looking for an answer to this, I think the arguments
              > are initialised after construction, so you can't access them from the
              > constructor.

              Thanks for the response Andy,

              Per the user's guide, "Initialise that collection in the constructor of your fixture to the actual results that should be compared to the table." That makes getting the args post-construction just a bit late. :-)

              I've been searching a bit for a code example that incorporates args but haven't found one yet. I'll look at the source code and see what I can glean.

              Jeff


              --
              Cheers,
              Mike Stockdale

              fitSharp
              Syterra Software Inc.
            • Jeff
              Thanks Mike, That makes sense, the more I work with fitlibrary the more I realize that s the right solution. Regards, Jeff
              Message 6 of 7 , Jun 5, 2013
              • 0 Attachment
                Thanks Mike,

                That makes sense, the more I work with fitlibrary the more I realize that's the right solution.

                Regards,
                Jeff

                --- In fitnesse@yahoogroups.com, Mike Stockdale <jediwhale@...> wrote:
                >
                > Best way to use ArrayFixture is via auto wrapping.
                >
                > not
                >
                > |myarrayfixture|hard to use args|
                > |expected results...|
                >
                > but
                >
                > |mydofixture|
                > |myarraymethod|easy to use args|
                > |expected results ...|
              Your message has been successfully submitted and would be delivered to recipients shortly.