Subversion Repositories SmartDukaan

Rev

Rev 3168 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3024 mandeep.dh 1
/**
2
 * 
3
 */
4
package in.shop2020.crm.handler;
5
 
3106 mandeep.dh 6
import in.shop2020.crm.TicketCategory;
3024 mandeep.dh 7
import in.shop2020.crm.TicketPriority;
8
import in.shop2020.crm.TicketStatus;
9
import in.shop2020.crm.domain.Activity;
10
 
11
import org.apache.thrift.TException;
12
import org.junit.Before;
3029 mandeep.dh 13
import org.junit.Ignore;
3024 mandeep.dh 14
import org.springframework.context.ApplicationContext;
15
import org.springframework.context.support.ClassPathXmlApplicationContext;
16
 
17
/**
18
 * Unit test cases for ActivityHandler
19
 *
20
 * @author mandeep
21
 */
22
public class ActivityHandlerTest {
23
 
24
    private ActivityHandler activityHandler;
25
 
26
    /**
27
     * @throws java.lang.Exception
28
     */
29
    @Before
30
    public void setUp() throws Exception {
31
        ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:context.xml");
32
        activityHandler = ctx.getBean(ActivityHandler.class);
33
    }
34
 
35
    /**
36
     * Test method for {@link in.shop2020.crm.handler.ActivityHandler#fetchActivities(long, in.shop2020.crm.ActivityStatus, long)}.
37
     * @throws TException 
38
     */
3156 mandeep.dh 39
    @Ignore
3024 mandeep.dh 40
    public void testFetchActivities() throws TException {
41
    }
42
 
43
    /**
44
     * Test method for {@link in.shop2020.crm.handler.ActivityHandler#insertActivity(in.shop2020.crm.domain.Activity)}.
45
     * @throws TException 
46
     */
3029 mandeep.dh 47
    @Ignore
3024 mandeep.dh 48
    public void testInsertActivity() throws TException {
49
        Activity activity = new Activity();
50
        activity.setCustomerId(34l);
51
        activity.setTicketPriority(TicketPriority.HIGH);
52
        activity.setCreatorId(0);
53
        activity.setDescription("sdfklshdf");
3106 mandeep.dh 54
        activity.setTicketAssigneeId(0l);
55
        activity.setTicketId(0l);
3024 mandeep.dh 56
        activity.setTicketPriority(TicketPriority.HIGH);
57
        activity.setTicketStatus(TicketStatus.OPEN);
3106 mandeep.dh 58
        activity.setTicketCategory(TicketCategory.DELIVERY_PROBLEM);
3024 mandeep.dh 59
        activityHandler.insertActivity(activity);
60
        System.out.println(activity.getId());
61
    }
62
}