jmock « junit « Java Testing Q&A

Home
Java Testing Q&A
1.Development
2.FindBugs
3.HTMLUnit
4.hudson
5.junit
6.performance
7.plugin
8.profile
9.selenium
10.Tools
11.unit test
Java Testing Q&A » junit » jmock 

1. Why do you use .proxy() in JMock?    stackoverflow.com

I'm trying to learn how to use JMock and I'm a bit confused about what you use the .proxy() method for. I know its invoked on your Mock class but I ...

2. AtUnit vs 'Junit,JMock and GUICE' by hand -?    stackoverflow.com

How does AtUnit fare with respect to unit testing using DI and guice ?. Please share your experiences.

3. No tests found using JMock    stackoverflow.com

having problems trying to run by unit test with Ant, my test class uses Jmock;

@RunWith(JMock.class)
and annotations to identify each test method. When i attempt to build with ant (1.7.1) i get ...

4. When should we use Mockery vs JUnit4Mockery?    stackoverflow.com

If writing a Java unit test with mocking using JMock, should we use
Mockery context = new Mockery()
or
Mockery context = new JUnit4Mockery() What is the ...

5. Need help with writing test    stackoverflow.com

I'm trying to write a test for this class its called Receiver :

public void get(People person) {
            if(null != person) ...

6. Set property to mock object jmock    stackoverflow.com

Is it possible to assing value to mock object. Ex:

myMockObject = context.mock(MyObject.class);

myMockObject.setId("someId");
My method which I'm testing reaches the end, but at the end there is method for validation of that object ...

7. JUnit mocks, which tool should i use?    stackoverflow.com

I come from the PHP testing world and i'm starting testing in Java. I've seen several tools to mock the SUT in JUnit, like Mockito, SevenMock, ClassMock, etc. I really appreciate any recommendation ...

8. Standard way to capture arguments in JMock    stackoverflow.com

Is there an already build in standard way in JMock to capture method arguments to test the argument object later on with standard Junit functionality? Something like

final CapturedContainer<SimpleMailMessage>capturedArgumentContainer = new ...
context.checking(new Expectations() ...

9. JMock assertIsSatisfied in TearDown?    stackoverflow.com

I don't know why, but I have always written my JMock tests like this:

@Test
public void testMyThing() throws Exception {
    mockery.checking(new Expectations() {{
       ...

10. Where does symbol once come from?    stackoverflow.com

I'm trying to work through an article (http://martinfowler.com/articles/mocksArentStubs.html) on mocking with pseudocode in it that I'm implementing, but I'm having trouble finding once (and eq, returnValue, etc.). I first wanted ...

11. JMock unexpected invocation    stackoverflow.com

Below I am just trying to mock a class named TestWrapper and set 'allowing' expecations on it. However, when setting expectations I get error. When using easymock and just setting expectations, ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.