You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Erin Noe-Payne <er...@gmail.com> on 2013/03/29 18:32:08 UTC

Build failing tests

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

Re: Build failing tests

Posted by Chris Geer <ch...@cxtsoftware.com>.
On Fri, Mar 29, 2013 at 11:41 AM, Matt Franklin <m....@gmail.com>wrote:

> On Fri, Mar 29, 2013 at 2:34 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
>
> > On Fri, Mar 29, 2013 at 10:35 AM, Chris Geer <ch...@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
> >
>

Re: Build failing tests

Posted by Matt Franklin <m....@gmail.com>.
On Fri, Mar 29, 2013 at 2:34 PM, Chris Geer <ch...@cxtsoftware.com> wrote:

> On Fri, Mar 29, 2013 at 10:35 AM, Chris Geer <ch...@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);


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

Re: Build failing tests

Posted by Chris Geer <ch...@cxtsoftware.com>.
On Fri, Mar 29, 2013 at 10:35 AM, Chris Geer <ch...@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?

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

Chris

Re: Build failing tests

Posted by Chris Geer <ch...@cxtsoftware.com>.
I'll look at it...maybe I broke something.

On Fri, Mar 29, 2013 at 10:32 AM, Erin Noe-Payne
<er...@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
>