Anubhava, your accomplishment is commendable and certainly not the focus of my comments. Please accept my apology if it was perceived as such.
Unless you're using FitNesse as a unit test environment or stepping outside of good coding practices, the existing FitLibrary should suffice. In other words, is the test to insure the code is built right, or is the right code is built?
To address your concerns with FitLibrary capabilities:
-
Most coding standards require externally facing modules to have a default constructor for robustness. For example, many interfaces such as JavaBeans, EJB, Servlet, JPA, etc. require a default constructor.
-
Static methods are allowed. Add the following to the Address class:
static public int getReturnPlusFifteenTwo (int x) { return x + 15; }
with this in the Do section of the wiki:
| check | get Return Plus Fifteen Two | 10 | 25 | -
As long as any "arbitrary methods" for utility purposes are encapsulated in a fixture, FitLibrary with the appropriate UFO patch will accommodate embedded fixtures. Case in point, there is a FitNesse fixture called Sleep that takes a millisecond argument.
In essence, although it's possible to extend FitNesse to handle unit testing, it may prove more appropriate and robust to use an xUnit suite rather than a FitNesse suite. Recognizing that occasionally there are overlaps in domain, the mindsets are different.
Again, xUnit insures the code is built right, and FitNesse insures the right code is built.
~~Andy
--- In fitnesse@yahoogroups.com, "anubhavas" <anubhava@...> wrote:
>
> Thanks for spending precious time to read my post and for your response?
>
> I haven't researched Workflow pattern in detail but just by looking at
> your response, will it instantiate objects that have NO default
> public constructor (constructor with no arguments). If I have Address
> class with one 1 constructor:
> public Address(int streetNo, String street, String city, int postcode,
> String state); will your example still work?
>
> And what about class with static methods like lava.lang.Math class?
>
> And what about the ability to call arbitrary static methods like
> java.lang.Thread.sleep(delay) any where in test tables?
>
> Regards,
> Anubhava
> --- In fitnesse@yahoogroups.com, "Andy Dassing" andrew.dassing@
> wrote:
> >
> > Does not this same functionality already exist in the Workflow pattern
> > of FitLibary? There are two flavors: 1) In-line, and 2) phased. 1.
> > Inline !define TEST_RUNNER {fitlibrary.suite.FitLibraryServer} |
> > Address | ---- DO
> > | set Address | 123 || Nutley Street || New York || 21019 || NY | '''
> > Get & Check '''
> > | check | Street No | 123 |
> > | check | City | New York |
> > | check | State | NY |
> > | check | Full Address | 123 Nutley Street, New York, NY - 21019 | '''
> > Set '''
> > | set Street No | 111 |
> > | set Postcode | 20133 | ''' Get & Check '''
> > | check | Postcode | 20133 |
> > | check | Street No | 111 |
> > | check | State | NY | 2. Phased
> > !define TEST_RUNNER {fitlibrary.suite.FitLibraryServer}
> > | Address |
> > ---- ''' Do '''
> > | set Address | 123 || Nutley Street || New York || 21019 || NY |
> > ---- ''' Get & Check '''
> > | Street No | 123 |
> > | City | New York |
> > | State | NY |
> > | Full Address | 123 Nutley Street, New York, NY - 21019 |
> > ---- ''' Set '''
> > | Street No | 111 |
> > | Postcode | 20133 |
> > ----
> > ---- ''' Get & Check '''
> > | Postcode | 20133 |
> > | Street No | 111 |
> > | State | NY |
> >
> >
> >
> > --- In fitnesse@yahoogroups.com, "anubhavas" <anubhava@> wrote:
> > >
> > > Hi Friends,
> > >
> > > I wrote a Generic Fixture where you just drop your class in FitNesse's
> > > class path, write your test tables in wiki and be ready to test
> > > without having to write a single line of Java code.
> > >
> > > Please visit my bog
> > >
> >
> http://anubhavas.blogspot.com/2008/01/introducing-generic-fixture-for.ht\
> > ml
> > > to read this in detail and see the code.
> > >
> > > Thanks,
> > > Anubhava
> > >
> >
>