rave-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Geer <ch...@cxtsoftware.com>
Subject Re: Build failing tests
Date Fri, 29 Mar 2013 19:24:56 GMT
On Fri, Mar 29, 2013 at 11:41 AM, Matt Franklin <m.ben.franklin@gmail.com>wrote:

> On Fri, Mar 29, 2013 at 2:34 PM, Chris Geer <chris@cxtsoftware.com> wrote:
>
> > On Fri, Mar 29, 2013 at 10:35 AM, Chris Geer <chris@cxtsoftware.com>
> > wrote:
> >
> > > I'll look at it...maybe I broke something.
> > >
> > >
> > > On Fri, Mar 29, 2013 at 10:32 AM, Erin Noe-Payne <
> > erin.noe.payne@gmail.com
> > > > wrote:
> > >
> > >> Building rave-core
> > >>
> > >> Running org.apache.rave.portal.service.impl.DefaultCategoryServiceTest
> > >> Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.009
> > sec
> > >> <<< FAILURE!
> > >> Running
> org.apache.rave.portal.service.impl.DefaultNewAccountServiceTest
> > >> DEBUG:
> org.apache.rave.portal.service.impl.DefaultNewAccountServiceTest
> > -
> > >> Expected failure of account creation due to duplicate name
> > >> DEBUG:
> org.apache.rave.portal.service.impl.DefaultNewAccountServiceTest
> > -
> > >> Expected failure of account creation due to duplicate email
> > >>
> > >
> > Ok, I broke this. I know why it broke but I don't have a good solution to
> > make this test viable again so any ideas would be great. The change I
> made
> > was to the DefaultCategoryService to return the category returned from
> the
> > Repository instead of the category passed in. This was done for the major
> > reason that previously it was just returning the category passed in which
> > didn't have an ID which was a major problem. So now it returns the actual
> > saved category with the ID.
>
>
> > The reason the test broke is because it's testing for all sorts of
> > attributes that are set by the service. Under normal circumstances these
> > would all be returned from the repository but with the Mock repository
> it's
> > just returning a super basic object. Does anyone know of a way to mock a
> > method so I could take in the object passed in, modify it and send it
> back
> > out instead of returning a static object?
> >
>
> Look at EasyMock.andAnswer(IAnswer<T> answer);
>

Perfect, test is re-enabled.

>
>
> >
> > For now I'm going to comment out the test so that the compile doesn't
> fail.
> >
> > Chris
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message