1 8 9 package test.javax.management.relation; 10 11 import java.util.ArrayList ; 12 import java.util.List ; 13 import javax.management.ObjectName ; 14 import javax.management.relation.Role ; 15 16 import junit.framework.TestCase; 17 18 21 public class RoleTest extends TestCase 22 { 23 private Role _role; 24 25 public RoleTest(String name) 26 { 27 super(name); 28 } 29 30 protected void setUp() throws Exception 31 { 32 _role = new Role ("test Role", new ArrayList ()); 33 } 34 35 protected void tearDown() throws Exception 36 { 37 } 38 39 public void testGetRoleValue() throws Exception 40 { 41 List roleValues = _role.getRoleValue(); 42 assertNotNull(roleValues); 43 } 44 45 public void testGetRoleValue_ListHasElements() throws Exception 46 { 47 List values = new ArrayList (); 48 values.add(new ObjectName ("domain:name=test")); 49 Role role = new Role ("Test Role", values); 50 assertEquals(1, role.getRoleValue().size()); 51 } 52 } | Popular Tags |