1 23 24 package com.sun.enterprise.management.config; 25 26 import com.sun.appserv.management.config.AMXConfig; 27 import com.sun.appserv.management.config.ConfigConfig; 28 import com.sun.appserv.management.config.ConnectorServiceConfig; 29 30 import com.sun.appserv.management.util.misc.ExceptionUtil; 31 32 33 import com.sun.enterprise.management.AMXTestBase; 34 import com.sun.enterprise.management.Capabilities; 35 36 38 public final class ConnectorServiceConfigTest extends AMXTestBase 39 { 40 public ConnectorServiceConfigTest() 41 { 42 if ( checkNotOffline( "ensureDefaultInstance" ) ) 43 { 44 ensureDefaultInstance( getConfigConfig() ); 45 } 46 } 47 48 public static ConnectorServiceConfig 49 ensureDefaultInstance( final ConfigConfig configConfig ) 50 { 51 return configConfig.createConnectorServiceConfig(); 52 } 53 54 public synchronized void 55 testCreateRemove() 56 { 57 if ( checkNotOffline( "testCreateRemove" ) ) 58 { 59 final ConfigConfig configConfig = getConfigConfig(); 60 61 configConfig.removeConnectorServiceConfig(); 63 64 configConfig.createConnectorServiceConfig(); 66 configConfig.removeConnectorServiceConfig(); 67 68 ensureDefaultInstance( configConfig ); 70 } 71 } 72 73 public synchronized void 74 testGetters() 75 { 76 if ( checkNotOffline( "ensureDefaultInstance" ) ) 77 { 78 ensureDefaultInstance( getConfigConfig() ); 79 80 final ConnectorServiceConfig cs = getConfigConfig().getConnectorServiceConfig(); 81 82 final String value = cs.getShutdownTimeoutInSeconds(); 83 assert( value != null ); 84 85 try 86 { 87 final String newValue = "" + (Integer.parseInt( value ) + 1); 88 cs.setShutdownTimeoutInSeconds( newValue ); 89 final String after = cs.getShutdownTimeoutInSeconds(); 90 assert( after.equals( newValue ) ); 91 92 cs.setShutdownTimeoutInSeconds( "30" ); 93 cs.setShutdownTimeoutInSeconds( newValue ); 94 } 95 catch( Exception e ) 96 { 97 warning( getRootCauseStackTrace( e ) ); 98 99 failure( "ConnectorServiceConfig.setShutdownTimeoutInSeconds FAILED " + 100 "(bug #6307916 in com.sun.appserv:type=connector-service MBean)" ); 101 } 102 } 103 } 104 } 105 106 107 108 109 110 111 112 113 114 115 | Popular Tags |