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 RModuleOptionTest extends BaseScarabTestCase 59 { 60 private RModuleOption rmo = null; 61 private Attribute priority = null; 62 private AttributeOption high = null; 63 private IssueType issueType = null; 64 65 66 67 public void setUp() throws Exception 68 { 69 super.setUp(); 70 issueType = getDefaultIssueType(); 71 priority = AttributeManager.getInstance(new NumberKey("7")); 72 high = AttributeOptionManager.getInstance(new NumberKey("54")); 73 rmo = getModule().getRModuleOption(high, issueType); 74 assertNotNull(issueType); 75 assertNotNull(priority); 76 assertNotNull(high); 77 assertNotNull("RMO should not be null!",rmo); 78 79 } 80 81 82 public void testGetDisplayValue() throws Exception 83 { 84 System.out.println("\ntestGetDisplayValue()"); 85 assertEquals("High", rmo.getDisplayValue()); 86 } 87 88 public void testGetLevel() throws Exception 89 { 90 System.out.println("\ntestGetLevel()"); 91 assertEquals(0, rmo.getLevel()); 92 } 93 94 public void testSetLevel() throws Exception 95 { 96 System.out.println("\ntestSetLevel()"); 97 rmo.setLevel(2); 98 assertEquals(2, rmo.getLevel()); 99 } 100 101 public void testGetRModuleAttribute() throws Exception 102 { 103 System.out.println("\ntestGetRModuleAttribute()"); 104 assertEquals("Priority", rmo.getRModuleAttribute(issueType).getAttribute().getName()); 105 } 106 107 112 public void OFFtestDelete() throws Exception 113 { 114 System.out.println("\ntestDelete()"); 115 RModuleOption rmoNew= RModuleOptionManager.getInstance(); 116 rmoNew.setModule(getModule()); 117 rmoNew.setIssueType(getDefaultIssueType()); 118 rmoNew.setOptionId(new Integer (1)); 119 rmoNew.save(); 120 rmoNew.delete(); 121 } 122 } 123 | Popular Tags |