• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WOUnit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOUnit


  • Subject: Re: WOUnit
  • From: Henrique Prange <email@hidden>
  • Date: Wed, 18 Apr 2012 13:06:00 -0300

Hi Ron,

On 18/04/2012, at 08:06, Ron X wrote:

What is the meaning of using @UnderTest?


The @UnderTest annotation can be used to create real enterprise objects and insert them into the editing context rule. It is a shorthand for:

public class SongTest {
    ...
    private Song song;
 
    @Before
    public void setup() {
        foo = Song.createFoo(ec);
    }
    ...
}

The WOUnit User's Guide [1] contains a step-by-step explanation of the problem solved by the @UnderTest annotation. See the "@Dummy and @UnderTest Annotations" section for details.

it can be omitted and using mock(<entity>).

No, it can't. A fake object is created when you use the mock() method. The @UnderTest annotation creates and inserts a real enterprise object in the MockEditingContext.

when i do confirm(song, canBeSaved()); - it falls with exception

Mock objects created with Mockito are not intended to work with the WOUnit's assertions.

but when i do:
mock(Song.class);
and than do confirm(song, canBeSaved());
everything works fine


It's just coincidence. The mock Song created by Mockito doesn't throw any exception when the validateForSave() method is called. Then, the canBeSaved() assertion seems to work.

[1]http://hprange.github.com/wounit/usage.html

Cheers,

Henrique

18 апреля 2012 г. 11:53 пользователь Ron X <email@hidden> написал:
hi everybody

@Spy - not find in classpath

        <dependency>
            <groupId>com.wounit</groupId>
            <artifactId>wounit</artifactId>
            <version>1.3-SNAPSHOT</version>
        </dependency>

why?

Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: WOUnit
      • From: Henrique Prange <email@hidden>
References: 
 >WOUnit (From: Ron X <email@hidden>)
 >Re: WOUnit (From: Ron X <email@hidden>)

  • Prev by Date: Re: WOUnit
  • Next by Date: Re: WOUnit
  • Previous by thread: Re: WOUnit
  • Next by thread: Re: WOUnit
  • Index(es):
    • Date
    • Thread