// Test the default values
assertEquals(new Integer(fullSize), ServerManagement.getAttribute(destObjectName, "FullSize"));
assertEquals(new Integer(pageSize), ServerManagement.getAttribute(destObjectName, "PageSize"));
assertEquals(new Integer(downCacheSize), ServerManagement.getAttribute(destObjectName, "DownCacheSize"));
JBossDestination jbd2;
if (isQueue())
{
jbd2 = new JBossQueue("PageableAttributes");
}
else
{
jbd2 = new JBossTopic("PageableAttributes");
}
ManagedDestination mDest = ServerManagement.getDestinationManager().getDestination(jbd2.getName(), jbd2.isQueue());
assertEquals(fullSize, mDest.getFullSize());
assertEquals(pageSize, mDest.getPageSize());
assertEquals(downCacheSize, mDest.getDownCacheSize());
// Try to change the values when destination lives, no effect
ServerManagement.setAttribute(destObjectName, "FullSize", "1111");
assertEquals(new Integer(fullSize), ServerManagement.getAttribute(destObjectName, "FullSize"));
ServerManagement.setAttribute(destObjectName, "PageSize", "222");
assertEquals(new Integer(pageSize), ServerManagement.getAttribute(destObjectName, "PageSize"));
ServerManagement.setAttribute(destObjectName, "DownCacheSize", "33");
assertEquals(new Integer(downCacheSize), ServerManagement.getAttribute(destObjectName, "DownCacheSize"));
// Stop the destination and change the value then test them from MBean
ServerManagement.invoke(destObjectName, "stop", null, null);
ServerManagement.setAttribute(destObjectName, "DownCacheSize", "9999");
assertEquals(new Integer(9999), ServerManagement.getAttribute(destObjectName, "DownCacheSize"));
ServerManagement.setAttribute(destObjectName, "PageSize", "20019");
assertEquals(new Integer(20019), ServerManagement.getAttribute(destObjectName, "PageSize"));
ServerManagement.setAttribute(destObjectName, "FullSize", "751119");
assertEquals(new Integer(751119), ServerManagement.getAttribute(destObjectName, "FullSize"));
// Start the service again and test the value from core destination
ServerManagement.invoke(destObjectName, "start", null, null);
mDest = ServerManagement.getDestinationManager().getDestination(jbd2.getName(), jbd2.isQueue());
// Must get the new core destination!
assertEquals(751119, mDest.getFullSize());
assertEquals(20019, mDest.getPageSize());
assertEquals(9999, mDest.getDownCacheSize());