KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > DomainRootTest


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /*
25  * $Header: /cvs/glassfish/admin/mbeanapi-impl/tests/com/sun/enterprise/management/DomainRootTest.java,v 1.5 2005/12/25 03:41:17 tcfujii Exp $
26  * $Revision: 1.5 $
27  * $Date: 2005/12/25 03:41:17 $
28  */

29 package com.sun.enterprise.management;
30
31 import java.util.Set JavaDoc;
32 import java.util.Map JavaDoc;
33 import java.util.Iterator JavaDoc;
34 import java.io.IOException JavaDoc;
35
36 import javax.management.ObjectName JavaDoc;
37 import javax.management.AttributeList JavaDoc;
38 import javax.management.MBeanServerConnection JavaDoc;
39 import javax.management.NotCompliantMBeanException JavaDoc;
40
41 import com.sun.appserv.management.DomainRoot;
42 import com.sun.appserv.management.j2ee.J2EEDomain;
43 import com.sun.appserv.management.base.NotificationEmitterService;
44
45
46 import com.sun.appserv.management.util.jmx.MBeanServerConnectionConnectionSource;
47
48 import com.sun.enterprise.management.support.AMXNonConfigImplBase;
49 import com.sun.enterprise.management.support.QueryMgrImpl;
50
51 import com.sun.appserv.management.util.misc.ExceptionUtil;
52
53 /**
54  */

55 public final class DomainRootTest extends AMXTestBase
56 {
57
58         public
59     DomainRootTest( )
60         throws IOException JavaDoc
61     {
62     }
63
64         public void
65     testGetDomain()
66     {
67         getDomainRoot();
68     }
69     
70         public void
71     testGetDeploymentMgr()
72     {
73         assert( getDomainRoot().getDeploymentMgr() != null );
74     }
75     
76         public void
77     testGetConfigDottedNames()
78     {
79         if ( checkNotOffline( "testGetConfigDottedNames" ) )
80         {
81             assert( getDomainRoot().getConfigDottedNames() != null );
82         }
83     }
84     
85         public void
86     testGetMonitoringDottedNames()
87     {
88         if ( checkNotOffline( "testGetConfigDottedNames" ) )
89         {
90             assert( getDomainRoot().getMonitoringDottedNames() != null );
91         }
92     }
93     
94     
95         public void
96     testGetDomainNotificationEmitterService()
97     {
98         assert( getDomainRoot().getDomainNotificationEmitterService() != null );
99     }
100     
101     
102         public void
103     testGetDomainNotificationEmitterServiceMap()
104     {
105         final Map JavaDoc<String JavaDoc,NotificationEmitterService> services =
106             getDomainRoot().getNotificationEmitterServiceMap();
107         assert( services != null );
108         
109         for( NotificationEmitterService s : services.values() )
110         {
111             s.getListenerCount();
112         }
113     }
114     
115     
116         public void
117     testAMXReady()
118     {
119         final DomainRoot domainRoot = getDomainRoot();
120         
121         while ( ! domainRoot.getAMXReady() )
122         {
123             mySleep( 10 );
124         }
125     }
126     
127         public void
128     testWaitAMXReady()
129     {
130         final DomainRoot domainRoot = getDomainRoot();
131         
132         domainRoot.waitAMXReady();
133     }
134 }
135
136
137
Popular Tags