KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > javax > management > relation > RoleTest


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package test.javax.management.relation;
10
11 import java.util.ArrayList JavaDoc;
12 import java.util.List JavaDoc;
13 import javax.management.ObjectName JavaDoc;
14 import javax.management.relation.Role JavaDoc;
15
16 import junit.framework.TestCase;
17
18 /**
19  * @version $Revision: 1.4 $
20  */

21 public class RoleTest extends TestCase
22 {
23    private Role JavaDoc _role;
24
25    public RoleTest(String JavaDoc name)
26    {
27       super(name);
28    }
29
30    protected void setUp() throws Exception JavaDoc
31    {
32       _role = new Role JavaDoc("test Role", new ArrayList JavaDoc());
33    }
34
35    protected void tearDown() throws Exception JavaDoc
36    {
37    }
38
39    public void testGetRoleValue() throws Exception JavaDoc
40    {
41       List JavaDoc roleValues = _role.getRoleValue();
42       assertNotNull(roleValues);
43    }
44
45    public void testGetRoleValue_ListHasElements() throws Exception JavaDoc
46    {
47       List JavaDoc values = new ArrayList JavaDoc();
48       values.add(new ObjectName JavaDoc("domain:name=test"));
49       Role JavaDoc role = new Role JavaDoc("Test Role", values);
50       assertEquals(1, role.getRoleValue().size());
51    }
52 }
Popular Tags