1 23 24 29 package com.sun.enterprise.management.config; 30 31 32 import com.sun.appserv.management.config.DomainConfig; 33 import com.sun.appserv.management.config.ResourceAdapterConfig; 34 35 36 import com.sun.enterprise.management.AMXTestBase; 37 import com.sun.enterprise.management.Capabilities; 38 39 40 42 public final class ResourceAdapterConfigTest extends AMXTestBase 43 { 44 public 45 ResourceAdapterConfigTest() 46 { 47 if ( checkNotOffline( "ensureDefaultInstance" ) ) 48 { 49 ensureDefaultInstance( getDomainConfig() ); 50 } 51 } 52 53 public static String 54 getDefaultInstanceName() 55 { 56 return getDefaultInstanceName( "ResourceAdapterConfig" ); 57 } 58 59 public static ResourceAdapterConfig 60 ensureDefaultInstance( final DomainConfig domainConfig ) 61 { 62 ResourceAdapterConfig result = 63 domainConfig.getResourceAdapterConfigMap().get( getDefaultInstanceName() ); 64 65 if ( result == null ) 66 { 67 result = createInstance( domainConfig, getDefaultInstanceName() ); 68 } 69 70 return result; 71 } 72 73 public static ResourceAdapterConfig 74 createInstance( 75 final DomainConfig domainConfig, 76 final String name ) 77 { 78 final ResourceAdapterConfig rac = 79 domainConfig.createResourceAdapterConfig( name, null ); 80 81 return rac; 82 } 83 84 private void 85 testGetters( final ResourceAdapterConfig resAdapterConfig ) 86 { 87 resAdapterConfig.getResourceAdapterName(); 88 resAdapterConfig.getThreadPoolIDs(); 89 } 90 91 public void 92 testCreateRemove() 93 { 94 if ( checkNotOffline( "testCreateSSL" ) ) 95 { 96 final ResourceAdapterConfig resAdapterConfig = 97 createInstance( getDomainConfig(), 98 "ResourceAdapterConfigTest.testCreateRemove" ); 99 100 try 101 { 102 testGetters( resAdapterConfig ); 103 } 104 finally 105 { 106 getDomainConfig().removeResourceAdapterConfig( resAdapterConfig.getName() ); 107 } 108 } 109 } 110 111 } 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | Popular Tags |