Package org.sete.enterprise.dao.project

Examples of org.sete.enterprise.dao.project.ScienceProjectDao


  public void testStudentBelongsToProject() {
    // assemble core of test requirements
    service = new ScienceProjectServiceImpl();

    UserDao userDaoMock = createMock(UserDao.class);
    ScienceProjectDao spDaoMock = createMock(ScienceProjectDao.class);

    ((ScienceProjectServiceImpl) service).setUserDao(userDaoMock);
    ((ScienceProjectServiceImpl) service).setProjectDao(spDaoMock);

    // mock the dao's
    expect(userDaoMock.findById(studentAId)).andReturn(studentA);
    replay(userDaoMock);

    expect(spDaoMock.findBy(studentA)).andReturn(project);
    replay(spDaoMock);

    // test it
    ScienceProjectVo spVo = service
        .loadScienceProjectByStudentUserId(studentAId);
View Full Code Here


  public void testStudentDoesNotBelongToProject() {
    // assemble core of test requirements
    service = new ScienceProjectServiceImpl();

    UserDao userDaoMock = createMock(UserDao.class);
    ScienceProjectDao spDaoMock = createMock(ScienceProjectDao.class);

    ((ScienceProjectServiceImpl) service).setUserDao(userDaoMock);
    ((ScienceProjectServiceImpl) service).setProjectDao(spDaoMock);

    // mock the dao's
    expect(userDaoMock.findById(studentBId)).andReturn(studentB);
    replay(userDaoMock);

    expect(spDaoMock.findBy(studentB)).andReturn(null);
    replay(spDaoMock);

    // test it
    ScienceProjectVo spVo = service
        .loadScienceProjectByStudentUserId(studentBId);
View Full Code Here

  public void testUserIdNotStudent() {
    // assemble core of test requirements
    service = new ScienceProjectServiceImpl();

    UserDao userDaoMock = createMock(UserDao.class);
    ScienceProjectDao spDaoMock = createMock(ScienceProjectDao.class);

    ((ScienceProjectServiceImpl) service).setUserDao(userDaoMock);
    ((ScienceProjectServiceImpl) service).setProjectDao(spDaoMock);

    // mock the dao's
    expect(userDaoMock.findById(sponsorId)).andReturn(sponsor);
    replay(userDaoMock);

    expect(spDaoMock.findBy(sponsor)).andReturn(null);
    replay(spDaoMock);

    // test it
    ScienceProjectVo spVo = service
        .loadScienceProjectByStudentUserId(sponsorId);
View Full Code Here

  public void testUserIdIsNull() {
    // assemble core of test requirements
    service = new ScienceProjectServiceImpl();

    UserDao userDaoMock = createMock(UserDao.class);
    ScienceProjectDao spDaoMock = createMock(ScienceProjectDao.class);

    ((ScienceProjectServiceImpl) service).setUserDao(userDaoMock);
    ((ScienceProjectServiceImpl) service).setProjectDao(spDaoMock);

    // mock the dao's
    expect(userDaoMock.findById(null)).andReturn(null);
    replay(userDaoMock);

    expect(spDaoMock.findBy(null)).andReturn(null);
    replay(spDaoMock);

    // test it

    try {
View Full Code Here

    public void testLoadAllScienceProjectsSponsoredBy(){
        //assemble core of test requirements
        service = new ScienceProjectServiceImpl();
       
        UserDao userDaoMock = createMock(UserDao.class);
        ScienceProjectDao spDaoMock = createMock(ScienceProjectDao.class);
       
        ((ScienceProjectServiceImpl)service).setUserDao(userDaoMock);
        ((ScienceProjectServiceImpl)service).setProjectDao(spDaoMock);
       
        // mock the dao's
        expect(userDaoMock.findById(sponsor1ID)).andReturn(sponsor1);
        expect(userDaoMock.findById(sponsor2ID)).andReturn(sponsor2);
        expect(userDaoMock.findById(sponsor3ID)).andReturn(sponsor3);
        replay(userDaoMock);
       
        expect(spDaoMock.findSponsoredBy(sponsor1)).andReturn(sponsor1Projects);
        expect(spDaoMock.findSponsoredBy(sponsor2)).andReturn(sponsor2Projects);
        expect(spDaoMock.findSponsoredBy(sponsor3)).andReturn(sponsor3Projects);
        replay(spDaoMock);
       
        //test it
        List<ScienceProjectVo> tp1 = service.loadAllScienceProjectsSponsoredBy(sponsor1ID);
        List<ScienceProjectVo> tp2 = service.loadAllScienceProjectsSponsoredBy(sponsor2ID);
View Full Code Here

TOP

Related Classes of org.sete.enterprise.dao.project.ScienceProjectDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.