public void | testLibraries()public void
testGUIHang()
{
final String[] TEST_LIBS = new String[] { "/foo", "/bar" };
final ObjectName objectName = Util.newObjectName( "amx:j2eeType=X-WebModuleConfig,name=admingui" );
final WebModuleConfig cfg = getProxyFactory().getProxy( objectName );
final String[] saveLibs = cfg.getLibraries();
assert( saveLibs != null );
final String[] testLibs = ArrayUtil.newArray( saveLibs, TEST_LIBS );
try
{
cfg.setLibraries( testLibs );
}
finally
{
cfg.setLibraries( saveLibs );
}
}
final Set<Libraries> all = getTestUtil().getAllAMX( Libraries.class );
for( final Libraries l : all )
{
final AMX amx = (AMX)l;
if ( DONT_TEST_LIBRARIES.contains( amx.getName() ) )
{
continue;
}
final ObjectName objectName = Util.getObjectName( amx );
final String[] saveLibs = l.getLibraries();
assert( saveLibs != null );
final String[] testLibs = ArrayUtil.newArray( saveLibs, TEST_LIBS );
try
{
l.setLibraries( testLibs );
}
catch( Exception e )
{
if ( ! READ_ONLY_LIBRARIES.contains( ((AMX)l).getName() ) )
{
warning ("Couldn't change Libraries Attribute for " + objectName +
" (probably read-only, though not advertised as such)" );
}
}
finally
{
l.setLibraries( saveLibs );
}
}
|