1 package org.tigris.scarab.om; 2 3 48 49 import org.apache.torque.om.NumberKey; 50 import org.tigris.scarab.test.BaseScarabTestCase; 51 52 58 public class ActivitySetTest extends BaseScarabTestCase 59 { 60 private ActivitySet trans = null; 61 62 63 public void testCreate() throws Exception { 64 65 Issue issue2 = BaseIssuePeer.retrieveByPK(new NumberKey("1")); 66 assertNotNull(issue2); 67 System.out.println("\ntestCreate()"); 68 Issue issue = IssueManager.getInstance(new NumberKey("1")); 69 Attachment attachment = AttachmentManager.getInstance(); 70 attachment.setName("activitySet test"); 71 attachment.setData("Test comment"); 72 attachment.setTextFields(getUser1(), issue, Attachment.COMMENT__PK); 73 attachment.save(); 74 75 trans = ActivitySetManager.getInstance(new Integer (1), getUser1(), attachment); 76 trans.save(); 77 System.out.println("new activitySet id = " + trans.getActivitySetId()); 78 79 Activity activity = ActivityManager.createTextActivity(getIssue0(), null, trans, "trans activity", null, 81 "oldValue", "newValue"); 82 activity.save(); 83 Activity activity1 = ActivityManager.createTextActivity(getIssue0(), null, trans, "trans activity", null, 84 "oldValue", "newValue"); 85 activity1.save(); 86 } 87 88 public void testGetActivityList() throws Exception { 89 testCreate(); 90 System.out.println("\ntestGetActivityList()"); 91 assertEquals(2, trans.getActivityList().size()); 92 } 93 } | Popular Tags |