01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: 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: /**
19: * @version $Revision: 1.4 $
20: */
21: public class RoleTest extends TestCase {
22: private Role _role;
23:
24: public RoleTest(String name) {
25: super (name);
26: }
27:
28: protected void setUp() throws Exception {
29: _role = new Role("test Role", new ArrayList());
30: }
31:
32: protected void tearDown() throws Exception {
33: }
34:
35: public void testGetRoleValue() throws Exception {
36: List roleValues = _role.getRoleValue();
37: assertNotNull(roleValues);
38: }
39:
40: public void testGetRoleValue_ListHasElements() throws Exception {
41: List values = new ArrayList();
42: values.add(new ObjectName("domain:name=test"));
43: Role role = new Role("Test Role", values);
44: assertEquals(1, role.getRoleValue().size());
45: }
46: }
|