1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Set ; 26 import java.util.Map ; 27 import java.util.Iterator ; 28 29 import javax.management.ObjectName ; 30 31 import com.sun.appserv.management.config.NamedConfigElement; 32 import com.sun.appserv.management.config.DomainConfig; 33 34 import com.sun.enterprise.management.AMXTestBase; 35 import com.sun.enterprise.management.Capabilities; 36 import com.sun.appserv.management.base.AMX; 37 import com.sun.appserv.management.config.*; 38 39 import com.sun.appserv.management.base.Util; 40 41 42 44 public final class DomainConfigTest extends AMXTestBase 45 { 46 public 47 DomainConfigTest() 48 { 49 } 50 51 public void 52 testGetDeployedItemProxies() 53 { 54 final DomainConfig mgr = getDomainConfig(); 55 56 final Set proxies = mgr.getContaineeSet(); 57 assert( proxies.size() != 0 ); 58 59 final Iterator iter = proxies.iterator(); 60 while ( iter.hasNext() ) 61 { 62 final AMX proxy = Util.asAMX(iter.next()); 63 } 64 } 65 66 public void 67 testGetDeployedItemProxiesByName() 68 { 69 final DomainConfig mgr = getDomainConfig(); 70 71 final Map <String ,Map <String ,AMX>> typeMap = mgr.getMultiContaineeMap( null ); 72 73 for( final String j2eeType : typeMap.keySet() ) 74 { 75 final Map <String ,AMX> proxyMap = typeMap.get( j2eeType ); 76 for( final String name : proxyMap.keySet() ) 77 { 78 final AMX amx = Util.asAMX(proxyMap.get( name )); 79 80 final AMX proxy = mgr.getContainee( j2eeType, name); 81 82 assert( Util.getObjectName( proxy ).equals( Util.getObjectName( amx ) ) ); 83 assert( proxy.getName().equals( name ) ); 84 } 85 } 86 } 87 88 89 public void 90 testGetAttributes() 91 { 92 final DomainConfig mgr = getDomainConfig(); 93 94 mgr.getApplicationRoot(); 95 mgr.getLocale(); 96 mgr.getLogRoot(); 97 } 98 99 private <T extends AMX> void 100 checkMap( final Map <String ,T> m ) 101 { 102 assert( m != null ); 103 assert( ! m.keySet().contains( AMX.NO_NAME ) ); 104 assert( ! m.keySet().contains( AMX.NULL_NAME ) ); 105 } 106 107 108 public void 109 testGetMaps() 110 { 111 final DomainConfig m = getDomainConfig(); 112 113 checkMap( m.getServerConfigMap() ); 114 checkMap( m.getStandaloneServerConfigMap() ); 115 checkMap( m.getClusteredServerConfigMap() ); 116 checkMap( m.getLBConfigMap() ); 117 checkMap( m.getLoadBalancerConfigMap() ); 118 checkMap( m.getNodeAgentConfigMap() ); 119 checkMap( m.getConfigConfigMap() ); 120 checkMap( m.getClusterConfigMap() ); 121 122 checkMap( m.getPersistenceManagerFactoryResourceConfigMap() ); 123 checkMap( m.getJDBCResourceConfigMap() ); 124 checkMap( m.getJDBCConnectionPoolConfigMap() ); 125 checkMap( m.getConnectorResourceConfigMap() ); 126 checkMap( m.getConnectorConnectionPoolConfigMap() ); 127 checkMap( m.getAdminObjectResourceConfigMap() ); 128 checkMap( m.getResourceAdapterConfigMap() ); 129 checkMap( m.getMailResourceConfigMap() ); 130 131 checkMap( m.getJ2EEApplicationConfigMap() ); 132 checkMap( m.getEJBModuleConfigMap( ) ); 133 checkMap( m.getWebModuleConfigMap( ) ); 134 checkMap( m.getRARModuleConfigMap() ); 135 checkMap( m.getAppClientModuleConfigMap() ); 136 checkMap( m.getLifecycleModuleConfigMap() ); 137 } 138 139 152 153 154 public void 155 testCreateClusterConfig() 156 { 157 } 159 } 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | Popular Tags |