can be because the if else's are not hit with both options or the method is hitting a parent class.


tibi



? 2010-12-13 19:50, Josep García ??:
I have found this post, which assures solves the problem.
http://www.mail-archive.com/users@appfuse.dev.java.net/msg08809.html

Let us know if it works for you too!
Josep

2010/12/13 <t...@dds.nl <mailto:t...@dds.nl>>

   it had something to do with turning off the
   aspectj-maven-plugin

   i see i have this one commented out


   tibi


       hi,Matt
       "mvn appfuse:full-source",the default appfuse codes will be added
       including a couple of unit test code,but the cobertura
       coverage is still
       0%,i search many threads,but there aren't the formal manual in
       www.appfuse.org <http://www.appfuse.org>,may be the
       aspectj-maven-plugin affect the cobertura,so
       it may depend on the APF-1217 resolved

       ---------------------------------------------------------------------
       To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
       <mailto:users-unsubscr...@appfuse.dev.java.net>
       For additional commands, e-mail:
       users-h...@appfuse.dev.java.net
       <mailto:users-h...@appfuse.dev.java.net>






   ---------------------------------------------------------------------
   To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
   <mailto:users-unsubscr...@appfuse.dev.java.net>
   For additional commands, e-mail: users-h...@appfuse.dev.java.net
   <mailto:users-h...@appfuse.dev.java.net>


Great,I can run the cobertura successful,but i am still puzzled about
the result:

public class UserManagerImplTest extends BaseManagerMockTestCase {
    //~ Instance fields
========================================================
    private UserManagerImpl userManager = new UserManagerImpl();
    private RoleManagerImpl roleManager;
    private UserDao userDao;
    private RoleDao roleDao;

    //~ Methods
================================================================
    @Before
    public void setUp() throws Exception {
        userDao = context.mock(UserDao.class);
        userManager.setUserDao(userDao);
        roleDao = context.mock(RoleDao.class);
        roleManager = new RoleManagerImpl(roleDao);
    }

    @Test
    public void testGetUser() throws Exception {
        final User testData = new User("1");
        testData.getRoles().add(new Role("user"));

        // set expected behavior on dao
        context.checking(new Expectations() {{
            one(userDao).get(with(equal(1L)));
            will(returnValue(testData));
        }});

        User user = userManager.getUser("1");
        assertTrue(user != null);
        assert user != null;
        assertTrue(user.getRoles().size() == 1);
    }

........

preceding code UserManagerImplTest is coming from "mvn appfuse:full-source"
we can see method   userManager.getUser("1")
but the coverage report still show 0% at the UserManager,why?




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to