1 23 package com.sun.enterprise.management.config; 24 25 import com.sun.appserv.management.base.Util; 26 27 import com.sun.appserv.management.config.ResourceConfig; 28 import com.sun.appserv.management.config.StandaloneServerConfig; 29 30 import com.sun.appserv.management.util.misc.ExceptionUtil; 31 32 import com.sun.enterprise.management.AMXTestBase; 33 34 36 public abstract class ResourceConfigTestBase extends ConfigMgrTestBase 37 { 38 protected 39 ResourceConfigTestBase() 40 { 41 super(); 42 43 StandaloneServerConfigTest.ensureDefaultInstance( getDomainRoot() ); 44 } 45 46 protected void 47 addReference( final ResourceConfig rc ) 48 { 49 final StandaloneServerConfig server = 50 StandaloneServerConfigTest.ensureDefaultInstance( getDomainRoot() ); 51 assert server != null; 52 53 if ( server.getResourceRefConfigMap().get( rc.getName() ) != null ) 54 { 55 warning( "ResourceRefConfig already exists for: " + rc.getName() ); 56 } 57 else 58 { 59 try 60 { 61 server.createResourceRefConfig( rc.getName(), false ); 62 } 63 catch( Exception e ) 64 { 65 final Throwable rootCause = ExceptionUtil.getRootCause( e ); 66 67 warning( "Couldn't add RefConfig to: " + Util.getObjectName( rc ) ); 68 } 69 } 70 71 assert server.getResourceRefConfigMap().get( rc.getName() ) != null; 72 } 73 74 75 } 76 77 78 | Popular Tags |