[jboss-cvs] JBossAS SVN: r91129 - in branches/Branch_5_x/jmx: src and 39 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Jul 11 15:11:47 EDT 2009
Author: scott.stark at jboss.org
Date: 2009-07-11 15:11:42 -0400 (Sat, 11 Jul 2009)
New Revision: 91129
Added:
branches/Branch_5_x/jmx/src/tests/
branches/Branch_5_x/jmx/src/tests/test/
branches/Branch_5_x/jmx/src/tests/test/compliance/
branches/Branch_5_x/jmx/src/tests/test/compliance/ComplianceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/compliance/FullComplianceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/
branches/Branch_5_x/jmx/src/tests/test/implementation/ImplementationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoadingSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/AClass.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Start.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/StartMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Target.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TargetMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Test.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/User.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/NotificationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/Listener.java
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/Resource.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/RegistrySUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/ValuesTestCase.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/
branches/Branch_5_x/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/ServerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/
branches/Branch_5_x/jmx/src/tests/test/implementation/util/AgentIDTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/UtilSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ExtendedResource.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface2.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Resource.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceOverride.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/
branches/Branch_5_x/jmx/src/tests/test/performance/PerformanceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/InvocationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/Dyn.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/Resource.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/
branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/
branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/
branches/Branch_5_x/jmx/src/tests/test/performance/standard/InvocationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java
branches/Branch_5_x/jmx/src/tests/test/performance/timer/
branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java
branches/Branch_5_x/jmx/src/tests/test/serialization/
branches/Branch_5_x/jmx/src/tests/test/serialization/SerializationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/stress/
branches/Branch_5_x/jmx/src/tests/test/stress/ConcurrencyTestCase.java
branches/Branch_5_x/jmx/src/tests/test/stress/StressSUITE.java
branches/Branch_5_x/jmx/src/tests/test/stress/timer/
branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerTestCase.java
Removed:
branches/Branch_5_x/jmx/src/main/test/
branches/Branch_5_x/jmx/src/tests/test/
branches/Branch_5_x/jmx/src/tests/test/compliance/
branches/Branch_5_x/jmx/src/tests/test/compliance/ComplianceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/compliance/FullComplianceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/
branches/Branch_5_x/jmx/src/tests/test/implementation/ImplementationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoadingSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/AClass.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Start.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/StartMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Target.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TargetMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Test.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/User.java
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd
branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/NotificationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/Listener.java
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/Resource.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/RegistrySUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/ValuesTestCase.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/
branches/Branch_5_x/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/ServerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/
branches/Branch_5_x/jmx/src/tests/test/implementation/util/AgentIDTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/UtilSUITE.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ExtendedResource.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface2.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Resource.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceOverride.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java
branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/TrivialMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/
branches/Branch_5_x/jmx/src/tests/test/performance/PerformanceSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/InvocationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/
branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/Dyn.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/
branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/Resource.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/
branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/
branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/
branches/Branch_5_x/jmx/src/tests/test/performance/standard/InvocationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/ThroughputTEST.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/Standard.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBean.java
branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java
branches/Branch_5_x/jmx/src/tests/test/performance/timer/
branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java
branches/Branch_5_x/jmx/src/tests/test/serialization/
branches/Branch_5_x/jmx/src/tests/test/serialization/SerializationSUITE.java
branches/Branch_5_x/jmx/src/tests/test/stress/
branches/Branch_5_x/jmx/src/tests/test/stress/ConcurrencyTestCase.java
branches/Branch_5_x/jmx/src/tests/test/stress/StressSUITE.java
branches/Branch_5_x/jmx/src/tests/test/stress/timer/
branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerSUITE.java
branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerTestCase.java
Modified:
branches/Branch_5_x/jmx/.classpath
branches/Branch_5_x/jmx/pom.xml
Log:
Move the tests into a separate source tree
Modified: branches/Branch_5_x/jmx/.classpath
===================================================================
--- branches/Branch_5_x/jmx/.classpath 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/.classpath 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="src" path="src/tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
<classpathentry exported="true" kind="src" path="/mbeans"/>
Modified: branches/Branch_5_x/jmx/pom.xml
===================================================================
--- branches/Branch_5_x/jmx/pom.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/pom.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -14,23 +14,23 @@
<description>JBoss Application Server (jmx module)</description>
<build>
<sourceDirectory>src/main</sourceDirectory>
- <testResources>
+ <testSourceDirectory>src/tests</testSourceDirectory>
+ <testResources>
<testResource>
<directory>src/resources/test</directory>
</testResource>
</testResources>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>test/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
@@ -73,6 +73,7 @@
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-j2se</artifactId>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
@@ -93,4 +94,4 @@
<paulprop>hello</paulprop>
</properties>
-</project>
\ No newline at end of file
+</project>
Copied: branches/Branch_5_x/jmx/src/tests (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests)
Copied: branches/Branch_5_x/jmx/src/tests/test (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test)
Copied: branches/Branch_5_x/jmx/src/tests/test/compliance (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/compliance)
Deleted: branches/Branch_5_x/jmx/src/tests/test/compliance/ComplianceSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/compliance/ComplianceSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/compliance/ComplianceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.compliance;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Everything under test.compliance is a set of unit tests
- * which should pass as much as possible against the JMX RI
- *
- * Additions to this package are welcome/encouraged - adding a
- * test that fails is a great way to communicate a bug ;-)
- *
- * Anyone contributing to the JBoss JMX impl should seriously
- * consider providing a testcase prior to making code changes
- * in the impl itself - ala XP.
- *
- * The only restriction is that if the tests don't succeed against
- * the RI, the test error message should indicate that the test
- * will fail on the RI (preferred way) or at least comment the testcase
- * stating expected failures. Either way, you should comment the code
- * justifying why the test is valid despite failing against the RI.
- *
- * @author <a href="mailto:trevor at protocool.com">Trevor Squires</a>.
- */
-
-public class ComplianceSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- try
- {
- // Support for RI tracing, use -Dcom.sun.jmx.trace.level=x where x is one of 0, 1 or 2
- Class trace = Thread.currentThread().getContextClassLoader().loadClass("com.sun.jmx.trace.TraceImplementation");
- java.lang.reflect.Method init = trace.getMethod("init", new Class[] { Integer.TYPE });
- init.invoke(null, new Object[] { new Integer(System.getProperty("com.sun.jmx.trace.level")) });
- }
- catch (Exception ignored)
- {
- }
-
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All Compliance Tests");
-
- suite.addTest(org.jboss.test.jmx.compliance.ComplianceSUITE.suite());
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/compliance/ComplianceSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/compliance/ComplianceSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/compliance/ComplianceSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/compliance/ComplianceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.compliance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Everything under test.compliance is a set of unit tests
+ * which should pass as much as possible against the JMX RI
+ *
+ * Additions to this package are welcome/encouraged - adding a
+ * test that fails is a great way to communicate a bug ;-)
+ *
+ * Anyone contributing to the JBoss JMX impl should seriously
+ * consider providing a testcase prior to making code changes
+ * in the impl itself - ala XP.
+ *
+ * The only restriction is that if the tests don't succeed against
+ * the RI, the test error message should indicate that the test
+ * will fail on the RI (preferred way) or at least comment the testcase
+ * stating expected failures. Either way, you should comment the code
+ * justifying why the test is valid despite failing against the RI.
+ *
+ * @author <a href="mailto:trevor at protocool.com">Trevor Squires</a>.
+ */
+
+public class ComplianceSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ try
+ {
+ // Support for RI tracing, use -Dcom.sun.jmx.trace.level=x where x is one of 0, 1 or 2
+ Class trace = Thread.currentThread().getContextClassLoader().loadClass("com.sun.jmx.trace.TraceImplementation");
+ java.lang.reflect.Method init = trace.getMethod("init", new Class[] { Integer.TYPE });
+ init.invoke(null, new Object[] { new Integer(System.getProperty("com.sun.jmx.trace.level")) });
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All Compliance Tests");
+
+ suite.addTest(org.jboss.test.jmx.compliance.ComplianceSUITE.suite());
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/compliance/FullComplianceSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/compliance/FullComplianceSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/compliance/FullComplianceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.compliance;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This suite includes the timer and monitoring tests that take
- * a while to run.
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-
-public class FullComplianceSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All Compliance Tests");
- suite.addTest(org.jboss.test.jmx.compliance.FullComplianceSUITE.suite());
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/compliance/FullComplianceSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/compliance/FullComplianceSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/compliance/FullComplianceSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/compliance/FullComplianceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.compliance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * This suite includes the timer and monitoring tests that take
+ * a while to run.
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+
+public class FullComplianceSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All Compliance Tests");
+ suite.addTest(org.jboss.test.jmx.compliance.FullComplianceSUITE.suite());
+
+ return suite;
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/ImplementationSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/ImplementationSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/ImplementationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suites under <tt>test.implementation</tt> are used
- * to test internal JBossMX implementation and additional
- * functionality not covered in the JMX spec.
- *
- * This suite should be run with the compliance test suite
- * (see <tt>test.compliance</tt> package) whenever new
- * features are being added.
- *
- * @see test.compliance.ComplianceSUITE
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- */
-
-public class ImplementationSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
-
- if (System.getProperty("force.jvm.exit") != null &&
- System.getProperty("force.jvm.exit").equalsIgnoreCase("true"))
- System.exit(0);
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All JBossMX Implementation Tests");
-
- suite.addTest(test.implementation.util.UtilSUITE.suite());
- suite.addTest(test.implementation.persistence.PersistenceSUITE.suite());
- suite.addTest(test.implementation.loading.LoadingSUITE.suite());
- suite.addTest(test.implementation.server.ServerSUITE.suite());
- suite.addTest(test.implementation.registry.RegistrySUITE.suite());
- suite.addTest(test.implementation.modelmbean.ModelMBeanSUITE.suite());
- suite.addTest(test.implementation.interceptor.InterceptorSUITE.suite());
- suite.addTest(test.implementation.notification.NotificationSUITE.suite());
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/ImplementationSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/ImplementationSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/ImplementationSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/ImplementationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suites under <tt>test.implementation</tt> are used
+ * to test internal JBossMX implementation and additional
+ * functionality not covered in the JMX spec.
+ *
+ * This suite should be run with the compliance test suite
+ * (see <tt>test.compliance</tt> package) whenever new
+ * features are being added.
+ *
+ * @see test.compliance.ComplianceSUITE
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ */
+
+public class ImplementationSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+
+ if (System.getProperty("force.jvm.exit") != null &&
+ System.getProperty("force.jvm.exit").equalsIgnoreCase("true"))
+ System.exit(0);
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All JBossMX Implementation Tests");
+
+ suite.addTest(test.implementation.util.UtilSUITE.suite());
+ suite.addTest(test.implementation.persistence.PersistenceSUITE.suite());
+ suite.addTest(test.implementation.loading.LoadingSUITE.suite());
+ suite.addTest(test.implementation.server.ServerSUITE.suite());
+ suite.addTest(test.implementation.registry.RegistrySUITE.suite());
+ suite.addTest(test.implementation.modelmbean.ModelMBeanSUITE.suite());
+ suite.addTest(test.implementation.interceptor.InterceptorSUITE.suite());
+ suite.addTest(test.implementation.notification.NotificationSUITE.suite());
+
+ return suite;
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.interceptor;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class InterceptorSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Interceptor Tests");
-
- //suite.addTest(new TestSuite(InterceptorTEST.class));
- suite.addTest(new TestSuite(SharedInterceptorTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.interceptor;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class InterceptorSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Interceptor Tests");
+
+ //suite.addTest(new TestSuite(InterceptorTEST.class));
+ suite.addTest(new TestSuite(SharedInterceptorTEST.class));
+
+ return suite;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.interceptor;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.server.ServerConstants;
-import org.jboss.mx.service.ServiceConstants;
-
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class InterceptorTEST extends TestCase
- implements ServerConstants, ServiceConstants
-{
- public InterceptorTEST(String s)
- {
- super(s);
- }
-
-
-
-}
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/InterceptorTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.interceptor;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.server.ServerConstants;
+import org.jboss.mx.service.ServiceConstants;
+
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class InterceptorTEST extends TestCase
+ implements ServerConstants, ServiceConstants
+{
+ public InterceptorTEST(String s)
+ {
+ super(s);
+ }
+
+
+
+}
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.interceptor;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.server.Invocation;
-import org.jboss.mx.server.InvocationContext;
-import org.jboss.mx.server.ServerConstants;
-import org.jboss.mx.service.ServiceConstants;
-
-import test.implementation.interceptor.support.MySharedInterceptor;
-
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class SharedInterceptorTEST extends TestCase
- implements ServerConstants, ServiceConstants
-{
- public SharedInterceptorTEST(String s)
- {
- super(s);
- }
-
-
- public void testSharedInterceptor() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
-
- MySharedInterceptor shared = new MySharedInterceptor();
-
- ObjectName oname = shared.register(server);
-
- assertTrue(server.isRegistered(new ObjectName(
- JBOSSMX_DOMAIN + ":" + "type=Interceptor,name=MySharedInterceptor,ID=0"
- )));
-
- InvocationContext ic = new InvocationContext();
- Invocation i = new Invocation();
-
- i.addContext(ic);
- i.setType("bloopah");
-
- server.invoke(oname, "invoke",
- new Object[] { i },
- new String[] { Invocation.class.getName() }
- );
-
- assertTrue(i.getType().equals("something"));
- }
-
- public void testIsShared() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
-
- MySharedInterceptor shared = new MySharedInterceptor();
-
- assertTrue(shared.isShared() == false);
-
- shared.register(server);
-
- assertTrue(shared.isShared() == true);
- }
-
- public void testLifecycleCallbacks() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
-
- MySharedInterceptor shared = new MySharedInterceptor();
-
- assertTrue(shared.isInit == false);
- assertTrue(shared.isStart == false);
-
- ObjectName oname = shared.register(server);
-
- assertTrue(shared.isInit == true);
- assertTrue(shared.isStart == true);
-
- assertTrue(shared.isStop == false);
- assertTrue(shared.isDestroy == false);
-
- server.unregisterMBean(oname);
-
- assertTrue(shared.isStop == true);
- assertTrue(shared.isDestroy = true);
- }
-
-
-
-
-
-}
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/SharedInterceptorTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.interceptor;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.server.Invocation;
+import org.jboss.mx.server.InvocationContext;
+import org.jboss.mx.server.ServerConstants;
+import org.jboss.mx.service.ServiceConstants;
+
+import test.implementation.interceptor.support.MySharedInterceptor;
+
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class SharedInterceptorTEST extends TestCase
+ implements ServerConstants, ServiceConstants
+{
+ public SharedInterceptorTEST(String s)
+ {
+ super(s);
+ }
+
+
+ public void testSharedInterceptor() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+
+ MySharedInterceptor shared = new MySharedInterceptor();
+
+ ObjectName oname = shared.register(server);
+
+ assertTrue(server.isRegistered(new ObjectName(
+ JBOSSMX_DOMAIN + ":" + "type=Interceptor,name=MySharedInterceptor,ID=0"
+ )));
+
+ InvocationContext ic = new InvocationContext();
+ Invocation i = new Invocation();
+
+ i.addContext(ic);
+ i.setType("bloopah");
+
+ server.invoke(oname, "invoke",
+ new Object[] { i },
+ new String[] { Invocation.class.getName() }
+ );
+
+ assertTrue(i.getType().equals("something"));
+ }
+
+ public void testIsShared() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+
+ MySharedInterceptor shared = new MySharedInterceptor();
+
+ assertTrue(shared.isShared() == false);
+
+ shared.register(server);
+
+ assertTrue(shared.isShared() == true);
+ }
+
+ public void testLifecycleCallbacks() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+
+ MySharedInterceptor shared = new MySharedInterceptor();
+
+ assertTrue(shared.isInit == false);
+ assertTrue(shared.isStart == false);
+
+ ObjectName oname = shared.register(server);
+
+ assertTrue(shared.isInit == true);
+ assertTrue(shared.isStart == true);
+
+ assertTrue(shared.isStop == false);
+ assertTrue(shared.isDestroy == false);
+
+ server.unregisterMBean(oname);
+
+ assertTrue(shared.isStop == true);
+ assertTrue(shared.isDestroy = true);
+ }
+
+
+
+
+
+}
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.interceptor.support;
-
-import org.jboss.mx.interceptor.AbstractSharedInterceptor;
-import org.jboss.mx.server.Invocation;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class MySharedInterceptor
- extends AbstractSharedInterceptor
-{
-
- public boolean isInit = false;
- public boolean isStart = false;
- public boolean isStop = false;
- public boolean isDestroy = false;
-
- public MySharedInterceptor()
- {
- super("MySharedInterceptor");
- }
-
- public Object invoke(Invocation i) throws Throwable
- {
- i.setType("something");
-
- return super.invoke(i);
- }
-
- public void init() throws Exception
- {
- isInit = true;
- }
-
- public void start()
- {
- isStart = true;
- }
-
- public void stop() throws Exception
- {
- isStop = true;
- }
-
- public void destroy()
- {
- isDestroy = true;
- }
-
-}
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/interceptor/support/MySharedInterceptor.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.interceptor.support;
+
+import org.jboss.mx.interceptor.AbstractSharedInterceptor;
+import org.jboss.mx.server.Invocation;
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class MySharedInterceptor
+ extends AbstractSharedInterceptor
+{
+
+ public boolean isInit = false;
+ public boolean isStart = false;
+ public boolean isStop = false;
+ public boolean isDestroy = false;
+
+ public MySharedInterceptor()
+ {
+ super("MySharedInterceptor");
+ }
+
+ public Object invoke(Invocation i) throws Throwable
+ {
+ i.setType("something");
+
+ return super.invoke(i);
+ }
+
+ public void init() throws Exception
+ {
+ isInit = true;
+ }
+
+ public void start()
+ {
+ isStart = true;
+ }
+
+ public void stop() throws Exception
+ {
+ isStop = true;
+ }
+
+ public void destroy()
+ {
+ isDestroy = true;
+ }
+
+}
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,151 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading;
-
-import java.net.URL;
-
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.loading.DefaultLoaderRepository;
-import javax.management.loading.MLet;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.loading.LoaderRepository;
-import org.jboss.mx.loading.RepositoryClassLoader;
-import org.jboss.mx.server.ServerConstants;
-import org.jboss.mx.util.AgentID;
-
-public class LoaderRepositoryTEST extends TestCase implements ServerConstants
-{
- public LoaderRepositoryTEST(String s)
- {
- super(s);
- }
-
- public void testRemoveDuplicateURL() throws Exception
- {
- // NOTE:
- // the urls used here are relative to the location of the build.xml
- final URL url = new URL("file:./output/etc/test/implementation/loading/MyMBeans.jar");
-
- // Retrieve the loader repository
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- LoaderRepository lr = (LoaderRepository)server.getClassLoaderRepository();
-
- // Should not be able to load the class
- try
- {
- lr.loadClass("test.implementation.loading.support.Trivial");
- fail("test.implementation.loading.support.Trivial is already visible");
- }
- catch (ClassNotFoundException expected) {}
-
- // Add the URL to the repository twice
- RepositoryClassLoader ucl1 = lr.newClassLoader(url, true);
- RepositoryClassLoader ucl2 = lr.newClassLoader(url, true);
-
- // Should be able to load the class
- lr.loadClass("test.implementation.loading.support.Trivial");
-
- // Remove one
- ucl1.unregister();
-
- // Should still be able to load the class
- lr.loadClass("test.implementation.loading.support.Trivial");
-
- // Remove the other
- ucl2.unregister();
- }
-
- public void testClassConflictBetweenMLets() throws Exception
- {
- // NOTE:
- // the urls used here are relative to the location of the build.xml
-
- // make sure the classes are loaded from mlet, not system cl
- String[] classes = { "test.implementation.loading.support.Start",
- "test.implementation.loading.support.StartMBean",
- "test.implementation.loading.support.Target",
- "test.implementation.loading.support.TargetMBean",
- "test.implementation.loading.support.AClass"
- };
-
- for (int i = 0; i < classes.length; ++i)
- {
- try
- {
- DefaultLoaderRepository.loadClass(classes[i]);
-
- fail("class " + classes[i] + " was already found in CL repository.");
- }
- catch (ClassNotFoundException e)
- {
- // expected
- }
- }
-
- try
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- MLet mlet1 = new MLet();
- MLet mlet2 = new MLet();
- ObjectName m1Name = new ObjectName(":name=mlet1");
- ObjectName m2Name = new ObjectName(":name=mlet2");
-
- server.registerMBean(mlet1, m1Name);
- server.registerMBean(mlet2, m2Name);
-
- server.invoke(m1Name, "getMBeansFromURL",
- new Object[] { "file:./output/etc/test/implementation/loading/CCTest1.mlet" },
- new String[] { String.class.getName() }
- );
-
- server.invoke(m2Name, "getMBeansFromURL",
- new Object[] { "file:./output/etc/test/implementation/loading/CCTest2.mlet" },
- new String[] { String.class.getName() }
- );
-
- server.invoke(new ObjectName(":name=Start"), "startOp",
- new Object[] { AgentID.get(server) },
- new String[] { String.class.getName() }
- );
-
- //fail("Expected to fail due to two different mlet loaders having a class mismatch.");
- }
- catch (MBeanException e)
- {
- if (e.getTargetException() instanceof ReflectionException)
- {
- // expected, argument type mismatch error since the arg of type AClass is
- // loaded by diff mlet loader than the target MBean with AClass in its sign.
- if (System.getProperty(LOADER_REPOSITORY_CLASS_PROPERTY).equals(UNIFIED_LOADER_REPOSITORY_CLASS))
- throw e;
- }
- else throw e;
- }
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoaderRepositoryTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading;
+
+import java.net.URL;
+
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.management.loading.DefaultLoaderRepository;
+import javax.management.loading.MLet;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.loading.LoaderRepository;
+import org.jboss.mx.loading.RepositoryClassLoader;
+import org.jboss.mx.server.ServerConstants;
+import org.jboss.mx.util.AgentID;
+
+public class LoaderRepositoryTEST extends TestCase implements ServerConstants
+{
+ public LoaderRepositoryTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testRemoveDuplicateURL() throws Exception
+ {
+ // NOTE:
+ // the urls used here are relative to the location of the build.xml
+ final URL url = new URL("file:./output/etc/test/implementation/loading/MyMBeans.jar");
+
+ // Retrieve the loader repository
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ LoaderRepository lr = (LoaderRepository)server.getClassLoaderRepository();
+
+ // Should not be able to load the class
+ try
+ {
+ lr.loadClass("test.implementation.loading.support.Trivial");
+ fail("test.implementation.loading.support.Trivial is already visible");
+ }
+ catch (ClassNotFoundException expected) {}
+
+ // Add the URL to the repository twice
+ RepositoryClassLoader ucl1 = lr.newClassLoader(url, true);
+ RepositoryClassLoader ucl2 = lr.newClassLoader(url, true);
+
+ // Should be able to load the class
+ lr.loadClass("test.implementation.loading.support.Trivial");
+
+ // Remove one
+ ucl1.unregister();
+
+ // Should still be able to load the class
+ lr.loadClass("test.implementation.loading.support.Trivial");
+
+ // Remove the other
+ ucl2.unregister();
+ }
+
+ public void testClassConflictBetweenMLets() throws Exception
+ {
+ // NOTE:
+ // the urls used here are relative to the location of the build.xml
+
+ // make sure the classes are loaded from mlet, not system cl
+ String[] classes = { "test.implementation.loading.support.Start",
+ "test.implementation.loading.support.StartMBean",
+ "test.implementation.loading.support.Target",
+ "test.implementation.loading.support.TargetMBean",
+ "test.implementation.loading.support.AClass"
+ };
+
+ for (int i = 0; i < classes.length; ++i)
+ {
+ try
+ {
+ DefaultLoaderRepository.loadClass(classes[i]);
+
+ fail("class " + classes[i] + " was already found in CL repository.");
+ }
+ catch (ClassNotFoundException e)
+ {
+ // expected
+ }
+ }
+
+ try
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ MLet mlet1 = new MLet();
+ MLet mlet2 = new MLet();
+ ObjectName m1Name = new ObjectName(":name=mlet1");
+ ObjectName m2Name = new ObjectName(":name=mlet2");
+
+ server.registerMBean(mlet1, m1Name);
+ server.registerMBean(mlet2, m2Name);
+
+ server.invoke(m1Name, "getMBeansFromURL",
+ new Object[] { "file:./output/etc/test/implementation/loading/CCTest1.mlet" },
+ new String[] { String.class.getName() }
+ );
+
+ server.invoke(m2Name, "getMBeansFromURL",
+ new Object[] { "file:./output/etc/test/implementation/loading/CCTest2.mlet" },
+ new String[] { String.class.getName() }
+ );
+
+ server.invoke(new ObjectName(":name=Start"), "startOp",
+ new Object[] { AgentID.get(server) },
+ new String[] { String.class.getName() }
+ );
+
+ //fail("Expected to fail due to two different mlet loaders having a class mismatch.");
+ }
+ catch (MBeanException e)
+ {
+ if (e.getTargetException() instanceof ReflectionException)
+ {
+ // expected, argument type mismatch error since the arg of type AClass is
+ // loaded by diff mlet loader than the target MBean with AClass in its sign.
+ if (System.getProperty(LOADER_REPOSITORY_CLASS_PROPERTY).equals(UNIFIED_LOADER_REPOSITORY_CLASS))
+ throw e;
+ }
+ else throw e;
+ }
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoadingSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/LoadingSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoadingSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class LoadingSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Loader Tests");
-
- suite.addTest(new TestSuite(LoaderRepositoryTEST.class));
- suite.addTest(new TestSuite(MLetVersionTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoadingSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/LoadingSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoadingSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/LoadingSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class LoadingSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Loader Tests");
+
+ suite.addTest(new TestSuite(LoaderRepositoryTEST.class));
+ suite.addTest(new TestSuite(MLetVersionTEST.class));
+
+ return suite;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,215 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading;
-
-import java.util.List;
-
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import javax.management.loading.MLet;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.server.ServerConstants;
-import org.jboss.mx.util.MBeanInstaller;
-
-public class MLetVersionTEST extends TestCase
-{
- public MLetVersionTEST(String s)
- {
- super(s);
- }
-
- public void testMLetFileLoadWithVersion() throws Exception
- {
- // NOTE:
- // the urls used here are relative to the location of the build.xml
-
- final String MLET_URL1 = "file:./output/etc/test/implementation/loading/MLetVersion1.mlet";
- final String MLET_URL2 = "file:./output/etc/test/implementation/loading/MLetVersion2.mlet";
-
- ObjectName registry = new ObjectName(ServerConstants.MBEAN_REGISTRY);
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- MLet mlet = new MLet();
- ObjectName name = new ObjectName("test:name=mlet");
- server.registerMBean(mlet, name);
-
- // Repeat to call the getMBeansFromURL method
-
- server.invoke(name, "getMBeansFromURL",
- new Object[] { MLET_URL1 },
- new String[] { String.class.getName() }
- );
-
- server.invoke(name, "getMBeansFromURL",
- new Object[] { MLET_URL2 },
- new String[] { String.class.getName() }
- );
-
- try
- {
- List versions1 =
- (List) server.invoke(registry, "getValue",
- new Object[]
- {
- new ObjectName("test:name=Trivial"),
- MBeanInstaller.VERSIONS
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
- List versions2 =
- (List) server.invoke(registry, "getValue",
- new Object[]
- {
- new ObjectName("test:name=Trivial2"),
- MBeanInstaller.VERSIONS
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
-
- assertTrue("Trivial1 version=" + versions1, ((String)versions1.get(0)).equals("1.1"));
- assertTrue("Trivial2 version=" + versions2, ((String)versions2.get(0)).equals("2.1"));
- }
- catch (MBeanException e)
- {
- e.printStackTrace();
- assertTrue(false);
- }
-
- assertTrue(server.isRegistered(new ObjectName("test:name=Trivial")));
- assertTrue(server.isRegistered(new ObjectName("test:name=Trivial2")));
-
- assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial")) != null);
- assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial2")) != null);
-
- assertTrue(server.getAttribute(new ObjectName("test:name=Trivial2"), "Something").equals("foo"));
-
- server.invoke(new ObjectName("test:name=Trivial"), "doOperation",
- new Object[] { "Test" },
- new String[] { String.class.getName() }
- );
-
- server.invoke(new ObjectName("test:name=Trivial2"), "doOperation",
- new Object[] { "Test" },
- new String[] { String.class.getName() }
- );
-
- }
-
-
- public void testMLetFileLoadWithVersion2() throws Exception
- {
- // NOTE:
- // the urls used here are relative to the location of the build.xml
-
- final String MLET_URL1 = "file:./output/etc/test/implementation/loading/MLetVersion3.mlet";
- final String MLET_URL2 = "file:./output/etc/test/implementation/loading/MLetVersion4.mlet";
-
- ObjectName registry = new ObjectName(ServerConstants.MBEAN_REGISTRY);
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- MLet mlet = new MLet();
- ObjectName name = new ObjectName("test:name=mlet");
- server.registerMBean(mlet, name);
-
- // Repeat to call the getMBeansFromURL method
-
- server.invoke(name, "getMBeansFromURL",
- new Object[] { MLET_URL1 },
- new String[] { String.class.getName() }
- );
-
- server.invoke(name, "getMBeansFromURL",
- new Object[] { MLET_URL2 },
- new String[] { String.class.getName() }
- );
-
- try
- {
- List versions1 =
- (List) server.invoke(registry, "getValue",
- new Object[]
- {
- new ObjectName("test:name=Trivial,round=2"),
- MBeanInstaller.VERSIONS
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
- List versions2 =
- (List) server.invoke(registry, "getValue",
- new Object[]
- {
- new ObjectName("test:name=Trivial2,round=2"),
- MBeanInstaller.VERSIONS
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
-
- assertTrue("Trivial1 version=" + versions1, versions1 == null);
- assertTrue("Trivial2 version=" + versions2, ((String)versions2.get(0)).equals("5.1"));
- }
- catch (MBeanException e)
- {
- e.printStackTrace();
- assertTrue(false);
- }
-
- assertTrue(server.isRegistered(new ObjectName("test:name=Trivial,round=2")));
- assertTrue(server.isRegistered(new ObjectName("test:name=Trivial2,round=2")));
-
- assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial,round=2")) != null);
- assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial2,round=2")) != null);
-
- assertTrue(server.getAttribute(new ObjectName("test:name=Trivial2,round=2"), "Something").equals("foo"));
-
- server.invoke(new ObjectName("test:name=Trivial,round=2"), "doOperation",
- new Object[] { "Test" },
- new String[] { String.class.getName() }
- );
-
- server.invoke(new ObjectName("test:name=Trivial2,round=2"), "doOperation",
- new Object[] { "Test" },
- new String[] { String.class.getName() }
- );
-
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/MLetVersionTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,215 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading;
+
+import java.util.List;
+
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+import javax.management.loading.MLet;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.server.ServerConstants;
+import org.jboss.mx.util.MBeanInstaller;
+
+public class MLetVersionTEST extends TestCase
+{
+ public MLetVersionTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testMLetFileLoadWithVersion() throws Exception
+ {
+ // NOTE:
+ // the urls used here are relative to the location of the build.xml
+
+ final String MLET_URL1 = "file:./output/etc/test/implementation/loading/MLetVersion1.mlet";
+ final String MLET_URL2 = "file:./output/etc/test/implementation/loading/MLetVersion2.mlet";
+
+ ObjectName registry = new ObjectName(ServerConstants.MBEAN_REGISTRY);
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ MLet mlet = new MLet();
+ ObjectName name = new ObjectName("test:name=mlet");
+ server.registerMBean(mlet, name);
+
+ // Repeat to call the getMBeansFromURL method
+
+ server.invoke(name, "getMBeansFromURL",
+ new Object[] { MLET_URL1 },
+ new String[] { String.class.getName() }
+ );
+
+ server.invoke(name, "getMBeansFromURL",
+ new Object[] { MLET_URL2 },
+ new String[] { String.class.getName() }
+ );
+
+ try
+ {
+ List versions1 =
+ (List) server.invoke(registry, "getValue",
+ new Object[]
+ {
+ new ObjectName("test:name=Trivial"),
+ MBeanInstaller.VERSIONS
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+ List versions2 =
+ (List) server.invoke(registry, "getValue",
+ new Object[]
+ {
+ new ObjectName("test:name=Trivial2"),
+ MBeanInstaller.VERSIONS
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+
+ assertTrue("Trivial1 version=" + versions1, ((String)versions1.get(0)).equals("1.1"));
+ assertTrue("Trivial2 version=" + versions2, ((String)versions2.get(0)).equals("2.1"));
+ }
+ catch (MBeanException e)
+ {
+ e.printStackTrace();
+ assertTrue(false);
+ }
+
+ assertTrue(server.isRegistered(new ObjectName("test:name=Trivial")));
+ assertTrue(server.isRegistered(new ObjectName("test:name=Trivial2")));
+
+ assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial")) != null);
+ assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial2")) != null);
+
+ assertTrue(server.getAttribute(new ObjectName("test:name=Trivial2"), "Something").equals("foo"));
+
+ server.invoke(new ObjectName("test:name=Trivial"), "doOperation",
+ new Object[] { "Test" },
+ new String[] { String.class.getName() }
+ );
+
+ server.invoke(new ObjectName("test:name=Trivial2"), "doOperation",
+ new Object[] { "Test" },
+ new String[] { String.class.getName() }
+ );
+
+ }
+
+
+ public void testMLetFileLoadWithVersion2() throws Exception
+ {
+ // NOTE:
+ // the urls used here are relative to the location of the build.xml
+
+ final String MLET_URL1 = "file:./output/etc/test/implementation/loading/MLetVersion3.mlet";
+ final String MLET_URL2 = "file:./output/etc/test/implementation/loading/MLetVersion4.mlet";
+
+ ObjectName registry = new ObjectName(ServerConstants.MBEAN_REGISTRY);
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ MLet mlet = new MLet();
+ ObjectName name = new ObjectName("test:name=mlet");
+ server.registerMBean(mlet, name);
+
+ // Repeat to call the getMBeansFromURL method
+
+ server.invoke(name, "getMBeansFromURL",
+ new Object[] { MLET_URL1 },
+ new String[] { String.class.getName() }
+ );
+
+ server.invoke(name, "getMBeansFromURL",
+ new Object[] { MLET_URL2 },
+ new String[] { String.class.getName() }
+ );
+
+ try
+ {
+ List versions1 =
+ (List) server.invoke(registry, "getValue",
+ new Object[]
+ {
+ new ObjectName("test:name=Trivial,round=2"),
+ MBeanInstaller.VERSIONS
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+ List versions2 =
+ (List) server.invoke(registry, "getValue",
+ new Object[]
+ {
+ new ObjectName("test:name=Trivial2,round=2"),
+ MBeanInstaller.VERSIONS
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+
+ assertTrue("Trivial1 version=" + versions1, versions1 == null);
+ assertTrue("Trivial2 version=" + versions2, ((String)versions2.get(0)).equals("5.1"));
+ }
+ catch (MBeanException e)
+ {
+ e.printStackTrace();
+ assertTrue(false);
+ }
+
+ assertTrue(server.isRegistered(new ObjectName("test:name=Trivial,round=2")));
+ assertTrue(server.isRegistered(new ObjectName("test:name=Trivial2,round=2")));
+
+ assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial,round=2")) != null);
+ assertTrue(server.getMBeanInfo(new ObjectName("test:name=Trivial2,round=2")) != null);
+
+ assertTrue(server.getAttribute(new ObjectName("test:name=Trivial2,round=2"), "Something").equals("foo"));
+
+ server.invoke(new ObjectName("test:name=Trivial,round=2"), "doOperation",
+ new Object[] { "Test" },
+ new String[] { String.class.getName() }
+ );
+
+ server.invoke(new ObjectName("test:name=Trivial2,round=2"), "doOperation",
+ new Object[] { "Test" },
+ new String[] { String.class.getName() }
+ );
+
+ }
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/AClass.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/AClass.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/AClass.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,29 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-
-public class AClass
-{
-
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/AClass.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/AClass.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/AClass.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/AClass.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+
+public class AClass
+{
+
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Start.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Start.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Start.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-/**
- * Start MBean invokes Target MBean with an arg AClass that
- * both MBeans have loaded using different MLet loaders.
- *
- * @see <related>
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class Start
- implements StartMBean
-{
-
- public void startOp(String agentID) throws Exception
- {
- MBeanServer server = (MBeanServer)MBeanServerFactory.findMBeanServer(agentID).get(0);
-
- server.invoke(new ObjectName(":name=Target"), "executeTarget",
- new Object[] { new AClass() },
- new String[] { AClass.class.getName() }
- );
- }
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Start.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Start.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Start.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Start.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+import javax.management.ObjectName;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+/**
+ * Start MBean invokes Target MBean with an arg AClass that
+ * both MBeans have loaded using different MLet loaders.
+ *
+ * @see <related>
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class Start
+ implements StartMBean
+{
+
+ public void startOp(String agentID) throws Exception
+ {
+ MBeanServer server = (MBeanServer)MBeanServerFactory.findMBeanServer(agentID).get(0);
+
+ server.invoke(new ObjectName(":name=Target"), "executeTarget",
+ new Object[] { new AClass() },
+ new String[] { AClass.class.getName() }
+ );
+ }
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/StartMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/StartMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/StartMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-/**
- * Start MBean invokes Target MBean with an arg AClass that
- * both MBeans have loaded using different MLet loaders.
- *
- * @see <related>
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public interface StartMBean
-{
-
- public void startOp(String agentID) throws Exception;
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/StartMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/StartMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/StartMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/StartMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+/**
+ * Start MBean invokes Target MBean with an arg AClass that
+ * both MBeans have loaded using different MLet loaders.
+ *
+ * @see <related>
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public interface StartMBean
+{
+
+ public void startOp(String agentID) throws Exception;
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Target.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Target.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Target.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-/**
- * Target attempts to place the arg to instance field.
- *
- * @see <related>
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class Target
- implements TargetMBean
-{
-
- AClass a;
-
- public void executeTarget(AClass a)
- {
- this.a = a;
- }
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Target.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Target.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Target.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Target.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+/**
+ * Target attempts to place the arg to instance field.
+ *
+ * @see <related>
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class Target
+ implements TargetMBean
+{
+
+ AClass a;
+
+ public void executeTarget(AClass a)
+ {
+ this.a = a;
+ }
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TargetMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/TargetMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TargetMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-/**
- * Target attempts to place the arg to instance field.
- *
- * @see <related>
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public interface TargetMBean
-{
-
- public void executeTarget(AClass a);
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TargetMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/TargetMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TargetMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TargetMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+/**
+ * Target attempts to place the arg to instance field.
+ *
+ * @see <related>
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public interface TargetMBean
+{
+
+ public void executeTarget(AClass a);
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Trivial.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-/**
- * Goes into MyMBeans.jar
- */
-public class Trivial implements TrivialMBean
-{
- private String something = null;
- private boolean anAttribute = true;
-
- public void setSomething(String thing)
- {
- this.something = thing;
- }
-
- public String getSomething()
- {
- return something;
- }
-
- public void doOperation(String arg)
- {
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Trivial.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+/**
+ * Goes into MyMBeans.jar
+ */
+public class Trivial implements TrivialMBean
+{
+ private String something = null;
+ private boolean anAttribute = true;
+
+ public void setSomething(String thing)
+ {
+ this.something = thing;
+ }
+
+ public String getSomething()
+ {
+ return something;
+ }
+
+ public void doOperation(String arg)
+ {
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Trivial2.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-/**
- * Goes into MyMBeans.jar
- */
-public class Trivial2 implements Trivial2MBean
-{
- private String something = null;
- private boolean anAttribute = true;
-
- public Trivial2(String aa)
- {
- this.something = aa;
- }
-
- public void setSomething(String thing)
- {
- this.something = thing;
- }
-
- public String getSomething()
- {
- return something;
- }
-
- public void doOperation(String arg)
- {
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Trivial2.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+/**
+ * Goes into MyMBeans.jar
+ */
+public class Trivial2 implements Trivial2MBean
+{
+ private String something = null;
+ private boolean anAttribute = true;
+
+ public Trivial2(String aa)
+ {
+ this.something = aa;
+ }
+
+ public void setSomething(String thing)
+ {
+ this.something = thing;
+ }
+
+ public String getSomething()
+ {
+ return something;
+ }
+
+ public void doOperation(String arg)
+ {
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-/**
- * Goes into MyMBeans.jar
- */
-public interface Trivial2MBean
-{
- void setSomething(String thing);
-
- String getSomething();
-
- void doOperation(String arg);
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/Trivial2MBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+/**
+ * Goes into MyMBeans.jar
+ */
+public interface Trivial2MBean
+{
+ void setSomething(String thing);
+
+ String getSomething();
+
+ void doOperation(String arg);
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.loading.support;
-
-/**
- * Goes into MyMBeans.jar
- */
-public interface TrivialMBean
-{
- void setSomething(String thing);
-
- String getSomething();
-
- void doOperation(String arg);
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/loading/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.loading.support;
+
+/**
+ * Goes into MyMBeans.jar
+ */
+public interface TrivialMBean
+{
+ void setSomething(String thing);
+
+ String getSomething();
+
+ void doOperation(String arg);
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,271 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.modelmbean;
-
-import javax.management.Attribute;
-import javax.management.AttributeChangeNotification;
-import javax.management.Descriptor;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.modelmbean.DescriptorSupport;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.modelmbean.XMBean;
-import org.jboss.mx.modelmbean.XMBeanConstants;
-
-import test.implementation.modelmbean.support.Test;
-
-/**
- * Tests attribute caching and operation mapping for XMBean.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class AttributeCacheTEST extends TestCase implements XMBeanConstants
-{
- public AttributeCacheTEST(String s)
- {
- super(s);
- }
-
- /**
- * Tests that attribute values are not cached if nothing is declared in xml.
- *
- * This test uses the xmbean.dtd
- */
- public void testImplicitDisabledAttributeCaching() throws Exception
- {
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Test resource = new Test();
-
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, resource);
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- ObjectName name = new ObjectName(":test=test");
- server.registerMBean(mmb, name);
-
- for (int i = 0; i < 10; ++i)
- {
- server.setAttribute(name, new Attribute("Something", "foo"));
- server.getAttribute(name, "Something");
- }
-
- assertTrue(resource.getFooCount() == 10);
- assertTrue(resource.getBarCount() == 10);
- }
-
- /**
- * Tests that attribute values are not cached if currencyTimeLimit = 0
- *
- * This test uses the xmbean.dtd
- */
- public void testExplicitDisabledAttributeCaching() throws Exception
- {
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Test resource = new Test();
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, resource);
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- ObjectName name = new ObjectName(":test=test");
- server.registerMBean(mmb, name);
-
- for (int i = 0; i < 8; ++i)
- {
- server.setAttribute(name, new Attribute("Something", "foo"));
- server.getAttribute(name, "Something");
- }
-
- assertTrue(resource.getFooCount() == 8);
- assertTrue(resource.getBarCount() == 8);
-
- }
-
- /**
- * Tests attribute that is never stale (currencyTimeLimit = -1)
- *
- * This test uses the xmbean.dtd
- */
- public void testNeverStaleAttributeCaching() throws Exception
- {
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Test resource = new Test();
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, resource);
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- ObjectName name = new ObjectName(":test=test");
- server.registerMBean(mmb, name);
-
- for (int i = 0; i < 11; ++i)
- {
- server.setAttribute(name, new Attribute("Something", "foo"));
- server.getAttribute(name, "Something");
- }
-
- assertTrue(resource.getFooCount() == 11);
- assertTrue(resource.getBarCount() == 0);
- }
-
- /**
- * Tests attribute that caches the value for 10 secs.
- *
- * This test uses the xmbean.dtd
- */
- public void testCachedAttribute() throws Exception
- {
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Test resource = new Test();
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, resource);
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- ObjectName name = new ObjectName(":test=test");
- server.registerMBean(mmb, name);
-
- for (int i = 0; i < 7; ++i)
- {
- server.setAttribute(name, new Attribute("Something", "foo"));
- server.getAttribute(name, "Something");
- }
-
- assertTrue(resource.getFooCount() == 7);
- assertTrue(resource.getBarCount() == 0);
- }
-
- /**
- * Tests attribute that caches the value for 1 secs.
- *
- * This test uses the xmbean.dtd
- */
- public void testCachedAttribute2() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Test resource = new Test();
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, resource);
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- ObjectName name = new ObjectName(":test=test");
- server.registerMBean(mmb, name);
-
- server.getAttribute(name, "Something");
-
- assertTrue(resource.getBarCount() == 1);
-
- server.setAttribute(name, new Attribute("Something", "yksi"));
-
- assertTrue(resource.getFooCount() == 1);
-
- String str = (String)server.getAttribute(name, "Something");
-
- assertTrue(resource.getBarCount() == 1);
- assertTrue(str.equals("yksi"));
-
- try { Thread.sleep(1100); } catch (Throwable t) {}
-
- server.getAttribute(name, "Something");
-
- assertTrue(resource.getBarCount() == 2);
-
- server.setAttribute(name, new Attribute("Something", "kaksi"));
-
- assertTrue(resource.getFooCount() == 2);
-
- try { Thread.sleep(1100); } catch (Throwable t) {}
-
- str = (String)server.getAttribute(name, "Something");
-
- assertTrue(resource.getBarCount() == 3);
- assertTrue(str.equals("kaksi"));
-
- str = (String)server.getAttribute(name, "Something");
-
- assertTrue(resource.getBarCount() == 3);
- assertTrue(str.equals("kaksi"));
- }
-
- /**
- * Tests attribute change notifications
- */
- public void testAttributeChangeNotifications() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Test resource = new Test();
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, resource);
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- ObjectName name = new ObjectName(":test=test");
- server.registerMBean(mmb, name);
-
- class MyNotificationListener implements NotificationListener
- {
- int notifCount = 0;
-
- public void handleNotification(Notification notification, Object handback)
- {
- AttributeChangeNotification notif = (AttributeChangeNotification)notification;
-
- assertTrue(notif.getNewValue().equals("somevalue"));
-
- notifCount++;
- }
- }
-
- MyNotificationListener listener = new MyNotificationListener();
- server.addNotificationListener(name, listener, null, null);
-
- for (int i = 0; i < 10; ++i)
- server.setAttribute(name, new Attribute("Something", "somevalue"));
-
- assertTrue(listener.notifCount == 10);
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/AttributeCacheTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,271 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.modelmbean;
+
+import javax.management.Attribute;
+import javax.management.AttributeChangeNotification;
+import javax.management.Descriptor;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.modelmbean.DescriptorSupport;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.modelmbean.XMBean;
+import org.jboss.mx.modelmbean.XMBeanConstants;
+
+import test.implementation.modelmbean.support.Test;
+
+/**
+ * Tests attribute caching and operation mapping for XMBean.
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class AttributeCacheTEST extends TestCase implements XMBeanConstants
+{
+ public AttributeCacheTEST(String s)
+ {
+ super(s);
+ }
+
+ /**
+ * Tests that attribute values are not cached if nothing is declared in xml.
+ *
+ * This test uses the xmbean.dtd
+ */
+ public void testImplicitDisabledAttributeCaching() throws Exception
+ {
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Test resource = new Test();
+
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, resource);
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ ObjectName name = new ObjectName(":test=test");
+ server.registerMBean(mmb, name);
+
+ for (int i = 0; i < 10; ++i)
+ {
+ server.setAttribute(name, new Attribute("Something", "foo"));
+ server.getAttribute(name, "Something");
+ }
+
+ assertTrue(resource.getFooCount() == 10);
+ assertTrue(resource.getBarCount() == 10);
+ }
+
+ /**
+ * Tests that attribute values are not cached if currencyTimeLimit = 0
+ *
+ * This test uses the xmbean.dtd
+ */
+ public void testExplicitDisabledAttributeCaching() throws Exception
+ {
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Test resource = new Test();
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, resource);
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ ObjectName name = new ObjectName(":test=test");
+ server.registerMBean(mmb, name);
+
+ for (int i = 0; i < 8; ++i)
+ {
+ server.setAttribute(name, new Attribute("Something", "foo"));
+ server.getAttribute(name, "Something");
+ }
+
+ assertTrue(resource.getFooCount() == 8);
+ assertTrue(resource.getBarCount() == 8);
+
+ }
+
+ /**
+ * Tests attribute that is never stale (currencyTimeLimit = -1)
+ *
+ * This test uses the xmbean.dtd
+ */
+ public void testNeverStaleAttributeCaching() throws Exception
+ {
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Test resource = new Test();
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, resource);
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ ObjectName name = new ObjectName(":test=test");
+ server.registerMBean(mmb, name);
+
+ for (int i = 0; i < 11; ++i)
+ {
+ server.setAttribute(name, new Attribute("Something", "foo"));
+ server.getAttribute(name, "Something");
+ }
+
+ assertTrue(resource.getFooCount() == 11);
+ assertTrue(resource.getBarCount() == 0);
+ }
+
+ /**
+ * Tests attribute that caches the value for 10 secs.
+ *
+ * This test uses the xmbean.dtd
+ */
+ public void testCachedAttribute() throws Exception
+ {
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Test resource = new Test();
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, resource);
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ ObjectName name = new ObjectName(":test=test");
+ server.registerMBean(mmb, name);
+
+ for (int i = 0; i < 7; ++i)
+ {
+ server.setAttribute(name, new Attribute("Something", "foo"));
+ server.getAttribute(name, "Something");
+ }
+
+ assertTrue(resource.getFooCount() == 7);
+ assertTrue(resource.getBarCount() == 0);
+ }
+
+ /**
+ * Tests attribute that caches the value for 1 secs.
+ *
+ * This test uses the xmbean.dtd
+ */
+ public void testCachedAttribute2() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Test resource = new Test();
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, resource);
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ ObjectName name = new ObjectName(":test=test");
+ server.registerMBean(mmb, name);
+
+ server.getAttribute(name, "Something");
+
+ assertTrue(resource.getBarCount() == 1);
+
+ server.setAttribute(name, new Attribute("Something", "yksi"));
+
+ assertTrue(resource.getFooCount() == 1);
+
+ String str = (String)server.getAttribute(name, "Something");
+
+ assertTrue(resource.getBarCount() == 1);
+ assertTrue(str.equals("yksi"));
+
+ try { Thread.sleep(1100); } catch (Throwable t) {}
+
+ server.getAttribute(name, "Something");
+
+ assertTrue(resource.getBarCount() == 2);
+
+ server.setAttribute(name, new Attribute("Something", "kaksi"));
+
+ assertTrue(resource.getFooCount() == 2);
+
+ try { Thread.sleep(1100); } catch (Throwable t) {}
+
+ str = (String)server.getAttribute(name, "Something");
+
+ assertTrue(resource.getBarCount() == 3);
+ assertTrue(str.equals("kaksi"));
+
+ str = (String)server.getAttribute(name, "Something");
+
+ assertTrue(resource.getBarCount() == 3);
+ assertTrue(str.equals("kaksi"));
+ }
+
+ /**
+ * Tests attribute change notifications
+ */
+ public void testAttributeChangeNotifications() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Test resource = new Test();
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, resource);
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ ObjectName name = new ObjectName(":test=test");
+ server.registerMBean(mmb, name);
+
+ class MyNotificationListener implements NotificationListener
+ {
+ int notifCount = 0;
+
+ public void handleNotification(Notification notification, Object handback)
+ {
+ AttributeChangeNotification notif = (AttributeChangeNotification)notification;
+
+ assertTrue(notif.getNewValue().equals("somevalue"));
+
+ notifCount++;
+ }
+ }
+
+ MyNotificationListener listener = new MyNotificationListener();
+ server.addNotificationListener(name, listener, null, null);
+
+ for (int i = 0; i < 10; ++i)
+ server.setAttribute(name, new Attribute("Something", "somevalue"));
+
+ assertTrue(listener.notifCount == 10);
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.modelmbean;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class ModelMBeanSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Model MBean Tests");
-
- suite.addTest(new TestSuite(XMBeanTEST.class));
- suite.addTest(new TestSuite(AttributeCacheTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/ModelMBeanSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.modelmbean;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class ModelMBeanSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Model MBean Tests");
+
+ suite.addTest(new TestSuite(XMBeanTEST.class));
+ suite.addTest(new TestSuite(AttributeCacheTEST.class));
+
+ return suite;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.modelmbean;
-
-import javax.management.Attribute;
-import javax.management.Descriptor;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import javax.management.modelmbean.DescriptorSupport;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.modelmbean.XMBean;
-import org.jboss.mx.modelmbean.XMBeanConstants;
-
-import test.implementation.modelmbean.support.Trivial;
-import test.implementation.modelmbean.support.User;
-
-/**
- * Here are some basic XMBean tests, mainly to demonstrate the use of the
- * XMBean class and the MBean creation (this is the doc ;)
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class XMBeanTEST extends TestCase implements XMBeanConstants
-{
- public XMBeanTEST(String s)
- {
- super(s);
- }
-
- public void testCreateXMBean() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
-
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, new User());
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/UserManagementInterface.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- ObjectName name = new ObjectName(":test=test");
-
- server.registerMBean(mmb, name);
- assertTrue(server.isRegistered(name));
-
- server.setAttribute(name, new Attribute("Name", "Juha"));
- assertTrue(server.getAttribute(name, "Name").equals("Juha"));
-
- server.setAttribute(name, new Attribute("Address", "StrawBerry Street"));
- assertTrue(server.getAttribute(name, "Address").equals("StrawBerry Street"));
-
- assertTrue(server.invoke(name, "printInfo", null, null) instanceof String);
- }
-
- public void testCreateWithJBossXMBean10DTD() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Descriptor d = new DescriptorSupport();
- d.setField(RESOURCE_REFERENCE, new User());
- d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/User.xml");
- d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
-
- XMBean mmb = new XMBean(d, DESCRIPTOR);
-
- server.registerMBean(mmb, new ObjectName(":test=test"));
-
- assertTrue(server.isRegistered(new ObjectName(":test=test")));
-
- server.setAttribute(new ObjectName(":test=test"), new Attribute("Name", "Juha"));
-
- assertTrue(server.getAttribute(new ObjectName(":test=test"), "Name").equals("Juha"));
-
- }
-
- public void testCreateWithStandardInterface() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- Trivial trivial = new Trivial();
- ObjectName name = new ObjectName(":foo=bar");
-
- XMBean mmb = new XMBean(trivial, XMBeanConstants.STANDARD_INTERFACE);
- server.registerMBean(mmb, name);
-
- assertTrue(server.isRegistered(new ObjectName(":foo=bar")));
-
- server.setAttribute(name, new Attribute("Something", "foobar"));
- assertTrue(server.getAttribute(name, "Something").equals("foobar"));
-
- Boolean b = (Boolean)server.invoke(name, "doOperation", new Object[] { "" }, new String[] { "java.lang.String" });
- assertTrue(b.booleanValue() == true);
- }
-
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/XMBeanTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.modelmbean;
+
+import javax.management.Attribute;
+import javax.management.Descriptor;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+import javax.management.modelmbean.DescriptorSupport;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.modelmbean.XMBean;
+import org.jboss.mx.modelmbean.XMBeanConstants;
+
+import test.implementation.modelmbean.support.Trivial;
+import test.implementation.modelmbean.support.User;
+
+/**
+ * Here are some basic XMBean tests, mainly to demonstrate the use of the
+ * XMBean class and the MBean creation (this is the doc ;)
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class XMBeanTEST extends TestCase implements XMBeanConstants
+{
+ public XMBeanTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testCreateXMBean() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, new User());
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/UserManagementInterface.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ ObjectName name = new ObjectName(":test=test");
+
+ server.registerMBean(mmb, name);
+ assertTrue(server.isRegistered(name));
+
+ server.setAttribute(name, new Attribute("Name", "Juha"));
+ assertTrue(server.getAttribute(name, "Name").equals("Juha"));
+
+ server.setAttribute(name, new Attribute("Address", "StrawBerry Street"));
+ assertTrue(server.getAttribute(name, "Address").equals("StrawBerry Street"));
+
+ assertTrue(server.invoke(name, "printInfo", null, null) instanceof String);
+ }
+
+ public void testCreateWithJBossXMBean10DTD() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Descriptor d = new DescriptorSupport();
+ d.setField(RESOURCE_REFERENCE, new User());
+ d.setField(RESOURCE_TYPE, "file:./src/main/test/implementation/modelmbean/support/xml/User.xml");
+ d.setField(SAX_PARSER, "org.apache.crimson.parser.XMLReaderImpl");
+
+ XMBean mmb = new XMBean(d, DESCRIPTOR);
+
+ server.registerMBean(mmb, new ObjectName(":test=test"));
+
+ assertTrue(server.isRegistered(new ObjectName(":test=test")));
+
+ server.setAttribute(new ObjectName(":test=test"), new Attribute("Name", "Juha"));
+
+ assertTrue(server.getAttribute(new ObjectName(":test=test"), "Name").equals("Juha"));
+
+ }
+
+ public void testCreateWithStandardInterface() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ Trivial trivial = new Trivial();
+ ObjectName name = new ObjectName(":foo=bar");
+
+ XMBean mmb = new XMBean(trivial, XMBeanConstants.STANDARD_INTERFACE);
+ server.registerMBean(mmb, name);
+
+ assertTrue(server.isRegistered(new ObjectName(":foo=bar")));
+
+ server.setAttribute(name, new Attribute("Something", "foobar"));
+ assertTrue(server.getAttribute(name, "Something").equals("foobar"));
+
+ Boolean b = (Boolean)server.invoke(name, "doOperation", new Object[] { "" }, new String[] { "java.lang.String" });
+ assertTrue(b.booleanValue() == true);
+ }
+
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Test.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/Test.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Test.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.modelmbean.support;
-
-/**
- * Trivial POJO to test MMB attribute caching.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class Test
-{
- // Attributes ----------------------------------------------------
- int fooCount = 0;
- int barCount = 0;
- String value = null;
-
- // Management interface implementation ---------------------------
- public void setFoo(String value)
- {
- fooCount++;
- this.value = value;
- }
-
- public String getBar()
- {
- barCount++;
- return value;
- }
-
- // Public --------------------------------------------------------
- public int getFooCount()
- {
- return fooCount;
- }
-
- public int getBarCount()
- {
- return barCount;
- }
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Test.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/Test.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Test.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Test.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.modelmbean.support;
+
+/**
+ * Trivial POJO to test MMB attribute caching.
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class Test
+{
+ // Attributes ----------------------------------------------------
+ int fooCount = 0;
+ int barCount = 0;
+ String value = null;
+
+ // Management interface implementation ---------------------------
+ public void setFoo(String value)
+ {
+ fooCount++;
+ this.value = value;
+ }
+
+ public String getBar()
+ {
+ barCount++;
+ return value;
+ }
+
+ // Public --------------------------------------------------------
+ public int getFooCount()
+ {
+ return fooCount;
+ }
+
+ public int getBarCount()
+ {
+ return barCount;
+ }
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.modelmbean.support;
-
-public class Trivial implements TrivialMBean
-{
- private String something = null;
- private boolean anAttribute = true;
-
- public void setSomething(String thing)
- {
- this.something = thing;
- }
-
- public String getSomething()
- {
- return something;
- }
-
- public boolean doOperation(String arg)
- {
- return true;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.modelmbean.support;
+
+public class Trivial implements TrivialMBean
+{
+ private String something = null;
+ private boolean anAttribute = true;
+
+ public void setSomething(String thing)
+ {
+ this.something = thing;
+ }
+
+ public String getSomething()
+ {
+ return something;
+ }
+
+ public boolean doOperation(String arg)
+ {
+ return true;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.modelmbean.support;
-
-public interface TrivialMBean
-{
- void setSomething(String thing);
-
- String getSomething();
-
- boolean doOperation(String arg);
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.modelmbean.support;
+
+public interface TrivialMBean
+{
+ void setSomething(String thing);
+
+ String getSomething();
+
+ boolean doOperation(String arg);
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/User.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/User.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/User.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,230 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.modelmbean.support;
-/**
- * @jmx:mbean description="sample for jboss xmbean.dtd"
- * persistPolicy="Never"
- * persistPeriod="10"
- * persistLocation="pl1"
- * persistName="JBossXMLExample1"
- * currencyTimeLimit="10"
- * descriptor="name=\"testdescriptor\" value=\"testvalue\""
- * state-action-on-update="RESTART"
- *
- *
- * @jmx:notification description="first notification"
- * name="javax.management.SomeEvent"
- * notificationType="xd.example.first,xd.example.second"
- * persistPolicy="Never"
- * persistPeriod="20"
- * persistLocation="pl2"
- * persistName="JBossXMLExample2"
- * currencyTimeLimit="20"
- *
- **/
-public class User {
-
- private long id = System.currentTimeMillis();
- private String name = "";
- private String address = "";
- private String password = null;
- private String[] numbers = new String[3];
-
- /**
- * Creates a new <code>User</code> instance using constructor with one argument.
- *
- * @param id a <code>long</code> value
- * @jmx:managed-constructor
- */
- public User(long id)
- {
- this.id = id;
- }
-
- /**
- * Creates a new <code>User</code> using constructor with no argument
- * @jmx:managed-constructor
- *
- */
- public User()
- {
- }
-
-
- /**
- * Describe <code>getID</code> method here.
- * read-only attribute
- * @return a <code>long</code> value
- * @jmx:managed-attribute persistPolicy="Never"
- * persistPeriod="30"
- * currencyTimeLimit="30"
- */
- public long getID() {
- return id;
- }
-
-
-
- /**
- * Describe <code>setID</code> method here.
- * application method, not exposed to management
- *
- * @param id a <code>long</code> value
- */
- public void setID(long id) {
- this.id = id;
- }
-
-
-
- /**
- * Describe <code>getName</code> method here.
- * read-write attribute
- * @return a <code>String</code> value
- * @jmx:managed-attribute persistPolicy="Never"
- * persistPeriod="30"
- * currencyTimeLimit="30"
- */
- public String getName() {
- return name;
- }
- /**
- * Describe <code>setName</code> method here.
- *
- * @param name a <code>String</code> value
- * @jmx:managed-attribute
- */
- public void setName(String name) {
-
- //System.out.println("SetNAME");
-
- this.name = name;
- }
-
-
-
- /**
- * Describe <code>getAddress</code> method here.
- * read-write attribute
- * @return a <code>String</code> value
- * @jmx:managed-attribute persistPolicy="Never"
- * persistPeriod="30"
- * currencyTimeLimit="30"
- */
- public String getAddress() {
- return address;
- }
-
- /**
- * Describe <code>setAddress</code> method here.
- *
- * @param address a <code>String</code> value
- * @jmx:managed-attribute
- */
- public void setAddress(String address) {
- this.address = address;
- }
-
-
-
- /**
- * Describe <code>getPhoneNumbers</code> method here.
- * read-write attribute
- * @return a <code>String[]</code> value
- * @jmx:managed-attribute persistPolicy="Never"
- * persistPeriod="30"
- * currencyTimeLimit="30"
- */
- public String[] getPhoneNumbers() {
- return numbers;
- }
- /**
- * Describe <code>setPhoneNumbers</code> method here.
- *
- * @param numbers a <code>String[]</code> value
- * @jmx:managed-attribute
- */
- public void setPhoneNumbers(String[] numbers) {
- this.numbers = numbers;
- }
-
-
-
- /**
- * Describe <code>setPassword</code> method here.
- * write only attribute
- * @param passwd a <code>String</code> value
- * @jmx:managed-attribute persistPolicy="Never"
- * persistPeriod="30"
- * currencyTimeLimit="30"
- */
- public void setPassword(String passwd) {
- this.password = passwd;
- }
-
-
- // management operations
-
- /**
- * Describe <code>printInfo</code> method here.
- * prints info
- * @return a <code>String</code> value
- * @jmx:managed-operation
- */
- public String printInfo() {
- return
- "User: " + getName() +"\n"+
- "Address: " + getAddress() +"\n"+
- "Phone #: " + getPhoneNumbers()[0] +"\n"+
- "Phone #: " + getPhoneNumbers()[1] +"\n"+
- "Phone #: " + getPhoneNumbers()[2] +"\n";
- }
-
- /**
- * Describe <code>addPhoneNumber</code> method here.
- *
- * @param number a <code>String</code> value, the phone number to add
- * @jmx:managed-operation
- */
- public void addPhoneNumber(String number) {
- for (int i = 0; i < numbers.length; ++i)
- if (numbers[i] == null) {
- numbers[i] = number;
- break;
- }
- }
-
- /**
- * Describe <code>removePhoneNumber</code> method here.
- *
- * @param index an <code>int</code> value, the index of phone number to remove
- * @jmx:managed-operation
- */
- public void removePhoneNumber(int index) {
- if (index < 0 || index >= numbers.length)
- return;
-
- numbers[index] = null;
- }
-}
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/User.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/User.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/User.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/User.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,230 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.modelmbean.support;
+/**
+ * @jmx:mbean description="sample for jboss xmbean.dtd"
+ * persistPolicy="Never"
+ * persistPeriod="10"
+ * persistLocation="pl1"
+ * persistName="JBossXMLExample1"
+ * currencyTimeLimit="10"
+ * descriptor="name=\"testdescriptor\" value=\"testvalue\""
+ * state-action-on-update="RESTART"
+ *
+ *
+ * @jmx:notification description="first notification"
+ * name="javax.management.SomeEvent"
+ * notificationType="xd.example.first,xd.example.second"
+ * persistPolicy="Never"
+ * persistPeriod="20"
+ * persistLocation="pl2"
+ * persistName="JBossXMLExample2"
+ * currencyTimeLimit="20"
+ *
+ **/
+public class User {
+
+ private long id = System.currentTimeMillis();
+ private String name = "";
+ private String address = "";
+ private String password = null;
+ private String[] numbers = new String[3];
+
+ /**
+ * Creates a new <code>User</code> instance using constructor with one argument.
+ *
+ * @param id a <code>long</code> value
+ * @jmx:managed-constructor
+ */
+ public User(long id)
+ {
+ this.id = id;
+ }
+
+ /**
+ * Creates a new <code>User</code> using constructor with no argument
+ * @jmx:managed-constructor
+ *
+ */
+ public User()
+ {
+ }
+
+
+ /**
+ * Describe <code>getID</code> method here.
+ * read-only attribute
+ * @return a <code>long</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public long getID() {
+ return id;
+ }
+
+
+
+ /**
+ * Describe <code>setID</code> method here.
+ * application method, not exposed to management
+ *
+ * @param id a <code>long</code> value
+ */
+ public void setID(long id) {
+ this.id = id;
+ }
+
+
+
+ /**
+ * Describe <code>getName</code> method here.
+ * read-write attribute
+ * @return a <code>String</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * Describe <code>setName</code> method here.
+ *
+ * @param name a <code>String</code> value
+ * @jmx:managed-attribute
+ */
+ public void setName(String name) {
+
+ //System.out.println("SetNAME");
+
+ this.name = name;
+ }
+
+
+
+ /**
+ * Describe <code>getAddress</code> method here.
+ * read-write attribute
+ * @return a <code>String</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public String getAddress() {
+ return address;
+ }
+
+ /**
+ * Describe <code>setAddress</code> method here.
+ *
+ * @param address a <code>String</code> value
+ * @jmx:managed-attribute
+ */
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+
+
+ /**
+ * Describe <code>getPhoneNumbers</code> method here.
+ * read-write attribute
+ * @return a <code>String[]</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public String[] getPhoneNumbers() {
+ return numbers;
+ }
+ /**
+ * Describe <code>setPhoneNumbers</code> method here.
+ *
+ * @param numbers a <code>String[]</code> value
+ * @jmx:managed-attribute
+ */
+ public void setPhoneNumbers(String[] numbers) {
+ this.numbers = numbers;
+ }
+
+
+
+ /**
+ * Describe <code>setPassword</code> method here.
+ * write only attribute
+ * @param passwd a <code>String</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public void setPassword(String passwd) {
+ this.password = passwd;
+ }
+
+
+ // management operations
+
+ /**
+ * Describe <code>printInfo</code> method here.
+ * prints info
+ * @return a <code>String</code> value
+ * @jmx:managed-operation
+ */
+ public String printInfo() {
+ return
+ "User: " + getName() +"\n"+
+ "Address: " + getAddress() +"\n"+
+ "Phone #: " + getPhoneNumbers()[0] +"\n"+
+ "Phone #: " + getPhoneNumbers()[1] +"\n"+
+ "Phone #: " + getPhoneNumbers()[2] +"\n";
+ }
+
+ /**
+ * Describe <code>addPhoneNumber</code> method here.
+ *
+ * @param number a <code>String</code> value, the phone number to add
+ * @jmx:managed-operation
+ */
+ public void addPhoneNumber(String number) {
+ for (int i = 0; i < numbers.length; ++i)
+ if (numbers[i] == null) {
+ numbers[i] = number;
+ break;
+ }
+ }
+
+ /**
+ * Describe <code>removePhoneNumber</code> method here.
+ *
+ * @param index an <code>int</code> value, the index of phone number to remove
+ * @jmx:managed-operation
+ */
+ public void removePhoneNumber(int index) {
+ if (index < 0 || index >= numbers.length)
+ return;
+
+ numbers[index] = null;
+ }
+}
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
-
-<mbean>
-
- <attribute setMethod="setFoo" getMethod="getBar">
- <name>Something</name>
- <type>java.lang.String</type>
- <access>read-write</access>
- </attribute>
-
- <operation>
- <name>setFoo</name>
- <parameter>
- <name>name</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>getBar</name>
- <return-type>java.lang.String</return-type>
- <impact>INFO</impact>
- </operation>
-
-</mbean>
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
+
+<mbean>
+
+ <attribute setMethod="setFoo" getMethod="getBar">
+ <name>Something</name>
+ <type>java.lang.String</type>
+ <access>read-write</access>
+ </attribute>
+
+ <operation>
+ <name>setFoo</name>
+ <parameter>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>getBar</name>
+ <return-type>java.lang.String</return-type>
+ <impact>INFO</impact>
+ </operation>
+
+</mbean>
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
-
-<mbean>
-
- <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="0">
- <name>Something</name>
- <type>java.lang.String</type>
- <access>read-write</access>
- </attribute>
-
- <operation>
- <name>setFoo</name>
- <parameter>
- <name>name</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>getBar</name>
- <return-type>java.lang.String</return-type>
- <impact>INFO</impact>
- </operation>
-
-</mbean>
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface2.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
+
+<mbean>
+
+ <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="0">
+ <name>Something</name>
+ <type>java.lang.String</type>
+ <access>read-write</access>
+ </attribute>
+
+ <operation>
+ <name>setFoo</name>
+ <parameter>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>getBar</name>
+ <return-type>java.lang.String</return-type>
+ <impact>INFO</impact>
+ </operation>
+
+</mbean>
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
-
-<mbean>
-
- <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="-1">
- <name>Something</name>
- <type>java.lang.String</type>
- <access>read-write</access>
- </attribute>
-
- <operation>
- <name>setFoo</name>
- <parameter>
- <name>name</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>getBar</name>
- <return-type>java.lang.String</return-type>
- <impact>INFO</impact>
- </operation>
-
-</mbean>
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface3.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
+
+<mbean>
+
+ <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="-1">
+ <name>Something</name>
+ <type>java.lang.String</type>
+ <access>read-write</access>
+ </attribute>
+
+ <operation>
+ <name>setFoo</name>
+ <parameter>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>getBar</name>
+ <return-type>java.lang.String</return-type>
+ <impact>INFO</impact>
+ </operation>
+
+</mbean>
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
-
-<mbean>
-
- <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="10">
- <name>Something</name>
- <type>java.lang.String</type>
- <access>read-write</access>
- </attribute>
-
- <operation>
- <name>setFoo</name>
- <parameter>
- <name>name</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>getBar</name>
- <return-type>java.lang.String</return-type>
- <impact>INFO</impact>
- </operation>
-
-</mbean>
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface4.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
+
+<mbean>
+
+ <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="10">
+ <name>Something</name>
+ <type>java.lang.String</type>
+ <access>read-write</access>
+ </attribute>
+
+ <operation>
+ <name>setFoo</name>
+ <parameter>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>getBar</name>
+ <return-type>java.lang.String</return-type>
+ <impact>INFO</impact>
+ </operation>
+
+</mbean>
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
-
-<mbean>
-
- <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="1">
- <name>Something</name>
- <type>java.lang.String</type>
- <access>read-write</access>
- </attribute>
-
- <operation>
- <name>setFoo</name>
- <parameter>
- <name>name</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>getBar</name>
- <return-type>java.lang.String</return-type>
- <impact>INFO</impact>
- </operation>
-
-</mbean>
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/TrivialManagementInterface5.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
+
+<mbean>
+
+ <attribute setMethod="setFoo" getMethod="getBar" currencyTimeLimit="1">
+ <name>Something</name>
+ <type>java.lang.String</type>
+ <access>read-write</access>
+ </attribute>
+
+ <operation>
+ <name>setFoo</name>
+ <parameter>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>getBar</name>
+ <return-type>java.lang.String</return-type>
+ <impact>INFO</impact>
+ </operation>
+
+</mbean>
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd">
-
-<mbean>
- <description><![CDATA[sample for jboss xmbean.dtd]]></description>
- <descriptors>
- <persistence persistPolicy="NEVER"
- persistPeriod="10"
- persistLocation="pl1"
- persistName="JBossXMLExample1"/>
- <state-action-on-update value="RESTART"/>
- <descriptor name="testdescriptor" value="testvalue"/>
- </descriptors>
- <class>test.implementation.modelmbean.support.User</class>
-
- <constructor>
- <description><![CDATA[Creates a new <code>User</code> instance using constructor with one argument.]]></description>
- <name>test.implementation.modelmbean.support.User</name>
- <parameter>
- <description><![CDATA[a <code>long</code> value]]></description>
- <name>id</name>
- <type>long</type>
- </parameter>
- </constructor>
- <constructor>
- <description><![CDATA[Creates a new <code>User</code> using constructor with no argument]]></description>
- <name>test.implementation.modelmbean.support.User</name>
- </constructor>
-
- <!--attributes-->
- <attribute access="READ_WRITE" getMethod="getID">
- <description><![CDATA[Describe <code>getID</code> method here.
- read-only attribute]]></description>
- <name>ID</name>
- <type>long</type>
- <descriptors>
- <persistence persistPolicy="NEVER"
- persistPeriod="30"/>
- </descriptors>
- </attribute>
- <attribute access="READ_WRITE" getMethod="getName" setMethod="setName">
- <description><![CDATA[Describe <code>getName</code> method here.
- read-write attribute]]></description>
- <name>Name</name>
- <type>java.lang.String</type>
- <descriptors>
- <persistence persistPolicy="NEVER"
- persistPeriod="30"/>
- </descriptors>
- </attribute>
- <attribute access="READ_WRITE" getMethod="getAddress" setMethod="setAddress">
- <description><![CDATA[Describe <code>getAddress</code> method here.
- read-write attribute]]></description>
- <name>Address</name>
- <type>java.lang.String</type>
- <descriptors>
- <persistence persistPolicy="NEVER"
- persistPeriod="30"/>
- </descriptors>
- </attribute>
- <attribute access="READ_WRITE" getMethod="getPhoneNumbers" setMethod="setPhoneNumbers">
- <description><![CDATA[Describe <code>getPhoneNumbers</code> method here.
- read-write attribute]]></description>
- <name>PhoneNumbers</name>
- <type>[Ljava.lang.String;</type>
- <descriptors>
- <persistence persistPolicy="NEVER"
- persistPeriod="30"/>
- </descriptors>
- </attribute>
- <attribute access="READ_WRITE" setMethod="setPassword">
- <description><![CDATA[Describe <code>setPassword</code> method here.
- write only attribute]]></description>
- <name>Password</name>
- <type>java.lang.String</type>
- <descriptors>
- <persistence persistPolicy="NEVER"
- persistPeriod="30"/>
- </descriptors>
- </attribute>
-
-<!--operations -->
- <operation>
- <description><![CDATA[Describe <code>printInfo</code> method here.
- prints info]]></description>
- <name>printInfo</name>
- <return-type>java.lang.String</return-type>
- </operation>
- <operation>
- <description><![CDATA[Describe <code>addPhoneNumber</code> method here.]]></description>
- <name>addPhoneNumber</name>
- <parameter>
- <description><![CDATA[a <code>String</code> value, the phone number to add]]></description>
- <name>number</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- </operation>
- <operation>
- <description><![CDATA[Describe <code>removePhoneNumber</code> method here.]]></description>
- <name>removePhoneNumber</name>
- <parameter>
- <description><![CDATA[an <code>int</code> value, the index of phone number to remove]]></description>
- <name>index</name>
- <type>int</type>
- </parameter>
- <return-type>void</return-type>
- </operation>
-
-<!--notifications -->
- <notification>
- <description><![CDATA[first notification]]></description>
- <name>javax.management.SomeEvent</name>
- <notification-type>xd.example.first</notification-type>
- <notification-type>xd.example.second</notification-type>
- <descriptors>
- <persistence persistPolicy="NEVER"
- persistPeriod="20"
- persistLocation="pl2"
- persistName="JBossXMLExample2"
-/>
- </descriptors>
- </notification>
-
-</mbean>
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/User.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd">
+
+<mbean>
+ <description><![CDATA[sample for jboss xmbean.dtd]]></description>
+ <descriptors>
+ <persistence persistPolicy="NEVER"
+ persistPeriod="10"
+ persistLocation="pl1"
+ persistName="JBossXMLExample1"/>
+ <state-action-on-update value="RESTART"/>
+ <descriptor name="testdescriptor" value="testvalue"/>
+ </descriptors>
+ <class>test.implementation.modelmbean.support.User</class>
+
+ <constructor>
+ <description><![CDATA[Creates a new <code>User</code> instance using constructor with one argument.]]></description>
+ <name>test.implementation.modelmbean.support.User</name>
+ <parameter>
+ <description><![CDATA[a <code>long</code> value]]></description>
+ <name>id</name>
+ <type>long</type>
+ </parameter>
+ </constructor>
+ <constructor>
+ <description><![CDATA[Creates a new <code>User</code> using constructor with no argument]]></description>
+ <name>test.implementation.modelmbean.support.User</name>
+ </constructor>
+
+ <!--attributes-->
+ <attribute access="READ_WRITE" getMethod="getID">
+ <description><![CDATA[Describe <code>getID</code> method here.
+ read-only attribute]]></description>
+ <name>ID</name>
+ <type>long</type>
+ <descriptors>
+ <persistence persistPolicy="NEVER"
+ persistPeriod="30"/>
+ </descriptors>
+ </attribute>
+ <attribute access="READ_WRITE" getMethod="getName" setMethod="setName">
+ <description><![CDATA[Describe <code>getName</code> method here.
+ read-write attribute]]></description>
+ <name>Name</name>
+ <type>java.lang.String</type>
+ <descriptors>
+ <persistence persistPolicy="NEVER"
+ persistPeriod="30"/>
+ </descriptors>
+ </attribute>
+ <attribute access="READ_WRITE" getMethod="getAddress" setMethod="setAddress">
+ <description><![CDATA[Describe <code>getAddress</code> method here.
+ read-write attribute]]></description>
+ <name>Address</name>
+ <type>java.lang.String</type>
+ <descriptors>
+ <persistence persistPolicy="NEVER"
+ persistPeriod="30"/>
+ </descriptors>
+ </attribute>
+ <attribute access="READ_WRITE" getMethod="getPhoneNumbers" setMethod="setPhoneNumbers">
+ <description><![CDATA[Describe <code>getPhoneNumbers</code> method here.
+ read-write attribute]]></description>
+ <name>PhoneNumbers</name>
+ <type>[Ljava.lang.String;</type>
+ <descriptors>
+ <persistence persistPolicy="NEVER"
+ persistPeriod="30"/>
+ </descriptors>
+ </attribute>
+ <attribute access="READ_WRITE" setMethod="setPassword">
+ <description><![CDATA[Describe <code>setPassword</code> method here.
+ write only attribute]]></description>
+ <name>Password</name>
+ <type>java.lang.String</type>
+ <descriptors>
+ <persistence persistPolicy="NEVER"
+ persistPeriod="30"/>
+ </descriptors>
+ </attribute>
+
+<!--operations -->
+ <operation>
+ <description><![CDATA[Describe <code>printInfo</code> method here.
+ prints info]]></description>
+ <name>printInfo</name>
+ <return-type>java.lang.String</return-type>
+ </operation>
+ <operation>
+ <description><![CDATA[Describe <code>addPhoneNumber</code> method here.]]></description>
+ <name>addPhoneNumber</name>
+ <parameter>
+ <description><![CDATA[a <code>String</code> value, the phone number to add]]></description>
+ <name>number</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ </operation>
+ <operation>
+ <description><![CDATA[Describe <code>removePhoneNumber</code> method here.]]></description>
+ <name>removePhoneNumber</name>
+ <parameter>
+ <description><![CDATA[an <code>int</code> value, the index of phone number to remove]]></description>
+ <name>index</name>
+ <type>int</type>
+ </parameter>
+ <return-type>void</return-type>
+ </operation>
+
+<!--notifications -->
+ <notification>
+ <description><![CDATA[first notification]]></description>
+ <name>javax.management.SomeEvent</name>
+ <notification-type>xd.example.first</notification-type>
+ <notification-type>xd.example.second</notification-type>
+ <descriptors>
+ <persistence persistPolicy="NEVER"
+ persistPeriod="20"
+ persistLocation="pl2"
+ persistName="JBossXMLExample2"
+/>
+ </descriptors>
+ </notification>
+
+</mbean>
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
-
-<mbean>
- <constructor>
- <name>DefaultConstructor</name>
- </constructor>
-
- <attribute>
- <name>ID</name>
- <type>java.lang.String</type>
- <access>read-only</access>
- </attribute>
-
- <attribute setMethod="setName" getMethod="getName">
- <name>Name</name>
- <type>java.lang.String</type>
- <access>read-write</access>
- </attribute>
-
- <attribute>
- <name>Address</name>
- <type>java.lang.String</type>
- <access>read-write</access>
- </attribute>
-
- <attribute>
- <name>PhoneNumbers</name>
- <type>[Ljava.lang.String;</type>
- <access>read-write</access>
- </attribute>
-
- <attribute>
- <name>Password</name>
- <type>java.lang.String</type>
- <access>write-only</access>
- </attribute>
-
- <operation>
- <name>printInfo</name>
- <return-type>java.lang.String</return-type>
- <impact>INFO</impact>
- </operation>
-
- <operation>
- <name>addPhoneNumber</name>
- <parameter>
- <name>number</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>removePhoneNumber</name>
- <parameter>
- <name>index</name>
- <type>int</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>setName</name>
- <parameter>
- <name>name</name>
- <type>java.lang.String</type>
- </parameter>
- <return-type>void</return-type>
- <impact>ACTION</impact>
- </operation>
-
- <operation>
- <name>getName</name>
- <return-type>java.lang.String</return-type>
- <impact>INFO</impact>
- </operation>
-
-</mbean>
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/UserManagementInterface.xml 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mbean SYSTEM "file:./src/main/test/implementation/modelmbean/support/xml/xmbean.dtd">
+
+<mbean>
+ <constructor>
+ <name>DefaultConstructor</name>
+ </constructor>
+
+ <attribute>
+ <name>ID</name>
+ <type>java.lang.String</type>
+ <access>read-only</access>
+ </attribute>
+
+ <attribute setMethod="setName" getMethod="getName">
+ <name>Name</name>
+ <type>java.lang.String</type>
+ <access>read-write</access>
+ </attribute>
+
+ <attribute>
+ <name>Address</name>
+ <type>java.lang.String</type>
+ <access>read-write</access>
+ </attribute>
+
+ <attribute>
+ <name>PhoneNumbers</name>
+ <type>[Ljava.lang.String;</type>
+ <access>read-write</access>
+ </attribute>
+
+ <attribute>
+ <name>Password</name>
+ <type>java.lang.String</type>
+ <access>write-only</access>
+ </attribute>
+
+ <operation>
+ <name>printInfo</name>
+ <return-type>java.lang.String</return-type>
+ <impact>INFO</impact>
+ </operation>
+
+ <operation>
+ <name>addPhoneNumber</name>
+ <parameter>
+ <name>number</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>removePhoneNumber</name>
+ <parameter>
+ <name>index</name>
+ <type>int</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>setName</name>
+ <parameter>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </parameter>
+ <return-type>void</return-type>
+ <impact>ACTION</impact>
+ </operation>
+
+ <operation>
+ <name>getName</name>
+ <return-type>java.lang.String</return-type>
+ <impact>INFO</impact>
+ </operation>
+
+</mbean>
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,150 +0,0 @@
-<!-- -->
-<!-- DTD for externalizing the definition of the -->
-<!-- JMX management interfaces. -->
-<!-- -->
-<!-- Author: Juha Lindfors -->
-<!-- Author: David Jencks -->
-<!--This is the XML DTD for the JBoss 3.0 EJB deployment descriptor.
-The DOCTYPE is:
- <!DOCTYPE mbean PUBLIC
- "-//JBoss//DTD JBOSS XMBEAN 1.0//EN"
- "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_0.dtd">
--->
-<!-- -->
-
-<!--
- The <mbean> element is the root element of the document containing the
- required elements for describing the management interface of one
- MBean (constructors, attributes, operations and notifications). It
- also includes an optional description element that can be used to
- describe the purpose of the MBean and attributes for persistence
- policy and attribute caching.
--->
-<!ELEMENT mbean (description?, descriptors?, class, constructor*, attribute*, operation*,
- notification*)>
-
-<!--
- The constructor element describes the constructors of an MBean
- that are exposed to the management application. The optional
- description element can be used to to describe the use of the
- constructor.
--->
-<!ELEMENT constructor (description?, name, parameter*, descriptors?)>
-
-<!--
- The <attribute> element describes the management attributes of an
- MBean. The <name> element contains the attribute's name and the <type>
- element contains a fully qualified class name of the attribute's
- type.
-
--->
-<!ELEMENT attribute (description?, name, type, descriptors?)>
-<!-- access read/write access to attribute -->
-<!ATTLIST attribute access (READ | WRITE | READ_WRITE) "READ_WRITE"
- getMethod CDATA #IMPLIED
- setMethod CDATA #IMPLIED
- >
-
-<!--
- The <operation> element describes a management operation of an MBean.
- The <name> element contains the operation's name and the <parameter>
- elements describe the operation's signature. The <return-type> element
- must contain a fully qualified class name of the return type from
- this operation.
-
- If <return-type> is not specified, void is assumed.
-
--->
-<!ELEMENT operation (description?, name, parameter*, return-type?)>
-
-<!-- impact Impact of operation -->
-<!ATTLIST operation
- impact (ACTION | INFO | ACTION_INFO) "ACTION_INFO" >
-
-<!-- descriptors -->
-<!-- The <descriptors> element contains all the
- descriptors for a containing element, as
- subelements. The descriptors suggested in
- the jmx spec have predefined elements,
- whereas custom descriptors have a generic
- element. -->
-<!ELEMENT descriptors (persistence?, currencyTimeLimit?, state-action-on-update?, descriptor*)>
-
-<!-- persistence -->
-<!-- The <persistence> element contains
- descriptors for the persistPolicy,
- persistPeriod, persistLocation, and
- persistName properties suggested by the
- spec. -->
-<!ELEMENT persistence EMPTY >
-
-<!-- persistPolicy
- persistPolicy as suggested by jmx spec
- persistPeriod
- persistPeriod as suggested by jmx spec
- persistLocation
- location of persistence store.
- persistNameName of persistent data in datastore for this
- mbean -->
-<!ATTLIST persistence
- persistPolicy
- (NEVER | ONUPDATE | NOMOREOFTENTHAN | ONTIMER)
- #IMPLIED
- persistPeriod
- CDATA #IMPLIED
- persistLocation
- CDATA #IMPLIED
- persistName
- CDATA #IMPLIED >
-
-
-<!-- currency-time-limit -->
-<!-- Time that a cached value of an attribute
- remains valid. -->
-<!ELEMENT currency-time-limit
- EMPTY >
-
-<!-- value Value for currencyTimeLimit -->
-<!ATTLIST currency-time-limit
- value CDATA #IMPLIED >
-
-<!-- state-action-on-update -->
-<!-- When an attribute is updated, how much
- does the service need to be stopped? -->
-<!ELEMENT state-action-on-update
- EMPTY >
-
-
-<!-- value how much the service needs to be stopped when
- this attribute is updated -->
-<!ATTLIST state-action-on-update
- value (KEEP_RUNNING | RESTART | REINSTANTIATE) #IMPLIED>
-
-<!-- descriptor -->
-<!-- Custom descriptor element -->
-<!ELEMENT descriptor EMPTY >
-<!-- name Name of descriptor
- value value of descriptor -->
-<!ATTLIST descriptor
- name CDATA #REQUIRED
- value CDATA #REQUIRED >
-
-<!--
- The <notification> element describes a management notification. The <name>
- element contains the fully qualified name of the notification class and
- the <notification-type> element contains the dot-separated notification
- type string.
--->
-<!ELEMENT notification (description?, name, notification-type+, descriptors?)>
-
-<!ELEMENT parameter (description?, name, type)>
-
-<!ELEMENT class (#PCDATA)>
-<!ELEMENT name (#PCDATA)>
-<!ELEMENT description (#PCDATA)>
-<!ELEMENT type (#PCDATA)>
-<!ELEMENT return-type (#PCDATA)>
-<!ELEMENT notification-type (#PCDATA)>
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/jboss_xmbean_1_0.dtd 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,150 @@
+<!-- -->
+<!-- DTD for externalizing the definition of the -->
+<!-- JMX management interfaces. -->
+<!-- -->
+<!-- Author: Juha Lindfors -->
+<!-- Author: David Jencks -->
+<!--This is the XML DTD for the JBoss 3.0 EJB deployment descriptor.
+The DOCTYPE is:
+ <!DOCTYPE mbean PUBLIC
+ "-//JBoss//DTD JBOSS XMBEAN 1.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_0.dtd">
+-->
+<!-- -->
+
+<!--
+ The <mbean> element is the root element of the document containing the
+ required elements for describing the management interface of one
+ MBean (constructors, attributes, operations and notifications). It
+ also includes an optional description element that can be used to
+ describe the purpose of the MBean and attributes for persistence
+ policy and attribute caching.
+-->
+<!ELEMENT mbean (description?, descriptors?, class, constructor*, attribute*, operation*,
+ notification*)>
+
+<!--
+ The constructor element describes the constructors of an MBean
+ that are exposed to the management application. The optional
+ description element can be used to to describe the use of the
+ constructor.
+-->
+<!ELEMENT constructor (description?, name, parameter*, descriptors?)>
+
+<!--
+ The <attribute> element describes the management attributes of an
+ MBean. The <name> element contains the attribute's name and the <type>
+ element contains a fully qualified class name of the attribute's
+ type.
+
+-->
+<!ELEMENT attribute (description?, name, type, descriptors?)>
+<!-- access read/write access to attribute -->
+<!ATTLIST attribute access (READ | WRITE | READ_WRITE) "READ_WRITE"
+ getMethod CDATA #IMPLIED
+ setMethod CDATA #IMPLIED
+ >
+
+<!--
+ The <operation> element describes a management operation of an MBean.
+ The <name> element contains the operation's name and the <parameter>
+ elements describe the operation's signature. The <return-type> element
+ must contain a fully qualified class name of the return type from
+ this operation.
+
+ If <return-type> is not specified, void is assumed.
+
+-->
+<!ELEMENT operation (description?, name, parameter*, return-type?)>
+
+<!-- impact Impact of operation -->
+<!ATTLIST operation
+ impact (ACTION | INFO | ACTION_INFO) "ACTION_INFO" >
+
+<!-- descriptors -->
+<!-- The <descriptors> element contains all the
+ descriptors for a containing element, as
+ subelements. The descriptors suggested in
+ the jmx spec have predefined elements,
+ whereas custom descriptors have a generic
+ element. -->
+<!ELEMENT descriptors (persistence?, currencyTimeLimit?, state-action-on-update?, descriptor*)>
+
+<!-- persistence -->
+<!-- The <persistence> element contains
+ descriptors for the persistPolicy,
+ persistPeriod, persistLocation, and
+ persistName properties suggested by the
+ spec. -->
+<!ELEMENT persistence EMPTY >
+
+<!-- persistPolicy
+ persistPolicy as suggested by jmx spec
+ persistPeriod
+ persistPeriod as suggested by jmx spec
+ persistLocation
+ location of persistence store.
+ persistNameName of persistent data in datastore for this
+ mbean -->
+<!ATTLIST persistence
+ persistPolicy
+ (NEVER | ONUPDATE | NOMOREOFTENTHAN | ONTIMER)
+ #IMPLIED
+ persistPeriod
+ CDATA #IMPLIED
+ persistLocation
+ CDATA #IMPLIED
+ persistName
+ CDATA #IMPLIED >
+
+
+<!-- currency-time-limit -->
+<!-- Time that a cached value of an attribute
+ remains valid. -->
+<!ELEMENT currency-time-limit
+ EMPTY >
+
+<!-- value Value for currencyTimeLimit -->
+<!ATTLIST currency-time-limit
+ value CDATA #IMPLIED >
+
+<!-- state-action-on-update -->
+<!-- When an attribute is updated, how much
+ does the service need to be stopped? -->
+<!ELEMENT state-action-on-update
+ EMPTY >
+
+
+<!-- value how much the service needs to be stopped when
+ this attribute is updated -->
+<!ATTLIST state-action-on-update
+ value (KEEP_RUNNING | RESTART | REINSTANTIATE) #IMPLIED>
+
+<!-- descriptor -->
+<!-- Custom descriptor element -->
+<!ELEMENT descriptor EMPTY >
+<!-- name Name of descriptor
+ value value of descriptor -->
+<!ATTLIST descriptor
+ name CDATA #REQUIRED
+ value CDATA #REQUIRED >
+
+<!--
+ The <notification> element describes a management notification. The <name>
+ element contains the fully qualified name of the notification class and
+ the <notification-type> element contains the dot-separated notification
+ type string.
+-->
+<!ELEMENT notification (description?, name, notification-type+, descriptors?)>
+
+<!ELEMENT parameter (description?, name, type)>
+
+<!ELEMENT class (#PCDATA)>
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT description (#PCDATA)>
+<!ELEMENT type (#PCDATA)>
+<!ELEMENT return-type (#PCDATA)>
+<!ELEMENT notification-type (#PCDATA)>
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,93 +0,0 @@
-<!-- -->
-<!-- DTD for externalizing the definition of the -->
-<!-- JMX management interfaces. -->
-<!-- -->
-<!-- Author: Juha Lindfors -->
-<!-- -->
-
-<!--
- The <mbean> element is the root element of the document containing the
- required elements for describing the management interface of one
- MBean (constructors, attributes, operations and notifications). It
- also includes an optional description element that can be used to
- describe the purpose of the MBean and attributes for persistence
- policy and attribute caching.
--->
-<!ELEMENT mbean (description?, constructor*, attribute*, operation*,
- notification*)>
-<!ATTLIST mbean persistPolicy
- (Never | OnUpdate | NoMoreOftenThan | OnTimer) "Never"
- persistPeriod NMTOKEN #IMPLIED
- persistLocation CDATA #IMPLIED
- persistName CDATA #IMPLIED
- currencyTimeLimit NMTOKEN #IMPLIED>
-
-<!--
- The constructor element describes the constructors of an MBean
- that are exposed to the management application. The optional
- description element can be used to to describe the use of the
- constructor.
--->
-<!ELEMENT constructor (description?, name, parameter*)>
-
-<!--
- The <attribute> element describes the management attributes of an
- MBean. The <name> element contains the attribute's name and the <type>
- element contains a fully qualified class name of the attribute's
- type.
-
- The optional <access> element defines the access type (read-only,
- write-only, read-write) of this attribute. Valid values are:
- <access>read-only</access>
- <access>write-only</access>
- <access>read-write</access>
-
- If <access> element is not specified, read-write access is assumed.
--->
-<!ELEMENT attribute (description?, name, type, access?)>
-<!ATTLIST attribute persistPolicy CDATA #IMPLIED
- getMethod CDATA #IMPLIED
- setMethod CDATA #IMPLIED
- persistPeriod NMTOKEN #IMPLIED
- currencyTimeLimit NMTOKEN #IMPLIED >
-
-<!--
- The <operation> element describes a management operation of an MBean.
- The <name> element contains the operation's name and the <parameter>
- elements describe the operation's signature. The <return-type> element
- must contain a fully qualified class name of the return type from
- this operation.
-
- If <return-type> is not specified, void is assumed.
-
- The impact element describes the operation's impact on the MBean's
- state when invoked. The valid values are:
- <impact>ACTION</impact>
- <impact>INFO</impact>
- <impact>ACTION_INFO</impact>
-
- If <impact> is not specified, ACTION_INFO is assumed.
--->
-<!ELEMENT operation (description?, name, parameter*, return-type?,
- impact?)>
-
-<!--
- The <notification> element describes a management notification. The <name>
- element contains the fully qualified name of the notification class and
- the <notification-type> element contains the dot-separated notification
- type string.
--->
-<!ELEMENT notification (description?, name, notification-type+)>
-
-<!ELEMENT parameter (description?, name, type)>
-
-<!ELEMENT name (#PCDATA)>
-<!ELEMENT description (#PCDATA)>
-<!ELEMENT type (#PCDATA)>
-<!ELEMENT access (#PCDATA)>
-<!ELEMENT impact (#PCDATA)>
-<!ELEMENT return-type (#PCDATA)>
-<!ELEMENT notification-type (#PCDATA)>
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/modelmbean/support/xml/xmbean.dtd 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,93 @@
+<!-- -->
+<!-- DTD for externalizing the definition of the -->
+<!-- JMX management interfaces. -->
+<!-- -->
+<!-- Author: Juha Lindfors -->
+<!-- -->
+
+<!--
+ The <mbean> element is the root element of the document containing the
+ required elements for describing the management interface of one
+ MBean (constructors, attributes, operations and notifications). It
+ also includes an optional description element that can be used to
+ describe the purpose of the MBean and attributes for persistence
+ policy and attribute caching.
+-->
+<!ELEMENT mbean (description?, constructor*, attribute*, operation*,
+ notification*)>
+<!ATTLIST mbean persistPolicy
+ (Never | OnUpdate | NoMoreOftenThan | OnTimer) "Never"
+ persistPeriod NMTOKEN #IMPLIED
+ persistLocation CDATA #IMPLIED
+ persistName CDATA #IMPLIED
+ currencyTimeLimit NMTOKEN #IMPLIED>
+
+<!--
+ The constructor element describes the constructors of an MBean
+ that are exposed to the management application. The optional
+ description element can be used to to describe the use of the
+ constructor.
+-->
+<!ELEMENT constructor (description?, name, parameter*)>
+
+<!--
+ The <attribute> element describes the management attributes of an
+ MBean. The <name> element contains the attribute's name and the <type>
+ element contains a fully qualified class name of the attribute's
+ type.
+
+ The optional <access> element defines the access type (read-only,
+ write-only, read-write) of this attribute. Valid values are:
+ <access>read-only</access>
+ <access>write-only</access>
+ <access>read-write</access>
+
+ If <access> element is not specified, read-write access is assumed.
+-->
+<!ELEMENT attribute (description?, name, type, access?)>
+<!ATTLIST attribute persistPolicy CDATA #IMPLIED
+ getMethod CDATA #IMPLIED
+ setMethod CDATA #IMPLIED
+ persistPeriod NMTOKEN #IMPLIED
+ currencyTimeLimit NMTOKEN #IMPLIED >
+
+<!--
+ The <operation> element describes a management operation of an MBean.
+ The <name> element contains the operation's name and the <parameter>
+ elements describe the operation's signature. The <return-type> element
+ must contain a fully qualified class name of the return type from
+ this operation.
+
+ If <return-type> is not specified, void is assumed.
+
+ The impact element describes the operation's impact on the MBean's
+ state when invoked. The valid values are:
+ <impact>ACTION</impact>
+ <impact>INFO</impact>
+ <impact>ACTION_INFO</impact>
+
+ If <impact> is not specified, ACTION_INFO is assumed.
+-->
+<!ELEMENT operation (description?, name, parameter*, return-type?,
+ impact?)>
+
+<!--
+ The <notification> element describes a management notification. The <name>
+ element contains the fully qualified name of the notification class and
+ the <notification-type> element contains the dot-separated notification
+ type string.
+-->
+<!ELEMENT notification (description?, name, notification-type+)>
+
+<!ELEMENT parameter (description?, name, type)>
+
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT description (#PCDATA)>
+<!ELEMENT type (#PCDATA)>
+<!ELEMENT access (#PCDATA)>
+<!ELEMENT impact (#PCDATA)>
+<!ELEMENT return-type (#PCDATA)>
+<!ELEMENT notification-type (#PCDATA)>
+
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/notification (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,188 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.notification;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.management.Notification;
-import javax.management.NotificationFilterSupport;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.notification.AsynchNotificationBroadcasterSupport;
-
-import test.implementation.notification.support.Listener;
-
-/**
- * Asynch Notification Broadcaster Support tests.
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class AsynchNotificationBroadcasterSupportTestCase
- extends TestCase
-{
- // Attributes ----------------------------------------------------------------
-
- /**
- * The sent notifications
- */
- private ArrayList sent = new ArrayList();
-
- /**
- * The next notification sequence
- */
- private long sequence = 0;
-
- /**
- * The default notification type
- */
- private static final String DEFAULT_TYPE = "DefaultType";
-
- /**
- * A different notification type
- */
- private static final String ANOTHER_TYPE = "AnotherType";
-
- /**
- * No notifications
- */
- private static final ArrayList EMPTY = new ArrayList();
-
- // Constructor ---------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public AsynchNotificationBroadcasterSupportTestCase(String s)
- {
- super(s);
- }
-
- // Tests ---------------------------------------------------------------------
-
- public void testAsynchDelivery()
- throws Exception
- {
- AsynchNotificationBroadcasterSupport broadcaster = new AsynchNotificationBroadcasterSupport();
-
- Listener listener = new Listener();
- broadcaster.addNotificationListener(listener, null, null);
-
- clear();
- createNotification(broadcaster);
-
- compare(EMPTY, received(listener, null));
-
- listener.doNotify(true);
- listener.doWait(false);
-
- compare(sent, received(listener, null));
- }
-
- public void testAsynchDeliveryTwice()
- throws Exception
- {
- AsynchNotificationBroadcasterSupport broadcaster = new AsynchNotificationBroadcasterSupport();
-
- Listener listener1 = new Listener();
- broadcaster.addNotificationListener(listener1, null, null);
- Listener listener2 = new Listener();
- broadcaster.addNotificationListener(listener2, null, null);
-
- clear();
- createNotification(broadcaster);
-
- compare(EMPTY, received(listener1, null));
- compare(EMPTY, received(listener2, null));
-
- listener1.doNotify(true);
- listener1.doWait(false);
-
- compare(sent, received(listener1, null));
- compare(EMPTY, received(listener2, null));
-
- listener2.doNotify(true);
- listener2.doWait(false);
-
- compare(sent, received(listener2, null));
- }
-
- // Support -------------------------------------------------------------------
-
- private void createNotification(AsynchNotificationBroadcasterSupport broadcaster)
- {
- createNotification(broadcaster, DEFAULT_TYPE);
- }
-
- private void createNotification(AsynchNotificationBroadcasterSupport broadcaster, String type)
- {
- synchronized(this)
- {
- sequence++;
- }
- Notification notification = new Notification(type, broadcaster, sequence);
- sent.add(notification);
- broadcaster.sendNotification(notification);
- }
-
- private void clear()
- {
- sent.clear();
- }
-
- private ArrayList apply(ArrayList sent, NotificationFilterSupport filter)
- {
- ArrayList result = new ArrayList();
- for (Iterator iterator = sent.iterator(); iterator.hasNext();)
- {
- Notification notification = (Notification) iterator.next();
- if (filter.isNotificationEnabled(notification))
- result.add(notification);
- }
- return result;
- }
-
- private ArrayList received(Listener listener, Object object)
- {
- ArrayList result = (ArrayList) listener.notifications.get(object);
- if (result == null)
- result = EMPTY;
- return result;
- }
-
- private void compare(ArrayList passedSent, ArrayList passedReceived)
- throws Exception
- {
- ArrayList sent = new ArrayList(passedSent);
- ArrayList received = new ArrayList(passedReceived);
-
- for (Iterator iterator = sent.iterator(); iterator.hasNext();)
- {
- Notification notification = (Notification) iterator.next();
- boolean found = received.remove(notification);
- assertTrue("Expected notification " + notification, found);
- }
-
- assertTrue("Didn't expect notification(s) " + received, received.isEmpty());
- }
-}
\ No newline at end of file
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/notification/AsynchNotificationBroadcasterSupportTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.notification;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.management.Notification;
+import javax.management.NotificationFilterSupport;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.notification.AsynchNotificationBroadcasterSupport;
+
+import test.implementation.notification.support.Listener;
+
+/**
+ * Asynch Notification Broadcaster Support tests.
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class AsynchNotificationBroadcasterSupportTestCase
+ extends TestCase
+{
+ // Attributes ----------------------------------------------------------------
+
+ /**
+ * The sent notifications
+ */
+ private ArrayList sent = new ArrayList();
+
+ /**
+ * The next notification sequence
+ */
+ private long sequence = 0;
+
+ /**
+ * The default notification type
+ */
+ private static final String DEFAULT_TYPE = "DefaultType";
+
+ /**
+ * A different notification type
+ */
+ private static final String ANOTHER_TYPE = "AnotherType";
+
+ /**
+ * No notifications
+ */
+ private static final ArrayList EMPTY = new ArrayList();
+
+ // Constructor ---------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public AsynchNotificationBroadcasterSupportTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Tests ---------------------------------------------------------------------
+
+ public void testAsynchDelivery()
+ throws Exception
+ {
+ AsynchNotificationBroadcasterSupport broadcaster = new AsynchNotificationBroadcasterSupport();
+
+ Listener listener = new Listener();
+ broadcaster.addNotificationListener(listener, null, null);
+
+ clear();
+ createNotification(broadcaster);
+
+ compare(EMPTY, received(listener, null));
+
+ listener.doNotify(true);
+ listener.doWait(false);
+
+ compare(sent, received(listener, null));
+ }
+
+ public void testAsynchDeliveryTwice()
+ throws Exception
+ {
+ AsynchNotificationBroadcasterSupport broadcaster = new AsynchNotificationBroadcasterSupport();
+
+ Listener listener1 = new Listener();
+ broadcaster.addNotificationListener(listener1, null, null);
+ Listener listener2 = new Listener();
+ broadcaster.addNotificationListener(listener2, null, null);
+
+ clear();
+ createNotification(broadcaster);
+
+ compare(EMPTY, received(listener1, null));
+ compare(EMPTY, received(listener2, null));
+
+ listener1.doNotify(true);
+ listener1.doWait(false);
+
+ compare(sent, received(listener1, null));
+ compare(EMPTY, received(listener2, null));
+
+ listener2.doNotify(true);
+ listener2.doWait(false);
+
+ compare(sent, received(listener2, null));
+ }
+
+ // Support -------------------------------------------------------------------
+
+ private void createNotification(AsynchNotificationBroadcasterSupport broadcaster)
+ {
+ createNotification(broadcaster, DEFAULT_TYPE);
+ }
+
+ private void createNotification(AsynchNotificationBroadcasterSupport broadcaster, String type)
+ {
+ synchronized(this)
+ {
+ sequence++;
+ }
+ Notification notification = new Notification(type, broadcaster, sequence);
+ sent.add(notification);
+ broadcaster.sendNotification(notification);
+ }
+
+ private void clear()
+ {
+ sent.clear();
+ }
+
+ private ArrayList apply(ArrayList sent, NotificationFilterSupport filter)
+ {
+ ArrayList result = new ArrayList();
+ for (Iterator iterator = sent.iterator(); iterator.hasNext();)
+ {
+ Notification notification = (Notification) iterator.next();
+ if (filter.isNotificationEnabled(notification))
+ result.add(notification);
+ }
+ return result;
+ }
+
+ private ArrayList received(Listener listener, Object object)
+ {
+ ArrayList result = (ArrayList) listener.notifications.get(object);
+ if (result == null)
+ result = EMPTY;
+ return result;
+ }
+
+ private void compare(ArrayList passedSent, ArrayList passedReceived)
+ throws Exception
+ {
+ ArrayList sent = new ArrayList(passedSent);
+ ArrayList received = new ArrayList(passedReceived);
+
+ for (Iterator iterator = sent.iterator(); iterator.hasNext();)
+ {
+ Notification notification = (Notification) iterator.next();
+ boolean found = received.remove(notification);
+ assertTrue("Expected notification " + notification, found);
+ }
+
+ assertTrue("Didn't expect notification(s) " + received, received.isEmpty());
+ }
+}
\ No newline at end of file
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/notification/NotificationSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification/NotificationSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/notification/NotificationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.notification;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * JBossMX Specific Notification tests.
- *
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class NotificationSUITE
- extends TestSuite
-{
- /**
- * Run the tests
- *
- * @param args the arguments for the test
- */
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Get a list of tests.
- *
- * @return the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Specific Notiifcation tests");
-
- suite.addTest(new TestSuite(AsynchNotificationBroadcasterSupportTestCase.class));
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/notification/NotificationSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification/NotificationSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/notification/NotificationSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/notification/NotificationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.notification;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * JBossMX Specific Notification tests.
+ *
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class NotificationSUITE
+ extends TestSuite
+{
+ /**
+ * Run the tests
+ *
+ * @param args the arguments for the test
+ */
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Get a list of tests.
+ *
+ * @return the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Specific Notiifcation tests");
+
+ suite.addTest(new TestSuite(AsynchNotificationBroadcasterSupportTestCase.class));
+
+ return suite;
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/Listener.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification/support/Listener.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/Listener.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.notification.support;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import javax.management.Notification;
-import javax.management.NotificationListener;
-
-/**
- * A listener
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class Listener
- implements NotificationListener
-{
- // Attributes ----------------------------------------------------------------
-
- /**
- * The notifications received by handback object
- */
- public HashMap notifications = new HashMap();
-
- public boolean waiting = false;
-
- // Constructor ---------------------------------------------------------------
-
- /**
- * Constructor
- */
- public Listener()
- {
- }
-
- // Notification Listener Implementation --------------------------------------
-
- /**
- * Handle the notification
- */
- public void handleNotification(Notification notification, Object handback)
- {
- doWait(true);
-
- synchronized(notifications)
- {
- ArrayList received = (ArrayList) notifications.get(handback);
- if (received == null)
- {
- received = new ArrayList();
- notifications.put(handback, received);
- }
- received.add(notification);
- }
-
- doNotify(false);
- }
-
- public synchronized void doWait(boolean value)
- {
- try
- {
- waiting = value;
- this.wait();
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e.toString());
- }
- }
-
- public synchronized void doNotify(boolean expected)
- {
- try
- {
- while (waiting != expected)
- this.wait(10);
- this.notifyAll();
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e.toString());
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/Listener.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/notification/support/Listener.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/Listener.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/notification/support/Listener.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.notification.support;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.management.Notification;
+import javax.management.NotificationListener;
+
+/**
+ * A listener
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class Listener
+ implements NotificationListener
+{
+ // Attributes ----------------------------------------------------------------
+
+ /**
+ * The notifications received by handback object
+ */
+ public HashMap notifications = new HashMap();
+
+ public boolean waiting = false;
+
+ // Constructor ---------------------------------------------------------------
+
+ /**
+ * Constructor
+ */
+ public Listener()
+ {
+ }
+
+ // Notification Listener Implementation --------------------------------------
+
+ /**
+ * Handle the notification
+ */
+ public void handleNotification(Notification notification, Object handback)
+ {
+ doWait(true);
+
+ synchronized(notifications)
+ {
+ ArrayList received = (ArrayList) notifications.get(handback);
+ if (received == null)
+ {
+ received = new ArrayList();
+ notifications.put(handback, received);
+ }
+ received.add(notification);
+ }
+
+ doNotify(false);
+ }
+
+ public synchronized void doWait(boolean value)
+ {
+ try
+ {
+ waiting = value;
+ this.wait();
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException(e.toString());
+ }
+ }
+
+ public synchronized void doNotify(boolean expected)
+ {
+ try
+ {
+ while (waiting != expected)
+ this.wait(10);
+ this.notifyAll();
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException(e.toString());
+ }
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.persistence;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.Descriptor;
-import javax.management.ObjectName;
-import javax.management.modelmbean.DescriptorSupport;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.modelmbean.ModelMBeanInfo;
-import javax.management.modelmbean.ModelMBeanInfoSupport;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-import javax.management.modelmbean.RequiredModelMBean;
-
-import org.jboss.mx.modelmbean.ModelMBeanConstants;
-
-import junit.framework.TestCase;
-
-import test.implementation.persistence.support.Resource;
-
-public class OnTimerPersistenceTEST
- extends TestCase
- implements ModelMBeanConstants
-{
-
- public OnTimerPersistenceTEST(String s)
- {
- super(s);
- }
-
- public void testOnTimerCallback()
- {
- try
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
-
- Descriptor descriptor = new DescriptorSupport();
- descriptor.setField(NAME, "Active");
- descriptor.setField(DESCRIPTOR_TYPE, ATTRIBUTE_DESCRIPTOR);
- descriptor.setField(PERSIST_POLICY, PP_ON_TIMER);
- descriptor.setField(PERSIST_PERIOD, "1000");
-
- ModelMBeanAttributeInfo attrInfo = new ModelMBeanAttributeInfo(
- "Active",
- boolean.class.getName(),
- "Test Attribute",
- IS_READABLE,
- !IS_WRITABLE,
- !IS_IS,
- descriptor
- );
-
- ModelMBeanInfo info = new ModelMBeanInfoSupport(
- Resource.class.getName(),
- "Test Resource",
- new ModelMBeanAttributeInfo[] { attrInfo },
- null, // constructors
- null, // operations
- null // notification
- );
-
- ModelMBean mmb = new RequiredModelMBean();
- mmb.setManagedResource(new Resource(), OBJECT_REF);
- mmb.setModelMBeanInfo(info);
-
- ObjectName oname = new ObjectName("test:name=OnTimerCallBack");
- server.registerMBean(mmb, oname);
-
- Thread.sleep(5000);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Creating Required ModelMBean instance with default constructor failed: " + t.toString());
- }
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/OnTimerPersistenceTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.persistence;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.Descriptor;
+import javax.management.ObjectName;
+import javax.management.modelmbean.DescriptorSupport;
+import javax.management.modelmbean.ModelMBean;
+import javax.management.modelmbean.ModelMBeanInfo;
+import javax.management.modelmbean.ModelMBeanInfoSupport;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+import javax.management.modelmbean.RequiredModelMBean;
+
+import org.jboss.mx.modelmbean.ModelMBeanConstants;
+
+import junit.framework.TestCase;
+
+import test.implementation.persistence.support.Resource;
+
+public class OnTimerPersistenceTEST
+ extends TestCase
+ implements ModelMBeanConstants
+{
+
+ public OnTimerPersistenceTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testOnTimerCallback()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+
+ Descriptor descriptor = new DescriptorSupport();
+ descriptor.setField(NAME, "Active");
+ descriptor.setField(DESCRIPTOR_TYPE, ATTRIBUTE_DESCRIPTOR);
+ descriptor.setField(PERSIST_POLICY, PP_ON_TIMER);
+ descriptor.setField(PERSIST_PERIOD, "1000");
+
+ ModelMBeanAttributeInfo attrInfo = new ModelMBeanAttributeInfo(
+ "Active",
+ boolean.class.getName(),
+ "Test Attribute",
+ IS_READABLE,
+ !IS_WRITABLE,
+ !IS_IS,
+ descriptor
+ );
+
+ ModelMBeanInfo info = new ModelMBeanInfoSupport(
+ Resource.class.getName(),
+ "Test Resource",
+ new ModelMBeanAttributeInfo[] { attrInfo },
+ null, // constructors
+ null, // operations
+ null // notification
+ );
+
+ ModelMBean mmb = new RequiredModelMBean();
+ mmb.setManagedResource(new Resource(), OBJECT_REF);
+ mmb.setModelMBeanInfo(info);
+
+ ObjectName oname = new ObjectName("test:name=OnTimerCallBack");
+ server.registerMBean(mmb, oname);
+
+ Thread.sleep(5000);
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Creating Required ModelMBean instance with default constructor failed: " + t.toString());
+ }
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class PersistenceSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Persistence Interceptor and Persistence Manager Tests");
-
- suite.addTest(new TestSuite(OnTimerPersistenceTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/PersistenceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.persistence;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class PersistenceSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Persistence Interceptor and Persistence Manager Tests");
+
+ suite.addTest(new TestSuite(OnTimerPersistenceTEST.class));
+
+ return suite;
+ }
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/Resource.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence/support/Resource.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/Resource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.persistence.support;
-
-public class Resource {
-
- public boolean isActive() {
- return true;
- }
-
-
-
-}
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/Resource.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/persistence/support/Resource.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/Resource.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/persistence/support/Resource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.persistence.support;
+
+public class Resource {
+
+ public boolean isActive() {
+ return true;
+ }
+
+
+
+}
+
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/registry (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/RegistrySUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/RegistrySUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/RegistrySUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.registry;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * JBossMX Specific Registry tests.
- *
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class RegistrySUITE
- extends TestSuite
-{
- /**
- * Run the tests
- *
- * @param args the arguments for the test
- */
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Get a list of tests.
- *
- * @return the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Specific Registry tests");
-
- suite.addTest(new TestSuite(ValuesTestCase.class));
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/RegistrySUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/RegistrySUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/registry/RegistrySUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/RegistrySUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.registry;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * JBossMX Specific Registry tests.
+ *
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class RegistrySUITE
+ extends TestSuite
+{
+ /**
+ * Run the tests
+ *
+ * @param args the arguments for the test
+ */
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Get a list of tests.
+ *
+ * @return the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Specific Registry tests");
+
+ suite.addTest(new TestSuite(ValuesTestCase.class));
+
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/ValuesTestCase.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/ValuesTestCase.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/ValuesTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,257 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.registry;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.server.ServerConstants;
-
-import test.implementation.registry.support.Trivial;
-
-/**
- * Tests the value map processing in the managed mbean registry
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class ValuesTestCase
- extends TestCase
- implements ServerConstants
-{
- // Attributes ----------------------------------------------------------------
-
- // Constructor ---------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public ValuesTestCase(String s)
- {
- super(s);
- }
-
- // Tests ---------------------------------------------------------------------
-
- /**
- * Test classloader
- */
- public void testClassLoader()
- throws Exception
- {
- // Get the previous registry value
- String previous = System.getProperty(MBEAN_REGISTRY_CLASS_PROPERTY);
- if (previous == null)
- previous = DEFAULT_MBEAN_REGISTRY_CLASS;
- //System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY,
- // "org.jboss.mx.server.registry.ManagedMBeanRegistry");
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- try
- {
- HashMap valuesMap = new HashMap();
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- valuesMap.put(CLASSLOADER, Thread.currentThread().getContextClassLoader());
- ObjectName mbean = new ObjectName("test:test=test");
- server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
- new Object[]
- {
- new Trivial(),
- mbean,
- valuesMap
- },
- new String[]
- {
- Object.class.getName(),
- ObjectName.class.getName(),
- Map.class.getName()
- }
- );
- Object result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
- new Object[]
- {
- mbean,
- CLASSLOADER
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
- assertEquals(cl, result);
- }
- finally
- {
- MBeanServerFactory.releaseMBeanServer(server);
- System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY, previous);
- }
- }
-
- /**
- * Test value
- */
- public void testValue()
- throws Exception
- {
- // Get the previous registry value
- String previous = System.getProperty(MBEAN_REGISTRY_CLASS_PROPERTY);
- if (previous == null)
- previous = DEFAULT_MBEAN_REGISTRY_CLASS;
- //System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY,
- // "org.jboss.mx.server.registry.ManagedMBeanRegistry");
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- try
- {
- HashMap valuesMap = new HashMap();
- Date date = new Date(System.currentTimeMillis());
- valuesMap.put("date", date);
- ObjectName mbean = new ObjectName("test:test=test");
- server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
- new Object[]
- {
- new Trivial(),
- mbean,
- valuesMap
- },
- new String[]
- {
- Object.class.getName(),
- ObjectName.class.getName(),
- Map.class.getName()
- }
- );
- Object result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
- new Object[]
- {
- mbean,
- "date"
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
- assertEquals(date, result);
- }
- finally
- {
- MBeanServerFactory.releaseMBeanServer(server);
- System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY, previous);
- }
- }
-
- /**
- * Test value registered
- */
- public void testValueRegistered()
- throws Exception
- {
- // Get the previous registry value
- String previous = System.getProperty(MBEAN_REGISTRY_CLASS_PROPERTY);
- if (previous == null)
- previous = DEFAULT_MBEAN_REGISTRY_CLASS;
- //System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY,
- // "org.jboss.mx.server.registry.ManagedMBeanRegistry");
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- try
- {
- HashMap valuesMap = new HashMap();
- Date date = new Date(System.currentTimeMillis());
- valuesMap.put("date", date);
- ObjectName mbean = new ObjectName("test:test=test");
- server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
- new Object[]
- {
- new Trivial(),
- mbean,
- valuesMap
- },
- new String[]
- {
- Object.class.getName(),
- ObjectName.class.getName(),
- Map.class.getName()
- }
- );
- Object result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
- new Object[]
- {
- mbean,
- "date"
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
- assertEquals(date, result);
-
- // Now remove it, reregister it and make sure it returns the new value
- server.unregisterMBean(mbean);
-
- Thread.sleep(2);
- date = new Date(System.currentTimeMillis());
- HashMap valueMap2 = new HashMap();
- valueMap2.put("date", date);
- server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
- new Object[]
- {
- new Trivial(),
- mbean,
- valueMap2
- },
- new String[]
- {
- Object.class.getName(),
- ObjectName.class.getName(),
- Map.class.getName()
- }
- );
- result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
- new Object[]
- {
- mbean,
- "date"
- },
- new String[]
- {
- ObjectName.class.getName(),
- String.class.getName()
- }
- );
- assertEquals(date, result);
- }
- finally
- {
- MBeanServerFactory.releaseMBeanServer(server);
- System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY, previous);
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/ValuesTestCase.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/ValuesTestCase.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/registry/ValuesTestCase.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/ValuesTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,257 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.registry;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.server.ServerConstants;
+
+import test.implementation.registry.support.Trivial;
+
+/**
+ * Tests the value map processing in the managed mbean registry
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class ValuesTestCase
+ extends TestCase
+ implements ServerConstants
+{
+ // Attributes ----------------------------------------------------------------
+
+ // Constructor ---------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public ValuesTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Tests ---------------------------------------------------------------------
+
+ /**
+ * Test classloader
+ */
+ public void testClassLoader()
+ throws Exception
+ {
+ // Get the previous registry value
+ String previous = System.getProperty(MBEAN_REGISTRY_CLASS_PROPERTY);
+ if (previous == null)
+ previous = DEFAULT_MBEAN_REGISTRY_CLASS;
+ //System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY,
+ // "org.jboss.mx.server.registry.ManagedMBeanRegistry");
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ try
+ {
+ HashMap valuesMap = new HashMap();
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ valuesMap.put(CLASSLOADER, Thread.currentThread().getContextClassLoader());
+ ObjectName mbean = new ObjectName("test:test=test");
+ server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
+ new Object[]
+ {
+ new Trivial(),
+ mbean,
+ valuesMap
+ },
+ new String[]
+ {
+ Object.class.getName(),
+ ObjectName.class.getName(),
+ Map.class.getName()
+ }
+ );
+ Object result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
+ new Object[]
+ {
+ mbean,
+ CLASSLOADER
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+ assertEquals(cl, result);
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY, previous);
+ }
+ }
+
+ /**
+ * Test value
+ */
+ public void testValue()
+ throws Exception
+ {
+ // Get the previous registry value
+ String previous = System.getProperty(MBEAN_REGISTRY_CLASS_PROPERTY);
+ if (previous == null)
+ previous = DEFAULT_MBEAN_REGISTRY_CLASS;
+ //System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY,
+ // "org.jboss.mx.server.registry.ManagedMBeanRegistry");
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ try
+ {
+ HashMap valuesMap = new HashMap();
+ Date date = new Date(System.currentTimeMillis());
+ valuesMap.put("date", date);
+ ObjectName mbean = new ObjectName("test:test=test");
+ server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
+ new Object[]
+ {
+ new Trivial(),
+ mbean,
+ valuesMap
+ },
+ new String[]
+ {
+ Object.class.getName(),
+ ObjectName.class.getName(),
+ Map.class.getName()
+ }
+ );
+ Object result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
+ new Object[]
+ {
+ mbean,
+ "date"
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+ assertEquals(date, result);
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY, previous);
+ }
+ }
+
+ /**
+ * Test value registered
+ */
+ public void testValueRegistered()
+ throws Exception
+ {
+ // Get the previous registry value
+ String previous = System.getProperty(MBEAN_REGISTRY_CLASS_PROPERTY);
+ if (previous == null)
+ previous = DEFAULT_MBEAN_REGISTRY_CLASS;
+ //System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY,
+ // "org.jboss.mx.server.registry.ManagedMBeanRegistry");
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ try
+ {
+ HashMap valuesMap = new HashMap();
+ Date date = new Date(System.currentTimeMillis());
+ valuesMap.put("date", date);
+ ObjectName mbean = new ObjectName("test:test=test");
+ server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
+ new Object[]
+ {
+ new Trivial(),
+ mbean,
+ valuesMap
+ },
+ new String[]
+ {
+ Object.class.getName(),
+ ObjectName.class.getName(),
+ Map.class.getName()
+ }
+ );
+ Object result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
+ new Object[]
+ {
+ mbean,
+ "date"
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+ assertEquals(date, result);
+
+ // Now remove it, reregister it and make sure it returns the new value
+ server.unregisterMBean(mbean);
+
+ Thread.sleep(2);
+ date = new Date(System.currentTimeMillis());
+ HashMap valueMap2 = new HashMap();
+ valueMap2.put("date", date);
+ server.invoke(new ObjectName(MBEAN_REGISTRY), "registerMBean",
+ new Object[]
+ {
+ new Trivial(),
+ mbean,
+ valueMap2
+ },
+ new String[]
+ {
+ Object.class.getName(),
+ ObjectName.class.getName(),
+ Map.class.getName()
+ }
+ );
+ result = server.invoke(new ObjectName(MBEAN_REGISTRY), "getValue",
+ new Object[]
+ {
+ mbean,
+ "date"
+ },
+ new String[]
+ {
+ ObjectName.class.getName(),
+ String.class.getName()
+ }
+ );
+ assertEquals(date, result);
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ System.setProperty(MBEAN_REGISTRY_CLASS_PROPERTY, previous);
+ }
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/Trivial.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/support/Trivial.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.registry.support;
-
-public class Trivial implements TrivialMBean
-{
- private String something = null;
- private boolean anAttribute = true;
-
- public void setSomething(String thing)
- {
- this.something = thing;
- }
-
- public String getSomething()
- {
- return something;
- }
-
- public void doOperation(String arg)
- {
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/Trivial.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/support/Trivial.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/Trivial.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.registry.support;
+
+public class Trivial implements TrivialMBean
+{
+ private String something = null;
+ private boolean anAttribute = true;
+
+ public void setSomething(String thing)
+ {
+ this.something = thing;
+ }
+
+ public String getSomething()
+ {
+ return something;
+ }
+
+ public void doOperation(String arg)
+ {
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.registry.support;
-
-public interface TrivialMBean
-{
- void setSomething(String thing);
-
- String getSomething();
-
- void doOperation(String arg);
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/registry/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.registry.support;
+
+public interface TrivialMBean
+{
+ void setSomething(String thing);
+
+ String getSomething();
+
+ void doOperation(String arg);
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/server (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,196 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.server;
-
-import junit.framework.TestCase;
-
-import test.implementation.server.support.Trivial;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import javax.management.ObjectInstance;
-
-import org.jboss.mx.server.ServerObjectInstance;
-
-/**
- * Tests the ObjectInstance handling which is a bit brain-dead in the RI.<p>
- *
- * Maybe one-day these will be part of the compliance testsuite.
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class ObjectInstanceTestCase
- extends TestCase
-{
- // Attributes ----------------------------------------------------------------
-
- // Constructor ---------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public ObjectInstanceTestCase(String s)
- {
- super(s);
- }
-
- // Tests that should work in the RI ------------------------------------------
-
- /**
- * Test default domain
- */
- public void testDefaultDomain()
- {
- MBeanServer server =null;
- ObjectName unqualifiedName = null;
- ObjectName qualifiedName = null;
- ObjectInstance instance1 = null;
- ObjectInstance instance2 = null;
- try
- {
- server = MBeanServerFactory.createMBeanServer();
- unqualifiedName = new ObjectName(":property=1");
- qualifiedName = new ObjectName("DefaultDomain:property=1");
- instance1 = server.registerMBean(new Trivial(), qualifiedName);
- instance2 = server.getObjectInstance(unqualifiedName);
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
-
- assertEquals(instance1.getObjectName(),qualifiedName);
- assertEquals(instance1, instance2);
-
- if (server != null)
- MBeanServerFactory.releaseMBeanServer(server);
- }
-
- /**
- * Test different servers
- */
- public void testDifferentServers()
- {
- MBeanServer server =null;
- ObjectName name = null;
- ObjectInstance instance1 = null;
- ObjectInstance instance2 = null;
- try
- {
- server = MBeanServerFactory.createMBeanServer();
- name = new ObjectName(":property=1");
- instance1 = server.registerMBean(new Trivial(), name);
- MBeanServerFactory.releaseMBeanServer(server);
- server = MBeanServerFactory.createMBeanServer();
- instance2 = server.registerMBean(new Trivial(), name);
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
-
- if (instance1.equals(instance2) == true)
- fail("Instances in different servers are the same");
-
- if (server != null)
- MBeanServerFactory.releaseMBeanServer(server);
- }
-
- // Tests that need to work in JBossMX because of the extra agent id --------
-
- /**
- * Test ObjectInstance/ServerObjectInstance Equals
- */
- public void testEquals()
- {
- // Create the object instances
- ObjectInstance oi = null;
- ServerObjectInstance soi = null;
- ObjectName name = null;
- String className = "org.jboss.AClass";
- try
- {
- name = new ObjectName(":a=a");
- oi = new ObjectInstance(name, className);
- soi = new ServerObjectInstance(name, className, "agentid");
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- assertEquals(oi, soi);
- }
- /**
- * Test serialization. For moving between implementations, this HAS
- * to produce an ObjectInstance.
- */
- public void testSerialization()
- {
- // Create the new object Instance
- ServerObjectInstance original = null;
- ObjectInstance result = null;
- ObjectName name = null;
- String className = "org.jboss.AClassName";
- try
- {
- name = new ObjectName(":a=a");
- original = new ServerObjectInstance(name, className, "agentid");
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
-
- try
- {
- // Serialize it
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(original);
-
- // Deserialize it
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectInputStream ois = new ObjectInputStream(bais);
- result = (ObjectInstance) ois.readObject();
- }
- catch (IOException ioe)
- {
- fail(ioe.toString());
- }
- catch (ClassNotFoundException cnfe)
- {
- fail(cnfe.toString());
- }
-
- // Did it work?
- assertEquals("javax.management.ObjectInstance", result.getClass().getName());
- assertEquals(name, result.getObjectName());
- assertEquals(className, result.getClassName());
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/ObjectInstanceTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,196 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.server;
+
+import junit.framework.TestCase;
+
+import test.implementation.server.support.Trivial;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+import javax.management.ObjectInstance;
+
+import org.jboss.mx.server.ServerObjectInstance;
+
+/**
+ * Tests the ObjectInstance handling which is a bit brain-dead in the RI.<p>
+ *
+ * Maybe one-day these will be part of the compliance testsuite.
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class ObjectInstanceTestCase
+ extends TestCase
+{
+ // Attributes ----------------------------------------------------------------
+
+ // Constructor ---------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public ObjectInstanceTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Tests that should work in the RI ------------------------------------------
+
+ /**
+ * Test default domain
+ */
+ public void testDefaultDomain()
+ {
+ MBeanServer server =null;
+ ObjectName unqualifiedName = null;
+ ObjectName qualifiedName = null;
+ ObjectInstance instance1 = null;
+ ObjectInstance instance2 = null;
+ try
+ {
+ server = MBeanServerFactory.createMBeanServer();
+ unqualifiedName = new ObjectName(":property=1");
+ qualifiedName = new ObjectName("DefaultDomain:property=1");
+ instance1 = server.registerMBean(new Trivial(), qualifiedName);
+ instance2 = server.getObjectInstance(unqualifiedName);
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+
+ assertEquals(instance1.getObjectName(),qualifiedName);
+ assertEquals(instance1, instance2);
+
+ if (server != null)
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+
+ /**
+ * Test different servers
+ */
+ public void testDifferentServers()
+ {
+ MBeanServer server =null;
+ ObjectName name = null;
+ ObjectInstance instance1 = null;
+ ObjectInstance instance2 = null;
+ try
+ {
+ server = MBeanServerFactory.createMBeanServer();
+ name = new ObjectName(":property=1");
+ instance1 = server.registerMBean(new Trivial(), name);
+ MBeanServerFactory.releaseMBeanServer(server);
+ server = MBeanServerFactory.createMBeanServer();
+ instance2 = server.registerMBean(new Trivial(), name);
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+
+ if (instance1.equals(instance2) == true)
+ fail("Instances in different servers are the same");
+
+ if (server != null)
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+
+ // Tests that need to work in JBossMX because of the extra agent id --------
+
+ /**
+ * Test ObjectInstance/ServerObjectInstance Equals
+ */
+ public void testEquals()
+ {
+ // Create the object instances
+ ObjectInstance oi = null;
+ ServerObjectInstance soi = null;
+ ObjectName name = null;
+ String className = "org.jboss.AClass";
+ try
+ {
+ name = new ObjectName(":a=a");
+ oi = new ObjectInstance(name, className);
+ soi = new ServerObjectInstance(name, className, "agentid");
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ assertEquals(oi, soi);
+ }
+ /**
+ * Test serialization. For moving between implementations, this HAS
+ * to produce an ObjectInstance.
+ */
+ public void testSerialization()
+ {
+ // Create the new object Instance
+ ServerObjectInstance original = null;
+ ObjectInstance result = null;
+ ObjectName name = null;
+ String className = "org.jboss.AClassName";
+ try
+ {
+ name = new ObjectName(":a=a");
+ original = new ServerObjectInstance(name, className, "agentid");
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+
+ try
+ {
+ // Serialize it
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(original);
+
+ // Deserialize it
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ result = (ObjectInstance) ois.readObject();
+ }
+ catch (IOException ioe)
+ {
+ fail(ioe.toString());
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ fail(cnfe.toString());
+ }
+
+ // Did it work?
+ assertEquals("javax.management.ObjectInstance", result.getClass().getName());
+ assertEquals(name, result.getObjectName());
+ assertEquals(className, result.getClassName());
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/server/ServerSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/ServerSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/ServerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.server;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * JBossMX Specific Server tests.
- *
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class ServerSUITE
- extends TestSuite
-{
- /**
- * Run the tests
- *
- * @param args the arguments for the test
- */
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Get a list of tests.
- *
- * @return the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Specific Server tests");
-
- suite.addTest(new TestSuite(ObjectInstanceTestCase.class));
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/server/ServerSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/ServerSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/server/ServerSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/ServerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.server;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * JBossMX Specific Server tests.
+ *
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class ServerSUITE
+ extends TestSuite
+{
+ /**
+ * Run the tests
+ *
+ * @param args the arguments for the test
+ */
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Get a list of tests.
+ *
+ * @return the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Specific Server tests");
+
+ suite.addTest(new TestSuite(ObjectInstanceTestCase.class));
+
+ return suite;
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/server/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/Trivial.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/support/Trivial.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.server.support;
-
-public class Trivial implements TrivialMBean
-{
- private String something = null;
- private boolean anAttribute = true;
-
- public void setSomething(String thing)
- {
- this.something = thing;
- }
-
- public String getSomething()
- {
- return something;
- }
-
- public void doOperation(String arg)
- {
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/Trivial.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/support/Trivial.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/Trivial.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.server.support;
+
+public class Trivial implements TrivialMBean
+{
+ private String something = null;
+ private boolean anAttribute = true;
+
+ public void setSomething(String thing)
+ {
+ this.something = thing;
+ }
+
+ public String getSomething()
+ {
+ return something;
+ }
+
+ public void doOperation(String arg)
+ {
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/TrivialMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/support/TrivialMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.server.support;
-
-public interface TrivialMBean
-{
- void setSomething(String thing);
-
- String getSomething();
-
- void doOperation(String arg);
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/TrivialMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/server/support/TrivialMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/TrivialMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/server/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.server.support;
+
+public interface TrivialMBean
+{
+ void setSomething(String thing);
+
+ String getSomething();
+
+ void doOperation(String arg);
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/AgentIDTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/AgentIDTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/AgentIDTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.server.ServerConstants;
-import org.jboss.mx.util.AgentID;
-
-
-public class AgentIDTEST extends TestCase implements ServerConstants
-{
- public AgentIDTEST(String s)
- {
- super(s);
- }
-
- public void testCreate()
- {
- String id1 = AgentID.create();
- String id2 = AgentID.create();
-
- assertTrue(!id1.equals(id2));
- }
-
- public void testGet()
- {
- try
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- String id1 = (String)server.getAttribute(new ObjectName(MBEAN_SERVER_DELEGATE), "MBeanServerId");
- String id2 = AgentID.get(server);
-
- assertTrue(id1.equals(id2));
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/AgentIDTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/AgentIDTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/AgentIDTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/AgentIDTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.server.ServerConstants;
+import org.jboss.mx.util.AgentID;
+
+
+public class AgentIDTEST extends TestCase implements ServerConstants
+{
+ public AgentIDTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testCreate()
+ {
+ String id1 = AgentID.create();
+ String id2 = AgentID.create();
+
+ assertTrue(!id1.equals(id2));
+ }
+
+ public void testGet()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ String id1 = (String)server.getAttribute(new ObjectName(MBEAN_SERVER_DELEGATE), "MBeanServerId");
+ String id2 = AgentID.get(server);
+
+ assertTrue(id1.equals(id2));
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,592 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util;
-
-import java.util.Set;
-
-import java.lang.reflect.Method;
-
-import javax.management.Attribute;
-import javax.management.AttributeNotFoundException;
-import javax.management.DynamicMBean;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-
-import javax.management.modelmbean.ModelMBean;
-import javax.management.modelmbean.RequiredModelMBean;
-
-import test.implementation.util.support.Trivial;
-import test.implementation.util.support.TrivialMBean;
-import test.implementation.util.support.Trivial2;
-import test.implementation.util.support.Trivial2MBean;
-import test.implementation.util.support.ExtendedResource;
-import test.implementation.util.support.MyInterface;
-import test.implementation.util.support.MyInterface2;
-import test.implementation.util.support.Resource;
-import test.implementation.util.support.ResourceOverride;
-import test.implementation.util.support.ResourceIncorrectInfo;
-
-import junit.framework.TestCase;
-
-import org.jboss.mx.util.AgentID;
-import org.jboss.mx.util.DefaultExceptionHandler;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.ProxyContext;
-
-import org.jboss.mx.modelmbean.XMBean;
-
-
-/**
- * Tests for mbean proxy
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class MBeanProxyTEST extends TestCase
-{
- public MBeanProxyTEST(String s)
- {
- super(s);
- }
-
- public void testGetWithServer() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:name=test");
-
- server.registerMBean(new Trivial(), oname);
-
- TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
- TrivialMBean.class, oname, server);
-
- mbean.doOperation();
- }
-
- public void testGetWithAgentID() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- String agentID = AgentID.get(server);
- ObjectName oname = new ObjectName("test:name=test");
-
- server.registerMBean(new Trivial(), oname);
-
- TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
- TrivialMBean.class, oname, agentID);
-
- mbean.doOperation();
- }
-
- public void testCreateWithServer() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- TrivialMBean mbean = (TrivialMBean)MBeanProxy.create(
- Trivial.class, TrivialMBean.class, oname, server);
-
- mbean.doOperation();
- }
-
- public void testCreateWithAgentID() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
- String agentID = AgentID.get(server);
-
- TrivialMBean mbean = (TrivialMBean)MBeanProxy.create(
- Trivial.class, TrivialMBean.class, oname, agentID);
-
- mbean.doOperation();
- }
-
- public void testProxyInvocations() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:name=test");
-
- server.registerMBean(new Trivial(), oname);
-
- TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
- TrivialMBean.class, oname, AgentID.get(server));
-
- mbean.doOperation();
- mbean.setSomething("JBossMX");
-
- assertEquals("JBossMX", mbean.getSomething());
- }
-
- public void testProxyInvocationWithConflictingMBeanAndContextMethods() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- server.registerMBean(new Trivial(), oname);
-
- TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
- TrivialMBean.class, oname, AgentID.get(server));
-
- mbean.getMBeanServer();
- assertTrue(mbean.isGMSInvoked());
- }
-
- public void testContextAccess() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
- Trivial2.class, Trivial2MBean.class, oname, server
- );
-
- ProxyContext ctx = (ProxyContext)mbean;
-
- ctx.getMBeanServer();
- }
-
- public void testProxyInvocationBetweenServers() throws Exception
- {
- MBeanServer server1 = MBeanServerFactory.createMBeanServer();
- MBeanServer server2 = MBeanServerFactory.createMBeanServer();
- ObjectName oname1 = new ObjectName("test:name=target");
- ObjectName oname2 = new ObjectName("test:name=proxy");
-
- // createMBean on server1 and retrieve a proxy to it
- Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
- Trivial2.class, Trivial2MBean.class, oname1, server1
- );
-
- //bind the proxy to server2
- server2.registerMBean(mbean, oname2);
-
- // invoke on server2
- server2.invoke(oname2, "doOperation", null, null);
-
- // check that server1 received the invocation
- assertTrue(((Boolean)server1.getAttribute(oname1, "OperationInvoked")).booleanValue());
- }
-
- public void testSimultaneousTypedAndDetypedInvocations() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
- Trivial2.class, Trivial2MBean.class, oname,server
- );
-
- // typed proxy interface
- mbean.setSomething("Kissa");
- assertTrue(mbean.getSomething().equals("Kissa"));
-
- // detyped proxy interface
- DynamicMBean mbean2 = (DynamicMBean)mbean;
- mbean2.setAttribute(new Attribute("Something", "Koira"));
- assertTrue(mbean2.getAttribute("Something").equals("Koira"));
-
- // direct local server invocation
- server.setAttribute(oname, new Attribute("Something", "Kissa"));
- assertTrue(server.getAttribute(oname, "Something").equals("Kissa"));
-
- // typed proxy interface invocation
- mbean.doOperation();
- assertTrue(mbean.isOperationInvoked());
-
- mbean.reset();
-
- // detyped proxy invocation
- mbean2.invoke("doOperation", null, null);
- assertTrue(((Boolean)mbean2.getAttribute("OperationInvoked")).booleanValue());
-
- mbean2.invoke("reset", null, null);
-
- // direct local server invocation
- server.invoke(oname, "doOperation", null, null);
- assertTrue(((Boolean)server.getAttribute(oname, "OperationInvoked")).booleanValue());
- }
-
- public void testContextAccessToMBeanServer() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
- Trivial2.class, Trivial2MBean.class, oname, server
- );
-
- // query the server this mbean is registered to
- ProxyContext ctx = (ProxyContext)mbean;
- MBeanServer srvr = ctx.getMBeanServer();
-
- Set mbeans = srvr.queryMBeans(new ObjectName("test:*"), null);
- ObjectInstance oi = (ObjectInstance)mbeans.iterator().next();
-
- assertTrue(oi.getObjectName().equals(oname));
-
- assertTrue(srvr.getAttribute(
- new ObjectName("JMImplementation:type=MBeanServerDelegate"),
- "ImplementationName"
- ).equals("JBossMX"));
-
- }
-
- public void testArbitraryInterfaceWithProxy() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- RequiredModelMBean rmm = new RequiredModelMBean();
- Resource resource = new Resource();
-
- rmm.setManagedResource(resource, "ObjectReference");
- rmm.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(rmm, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- mbean.setAttributeName("foo");
- mbean.setAttributeName2("bar");
-
- assertTrue(mbean.getAttributeName2().equals("bar"));
- assertTrue(mbean.doOperation().equals("tamppi"));
- }
-
- /**
- * This test shows how to override the default exception handling for
- * proxy invocations. The default handling for exceptions that are not
- * declared as part of the proxy typed interface (such as InstanceNotFound
- * or AttributeNotFound exceptions) are rethrown as unchecked
- * RuntimeProxyExceptions. See org.jboss.mx.proxy.DefaultExceptionHandler
- * for details. This behavior can be changed at runtime through the proxy
- * context interface setExceptionHandler() method.
- */
- public void testCustomExceptionHandler() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
- ObjectName oname2 = new ObjectName("test:test=test2");
-
- RequiredModelMBean rmm = new RequiredModelMBean();
- Resource resource = new Resource();
-
- rmm.setManagedResource(resource, "ObjectReference");
- rmm.setModelMBeanInfo(resource.getMBeanInfo());
-
- // create two identical mbeans
- server.registerMBean(rmm, oname);
- server.registerMBean(rmm, oname2);
-
- ProxyContext ctx = (ProxyContext)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- // override InstanceNotFound exception to redirect from test=test instance
- // to test=test2 instance
- ctx.setExceptionHandler(new DefaultExceptionHandler()
- {
- public Object handleInstanceNotFound(ProxyContext proxyCtx, InstanceNotFoundException e, Method m, Object[] args) throws Exception
- {
- return proxyCtx.getMBeanServer().invoke(new ObjectName("test:test=test2"), m.getName(), args, null);
- }
- });
-
- // unregister mbean 1
- server.unregisterMBean(oname);
-
- // invocation attempt to mbean1 should now redirect to mbean2
- MyInterface mbean = (MyInterface)ctx;
- assertTrue(mbean.doOperation().equals("tamppi"));
- }
-
- public void testObjectToStringOnProxy() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- RequiredModelMBean rmm = new RequiredModelMBean();
- Resource resource = new Resource();
-
- rmm.setManagedResource(resource, "ObjectReference");
- rmm.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(rmm, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- mbean.toString();
-
- Object o = (Object)mbean;
- o.toString();
- }
-
- public void testObjectToStringOverride() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- RequiredModelMBean rmm = new RequiredModelMBean();
- ResourceOverride resource = new ResourceOverride();
-
- rmm.setManagedResource(resource, "ObjectReference");
- rmm.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(rmm, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- assertTrue(mbean.toString().equals("Resource"));
- Object o = (Object)mbean;
- assertTrue(o.toString().equals("Resource"));
- }
-
- public void testObjectHashCodeOnProxy() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- RequiredModelMBean rmm = new RequiredModelMBean();
- Resource resource = new Resource();
-
- rmm.setManagedResource(resource, "ObjectReference");
- rmm.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(rmm, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- mbean.hashCode();
-
- Object o = (Object)mbean;
- o.toString();
- }
-
- public void testObjectHashCodeOverride() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- RequiredModelMBean rmm = new RequiredModelMBean();
- ResourceOverride resource = new ResourceOverride();
-
- rmm.setManagedResource(resource, "ObjectReference");
- rmm.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(rmm, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- assertTrue(mbean.hashCode() == 10);
- Object o = (Object)mbean;
- assertTrue(o.hashCode() == 10);
- }
-
- public void testObjectEqualsOnProxy() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- ModelMBean mmbean = new XMBean();
- Resource resource = new Resource();
-
- mmbean.setManagedResource(resource, "ObjectReference");
- mmbean.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(mmbean, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- MyInterface mbean2 = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- assertTrue(mbean.equals(mbean));
- assertTrue(!mbean.equals(mbean2));
- assertTrue(!mbean2.equals(mbean));
- }
-
- public void testObjectEqualsOverride() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- ModelMBean rmm = new RequiredModelMBean();
- ResourceOverride resource = new ResourceOverride("state");
-
- rmm.setManagedResource(resource, "ObjectReference");
- rmm.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(rmm, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- assertTrue(mbean.equals(mbean));
- }
-
- public void testAttributeNotFoundOnTypedProxy() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- ModelMBean mmbean = new XMBean();
- ResourceIncorrectInfo resource = new ResourceIncorrectInfo();
-
- mmbean.setManagedResource(resource, "ObjectReference");
- mmbean.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(mmbean, oname);
-
- MyInterface mbean = (MyInterface)MBeanProxy.get(
- MyInterface.class, oname, server
- );
-
- ProxyContext ctx = (ProxyContext)mbean;
- ctx.setExceptionHandler(new DefaultExceptionHandler());
-
- try
- {
- mbean.setAttributeName2("some name");
- }
- catch (IllegalArgumentException e)
- {
- // expected
-
- // by default, if no such attribute 'AttributeName2' exists in the
- // MBean metadata (as is the case with ResourceIncorrectInfo), the
- // MBeanProxy invocation handler falls back attempting to execute
- // MBeanServer.invoke() which fails with IAE.
- }
- }
-
- public void testAttributeNotFoundOnDeTypedProxy() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- ModelMBean mmbean = new XMBean();
- ResourceIncorrectInfo resource = new ResourceIncorrectInfo();
-
- mmbean.setManagedResource(resource, "ObjectReference");
- mmbean.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(mmbean, oname);
-
- DynamicMBean mbean = (DynamicMBean)MBeanProxy.get(oname, server);
-
- ProxyContext ctx = (ProxyContext)mbean;
- ctx.setExceptionHandler(new DefaultExceptionHandler());
-
- try
- {
- mbean.setAttribute(new Attribute("AttributeName2", "some name"));
- }
- catch (AttributeNotFoundException e)
- {
- // expected
- }
- }
-
- public void testInheritanceInTypedProxyArgs() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- XMBean mmbean = new XMBean();
- ExtendedResource resource = new ExtendedResource();
-
- mmbean.setManagedResource(resource, "ObjectReference");
- mmbean.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(mmbean, oname);
-
- MyInterface2 mbean = (MyInterface2)MBeanProxy.get(
- MyInterface2.class, oname, server);
-
- assertTrue(mbean.doOperation().equals("doOperation"));
-
- try
- {
- assertTrue(mbean.executeThis("executeThis").equals("executeThis"));
- }
- catch (ClassCastException e) {
- fail("KNOWN ISSUE: proxy generates incorrect JMX invocation " +
- "signature in case argument subclasses are used.");
- }
- }
-
- public void testInheritanceInProxyAttribute() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- XMBean mmbean = new XMBean();
- ExtendedResource resource = new ExtendedResource();
-
- mmbean.setManagedResource(resource, "ObjectReference");
- mmbean.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(mmbean, oname);
-
- MyInterface2 mbean = (MyInterface2)MBeanProxy.get(
- MyInterface2.class, oname, server);
-
- mbean.setAttribute3("Attribute3");
-
- assertTrue(mbean.getAttribute3().equals("Attribute3"));
- }
-
- public void testInheritanceInProxyReturnType() throws Exception
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName oname = new ObjectName("test:test=test");
-
- XMBean mmbean = new XMBean();
- ExtendedResource resource = new ExtendedResource();
-
- mmbean.setManagedResource(resource, "ObjectReference");
- mmbean.setModelMBeanInfo(resource.getMBeanInfo());
-
- server.registerMBean(mmbean, oname);
-
- MyInterface2 mbean = (MyInterface2)MBeanProxy.get(
- MyInterface2.class, oname, server);
-
- assertTrue(mbean.runMe("runMe").equals("runMe"));
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/MBeanProxyTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,592 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util;
+
+import java.util.Set;
+
+import java.lang.reflect.Method;
+
+import javax.management.Attribute;
+import javax.management.AttributeNotFoundException;
+import javax.management.DynamicMBean;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+
+import javax.management.modelmbean.ModelMBean;
+import javax.management.modelmbean.RequiredModelMBean;
+
+import test.implementation.util.support.Trivial;
+import test.implementation.util.support.TrivialMBean;
+import test.implementation.util.support.Trivial2;
+import test.implementation.util.support.Trivial2MBean;
+import test.implementation.util.support.ExtendedResource;
+import test.implementation.util.support.MyInterface;
+import test.implementation.util.support.MyInterface2;
+import test.implementation.util.support.Resource;
+import test.implementation.util.support.ResourceOverride;
+import test.implementation.util.support.ResourceIncorrectInfo;
+
+import junit.framework.TestCase;
+
+import org.jboss.mx.util.AgentID;
+import org.jboss.mx.util.DefaultExceptionHandler;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.ProxyContext;
+
+import org.jboss.mx.modelmbean.XMBean;
+
+
+/**
+ * Tests for mbean proxy
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class MBeanProxyTEST extends TestCase
+{
+ public MBeanProxyTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testGetWithServer() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:name=test");
+
+ server.registerMBean(new Trivial(), oname);
+
+ TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
+ TrivialMBean.class, oname, server);
+
+ mbean.doOperation();
+ }
+
+ public void testGetWithAgentID() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ String agentID = AgentID.get(server);
+ ObjectName oname = new ObjectName("test:name=test");
+
+ server.registerMBean(new Trivial(), oname);
+
+ TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
+ TrivialMBean.class, oname, agentID);
+
+ mbean.doOperation();
+ }
+
+ public void testCreateWithServer() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ TrivialMBean mbean = (TrivialMBean)MBeanProxy.create(
+ Trivial.class, TrivialMBean.class, oname, server);
+
+ mbean.doOperation();
+ }
+
+ public void testCreateWithAgentID() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+ String agentID = AgentID.get(server);
+
+ TrivialMBean mbean = (TrivialMBean)MBeanProxy.create(
+ Trivial.class, TrivialMBean.class, oname, agentID);
+
+ mbean.doOperation();
+ }
+
+ public void testProxyInvocations() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:name=test");
+
+ server.registerMBean(new Trivial(), oname);
+
+ TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
+ TrivialMBean.class, oname, AgentID.get(server));
+
+ mbean.doOperation();
+ mbean.setSomething("JBossMX");
+
+ assertEquals("JBossMX", mbean.getSomething());
+ }
+
+ public void testProxyInvocationWithConflictingMBeanAndContextMethods() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ server.registerMBean(new Trivial(), oname);
+
+ TrivialMBean mbean = (TrivialMBean)MBeanProxy.get(
+ TrivialMBean.class, oname, AgentID.get(server));
+
+ mbean.getMBeanServer();
+ assertTrue(mbean.isGMSInvoked());
+ }
+
+ public void testContextAccess() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
+ Trivial2.class, Trivial2MBean.class, oname, server
+ );
+
+ ProxyContext ctx = (ProxyContext)mbean;
+
+ ctx.getMBeanServer();
+ }
+
+ public void testProxyInvocationBetweenServers() throws Exception
+ {
+ MBeanServer server1 = MBeanServerFactory.createMBeanServer();
+ MBeanServer server2 = MBeanServerFactory.createMBeanServer();
+ ObjectName oname1 = new ObjectName("test:name=target");
+ ObjectName oname2 = new ObjectName("test:name=proxy");
+
+ // createMBean on server1 and retrieve a proxy to it
+ Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
+ Trivial2.class, Trivial2MBean.class, oname1, server1
+ );
+
+ //bind the proxy to server2
+ server2.registerMBean(mbean, oname2);
+
+ // invoke on server2
+ server2.invoke(oname2, "doOperation", null, null);
+
+ // check that server1 received the invocation
+ assertTrue(((Boolean)server1.getAttribute(oname1, "OperationInvoked")).booleanValue());
+ }
+
+ public void testSimultaneousTypedAndDetypedInvocations() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
+ Trivial2.class, Trivial2MBean.class, oname,server
+ );
+
+ // typed proxy interface
+ mbean.setSomething("Kissa");
+ assertTrue(mbean.getSomething().equals("Kissa"));
+
+ // detyped proxy interface
+ DynamicMBean mbean2 = (DynamicMBean)mbean;
+ mbean2.setAttribute(new Attribute("Something", "Koira"));
+ assertTrue(mbean2.getAttribute("Something").equals("Koira"));
+
+ // direct local server invocation
+ server.setAttribute(oname, new Attribute("Something", "Kissa"));
+ assertTrue(server.getAttribute(oname, "Something").equals("Kissa"));
+
+ // typed proxy interface invocation
+ mbean.doOperation();
+ assertTrue(mbean.isOperationInvoked());
+
+ mbean.reset();
+
+ // detyped proxy invocation
+ mbean2.invoke("doOperation", null, null);
+ assertTrue(((Boolean)mbean2.getAttribute("OperationInvoked")).booleanValue());
+
+ mbean2.invoke("reset", null, null);
+
+ // direct local server invocation
+ server.invoke(oname, "doOperation", null, null);
+ assertTrue(((Boolean)server.getAttribute(oname, "OperationInvoked")).booleanValue());
+ }
+
+ public void testContextAccessToMBeanServer() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ Trivial2MBean mbean = (Trivial2MBean)MBeanProxy.create(
+ Trivial2.class, Trivial2MBean.class, oname, server
+ );
+
+ // query the server this mbean is registered to
+ ProxyContext ctx = (ProxyContext)mbean;
+ MBeanServer srvr = ctx.getMBeanServer();
+
+ Set mbeans = srvr.queryMBeans(new ObjectName("test:*"), null);
+ ObjectInstance oi = (ObjectInstance)mbeans.iterator().next();
+
+ assertTrue(oi.getObjectName().equals(oname));
+
+ assertTrue(srvr.getAttribute(
+ new ObjectName("JMImplementation:type=MBeanServerDelegate"),
+ "ImplementationName"
+ ).equals("JBossMX"));
+
+ }
+
+ public void testArbitraryInterfaceWithProxy() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ RequiredModelMBean rmm = new RequiredModelMBean();
+ Resource resource = new Resource();
+
+ rmm.setManagedResource(resource, "ObjectReference");
+ rmm.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(rmm, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ mbean.setAttributeName("foo");
+ mbean.setAttributeName2("bar");
+
+ assertTrue(mbean.getAttributeName2().equals("bar"));
+ assertTrue(mbean.doOperation().equals("tamppi"));
+ }
+
+ /**
+ * This test shows how to override the default exception handling for
+ * proxy invocations. The default handling for exceptions that are not
+ * declared as part of the proxy typed interface (such as InstanceNotFound
+ * or AttributeNotFound exceptions) are rethrown as unchecked
+ * RuntimeProxyExceptions. See org.jboss.mx.proxy.DefaultExceptionHandler
+ * for details. This behavior can be changed at runtime through the proxy
+ * context interface setExceptionHandler() method.
+ */
+ public void testCustomExceptionHandler() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+ ObjectName oname2 = new ObjectName("test:test=test2");
+
+ RequiredModelMBean rmm = new RequiredModelMBean();
+ Resource resource = new Resource();
+
+ rmm.setManagedResource(resource, "ObjectReference");
+ rmm.setModelMBeanInfo(resource.getMBeanInfo());
+
+ // create two identical mbeans
+ server.registerMBean(rmm, oname);
+ server.registerMBean(rmm, oname2);
+
+ ProxyContext ctx = (ProxyContext)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ // override InstanceNotFound exception to redirect from test=test instance
+ // to test=test2 instance
+ ctx.setExceptionHandler(new DefaultExceptionHandler()
+ {
+ public Object handleInstanceNotFound(ProxyContext proxyCtx, InstanceNotFoundException e, Method m, Object[] args) throws Exception
+ {
+ return proxyCtx.getMBeanServer().invoke(new ObjectName("test:test=test2"), m.getName(), args, null);
+ }
+ });
+
+ // unregister mbean 1
+ server.unregisterMBean(oname);
+
+ // invocation attempt to mbean1 should now redirect to mbean2
+ MyInterface mbean = (MyInterface)ctx;
+ assertTrue(mbean.doOperation().equals("tamppi"));
+ }
+
+ public void testObjectToStringOnProxy() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ RequiredModelMBean rmm = new RequiredModelMBean();
+ Resource resource = new Resource();
+
+ rmm.setManagedResource(resource, "ObjectReference");
+ rmm.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(rmm, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ mbean.toString();
+
+ Object o = (Object)mbean;
+ o.toString();
+ }
+
+ public void testObjectToStringOverride() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ RequiredModelMBean rmm = new RequiredModelMBean();
+ ResourceOverride resource = new ResourceOverride();
+
+ rmm.setManagedResource(resource, "ObjectReference");
+ rmm.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(rmm, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ assertTrue(mbean.toString().equals("Resource"));
+ Object o = (Object)mbean;
+ assertTrue(o.toString().equals("Resource"));
+ }
+
+ public void testObjectHashCodeOnProxy() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ RequiredModelMBean rmm = new RequiredModelMBean();
+ Resource resource = new Resource();
+
+ rmm.setManagedResource(resource, "ObjectReference");
+ rmm.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(rmm, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ mbean.hashCode();
+
+ Object o = (Object)mbean;
+ o.toString();
+ }
+
+ public void testObjectHashCodeOverride() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ RequiredModelMBean rmm = new RequiredModelMBean();
+ ResourceOverride resource = new ResourceOverride();
+
+ rmm.setManagedResource(resource, "ObjectReference");
+ rmm.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(rmm, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ assertTrue(mbean.hashCode() == 10);
+ Object o = (Object)mbean;
+ assertTrue(o.hashCode() == 10);
+ }
+
+ public void testObjectEqualsOnProxy() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ ModelMBean mmbean = new XMBean();
+ Resource resource = new Resource();
+
+ mmbean.setManagedResource(resource, "ObjectReference");
+ mmbean.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(mmbean, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ MyInterface mbean2 = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ assertTrue(mbean.equals(mbean));
+ assertTrue(!mbean.equals(mbean2));
+ assertTrue(!mbean2.equals(mbean));
+ }
+
+ public void testObjectEqualsOverride() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ ModelMBean rmm = new RequiredModelMBean();
+ ResourceOverride resource = new ResourceOverride("state");
+
+ rmm.setManagedResource(resource, "ObjectReference");
+ rmm.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(rmm, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ assertTrue(mbean.equals(mbean));
+ }
+
+ public void testAttributeNotFoundOnTypedProxy() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ ModelMBean mmbean = new XMBean();
+ ResourceIncorrectInfo resource = new ResourceIncorrectInfo();
+
+ mmbean.setManagedResource(resource, "ObjectReference");
+ mmbean.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(mmbean, oname);
+
+ MyInterface mbean = (MyInterface)MBeanProxy.get(
+ MyInterface.class, oname, server
+ );
+
+ ProxyContext ctx = (ProxyContext)mbean;
+ ctx.setExceptionHandler(new DefaultExceptionHandler());
+
+ try
+ {
+ mbean.setAttributeName2("some name");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+
+ // by default, if no such attribute 'AttributeName2' exists in the
+ // MBean metadata (as is the case with ResourceIncorrectInfo), the
+ // MBeanProxy invocation handler falls back attempting to execute
+ // MBeanServer.invoke() which fails with IAE.
+ }
+ }
+
+ public void testAttributeNotFoundOnDeTypedProxy() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ ModelMBean mmbean = new XMBean();
+ ResourceIncorrectInfo resource = new ResourceIncorrectInfo();
+
+ mmbean.setManagedResource(resource, "ObjectReference");
+ mmbean.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(mmbean, oname);
+
+ DynamicMBean mbean = (DynamicMBean)MBeanProxy.get(oname, server);
+
+ ProxyContext ctx = (ProxyContext)mbean;
+ ctx.setExceptionHandler(new DefaultExceptionHandler());
+
+ try
+ {
+ mbean.setAttribute(new Attribute("AttributeName2", "some name"));
+ }
+ catch (AttributeNotFoundException e)
+ {
+ // expected
+ }
+ }
+
+ public void testInheritanceInTypedProxyArgs() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ XMBean mmbean = new XMBean();
+ ExtendedResource resource = new ExtendedResource();
+
+ mmbean.setManagedResource(resource, "ObjectReference");
+ mmbean.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(mmbean, oname);
+
+ MyInterface2 mbean = (MyInterface2)MBeanProxy.get(
+ MyInterface2.class, oname, server);
+
+ assertTrue(mbean.doOperation().equals("doOperation"));
+
+ try
+ {
+ assertTrue(mbean.executeThis("executeThis").equals("executeThis"));
+ }
+ catch (ClassCastException e) {
+ fail("KNOWN ISSUE: proxy generates incorrect JMX invocation " +
+ "signature in case argument subclasses are used.");
+ }
+ }
+
+ public void testInheritanceInProxyAttribute() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ XMBean mmbean = new XMBean();
+ ExtendedResource resource = new ExtendedResource();
+
+ mmbean.setManagedResource(resource, "ObjectReference");
+ mmbean.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(mmbean, oname);
+
+ MyInterface2 mbean = (MyInterface2)MBeanProxy.get(
+ MyInterface2.class, oname, server);
+
+ mbean.setAttribute3("Attribute3");
+
+ assertTrue(mbean.getAttribute3().equals("Attribute3"));
+ }
+
+ public void testInheritanceInProxyReturnType() throws Exception
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName oname = new ObjectName("test:test=test");
+
+ XMBean mmbean = new XMBean();
+ ExtendedResource resource = new ExtendedResource();
+
+ mmbean.setManagedResource(resource, "ObjectReference");
+ mmbean.setModelMBeanInfo(resource.getMBeanInfo());
+
+ server.registerMBean(mmbean, oname);
+
+ MyInterface2 mbean = (MyInterface2)MBeanProxy.get(
+ MyInterface2.class, oname, server);
+
+ assertTrue(mbean.runMe("runMe").equals("runMe"));
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/UtilSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/UtilSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/UtilSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class UtilSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("JBossMX Util Tests");
-
- suite.addTest(new TestSuite(MBeanProxyTEST.class));
- suite.addTest(new TestSuite(AgentIDTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/UtilSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/UtilSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/UtilSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/UtilSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class UtilSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JBossMX Util Tests");
+
+ suite.addTest(new TestSuite(MBeanProxyTEST.class));
+ suite.addTest(new TestSuite(AgentIDTEST.class));
+
+ return suite;
+ }
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ExtendedResource.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/ExtendedResource.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ExtendedResource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,130 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-import javax.management.*;
-import javax.management.modelmbean.*;
-
-/**
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class ExtendedResource implements MyInterface2
-{
- private String attr = null;
- private String attr2 = null;
- private Object arg = null;
-
- public void setAttributeName(String attr)
- {
- this.attr = attr;
- }
-
- public void setAttributeName2(String attr)
- {
- this.attr2 = attr;
- }
-
- public String getAttributeName2()
- {
- return attr2;
- }
-
- public void setAttribute3(Object arg)
- {
- this.arg = arg;
- }
-
- public Object getAttribute3()
- {
- return arg.toString();
- }
-
- public Object doOperation()
- {
- return "doOperation";
- }
-
- public String executeThis(Object arg)
- {
- return arg.toString();
- }
-
- public Object runMe(String str)
- {
- return str;
- }
-
- public ModelMBeanInfo getMBeanInfo()
- {
- ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
- {
- new ModelMBeanAttributeInfo(
- "AttributeName", "java.lang.String", "description",
- false, true, false
- ),
- new ModelMBeanAttributeInfo(
- "AttributeName2", "java.lang.String", "description",
- true, true, false
- ),
- new ModelMBeanAttributeInfo(
- "Attribute3", "java.lang.Object", "description",
- true, true, false
- )
- };
-
- ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
- {
- new ModelMBeanOperationInfo(
- "doOperation", "description", null, "java.lang.Object", 1
- ),
- new ModelMBeanOperationInfo(
- "executeThis", "description",
-
- new MBeanParameterInfo[] {
- new MBeanParameterInfo(
- "arg", "java.lang.Object", "description"
- )
- },
- "java.lang.Object", 1
- ),
- new ModelMBeanOperationInfo(
- "runMe", "description",
-
- new MBeanParameterInfo[] {
- new MBeanParameterInfo(
- "arg", "java.lang.String", "description"
- )
- },
- "java.lang.Object", 1
- )
- };
-
- ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
- "test.implementation.util.support.Resource", "description",
- attributes, null, operations, null
- );
-
- return info;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ExtendedResource.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/ExtendedResource.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ExtendedResource.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ExtendedResource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+import javax.management.*;
+import javax.management.modelmbean.*;
+
+/**
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class ExtendedResource implements MyInterface2
+{
+ private String attr = null;
+ private String attr2 = null;
+ private Object arg = null;
+
+ public void setAttributeName(String attr)
+ {
+ this.attr = attr;
+ }
+
+ public void setAttributeName2(String attr)
+ {
+ this.attr2 = attr;
+ }
+
+ public String getAttributeName2()
+ {
+ return attr2;
+ }
+
+ public void setAttribute3(Object arg)
+ {
+ this.arg = arg;
+ }
+
+ public Object getAttribute3()
+ {
+ return arg.toString();
+ }
+
+ public Object doOperation()
+ {
+ return "doOperation";
+ }
+
+ public String executeThis(Object arg)
+ {
+ return arg.toString();
+ }
+
+ public Object runMe(String str)
+ {
+ return str;
+ }
+
+ public ModelMBeanInfo getMBeanInfo()
+ {
+ ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
+ {
+ new ModelMBeanAttributeInfo(
+ "AttributeName", "java.lang.String", "description",
+ false, true, false
+ ),
+ new ModelMBeanAttributeInfo(
+ "AttributeName2", "java.lang.String", "description",
+ true, true, false
+ ),
+ new ModelMBeanAttributeInfo(
+ "Attribute3", "java.lang.Object", "description",
+ true, true, false
+ )
+ };
+
+ ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
+ {
+ new ModelMBeanOperationInfo(
+ "doOperation", "description", null, "java.lang.Object", 1
+ ),
+ new ModelMBeanOperationInfo(
+ "executeThis", "description",
+
+ new MBeanParameterInfo[] {
+ new MBeanParameterInfo(
+ "arg", "java.lang.Object", "description"
+ )
+ },
+ "java.lang.Object", 1
+ ),
+ new ModelMBeanOperationInfo(
+ "runMe", "description",
+
+ new MBeanParameterInfo[] {
+ new MBeanParameterInfo(
+ "arg", "java.lang.String", "description"
+ )
+ },
+ "java.lang.Object", 1
+ )
+ };
+
+ ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
+ "test.implementation.util.support.Resource", "description",
+ attributes, null, operations, null
+ );
+
+ return info;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/MyInterface.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-/**
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public interface MyInterface
-{
- void setAttributeName(String attr);
- void setAttributeName2(String attr);
- String getAttributeName2();
- Object doOperation();
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/MyInterface.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+/**
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public interface MyInterface
+{
+ void setAttributeName(String attr);
+ void setAttributeName2(String attr);
+ String getAttributeName2();
+ Object doOperation();
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface2.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/MyInterface2.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface2.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-/**
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public interface MyInterface2
-{
- void setAttributeName(String attr);
- void setAttributeName2(String attr);
- String getAttributeName2();
-
- void setAttribute3(Object attr);
- Object getAttribute3();
-
- Object doOperation();
- String executeThis(Object arg);
- Object runMe(String str);
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface2.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/MyInterface2.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface2.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/MyInterface2.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+/**
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public interface MyInterface2
+{
+ void setAttributeName(String attr);
+ void setAttributeName2(String attr);
+ String getAttributeName2();
+
+ void setAttribute3(Object attr);
+ Object getAttribute3();
+
+ Object doOperation();
+ String executeThis(Object arg);
+ Object runMe(String str);
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Resource.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Resource.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Resource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-import javax.management.modelmbean.ModelMBeanInfo;
-import javax.management.modelmbean.ModelMBeanInfoSupport;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-import javax.management.modelmbean.ModelMBeanOperationInfo;
-
-/**
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class Resource
-{
- public ModelMBeanInfo getMBeanInfo()
- {
- ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
- {
- new ModelMBeanAttributeInfo(
- "AttributeName", "java.lang.String", "description",
- false, true, false
- ),
- new ModelMBeanAttributeInfo(
- "AttributeName2", "java.lang.String", "description",
- true, true, false
- )
- };
-
- ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
- {
- new ModelMBeanOperationInfo(
- "doOperation", "description", null, "java.lang.Object", 1
- )
- };
-
- ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
- "test.implementation.util.support.Resource", "description",
- attributes, null, operations, null
- );
-
- return info;
- }
-
-
- public Object doOperation()
- {
- return "tamppi";
- }
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Resource.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Resource.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Resource.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Resource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+import javax.management.modelmbean.ModelMBeanInfo;
+import javax.management.modelmbean.ModelMBeanInfoSupport;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+import javax.management.modelmbean.ModelMBeanOperationInfo;
+
+/**
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class Resource
+{
+ public ModelMBeanInfo getMBeanInfo()
+ {
+ ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
+ {
+ new ModelMBeanAttributeInfo(
+ "AttributeName", "java.lang.String", "description",
+ false, true, false
+ ),
+ new ModelMBeanAttributeInfo(
+ "AttributeName2", "java.lang.String", "description",
+ true, true, false
+ )
+ };
+
+ ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
+ {
+ new ModelMBeanOperationInfo(
+ "doOperation", "description", null, "java.lang.Object", 1
+ )
+ };
+
+ ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
+ "test.implementation.util.support.Resource", "description",
+ attributes, null, operations, null
+ );
+
+ return info;
+ }
+
+
+ public Object doOperation()
+ {
+ return "tamppi";
+ }
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-import javax.management.modelmbean.ModelMBeanInfo;
-import javax.management.modelmbean.ModelMBeanInfoSupport;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-import javax.management.modelmbean.ModelMBeanOperationInfo;
-
-/**
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class ResourceIncorrectInfo
-{
- public ModelMBeanInfo getMBeanInfo()
- {
- ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
- {
- new ModelMBeanAttributeInfo(
- "AttributeName", "java.lang.String", "description",
- false, true, false
- )
- };
-
- ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
- {
- new ModelMBeanOperationInfo(
- "doOperation", "description", null, "java.lang.Object", 1
- )
- };
-
- ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
- "test.implementation.util.support.Resource", "description",
- attributes, null, operations, null
- );
-
- return info;
- }
-
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceIncorrectInfo.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+import javax.management.modelmbean.ModelMBeanInfo;
+import javax.management.modelmbean.ModelMBeanInfoSupport;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+import javax.management.modelmbean.ModelMBeanOperationInfo;
+
+/**
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class ResourceIncorrectInfo
+{
+ public ModelMBeanInfo getMBeanInfo()
+ {
+ ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
+ {
+ new ModelMBeanAttributeInfo(
+ "AttributeName", "java.lang.String", "description",
+ false, true, false
+ )
+ };
+
+ ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
+ {
+ new ModelMBeanOperationInfo(
+ "doOperation", "description", null, "java.lang.Object", 1
+ )
+ };
+
+ ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
+ "test.implementation.util.support.Resource", "description",
+ attributes, null, operations, null
+ );
+
+ return info;
+ }
+
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceOverride.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/ResourceOverride.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceOverride.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-import javax.management.modelmbean.ModelMBeanInfo;
-import javax.management.modelmbean.ModelMBeanInfoSupport;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-import javax.management.modelmbean.ModelMBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-
-/**
- * Overrides and exposes java.lang.Object methods in the management
- * interface.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class ResourceOverride
-{
-
- // Attributes ----------------------------------------------------
-
- private String state = null;
-
-
- // Constructors --------------------------------------------------
- public ResourceOverride(String state)
- {
- this.state = state;
- }
-
- public ResourceOverride() {}
-
-
- // Public --------------------------------------------------------
-
- public ModelMBeanInfo getMBeanInfo()
- {
- ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
- {
- new ModelMBeanAttributeInfo(
- "AttributeName", "java.lang.String", "description",
- false, true, false
- ),
- new ModelMBeanAttributeInfo(
- "AttributeName2", "java.lang.String", "description",
- true, true, false
- )
- };
-
- ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
- {
- new ModelMBeanOperationInfo(
- "doOperation", "description", null, "java.lang.Object", 1
- ),
-
- new ModelMBeanOperationInfo(
- "toString", "toString override", null, "java.lang.String", 1
- ),
-
- new ModelMBeanOperationInfo(
- "equals", "equals override",
- new MBeanParameterInfo[]
- {
- new MBeanParameterInfo("object", "java.lang.Object", "object to compare to")
- },
- "boolean", 1
- ),
-
- new ModelMBeanOperationInfo(
- "hashCode", "hashCode override in resource", null, Integer.TYPE.getName(), 1
- )
- };
-
- ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
- "test.implementation.util.support.Resource", "description",
- attributes, null, operations, null
- );
-
- return info;
- }
-
-
- public Object doOperation()
- {
- return "tamppi";
- }
-
-
- // Object overrides ----------------------------------------------
-
- public String toString()
- {
- return "Resource";
- }
-
- public boolean equals(Object o)
- {
- return true;
- }
-
- public int hashCode()
- {
- return 10;
- }
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceOverride.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/ResourceOverride.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceOverride.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/ResourceOverride.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+import javax.management.modelmbean.ModelMBeanInfo;
+import javax.management.modelmbean.ModelMBeanInfoSupport;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+import javax.management.modelmbean.ModelMBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+
+/**
+ * Overrides and exposes java.lang.Object methods in the management
+ * interface.
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class ResourceOverride
+{
+
+ // Attributes ----------------------------------------------------
+
+ private String state = null;
+
+
+ // Constructors --------------------------------------------------
+ public ResourceOverride(String state)
+ {
+ this.state = state;
+ }
+
+ public ResourceOverride() {}
+
+
+ // Public --------------------------------------------------------
+
+ public ModelMBeanInfo getMBeanInfo()
+ {
+ ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[]
+ {
+ new ModelMBeanAttributeInfo(
+ "AttributeName", "java.lang.String", "description",
+ false, true, false
+ ),
+ new ModelMBeanAttributeInfo(
+ "AttributeName2", "java.lang.String", "description",
+ true, true, false
+ )
+ };
+
+ ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
+ {
+ new ModelMBeanOperationInfo(
+ "doOperation", "description", null, "java.lang.Object", 1
+ ),
+
+ new ModelMBeanOperationInfo(
+ "toString", "toString override", null, "java.lang.String", 1
+ ),
+
+ new ModelMBeanOperationInfo(
+ "equals", "equals override",
+ new MBeanParameterInfo[]
+ {
+ new MBeanParameterInfo("object", "java.lang.Object", "object to compare to")
+ },
+ "boolean", 1
+ ),
+
+ new ModelMBeanOperationInfo(
+ "hashCode", "hashCode override in resource", null, Integer.TYPE.getName(), 1
+ )
+ };
+
+ ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
+ "test.implementation.util.support.Resource", "description",
+ attributes, null, operations, null
+ );
+
+ return info;
+ }
+
+
+ public Object doOperation()
+ {
+ return "tamppi";
+ }
+
+
+ // Object overrides ----------------------------------------------
+
+ public String toString()
+ {
+ return "Resource";
+ }
+
+ public boolean equals(Object o)
+ {
+ return true;
+ }
+
+ public int hashCode()
+ {
+ return 10;
+ }
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Trivial.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-import javax.management.MBeanServer;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class Trivial implements TrivialMBean
-{
- private String something = null;
- private boolean anAttribute = true;
- private boolean gmsWasInvoked = false;
-
- public void setSomething(String thing)
- {
- this.something = thing;
- }
-
- public String getSomething()
- {
- return something;
- }
-
- public void doOperation()
- {
- }
-
- public MBeanServer getMBeanServer()
- {
- gmsWasInvoked = true;
- return null;
- }
-
- public boolean isGMSInvoked()
- {
- return gmsWasInvoked;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Trivial.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+import javax.management.MBeanServer;
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class Trivial implements TrivialMBean
+{
+ private String something = null;
+ private boolean anAttribute = true;
+ private boolean gmsWasInvoked = false;
+
+ public void setSomething(String thing)
+ {
+ this.something = thing;
+ }
+
+ public String getSomething()
+ {
+ return something;
+ }
+
+ public void doOperation()
+ {
+ }
+
+ public MBeanServer getMBeanServer()
+ {
+ gmsWasInvoked = true;
+ return null;
+ }
+
+ public boolean isGMSInvoked()
+ {
+ return gmsWasInvoked;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Trivial2.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class Trivial2 implements Trivial2MBean
-{
- private String something = null;
- private boolean isOperationInvoked = false;
-
- public void setSomething(String thing)
- {
- this.something = thing;
- }
-
- public String getSomething()
- {
- return something;
- }
-
- public void doOperation()
- {
- isOperationInvoked = true;
- }
-
- public boolean isOperationInvoked()
- {
- return isOperationInvoked;
- }
-
- public void reset()
- {
- something = null;
- isOperationInvoked = false;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Trivial2.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class Trivial2 implements Trivial2MBean
+{
+ private String something = null;
+ private boolean isOperationInvoked = false;
+
+ public void setSomething(String thing)
+ {
+ this.something = thing;
+ }
+
+ public String getSomething()
+ {
+ return something;
+ }
+
+ public void doOperation()
+ {
+ isOperationInvoked = true;
+ }
+
+ public boolean isOperationInvoked()
+ {
+ return isOperationInvoked;
+ }
+
+ public void reset()
+ {
+ something = null;
+ isOperationInvoked = false;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public interface Trivial2MBean
-{
- void setSomething(String thing);
-
- String getSomething();
-
- void doOperation();
-
- boolean isOperationInvoked();
-
- void reset();
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/Trivial2MBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public interface Trivial2MBean
+{
+ void setSomething(String thing);
+
+ String getSomething();
+
+ void doOperation();
+
+ boolean isOperationInvoked();
+
+ void reset();
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/TrivialMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/TrivialMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.implementation.util.support;
-
-import javax.management.MBeanServer;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public interface TrivialMBean
-{
- void setSomething(String thing);
-
- String getSomething();
-
- void doOperation();
-
- MBeanServer getMBeanServer();
-
- boolean isGMSInvoked();
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/TrivialMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/implementation/util/support/TrivialMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/TrivialMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/implementation/util/support/TrivialMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.implementation.util.support;
+
+import javax.management.MBeanServer;
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public interface TrivialMBean
+{
+ void setSomething(String thing);
+
+ String getSomething();
+
+ void doOperation();
+
+ MBeanServer getMBeanServer();
+
+ boolean isGMSInvoked();
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/PerformanceSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/PerformanceSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/PerformanceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- */
-
-public class PerformanceSUITE extends TestSuite
-{
-
- public final static int SECOND = 1000;
- public final static int THROUGHPUT_TIME = 3 * SECOND;
-
- public final static int ITERATION_COUNT = 100000;
- public final static int REGISTRATION_ITERATION_COUNT = 1000;
- public final static int REPEAT_COUNT = 10;
- public final static int SERIALIZE_ITERATION_COUNT = 1000;
- public final static int TIMER_ITERATION_COUNT = 2000;
-
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All Performance Tests");
-
- suite.addTest(test.performance.dynamic.DynamicSUITE.suite());
- suite.addTest(test.performance.standard.StandardSUITE.suite());
- suite.addTest(test.performance.modelmbean.ModelMBeanSUITE.suite());
- suite.addTest(test.performance.invocationhandler.InvocationHandlerSUITE.suite());
- suite.addTest(test.performance.serialize.SerializeSUITE.suite());
- suite.addTest(test.performance.registration.RegistrationSUITE.suite());
- suite.addTest(test.performance.timer.TimerSUITE.suite());
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/PerformanceSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/PerformanceSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/PerformanceSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/PerformanceSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ */
+
+public class PerformanceSUITE extends TestSuite
+{
+
+ public final static int SECOND = 1000;
+ public final static int THROUGHPUT_TIME = 3 * SECOND;
+
+ public final static int ITERATION_COUNT = 100000;
+ public final static int REGISTRATION_ITERATION_COUNT = 1000;
+ public final static int REPEAT_COUNT = 10;
+ public final static int SERIALIZE_ITERATION_COUNT = 1000;
+ public final static int TIMER_ITERATION_COUNT = 2000;
+
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All Performance Tests");
+
+ suite.addTest(test.performance.dynamic.DynamicSUITE.suite());
+ suite.addTest(test.performance.standard.StandardSUITE.suite());
+ suite.addTest(test.performance.modelmbean.ModelMBeanSUITE.suite());
+ suite.addTest(test.performance.invocationhandler.InvocationHandlerSUITE.suite());
+ suite.addTest(test.performance.serialize.SerializeSUITE.suite());
+ suite.addTest(test.performance.registration.RegistrationSUITE.suite());
+ suite.addTest(test.performance.timer.TimerSUITE.suite());
+
+ return suite;
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.dynamic;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class DynamicSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Performance tests for Dynamic MBeans");
-
- suite.addTest(new TestSuite(ThroughputTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/DynamicSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.dynamic;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class DynamicSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Performance tests for Dynamic MBeans");
+
+ suite.addTest(new TestSuite(ThroughputTEST.class));
+
+ return suite;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/InvocationTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/InvocationTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/InvocationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,255 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.dynamic;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.dynamic.support.Dyn;
-
-import javax.management.*;
-
-
-public class InvocationTEST extends TestCase
-{
-
- public InvocationTEST(String s)
- {
- super(s);
- }
-
- public void testVoidInvocationWithDefaultDomain()
- {
- try
- {
- System.out.println("\nDYNAMIC: void invocation with DefaultDomain");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName(":performanceTest=dynamic");
- String method = "methodInvocation";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(new Dyn(), name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- MBeanServerFactory.releaseMBeanServer(server);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
-
- }
-
- public void testVoidInvocation()
- {
- try
- {
- System.out.println("\nDYNAMIC: void invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
- String method = "methodInvocation";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(new Dyn(), name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- MBeanServerFactory.releaseMBeanServer(server);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
- public void testCounterInvocation()
- {
- try
- {
- System.out.println("\nDYNAMIC: counter invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
- Dyn mbean = new Dyn();
- String method = "counter";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(mbean, name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- MBeanServerFactory.releaseMBeanServer(server);
-
- assertTrue(mbean.getCount() == (PerformanceSUITE.REPEAT_COUNT + 1)*PerformanceSUITE.ITERATION_COUNT);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
-
- public void testMixedArgsInvocation()
- {
- try
- {
- System.out.println("\nDYNAMIC: mixed arguments invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
- Dyn mbean = new Dyn();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- int.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(455617),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(mbean, name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, args, signature);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- MBeanServerFactory.releaseMBeanServer(server);
-
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/InvocationTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/InvocationTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/InvocationTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/InvocationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,255 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.dynamic;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.dynamic.support.Dyn;
+
+import javax.management.*;
+
+
+public class InvocationTEST extends TestCase
+{
+
+ public InvocationTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testVoidInvocationWithDefaultDomain()
+ {
+ try
+ {
+ System.out.println("\nDYNAMIC: void invocation with DefaultDomain");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName(":performanceTest=dynamic");
+ String method = "methodInvocation";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(new Dyn(), name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+
+ }
+
+ public void testVoidInvocation()
+ {
+ try
+ {
+ System.out.println("\nDYNAMIC: void invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
+ String method = "methodInvocation";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(new Dyn(), name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+ public void testCounterInvocation()
+ {
+ try
+ {
+ System.out.println("\nDYNAMIC: counter invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
+ Dyn mbean = new Dyn();
+ String method = "counter";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(mbean, name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ MBeanServerFactory.releaseMBeanServer(server);
+
+ assertTrue(mbean.getCount() == (PerformanceSUITE.REPEAT_COUNT + 1)*PerformanceSUITE.ITERATION_COUNT);
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+
+ public void testMixedArgsInvocation()
+ {
+ try
+ {
+ System.out.println("\nDYNAMIC: mixed arguments invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
+ Dyn mbean = new Dyn();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ int.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(455617),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(mbean, name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, args, signature);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ MBeanServerFactory.releaseMBeanServer(server);
+
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,201 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.dynamic;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.dynamic.support.Dyn;
-
-import javax.management.*;
-
-
-public class ThroughputTEST extends TestCase
-{
-
- public ThroughputTEST(String s)
- {
- super(s);
- }
-
- public void testInvocation()
- {
- try
- {
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
- Dyn mbean = new Dyn();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- int.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(455617),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- server.registerMBean(mbean, name);
-
- assertTrue(mbean.getCount() == 0);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- Object o = server.invoke(name, method, args, signature);
- }
-
- System.out.println("\nDynamic MBean Throughput: " +
- mbean.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + mbean.getCount() + ")\n");
-// System.out.println("\nDynamic MBean Throughput: " + mbean.getCount() / 3 + " invocations per second.");
-// System.out.println("(Total: " + mbean.getCount() + ")\n");
-
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
-
- public void testInvocationWithDefaultDomain()
- {
- try
- {
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName(":performanceTest=dynamic");
- Dyn mbean = new Dyn();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- int.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(455617),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- server.registerMBean(mbean, name);
-
- assertTrue(mbean.getCount() == 0);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- Object o = server.invoke(name, method, args, signature);
- }
-
- System.out.println("\nDynamic MBean Throughput (DEFAULTDOMAIN): " +
- mbean.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + mbean.getCount() + ")\n");
-
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
- class MyThread implements Runnable
- {
-
- private boolean keepRunning = true;
-
- public void run()
- {
- try
- {
- Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
- }
- catch (InterruptedException e)
- {
-
- }
-
- keepRunning = false;
- }
-
- public boolean isKeepRunning()
- {
- return keepRunning;
- }
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,201 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.dynamic;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.dynamic.support.Dyn;
+
+import javax.management.*;
+
+
+public class ThroughputTEST extends TestCase
+{
+
+ public ThroughputTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testInvocation()
+ {
+ try
+ {
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=dynamic");
+ Dyn mbean = new Dyn();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ int.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(455617),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ server.registerMBean(mbean, name);
+
+ assertTrue(mbean.getCount() == 0);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ Object o = server.invoke(name, method, args, signature);
+ }
+
+ System.out.println("\nDynamic MBean Throughput: " +
+ mbean.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + mbean.getCount() + ")\n");
+// System.out.println("\nDynamic MBean Throughput: " + mbean.getCount() / 3 + " invocations per second.");
+// System.out.println("(Total: " + mbean.getCount() + ")\n");
+
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+
+ public void testInvocationWithDefaultDomain()
+ {
+ try
+ {
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName(":performanceTest=dynamic");
+ Dyn mbean = new Dyn();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ int.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(455617),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ server.registerMBean(mbean, name);
+
+ assertTrue(mbean.getCount() == 0);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ Object o = server.invoke(name, method, args, signature);
+ }
+
+ System.out.println("\nDynamic MBean Throughput (DEFAULTDOMAIN): " +
+ mbean.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + mbean.getCount() + ")\n");
+
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+ class MyThread implements Runnable
+ {
+
+ private boolean keepRunning = true;
+
+ public void run()
+ {
+ try
+ {
+ Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
+ }
+ catch (InterruptedException e)
+ {
+
+ }
+
+ keepRunning = false;
+ }
+
+ public boolean isKeepRunning()
+ {
+ return keepRunning;
+ }
+ }
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/Dyn.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/support/Dyn.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/Dyn.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.dynamic.support;
-
-import javax.management.*;
-
-/**
- * Dynamic MBean with a single void management operation.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class Dyn implements DynamicMBean
-{
-
- private int counter = 0;
-
- public Object getAttribute(String attribute)
- throws AttributeNotFoundException, MBeanException, ReflectionException
- {
- return null;
- }
-
- public void setAttribute(Attribute attribute)
- throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
- {}
-
- public AttributeList getAttributes(String[] attributes)
- {
- return null;
- }
-
- public AttributeList setAttributes(AttributeList attributes)
- {
- return null;
- }
-
- public Object invoke(String actionName, Object[] params, String[] signature)
- throws MBeanException, ReflectionException
- {
- if (actionName.equals("bogus1"))
- return null;
- else if (actionName.equals("bogus2"))
- return null;
- else if (actionName.equals("bogus3"))
- return null;
- else if (actionName.equals("bogus4"))
- return null;
- else if (actionName.equals("bogus5"))
- return null;
-
- else if (actionName.equals("methodInvocation"))
- {
- methodInvocation();
- return null;
- }
-
- else if (actionName.equals("counter"))
- {
- countInvocation();
- return null;
- }
-
- else if (actionName.equals("mixedArguments"))
- {
- return myMethod((Integer)params[0], ((Integer)params[1]).intValue(),
- (Object[][][])params[2], (Attribute)params[3]);
-
- }
-
- return null;
- }
-
- public MBeanInfo getMBeanInfo()
- {
-
- return new MBeanInfo(
- "test.performance.dynamic.support.Dynamic", "",
- null,
- null,
- new MBeanOperationInfo[] {
- new MBeanOperationInfo(
- "methodInvocation", "",
- null, void.class.getName(), 0)
- ,
- new MBeanOperationInfo(
- "counter", "",
- null, void.class.getName(), 0)
- },
- null
- );
- }
-
- private void methodInvocation()
- {}
-
- private void countInvocation()
- {
- }
-
- public Object myMethod(Integer int1, int int2, Object[][][] space, Attribute attr)
- {
- ++counter;
- return new Integer(counter);
- }
-
- public int getCount()
- {
- return counter;
- }
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/Dyn.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/dynamic/support/Dyn.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/Dyn.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/dynamic/support/Dyn.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.dynamic.support;
+
+import javax.management.*;
+
+/**
+ * Dynamic MBean with a single void management operation.
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class Dyn implements DynamicMBean
+{
+
+ private int counter = 0;
+
+ public Object getAttribute(String attribute)
+ throws AttributeNotFoundException, MBeanException, ReflectionException
+ {
+ return null;
+ }
+
+ public void setAttribute(Attribute attribute)
+ throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
+ {}
+
+ public AttributeList getAttributes(String[] attributes)
+ {
+ return null;
+ }
+
+ public AttributeList setAttributes(AttributeList attributes)
+ {
+ return null;
+ }
+
+ public Object invoke(String actionName, Object[] params, String[] signature)
+ throws MBeanException, ReflectionException
+ {
+ if (actionName.equals("bogus1"))
+ return null;
+ else if (actionName.equals("bogus2"))
+ return null;
+ else if (actionName.equals("bogus3"))
+ return null;
+ else if (actionName.equals("bogus4"))
+ return null;
+ else if (actionName.equals("bogus5"))
+ return null;
+
+ else if (actionName.equals("methodInvocation"))
+ {
+ methodInvocation();
+ return null;
+ }
+
+ else if (actionName.equals("counter"))
+ {
+ countInvocation();
+ return null;
+ }
+
+ else if (actionName.equals("mixedArguments"))
+ {
+ return myMethod((Integer)params[0], ((Integer)params[1]).intValue(),
+ (Object[][][])params[2], (Attribute)params[3]);
+
+ }
+
+ return null;
+ }
+
+ public MBeanInfo getMBeanInfo()
+ {
+
+ return new MBeanInfo(
+ "test.performance.dynamic.support.Dynamic", "",
+ null,
+ null,
+ new MBeanOperationInfo[] {
+ new MBeanOperationInfo(
+ "methodInvocation", "",
+ null, void.class.getName(), 0)
+ ,
+ new MBeanOperationInfo(
+ "counter", "",
+ null, void.class.getName(), 0)
+ },
+ null
+ );
+ }
+
+ private void methodInvocation()
+ {}
+
+ private void countInvocation()
+ {
+ }
+
+ public Object myMethod(Integer int1, int int2, Object[][][] space, Attribute attr)
+ {
+ ++counter;
+ return new Integer(counter);
+ }
+
+ public int getCount()
+ {
+ return counter;
+ }
+}
+
+
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.invocationhandler;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite of performance tests for MBeanServerInvocationHandler.
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.org">Adrian Brock</a>.
- * @version $Revision$
- */
-public class InvocationHandlerSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Performance tests for MBeanServerInvocationHandler");
-
- suite.addTest(new TestSuite(ThroughputTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/InvocationHandlerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.invocationhandler;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Suite of performance tests for MBeanServerInvocationHandler.
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.org">Adrian Brock</a>.
+ * @version $Revision$
+ */
+public class InvocationHandlerSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Performance tests for MBeanServerInvocationHandler");
+
+ suite.addTest(new TestSuite(ThroughputTEST.class));
+
+ return suite;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,158 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.invocationhandler;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.invocationhandler.support.Standard;
-import test.performance.invocationhandler.support.StandardMBean;
-
-import javax.management.*;
-
-public class ThroughputTEST extends TestCase
-{
-
- public ThroughputTEST(String s)
- {
- super(s);
- }
-
- public void testThroughput() throws Exception
- {
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
-
- Integer arg0 = new Integer(1234);
- int arg1 = 5678;
- Object[][][] arg2 = new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- };
- Attribute arg3 = new Attribute("attribute", "value");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("test:test=test");
-
- Standard test = new Standard();
- server.registerMBean(test, name);
- StandardMBean proxy = (StandardMBean) MBeanServerInvocationHandler.newProxyInstance(
- server, name, StandardMBean.class, false);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- proxy.mixedArguments(arg0, arg1, arg2, arg3);
- }
-
- System.out.println("\nMBeanServerInvocationHandler Throughput: " +
- test.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + test.getCount() + ")\n");
- }
-/*
- public void testThroughputProxy() throws Exception
- {
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
-
- Integer arg0 = new Integer(1234);
- int arg1 = 5678;
- Object[][][] arg2 = new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- };
- Attribute arg3 = new Attribute("attribute", "value");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("test:test=test");
-
- Standard test = new Standard();
- server.registerMBean(test, name);
- StandardMBean proxy = (StandardMBean) org.jboss.mx.util.MBeanProxy.get(StandardMBean.class, name, server);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- proxy.mixedArguments(arg0, arg1, arg2, arg3);
- }
-
- System.out.println("\nMBeanProxy Throughput: " +
- test.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + test.getCount() + ")\n");
- }
-*/
- class MyThread implements Runnable
- {
-
- private boolean keepRunning = true;
-
- public void run()
- {
- try
- {
- Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
- }
- catch (InterruptedException e)
- {
-
- }
-
- keepRunning = false;
- }
-
- public boolean isKeepRunning()
- {
- return keepRunning;
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.invocationhandler;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.invocationhandler.support.Standard;
+import test.performance.invocationhandler.support.StandardMBean;
+
+import javax.management.*;
+
+public class ThroughputTEST extends TestCase
+{
+
+ public ThroughputTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testThroughput() throws Exception
+ {
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+
+ Integer arg0 = new Integer(1234);
+ int arg1 = 5678;
+ Object[][][] arg2 = new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ };
+ Attribute arg3 = new Attribute("attribute", "value");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("test:test=test");
+
+ Standard test = new Standard();
+ server.registerMBean(test, name);
+ StandardMBean proxy = (StandardMBean) MBeanServerInvocationHandler.newProxyInstance(
+ server, name, StandardMBean.class, false);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ proxy.mixedArguments(arg0, arg1, arg2, arg3);
+ }
+
+ System.out.println("\nMBeanServerInvocationHandler Throughput: " +
+ test.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + test.getCount() + ")\n");
+ }
+/*
+ public void testThroughputProxy() throws Exception
+ {
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+
+ Integer arg0 = new Integer(1234);
+ int arg1 = 5678;
+ Object[][][] arg2 = new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ };
+ Attribute arg3 = new Attribute("attribute", "value");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("test:test=test");
+
+ Standard test = new Standard();
+ server.registerMBean(test, name);
+ StandardMBean proxy = (StandardMBean) org.jboss.mx.util.MBeanProxy.get(StandardMBean.class, name, server);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ proxy.mixedArguments(arg0, arg1, arg2, arg3);
+ }
+
+ System.out.println("\nMBeanProxy Throughput: " +
+ test.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + test.getCount() + ")\n");
+ }
+*/
+ class MyThread implements Runnable
+ {
+
+ private boolean keepRunning = true;
+
+ public void run()
+ {
+ try
+ {
+ Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
+ }
+ catch (InterruptedException e)
+ {
+
+ }
+
+ keepRunning = false;
+ }
+
+ public boolean isKeepRunning()
+ {
+ return keepRunning;
+ }
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/Standard.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/support/Standard.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.invocationhandler.support;
-
-import javax.management.Attribute;
-
-/**
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- * @version $Revision$
- */
-public class Standard
- implements StandardMBean
-{
-
- private int counter = 0;
-
-
- public void bogus1() {}
- public void bogus2() {}
- public void bogus3() {}
- public void bogus4() {}
- public void bogus5() {}
-
-
- public void methodInvocation() {}
-
- public void counter() {
- //++counter;
- }
-
- public int getCount() {
- return counter;
- }
-
- Integer int1;
- int int2;
- Object[][][] space;
- Attribute attr;
-
- public void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr) {
- ++counter;
-
- this.int1 = int1;
- this.int2 = int2;
- this.space = space;
- this.attr = attr;
- }
-
- public void bogus6() {}
- public void bogus7() {}
- public void bogus8() {}
- public void bogus9() {}
- public void bogus10() {}
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/Standard.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/support/Standard.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/Standard.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.invocationhandler.support;
+
+import javax.management.Attribute;
+
+/**
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ * @version $Revision$
+ */
+public class Standard
+ implements StandardMBean
+{
+
+ private int counter = 0;
+
+
+ public void bogus1() {}
+ public void bogus2() {}
+ public void bogus3() {}
+ public void bogus4() {}
+ public void bogus5() {}
+
+
+ public void methodInvocation() {}
+
+ public void counter() {
+ //++counter;
+ }
+
+ public int getCount() {
+ return counter;
+ }
+
+ Integer int1;
+ int int2;
+ Object[][][] space;
+ Attribute attr;
+
+ public void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr) {
+ ++counter;
+
+ this.int1 = int1;
+ this.int2 = int2;
+ this.space = space;
+ this.attr = attr;
+ }
+
+ public void bogus6() {}
+ public void bogus7() {}
+ public void bogus8() {}
+ public void bogus9() {}
+ public void bogus10() {}
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.invocationhandler.support;
-
-import javax.management.Attribute;
-
-/**
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- * @version $Revision$
- */
-public interface StandardMBean
-{
- void bogus1();
- void bogus2();
- void bogus3();
- void bogus4();
- void bogus5();
-
- void methodInvocation();
- void counter();
- void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr);
-
- void bogus6();
- void bogus7();
- void bogus8();
- void bogus9();
- void bogus10();
-
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/invocationhandler/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.invocationhandler.support;
+
+import javax.management.Attribute;
+
+/**
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ * @version $Revision$
+ */
+public interface StandardMBean
+{
+ void bogus1();
+ void bogus2();
+ void bogus3();
+ void bogus4();
+ void bogus5();
+
+ void methodInvocation();
+ void counter();
+ void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr);
+
+ void bogus6();
+ void bogus7();
+ void bogus8();
+ void bogus9();
+ void bogus10();
+
+
+}
+
+
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.modelmbean;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite of performance tests for Model MBeans.
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.org">Adrian Brock</a>.
- * @version $Revision$
- */
-public class ModelMBeanSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Performance tests for Model MBeans");
-
- suite.addTest(new TestSuite(ThroughputTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ModelMBeanSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.modelmbean;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Suite of performance tests for Model MBeans.
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.org">Adrian Brock</a>.
+ * @version $Revision$
+ */
+public class ModelMBeanSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Performance tests for Model MBeans");
+
+ suite.addTest(new TestSuite(ThroughputTEST.class));
+
+ return suite;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,195 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.modelmbean;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.modelmbean.support.Resource;
-
-import javax.management.*;
-import javax.management.modelmbean.*;
-
-public class ThroughputTEST extends TestCase
-{
-
- public ThroughputTEST(String s)
- {
- super(s);
- }
-
- public void testThroughput() throws Exception
- {
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
-
- String method = "invokeMixedArgs";
- String[] signature = new String[] {
- Integer.class.getName(),
- String.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- "Hello",
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("test:test=test");
-
- Resource res = new Resource();
- RequiredModelMBean rmm = new RequiredModelMBean();
- rmm.setModelMBeanInfo(getManagementInterface());
- rmm.setManagedResource(res, "ObjectReference");
-
- server.registerMBean(rmm, name);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- server.invoke(name, method, args, signature);
- }
-
- System.out.println("\nModel MBean Throughput: " +
- res.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + res.getCount() + ")\n");
- }
-
- class MyThread implements Runnable
- {
-
- private boolean keepRunning = true;
-
- public void run()
- {
- try
- {
- Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
- }
- catch (InterruptedException e)
- {
-
- }
-
- keepRunning = false;
- }
-
- public boolean isKeepRunning()
- {
- return keepRunning;
- }
- }
-
- private ModelMBeanInfo getManagementInterface()
- {
- final boolean READABLE = true;
- final boolean WRITABLE = true;
- final boolean BOOLEAN = true;
-
- // registerMBean operation
- DescriptorSupport descMixedArgs = new DescriptorSupport();
- descMixedArgs.setField("name", "invokeMixedArgs");
- descMixedArgs.setField("descriptorType", "operation");
- descMixedArgs.setField("role", "operation");
- MBeanParameterInfo[] mixedArgsParms =
- new MBeanParameterInfo[]
- {
- new MBeanParameterInfo
- (
- "Arg1",
- Integer.class.getName(),
- "Desc"
- ),
- new MBeanParameterInfo
- (
- "Arg2",
- String.class.getName(),
- "Desc"
- ),
- new MBeanParameterInfo
- (
- "Arg3",
- Object[][][].class.getName(),
- "Desc"
- ),
- new MBeanParameterInfo
- (
- "Arg3",
- Attribute.class.getName(),
- "Desc"
- )
- };
- ModelMBeanOperationInfo invokeMixedArgs =
- new ModelMBeanOperationInfo
- (
- "invokeMixedArgs",
- "Desc",
- mixedArgsParms,
- void.class.getName(),
- ModelMBeanOperationInfo.ACTION_INFO,
- descMixedArgs
- );
-
- // Construct the modelmbean
- DescriptorSupport descMBean = new DescriptorSupport();
- descMBean.setField("name", RequiredModelMBean.class.getName());
- descMBean.setField("descriptorType", "MBean");
- ModelMBeanInfoSupport info = new ModelMBeanInfoSupport
- (
- RequiredModelMBean.class.getName(),
- "Resource",
- new ModelMBeanAttributeInfo[0],
- (ModelMBeanConstructorInfo[]) null,
- new ModelMBeanOperationInfo[]
- {
- invokeMixedArgs
- },
- (ModelMBeanNotificationInfo[]) null,
- descMBean
- );
-
- return info;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,195 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.modelmbean;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.modelmbean.support.Resource;
+
+import javax.management.*;
+import javax.management.modelmbean.*;
+
+public class ThroughputTEST extends TestCase
+{
+
+ public ThroughputTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testThroughput() throws Exception
+ {
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+
+ String method = "invokeMixedArgs";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ String.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ "Hello",
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("test:test=test");
+
+ Resource res = new Resource();
+ RequiredModelMBean rmm = new RequiredModelMBean();
+ rmm.setModelMBeanInfo(getManagementInterface());
+ rmm.setManagedResource(res, "ObjectReference");
+
+ server.registerMBean(rmm, name);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ server.invoke(name, method, args, signature);
+ }
+
+ System.out.println("\nModel MBean Throughput: " +
+ res.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + res.getCount() + ")\n");
+ }
+
+ class MyThread implements Runnable
+ {
+
+ private boolean keepRunning = true;
+
+ public void run()
+ {
+ try
+ {
+ Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
+ }
+ catch (InterruptedException e)
+ {
+
+ }
+
+ keepRunning = false;
+ }
+
+ public boolean isKeepRunning()
+ {
+ return keepRunning;
+ }
+ }
+
+ private ModelMBeanInfo getManagementInterface()
+ {
+ final boolean READABLE = true;
+ final boolean WRITABLE = true;
+ final boolean BOOLEAN = true;
+
+ // registerMBean operation
+ DescriptorSupport descMixedArgs = new DescriptorSupport();
+ descMixedArgs.setField("name", "invokeMixedArgs");
+ descMixedArgs.setField("descriptorType", "operation");
+ descMixedArgs.setField("role", "operation");
+ MBeanParameterInfo[] mixedArgsParms =
+ new MBeanParameterInfo[]
+ {
+ new MBeanParameterInfo
+ (
+ "Arg1",
+ Integer.class.getName(),
+ "Desc"
+ ),
+ new MBeanParameterInfo
+ (
+ "Arg2",
+ String.class.getName(),
+ "Desc"
+ ),
+ new MBeanParameterInfo
+ (
+ "Arg3",
+ Object[][][].class.getName(),
+ "Desc"
+ ),
+ new MBeanParameterInfo
+ (
+ "Arg3",
+ Attribute.class.getName(),
+ "Desc"
+ )
+ };
+ ModelMBeanOperationInfo invokeMixedArgs =
+ new ModelMBeanOperationInfo
+ (
+ "invokeMixedArgs",
+ "Desc",
+ mixedArgsParms,
+ void.class.getName(),
+ ModelMBeanOperationInfo.ACTION_INFO,
+ descMixedArgs
+ );
+
+ // Construct the modelmbean
+ DescriptorSupport descMBean = new DescriptorSupport();
+ descMBean.setField("name", RequiredModelMBean.class.getName());
+ descMBean.setField("descriptorType", "MBean");
+ ModelMBeanInfoSupport info = new ModelMBeanInfoSupport
+ (
+ RequiredModelMBean.class.getName(),
+ "Resource",
+ new ModelMBeanAttributeInfo[0],
+ (ModelMBeanConstructorInfo[]) null,
+ new ModelMBeanOperationInfo[]
+ {
+ invokeMixedArgs
+ },
+ (ModelMBeanNotificationInfo[]) null,
+ descMBean
+ );
+
+ return info;
+ }
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/Resource.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean/support/Resource.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/Resource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.modelmbean.support;
-
-import javax.management.Attribute;
-
-public class Resource
-{
- int count = 0;
-
- public void invokeNoArgs()
- {
- }
-
- public void invokeOneArg(String arg)
- {
- }
-
- public void invokeMixedArgs(Integer arg1, String arg2, Object[][][] arg3, Attribute arg4)
- {
- count++;
- }
-
- public int getCount()
- {
- return count;
- }
-}
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/Resource.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/modelmbean/support/Resource.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/Resource.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/modelmbean/support/Resource.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.modelmbean.support;
+
+import javax.management.Attribute;
+
+public class Resource
+{
+ int count = 0;
+
+ public void invokeNoArgs()
+ {
+ }
+
+ public void invokeOneArg(String arg)
+ {
+ }
+
+ public void invokeMixedArgs(Integer arg1, String arg2, Object[][][] arg3, Attribute arg4)
+ {
+ count++;
+ }
+
+ public int getCount()
+ {
+ return count;
+ }
+}
+
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/registration (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/RegistrationSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.registration;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import test.performance.registration.support.Standard;
-
-/**
- * Registration performance tests.
- *
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class RegistrationSUITE
- extends TestSuite
-{
- /**
- * Run the tests
- *
- * @param args the arguments for the test
- */
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Get a list of tests.
- *
- * @return the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Registation Performance tests");
-
- suite.addTest(new RegistrationTEST("testIt", new Standard(), "test:test=test", "Standard"));
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/RegistrationSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.registration;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import test.performance.registration.support.Standard;
+
+/**
+ * Registration performance tests.
+ *
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class RegistrationSUITE
+ extends TestSuite
+{
+ /**
+ * Run the tests
+ *
+ * @param args the arguments for the test
+ */
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Get a list of tests.
+ *
+ * @return the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Registation Performance tests");
+
+ suite.addTest(new RegistrationTEST("testIt", new Standard(), "test:test=test", "Standard"));
+
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/RegistrationTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,118 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.registration;
-
-import junit.framework.TestCase;
-
-import test.performance.PerformanceSUITE;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-/**
- * Tests the speed of registrion
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class RegistrationTEST
- extends TestCase
-{
- // Attributes ----------------------------------------------------------------
-
- /**
- * The object to register
- */
- private Object obj;
-
- /**
- * The object name to register
- */
- private String name;
-
- /**
- * The description of the test
- */
- private String desc;
-
- // Constructor ---------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public RegistrationTEST(String s, Object obj, String name, String desc)
- {
- super(s);
- this.obj = obj;
- this.name = name;
- this.desc = desc;
- }
-
- /**
- * Test Registration
- */
- public void testIt()
- {
- System.out.println("\n" + desc);
- System.out.println(PerformanceSUITE.REGISTRATION_ITERATION_COUNT + " Registrations/Deregistrations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)");
-
- long start = 0, end = 0;
- float avg = 0l;
- int size = 0;
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- try
- {
- ObjectName on = new ObjectName(name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.REGISTRATION_ITERATION_COUNT; ++invocationIterations)
- {
- server.registerMBean(obj, on);
- server.unregisterMBean(on);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- finally
- {
- MBeanServerFactory.releaseMBeanServer(server);
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/RegistrationTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/RegistrationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.registration;
+
+import junit.framework.TestCase;
+
+import test.performance.PerformanceSUITE;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+/**
+ * Tests the speed of registrion
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class RegistrationTEST
+ extends TestCase
+{
+ // Attributes ----------------------------------------------------------------
+
+ /**
+ * The object to register
+ */
+ private Object obj;
+
+ /**
+ * The object name to register
+ */
+ private String name;
+
+ /**
+ * The description of the test
+ */
+ private String desc;
+
+ // Constructor ---------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public RegistrationTEST(String s, Object obj, String name, String desc)
+ {
+ super(s);
+ this.obj = obj;
+ this.name = name;
+ this.desc = desc;
+ }
+
+ /**
+ * Test Registration
+ */
+ public void testIt()
+ {
+ System.out.println("\n" + desc);
+ System.out.println(PerformanceSUITE.REGISTRATION_ITERATION_COUNT + " Registrations/Deregistrations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)");
+
+ long start = 0, end = 0;
+ float avg = 0l;
+ int size = 0;
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ try
+ {
+ ObjectName on = new ObjectName(name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.REGISTRATION_ITERATION_COUNT; ++invocationIterations)
+ {
+ server.registerMBean(obj, on);
+ server.unregisterMBean(on);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/registration/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/Standard.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/support/Standard.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.registration.support;
-
-/**
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- * @version $Revision$
- *
- */
-public class Standard
- implements StandardMBean
-{
- public void method() {}
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/Standard.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/support/Standard.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/Standard.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.registration.support;
+
+/**
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ * @version $Revision$
+ *
+ */
+public class Standard
+ implements StandardMBean
+{
+ public void method() {}
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/StandardMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/support/StandardMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.registration.support;
-
-/**
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- * @version $Revision$
- *
- */
-public interface StandardMBean
-{
- void method();
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/StandardMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/registration/support/StandardMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/StandardMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/registration/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.registration.support;
+
+/**
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ * @version $Revision$
+ *
+ */
+public interface StandardMBean
+{
+ void method();
+}
+
+
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.serialize;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import test.performance.serialize.support.Standard;
-
-/**
- * Tests the size and speed of ObjectName serialization
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class ObjectInstanceTestSuite
- extends TestSuite
-{
- // Attributes ----------------------------------------------------------------
-
- // Constructor ---------------------------------------------------------------
-
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Construct the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All Object Instance tests");
-
- MBeanServer server = null;
-
- try
- {
- server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("a:a=a");
- ObjectInstance instance = server.registerMBean(new Standard(), name);
- // Speed Tests
- suite.addTest(new SerializeTEST("testIt", instance, "ObjectInstance"));
- }
- catch (Exception e)
- {
- throw new Error(e.toString());
- }
- finally
- {
- MBeanServerFactory.releaseMBeanServer(server);
- }
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectInstanceTestSuite.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.serialize;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import test.performance.serialize.support.Standard;
+
+/**
+ * Tests the size and speed of ObjectName serialization
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class ObjectInstanceTestSuite
+ extends TestSuite
+{
+ // Attributes ----------------------------------------------------------------
+
+ // Constructor ---------------------------------------------------------------
+
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Construct the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All Object Instance tests");
+
+ MBeanServer server = null;
+
+ try
+ {
+ server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("a:a=a");
+ ObjectInstance instance = server.registerMBean(new Standard(), name);
+ // Speed Tests
+ suite.addTest(new SerializeTEST("testIt", instance, "ObjectInstance"));
+ }
+ catch (Exception e)
+ {
+ throw new Error(e.toString());
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.serialize;
-
-import javax.management.ObjectName;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Tests the size and speed of ObjectName serialization
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class ObjectNameTestSuite
- extends TestSuite
-{
- // Attributes ----------------------------------------------------------------
-
- // Constructor ---------------------------------------------------------------
-
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Construct the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All Object Name tests");
-
- try
- {
- ObjectName name1 = new ObjectName("a:a=a");
- ObjectName name10 = new ObjectName("a:a=a,b=b,c=c,d=d,e=e,f=f,g=g,h=h,i=i,j=j");
- StringBuffer buffer = new StringBuffer("a:0=0");
- for (int i=1; i < 100; i++)
- buffer.append("," + i + "=" + i);
- ObjectName name100 = new ObjectName(buffer.toString());
- // Speed Tests
- suite.addTest(new SerializeTEST("testIt", name1, "ObjectName 1 property"));
- suite.addTest(new SerializeTEST("testIt", name10, "ObjectName 10 properties"));
- suite.addTest(new SerializeTEST("testIt", name100, "ObjectName 100 properties"));
- }
- catch (Exception e)
- {
- throw new Error(e.toString());
- }
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/ObjectNameTestSuite.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.serialize;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Tests the size and speed of ObjectName serialization
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class ObjectNameTestSuite
+ extends TestSuite
+{
+ // Attributes ----------------------------------------------------------------
+
+ // Constructor ---------------------------------------------------------------
+
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Construct the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All Object Name tests");
+
+ try
+ {
+ ObjectName name1 = new ObjectName("a:a=a");
+ ObjectName name10 = new ObjectName("a:a=a,b=b,c=c,d=d,e=e,f=f,g=g,h=h,i=i,j=j");
+ StringBuffer buffer = new StringBuffer("a:0=0");
+ for (int i=1; i < 100; i++)
+ buffer.append("," + i + "=" + i);
+ ObjectName name100 = new ObjectName(buffer.toString());
+ // Speed Tests
+ suite.addTest(new SerializeTEST("testIt", name1, "ObjectName 1 property"));
+ suite.addTest(new SerializeTEST("testIt", name10, "ObjectName 10 properties"));
+ suite.addTest(new SerializeTEST("testIt", name100, "ObjectName 100 properties"));
+ }
+ catch (Exception e)
+ {
+ throw new Error(e.toString());
+ }
+
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/SerializeSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.serialize;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Serialization performance tests.
- *
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class SerializeSUITE
- extends TestSuite
-{
- /**
- * Run the tests
- *
- * @param args the arguments for the test
- */
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Get a list of tests.
- *
- * @return the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Seralization Performance tests");
-
- suite.addTest(ObjectInstanceTestSuite.suite());
- suite.addTest(ObjectNameTestSuite.suite());
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/SerializeSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.serialize;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Serialization performance tests.
+ *
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class SerializeSUITE
+ extends TestSuite
+{
+ /**
+ * Run the tests
+ *
+ * @param args the arguments for the test
+ */
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Get a list of tests.
+ *
+ * @return the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Seralization Performance tests");
+
+ suite.addTest(ObjectInstanceTestSuite.suite());
+ suite.addTest(ObjectNameTestSuite.suite());
+
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/SerializeTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.serialize;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-
-/**
- * Tests the speed of serialization
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class SerializeTEST
- extends TestCase
-{
- // Attributes ----------------------------------------------------------------
-
- /**
- * The object to test
- */
- private Object obj;
-
- /**
- * The description of the test
- */
- private String desc;
-
- // Constructor ---------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public SerializeTEST(String s, Object obj, String desc)
- {
- super(s);
- this.obj = obj;
- this.desc = desc;
- }
-
- /**
- * Test Serialization
- */
- public void testIt()
- {
- System.out.println("\n" + desc);
- System.out.println(PerformanceSUITE.SERIALIZE_ITERATION_COUNT + " Serializations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)");
-
- long start = 0, end = 0;
- float avg = 0l;
- int size = 0;
-
- try
- {
-
- Object result = null;
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.SERIALIZE_ITERATION_COUNT; ++invocationIterations)
- {
- // Serialize it
- baos.reset();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(obj);
-
- // Deserialize it
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectInputStream ois = new ObjectInputStream(bais);
- result = ois.readObject();
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.print("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- System.out.println(" Size: " + baos.toByteArray().length);
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/SerializeTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/SerializeTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.serialize;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+
+/**
+ * Tests the speed of serialization
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class SerializeTEST
+ extends TestCase
+{
+ // Attributes ----------------------------------------------------------------
+
+ /**
+ * The object to test
+ */
+ private Object obj;
+
+ /**
+ * The description of the test
+ */
+ private String desc;
+
+ // Constructor ---------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public SerializeTEST(String s, Object obj, String desc)
+ {
+ super(s);
+ this.obj = obj;
+ this.desc = desc;
+ }
+
+ /**
+ * Test Serialization
+ */
+ public void testIt()
+ {
+ System.out.println("\n" + desc);
+ System.out.println(PerformanceSUITE.SERIALIZE_ITERATION_COUNT + " Serializations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)");
+
+ long start = 0, end = 0;
+ float avg = 0l;
+ int size = 0;
+
+ try
+ {
+
+ Object result = null;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.SERIALIZE_ITERATION_COUNT; ++invocationIterations)
+ {
+ // Serialize it
+ baos.reset();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(obj);
+
+ // Deserialize it
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ result = ois.readObject();
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.print("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ System.out.println(" Size: " + baos.toByteArray().length);
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/Standard.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/support/Standard.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.serialize.support;
-
-/**
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- * @version $Revision$
- *
- */
-public class Standard
- implements StandardMBean
-{
- public void method() {}
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/Standard.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/support/Standard.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/Standard.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.serialize.support;
+
+/**
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ * @version $Revision$
+ *
+ */
+public class Standard
+ implements StandardMBean
+{
+ public void method() {}
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/StandardMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/support/StandardMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.serialize.support;
-
-/**
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- * @version $Revision$
- *
- */
-public interface StandardMBean
-{
- void method();
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/StandardMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/serialize/support/StandardMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/StandardMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/serialize/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.serialize.support;
+
+/**
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ * @version $Revision$
+ *
+ */
+public interface StandardMBean
+{
+ void method();
+}
+
+
+
+
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/InvocationTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/InvocationTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/InvocationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,250 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.standard.support.Standard;
-
-import javax.management.*;
-
-
-public class InvocationTEST extends TestCase
-{
-
- public InvocationTEST(String s)
- {
- super(s);
- }
-
- public void testVoidInvocationWithDefaultDomain()
- {
- try
- {
- System.out.println("\nSTANDARD: void invocation with DefaultDomain");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName(":performanceTest=standard");
- String method = "methodInvocation";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(new Standard(), name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
- public void testVoidInvocation()
- {
- try
- {
- System.out.println("\nSTANDARD: void invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=standard");
- String method = "methodInvocation";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(new Standard(), name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
- public void testCounterInvocation()
- {
- try
- {
- System.out.println("\nSTANDARD: counter invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=standard");
- Standard mbean = new Standard();
- String method = "counter";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(mbean, name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
-
- assertTrue(mbean.getCount() == (PerformanceSUITE.REPEAT_COUNT + 1)*PerformanceSUITE.ITERATION_COUNT);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
-
- public void testMixedArgsInvocation()
- {
- try
- {
- System.out.println("\nSTANDARD: mixed arguments invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=standard");
- Standard mbean = new Standard();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- int.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(455617),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(mbean, name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, args, signature);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
-
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/InvocationTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/InvocationTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/InvocationTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/InvocationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,250 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.standard.support.Standard;
+
+import javax.management.*;
+
+
+public class InvocationTEST extends TestCase
+{
+
+ public InvocationTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testVoidInvocationWithDefaultDomain()
+ {
+ try
+ {
+ System.out.println("\nSTANDARD: void invocation with DefaultDomain");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName(":performanceTest=standard");
+ String method = "methodInvocation";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(new Standard(), name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+ public void testVoidInvocation()
+ {
+ try
+ {
+ System.out.println("\nSTANDARD: void invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=standard");
+ String method = "methodInvocation";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(new Standard(), name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+ public void testCounterInvocation()
+ {
+ try
+ {
+ System.out.println("\nSTANDARD: counter invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=standard");
+ Standard mbean = new Standard();
+ String method = "counter";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(mbean, name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+
+ assertTrue(mbean.getCount() == (PerformanceSUITE.REPEAT_COUNT + 1)*PerformanceSUITE.ITERATION_COUNT);
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+
+ public void testMixedArgsInvocation()
+ {
+ try
+ {
+ System.out.println("\nSTANDARD: mixed arguments invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=standard");
+ Standard mbean = new Standard();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ int.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(455617),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(mbean, name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, args, signature);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,287 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.standard.support.Standard;
-
-import javax.management.*;
-
-import org.jboss.mx.server.ServerConstants;
-
-/**
- * Tests the performance of the byte code optimized invocation dispatcher.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class OptimizedInvocationTEST extends TestCase
- implements ServerConstants
-{
-
- public OptimizedInvocationTEST(String s)
- {
- super(s);
- }
-
- public void testVoidInvocationWithDefaultDomain()
- {
- try
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
-
-
- System.out.println("\nSTANDARD (OPTIMIZED): void invocation with DefaultDomain");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName(":performanceTest=standard");
- String method = "methodInvocation";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(new Standard(), name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- finally
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
- }
- }
-
- public void testVoidInvocation()
- {
- try
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
-
-
- System.out.println("\nSTANDARD (OPTIMIZED): void invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=standard");
- String method = "methodInvocation";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(new Standard(), name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- finally
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
- }
- }
-
- public void testCounterInvocation()
- {
- try
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
-
-
- System.out.println("\nSTANDARD (OPTIMIZED): counter invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=standard");
- Standard mbean = new Standard();
- String method = "counter";
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(mbean, name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, null, null);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
-
- assertTrue(mbean.getCount() == (PerformanceSUITE.REPEAT_COUNT + 1)*PerformanceSUITE.ITERATION_COUNT);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- finally
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
- }
- }
-
-
- public void testMixedArgsInvocation()
- {
- try
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
-
- System.out.println("\nSTANDARD (OPTIMIZED): mixed arguments invocation");
- System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
- System.out.println("(this may take a while...)\n");
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("Domain:performanceTest=standard");
- Standard mbean = new Standard();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- int.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(455617),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- long start = 0, end = 0;
- float avg = 0l;
-
- server.registerMBean(mbean, name);
-
- // drop the first batch (+1)
- for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
- {
- start = System.currentTimeMillis();
- for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
- {
- server.invoke(name, method, args, signature);
- }
- end = System.currentTimeMillis();
-
- if (testIterations != 0)
- {
- long time = end - start;
- System.out.print( time + " ");
- avg += time;
- }
- }
-
- System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
-
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail("Unexpected error: " + t.toString());
- }
- finally
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
- }
-
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedInvocationTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,287 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.standard.support.Standard;
+
+import javax.management.*;
+
+import org.jboss.mx.server.ServerConstants;
+
+/**
+ * Tests the performance of the byte code optimized invocation dispatcher.
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class OptimizedInvocationTEST extends TestCase
+ implements ServerConstants
+{
+
+ public OptimizedInvocationTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testVoidInvocationWithDefaultDomain()
+ {
+ try
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
+
+
+ System.out.println("\nSTANDARD (OPTIMIZED): void invocation with DefaultDomain");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName(":performanceTest=standard");
+ String method = "methodInvocation";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(new Standard(), name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ finally
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
+ }
+ }
+
+ public void testVoidInvocation()
+ {
+ try
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
+
+
+ System.out.println("\nSTANDARD (OPTIMIZED): void invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=standard");
+ String method = "methodInvocation";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(new Standard(), name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ finally
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
+ }
+ }
+
+ public void testCounterInvocation()
+ {
+ try
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
+
+
+ System.out.println("\nSTANDARD (OPTIMIZED): counter invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=standard");
+ Standard mbean = new Standard();
+ String method = "counter";
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(mbean, name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, null, null);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+
+ assertTrue(mbean.getCount() == (PerformanceSUITE.REPEAT_COUNT + 1)*PerformanceSUITE.ITERATION_COUNT);
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ finally
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
+ }
+ }
+
+
+ public void testMixedArgsInvocation()
+ {
+ try
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
+
+ System.out.println("\nSTANDARD (OPTIMIZED): mixed arguments invocation");
+ System.out.println(PerformanceSUITE.ITERATION_COUNT + " Invocations, Repeat: x" + PerformanceSUITE.REPEAT_COUNT);
+ System.out.println("(this may take a while...)\n");
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("Domain:performanceTest=standard");
+ Standard mbean = new Standard();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ int.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(455617),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ long start = 0, end = 0;
+ float avg = 0l;
+
+ server.registerMBean(mbean, name);
+
+ // drop the first batch (+1)
+ for (int testIterations = 0; testIterations < PerformanceSUITE.REPEAT_COUNT + 1; ++testIterations)
+ {
+ start = System.currentTimeMillis();
+ for (int invocationIterations = 0; invocationIterations < PerformanceSUITE.ITERATION_COUNT; ++invocationIterations)
+ {
+ server.invoke(name, method, args, signature);
+ }
+ end = System.currentTimeMillis();
+
+ if (testIterations != 0)
+ {
+ long time = end - start;
+ System.out.print( time + " ");
+ avg += time;
+ }
+ }
+
+ System.out.println("\nAverage: " + (avg/PerformanceSUITE.REPEAT_COUNT));
+
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ fail("Unexpected error: " + t.toString());
+ }
+ finally
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
+ }
+
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,134 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.standard.support.Standard;
-
-import javax.management.*;
-
-import org.jboss.mx.server.ServerConstants;
-
-
-public class OptimizedThroughputTEST extends TestCase
- implements ServerConstants
-{
-
- public OptimizedThroughputTEST(String s)
- {
- super(s);
- }
-
- public void testThroughput() throws Exception
- {
-
- class MyThread implements Runnable
- {
-
- private boolean keepRunning = true;
-
- public void run()
- {
- try
- {
- Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
- }
- catch (InterruptedException e)
- {
-
- }
-
- keepRunning = false;
- }
-
- public boolean isKeepRunning()
- {
- return keepRunning;
- }
- }
-
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
- Standard std = new Standard();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- int.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(455617),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
-
- try
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("test:test=test");
-
- server.registerMBean(std, name);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- server.invoke(name, method, args, signature);
- }
-
- System.out.println("\nStandard MBean Throughput (OPTIMIZED): " +
- std.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + std.getCount() + ")\n");
- }
- finally
- {
- System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
- }
- }
-
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/OptimizedThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.standard.support.Standard;
+
+import javax.management.*;
+
+import org.jboss.mx.server.ServerConstants;
+
+
+public class OptimizedThroughputTEST extends TestCase
+ implements ServerConstants
+{
+
+ public OptimizedThroughputTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testThroughput() throws Exception
+ {
+
+ class MyThread implements Runnable
+ {
+
+ private boolean keepRunning = true;
+
+ public void run()
+ {
+ try
+ {
+ Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
+ }
+ catch (InterruptedException e)
+ {
+
+ }
+
+ keepRunning = false;
+ }
+
+ public boolean isKeepRunning()
+ {
+ return keepRunning;
+ }
+ }
+
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+ Standard std = new Standard();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ int.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(455617),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "true");
+
+ try
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("test:test=test");
+
+ server.registerMBean(std, name);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ server.invoke(name, method, args, signature);
+ }
+
+ System.out.println("\nStandard MBean Throughput (OPTIMIZED): " +
+ std.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + std.getCount() + ")\n");
+ }
+ finally
+ {
+ System.setProperty(OPTIMIZE_REFLECTED_DISPATCHER, "false");
+ }
+ }
+
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,118 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.standard.support.StandardMBeanExtension;
-
-import javax.management.*;
-
-public class StandardMBeanThroughputTEST extends TestCase
-{
-
- public StandardMBeanThroughputTEST(String s)
- {
- super(s);
- }
-
- public void testThroughput() throws Exception
- {
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
- StandardMBeanExtension std = new StandardMBeanExtension();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- Integer.TYPE.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(5678),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("test:test=test");
-
- server.registerMBean(std, name);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- server.invoke(name, method, args, signature);
- }
-
- System.out.println("\nStandardMBeanExtension Throughput: " +
- std.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + std.getCount() + ")\n");
- }
-
- class MyThread implements Runnable
- {
-
- private boolean keepRunning = true;
-
- public void run()
- {
- try
- {
- Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
- }
- catch (InterruptedException e)
- {
-
- }
-
- keepRunning = false;
- }
-
- public boolean isKeepRunning()
- {
- return keepRunning;
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardMBeanThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.standard.support.StandardMBeanExtension;
+
+import javax.management.*;
+
+public class StandardMBeanThroughputTEST extends TestCase
+{
+
+ public StandardMBeanThroughputTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testThroughput() throws Exception
+ {
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+ StandardMBeanExtension std = new StandardMBeanExtension();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ Integer.TYPE.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(5678),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("test:test=test");
+
+ server.registerMBean(std, name);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ server.invoke(name, method, args, signature);
+ }
+
+ System.out.println("\nStandardMBeanExtension Throughput: " +
+ std.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + std.getCount() + ")\n");
+ }
+
+ class MyThread implements Runnable
+ {
+
+ private boolean keepRunning = true;
+
+ public void run()
+ {
+ try
+ {
+ Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
+ }
+ catch (InterruptedException e)
+ {
+
+ }
+
+ keepRunning = false;
+ }
+
+ public boolean isKeepRunning()
+ {
+ return keepRunning;
+ }
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/StandardSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-/**
- * Suite of performance tests for Standard MBeans.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- */
-public class StandardSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Performance tests for Standard MBeans");
-
- try
- {
- MBeanServer server = MBeanServerFactory.createMBeanServer();
-
- if ("JBossMX".equalsIgnoreCase((String)server.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "ImplementationName")))
- {
- //suite.addTest(new TestSuite(OptimizedInvocationTEST.class));
- suite.addTest(new TestSuite(OptimizedThroughputTEST.class));
- }
- }
- catch (JMException e)
- {
- System.err.println("Unable to run optimized tests: " + e.toString());
- }
-
-
- //suite.addTest(new TestSuite(InvocationTEST.class));
- suite.addTest(new TestSuite(ThroughputTEST.class));
- suite.addTest(new TestSuite(StandardMBeanThroughputTEST.class));
-
- return suite;
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/StandardSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/StandardSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+/**
+ * Suite of performance tests for Standard MBeans.
+ *
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ */
+public class StandardSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Performance tests for Standard MBeans");
+
+ try
+ {
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+
+ if ("JBossMX".equalsIgnoreCase((String)server.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "ImplementationName")))
+ {
+ //suite.addTest(new TestSuite(OptimizedInvocationTEST.class));
+ suite.addTest(new TestSuite(OptimizedThroughputTEST.class));
+ }
+ }
+ catch (JMException e)
+ {
+ System.err.println("Unable to run optimized tests: " + e.toString());
+ }
+
+
+ //suite.addTest(new TestSuite(InvocationTEST.class));
+ suite.addTest(new TestSuite(ThroughputTEST.class));
+ suite.addTest(new TestSuite(StandardMBeanThroughputTEST.class));
+
+ return suite;
+ }
+
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/ThroughputTEST.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/ThroughputTEST.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,122 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-import test.performance.standard.support.Standard;
-
-import javax.management.*;
-
-
-public class ThroughputTEST extends TestCase
-{
-
- public ThroughputTEST(String s)
- {
- super(s);
- }
-
- public void testThroughput() throws Exception
- {
-
-
- MyThread myThread = new MyThread();
- Thread t = new Thread(myThread);
- Standard std = new Standard();
-
- String method = "mixedArguments";
- String[] signature = new String[] {
- Integer.class.getName(),
- int.class.getName(),
- Object[][][].class.getName(),
- Attribute.class.getName()
- };
-
- Object[] args = new Object[] {
- new Integer(1234),
- new Integer(455617),
- new Object[][][] {
- {
- { "1x1x1", "1x1x2", "1x1x3" },
- { "1x2x1", "1x2x2", "1x2x3" },
- { "1x3x1", "1x3x2", "1x3x3" }
- },
-
- {
- { "2x1x1", "2x1x2", "2x1x3" },
- { "2x2x1", "2x2x2", "2x2x3" },
- { "2x3x1", "2x3x2", "2x3x3" }
- },
-
- {
- { "3x1x1", "3x1x2", "3x1x3" },
- { "3x2x1", "3x2x2", "3x2x3" },
- { "3x3x1", "3x3x2", "3x3x3" }
- }
- },
- new Attribute("attribute", "value")
- };
-
- MBeanServer server = MBeanServerFactory.createMBeanServer();
- ObjectName name = new ObjectName("test:test=test");
-
- server.registerMBean(std, name);
-
- t.start();
- while(myThread.isKeepRunning())
- {
- server.invoke(name, method, args, signature);
- }
-
- System.out.println("\nStandard MBean Throughput: " +
- std.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
- " invocations per second.");
- System.out.println("(Total: " + std.getCount() + ")\n");
- }
-
- class MyThread implements Runnable
- {
-
- private boolean keepRunning = true;
-
- public void run()
- {
- try
- {
- Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
- }
- catch (InterruptedException e)
- {
-
- }
-
- keepRunning = false;
- }
-
- public boolean isKeepRunning()
- {
- return keepRunning;
- }
- }
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/ThroughputTEST.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/ThroughputTEST.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/ThroughputTEST.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/ThroughputTEST.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+import test.performance.standard.support.Standard;
+
+import javax.management.*;
+
+
+public class ThroughputTEST extends TestCase
+{
+
+ public ThroughputTEST(String s)
+ {
+ super(s);
+ }
+
+ public void testThroughput() throws Exception
+ {
+
+
+ MyThread myThread = new MyThread();
+ Thread t = new Thread(myThread);
+ Standard std = new Standard();
+
+ String method = "mixedArguments";
+ String[] signature = new String[] {
+ Integer.class.getName(),
+ int.class.getName(),
+ Object[][][].class.getName(),
+ Attribute.class.getName()
+ };
+
+ Object[] args = new Object[] {
+ new Integer(1234),
+ new Integer(455617),
+ new Object[][][] {
+ {
+ { "1x1x1", "1x1x2", "1x1x3" },
+ { "1x2x1", "1x2x2", "1x2x3" },
+ { "1x3x1", "1x3x2", "1x3x3" }
+ },
+
+ {
+ { "2x1x1", "2x1x2", "2x1x3" },
+ { "2x2x1", "2x2x2", "2x2x3" },
+ { "2x3x1", "2x3x2", "2x3x3" }
+ },
+
+ {
+ { "3x1x1", "3x1x2", "3x1x3" },
+ { "3x2x1", "3x2x2", "3x2x3" },
+ { "3x3x1", "3x3x2", "3x3x3" }
+ }
+ },
+ new Attribute("attribute", "value")
+ };
+
+ MBeanServer server = MBeanServerFactory.createMBeanServer();
+ ObjectName name = new ObjectName("test:test=test");
+
+ server.registerMBean(std, name);
+
+ t.start();
+ while(myThread.isKeepRunning())
+ {
+ server.invoke(name, method, args, signature);
+ }
+
+ System.out.println("\nStandard MBean Throughput: " +
+ std.getCount() / (PerformanceSUITE.THROUGHPUT_TIME / PerformanceSUITE.SECOND) +
+ " invocations per second.");
+ System.out.println("(Total: " + std.getCount() + ")\n");
+ }
+
+ class MyThread implements Runnable
+ {
+
+ private boolean keepRunning = true;
+
+ public void run()
+ {
+ try
+ {
+ Thread.sleep(PerformanceSUITE.THROUGHPUT_TIME);
+ }
+ catch (InterruptedException e)
+ {
+
+ }
+
+ keepRunning = false;
+ }
+
+ public boolean isKeepRunning()
+ {
+ return keepRunning;
+ }
+ }
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/support (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/support)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/Standard.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/support/Standard.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard.support;
-
-import javax.management.Attribute;
-
-/**
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public class Standard
- implements StandardMBean
-{
-
- private int counter = 0;
-
-
- public void bogus1() {}
- public void bogus2() {}
- public void bogus3() {}
- public void bogus4() {}
- public void bogus5() {}
-
-
- public void methodInvocation() {}
-
- public void counter() {
- //++counter;
- }
-
- public int getCount() {
- return counter;
- }
-
- Integer int1;
- int int2;
- Object[][][] space;
- Attribute attr;
-
- public void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr) {
- ++counter;
-
- this.int1 = int1;
- this.int2 = int2;
- this.space = space;
- this.attr = attr;
- }
-
- public void bogus6() {}
- public void bogus7() {}
- public void bogus8() {}
- public void bogus9() {}
- public void bogus10() {}
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/Standard.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/support/Standard.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/Standard.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/Standard.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard.support;
+
+import javax.management.Attribute;
+
+/**
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public class Standard
+ implements StandardMBean
+{
+
+ private int counter = 0;
+
+
+ public void bogus1() {}
+ public void bogus2() {}
+ public void bogus3() {}
+ public void bogus4() {}
+ public void bogus5() {}
+
+
+ public void methodInvocation() {}
+
+ public void counter() {
+ //++counter;
+ }
+
+ public int getCount() {
+ return counter;
+ }
+
+ Integer int1;
+ int int2;
+ Object[][][] space;
+ Attribute attr;
+
+ public void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr) {
+ ++counter;
+
+ this.int1 = int1;
+ this.int2 = int2;
+ this.space = space;
+ this.attr = attr;
+ }
+
+ public void bogus6() {}
+ public void bogus7() {}
+ public void bogus8() {}
+ public void bogus9() {}
+ public void bogus10() {}
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBean.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/support/StandardMBean.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard.support;
-
-import javax.management.Attribute;
-
-/**
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision$
- *
- */
-public interface StandardMBean
-{
- void bogus1();
- void bogus2();
- void bogus3();
- void bogus4();
- void bogus5();
-
- void methodInvocation();
- void counter();
- void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr);
-
- void bogus6();
- void bogus7();
- void bogus8();
- void bogus9();
- void bogus10();
-
-
-}
-
-
-
-
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBean.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/support/StandardMBean.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBean.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBean.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard.support;
+
+import javax.management.Attribute;
+
+/**
+ * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
+ * @version $Revision$
+ *
+ */
+public interface StandardMBean
+{
+ void bogus1();
+ void bogus2();
+ void bogus3();
+ void bogus4();
+ void bogus5();
+
+ void methodInvocation();
+ void counter();
+ void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr);
+
+ void bogus6();
+ void bogus7();
+ void bogus8();
+ void bogus9();
+ void bogus10();
+
+
+}
+
+
+
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.standard.support;
-
-import javax.management.Attribute;
-
-/**
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- * @version $Revision$
- *
- */
-public class StandardMBeanExtension
- extends javax.management.StandardMBean
- implements StandardMBean
-{
- public StandardMBeanExtension()
- throws Exception
- {
- super(StandardMBean.class);
- }
-
- private int counter = 0;
-
-
- public void bogus1() {}
- public void bogus2() {}
- public void bogus3() {}
- public void bogus4() {}
- public void bogus5() {}
-
-
- public void methodInvocation() {}
-
- public void counter() {
- //++counter;
- }
-
- public int getCount() {
- return counter;
- }
-
- Integer int1;
- int int2;
- Object[][][] space;
- Attribute attr;
-
- public void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr) {
- ++counter;
-
- this.int1 = int1;
- this.int2 = int2;
- this.space = space;
- this.attr = attr;
- }
-
- public void bogus6() {}
- public void bogus7() {}
- public void bogus8() {}
- public void bogus9() {}
- public void bogus10() {}
-
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/standard/support/StandardMBeanExtension.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.standard.support;
+
+import javax.management.Attribute;
+
+/**
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ * @version $Revision$
+ *
+ */
+public class StandardMBeanExtension
+ extends javax.management.StandardMBean
+ implements StandardMBean
+{
+ public StandardMBeanExtension()
+ throws Exception
+ {
+ super(StandardMBean.class);
+ }
+
+ private int counter = 0;
+
+
+ public void bogus1() {}
+ public void bogus2() {}
+ public void bogus3() {}
+ public void bogus4() {}
+ public void bogus5() {}
+
+
+ public void methodInvocation() {}
+
+ public void counter() {
+ //++counter;
+ }
+
+ public int getCount() {
+ return counter;
+ }
+
+ Integer int1;
+ int int2;
+ Object[][][] space;
+ Attribute attr;
+
+ public void mixedArguments(Integer int1, int int2, Object[][][] space, Attribute attr) {
+ ++counter;
+
+ this.int1 = int1;
+ this.int2 = int2;
+ this.space = space;
+ this.attr = attr;
+ }
+
+ public void bogus6() {}
+ public void bogus7() {}
+ public void bogus8() {}
+ public void bogus9() {}
+ public void bogus10() {}
+
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/timer (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/timer)
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/timer/TimerSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.timer;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Timer performance tests.
- *
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class TimerSUITE
- extends TestSuite
-{
- /**
- * Run the tests
- *
- * @param args the arguments for the test
- */
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Get a list of tests.
- *
- * @return the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Timer Performance tests");
-
- suite.addTest(new TestSuite(TimerTortureTestCase.class));
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/timer/TimerSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.timer;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Timer performance tests.
+ *
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class TimerSUITE
+ extends TestSuite
+{
+ /**
+ * Run the tests
+ *
+ * @param args the arguments for the test
+ */
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Get a list of tests.
+ *
+ * @return the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Timer Performance tests");
+
+ suite.addTest(new TestSuite(TimerTortureTestCase.class));
+
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,260 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.performance.timer;
-
-import java.util.Date;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.timer.Timer;
-import javax.management.timer.TimerNotification;
-
-import junit.framework.TestCase;
-import test.performance.PerformanceSUITE;
-
-/**
- * Timer Performance Tests
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class TimerTortureTestCase
- extends TestCase
- implements NotificationListener
-{
- // Constants ---------------------------------------------------------------
-
- String TIMER_TYPE = "TimerType";
- String MESSAGE = "Message";
- String USER_DATA = "UserData";
-
- // Attributes --------------------------------------------------------------
-
- /**
- * The MBeanServer
- */
- MBeanServer server;
-
- /**
- * The object name of the timer
- */
- ObjectName timerName;
-
- /**
- * The timer
- */
- Timer timer;
-
- /**
- * The timer notification id
- */
- Integer id;
-
- /**
- * The target notifications
- */
- int target = 0;
-
- /**
- * The number of notifications
- */
- int notifications = 0;
-
- // Constructor -------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public TimerTortureTestCase(String s)
- {
- super(s);
- }
-
- // Tests -------------------------------------------------------------------
-
- /**
- * See how long to do many notifications one notification,
- * this tests the overhead
- */
- public void testTortureOne()
- {
- System.err.println("\nTimer iterations " + PerformanceSUITE.TIMER_ITERATION_COUNT);
- System.err.println("One notification at 1 millsecond intervals.");
- initTest();
- try
- {
- initTimer();
- startTimer();
- target = PerformanceSUITE.TIMER_ITERATION_COUNT;
- long start = timeOffset(0).getTime();
- addNotification(1000, 1, PerformanceSUITE.TIMER_ITERATION_COUNT);
- sync();
- sleep(1000);
- long end = timeOffset(0).getTime();
- stopTimer();
-
- System.err.println("Time (ms): " + (end-start));
- }
- finally
- {
- MBeanServerFactory.releaseMBeanServer(server);
- }
- }
-
- /**
- * See how long to many notifications one notification, this tests the overhead
- */
- public void testTortureTen()
- {
- System.err.println("\nTimer iterations " + PerformanceSUITE.TIMER_ITERATION_COUNT);
- System.err.println("Ten notifications at 1 millsecond intervals.");
- initTest();
- try
- {
- initTimer();
- startTimer();
- target = 10 * PerformanceSUITE.TIMER_ITERATION_COUNT;
- long start = timeOffset(0).getTime();
- for (int i=0; i<10; i++)
- addNotification(1000, 1, PerformanceSUITE.TIMER_ITERATION_COUNT);
- sync();
- sleep(1000);
- long end = timeOffset(0).getTime();
- stopTimer();
-
- System.err.println("Time (ms): " + (end-start));
- }
- finally
- {
- MBeanServerFactory.releaseMBeanServer(server);
- }
- }
-
- // Support -----------------------------------------------------------------
-
- /**
- * Start a new test
- */
- private void initTest()
- {
- notifications = 0;
- server = MBeanServerFactory.createMBeanServer();
- }
-
- /**
- * Create a timer and register ourselves as a listener
- */
- private void initTimer()
- {
- try
- {
- timer = new Timer();
- timerName = new ObjectName("test:type=timer");
- server.registerMBean(timer, timerName);
- server.addNotificationListener(timerName, this, null, null);
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- }
-
- /**
- * Start the timer
- */
- private void startTimer()
- {
- timer.start();
- }
-
- /**
- * Stop the timer, does a small wait to avoid problems with the RI
- */
- private void stopTimer()
- {
- timer.stop();
- }
-
- /**
- * Add a notification
- */
- private void addNotification(long offset, long period, long occurs)
- {
- id = timer.addNotification(TIMER_TYPE, MESSAGE, USER_DATA,
- timeOffset(offset), period, occurs);
- }
-
- /**
- * Handle the notification, just add it to the list
- */
- public void handleNotification(Notification n, Object ignored)
- {
- notifications++;
- TimerNotification tn = (TimerNotification) n;
- if (timer.getNbOccurences(tn.getNotificationID()).longValue() == 1)
- synchronized(timerName)
- {
- timerName.notifyAll();
- }
- }
-
- /**
- * Sync with the notification handler
- */
- private void sync()
- {
- synchronized(timerName)
- {
- try
- {
- timerName.wait(60000);
- }
- catch (InterruptedException ignored)
- {
- }
- }
- }
-
- /**
- * Get the time using and offset
- */
- private Date timeOffset(long offset)
- {
- return new Date(System.currentTimeMillis() + offset);
- }
-
- /**
- * Sleep for a bit
- */
- private void sleep(long time)
- {
- try
- {
- Thread.sleep(time);
- }
- catch (InterruptedException ignored)
- {
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/performance/timer/TimerTortureTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,260 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.performance.timer;
+
+import java.util.Date;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.timer.Timer;
+import javax.management.timer.TimerNotification;
+
+import junit.framework.TestCase;
+import test.performance.PerformanceSUITE;
+
+/**
+ * Timer Performance Tests
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class TimerTortureTestCase
+ extends TestCase
+ implements NotificationListener
+{
+ // Constants ---------------------------------------------------------------
+
+ String TIMER_TYPE = "TimerType";
+ String MESSAGE = "Message";
+ String USER_DATA = "UserData";
+
+ // Attributes --------------------------------------------------------------
+
+ /**
+ * The MBeanServer
+ */
+ MBeanServer server;
+
+ /**
+ * The object name of the timer
+ */
+ ObjectName timerName;
+
+ /**
+ * The timer
+ */
+ Timer timer;
+
+ /**
+ * The timer notification id
+ */
+ Integer id;
+
+ /**
+ * The target notifications
+ */
+ int target = 0;
+
+ /**
+ * The number of notifications
+ */
+ int notifications = 0;
+
+ // Constructor -------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public TimerTortureTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Tests -------------------------------------------------------------------
+
+ /**
+ * See how long to do many notifications one notification,
+ * this tests the overhead
+ */
+ public void testTortureOne()
+ {
+ System.err.println("\nTimer iterations " + PerformanceSUITE.TIMER_ITERATION_COUNT);
+ System.err.println("One notification at 1 millsecond intervals.");
+ initTest();
+ try
+ {
+ initTimer();
+ startTimer();
+ target = PerformanceSUITE.TIMER_ITERATION_COUNT;
+ long start = timeOffset(0).getTime();
+ addNotification(1000, 1, PerformanceSUITE.TIMER_ITERATION_COUNT);
+ sync();
+ sleep(1000);
+ long end = timeOffset(0).getTime();
+ stopTimer();
+
+ System.err.println("Time (ms): " + (end-start));
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+ }
+
+ /**
+ * See how long to many notifications one notification, this tests the overhead
+ */
+ public void testTortureTen()
+ {
+ System.err.println("\nTimer iterations " + PerformanceSUITE.TIMER_ITERATION_COUNT);
+ System.err.println("Ten notifications at 1 millsecond intervals.");
+ initTest();
+ try
+ {
+ initTimer();
+ startTimer();
+ target = 10 * PerformanceSUITE.TIMER_ITERATION_COUNT;
+ long start = timeOffset(0).getTime();
+ for (int i=0; i<10; i++)
+ addNotification(1000, 1, PerformanceSUITE.TIMER_ITERATION_COUNT);
+ sync();
+ sleep(1000);
+ long end = timeOffset(0).getTime();
+ stopTimer();
+
+ System.err.println("Time (ms): " + (end-start));
+ }
+ finally
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+ }
+
+ // Support -----------------------------------------------------------------
+
+ /**
+ * Start a new test
+ */
+ private void initTest()
+ {
+ notifications = 0;
+ server = MBeanServerFactory.createMBeanServer();
+ }
+
+ /**
+ * Create a timer and register ourselves as a listener
+ */
+ private void initTimer()
+ {
+ try
+ {
+ timer = new Timer();
+ timerName = new ObjectName("test:type=timer");
+ server.registerMBean(timer, timerName);
+ server.addNotificationListener(timerName, this, null, null);
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ }
+
+ /**
+ * Start the timer
+ */
+ private void startTimer()
+ {
+ timer.start();
+ }
+
+ /**
+ * Stop the timer, does a small wait to avoid problems with the RI
+ */
+ private void stopTimer()
+ {
+ timer.stop();
+ }
+
+ /**
+ * Add a notification
+ */
+ private void addNotification(long offset, long period, long occurs)
+ {
+ id = timer.addNotification(TIMER_TYPE, MESSAGE, USER_DATA,
+ timeOffset(offset), period, occurs);
+ }
+
+ /**
+ * Handle the notification, just add it to the list
+ */
+ public void handleNotification(Notification n, Object ignored)
+ {
+ notifications++;
+ TimerNotification tn = (TimerNotification) n;
+ if (timer.getNbOccurences(tn.getNotificationID()).longValue() == 1)
+ synchronized(timerName)
+ {
+ timerName.notifyAll();
+ }
+ }
+
+ /**
+ * Sync with the notification handler
+ */
+ private void sync()
+ {
+ synchronized(timerName)
+ {
+ try
+ {
+ timerName.wait(60000);
+ }
+ catch (InterruptedException ignored)
+ {
+ }
+ }
+ }
+
+ /**
+ * Get the time using and offset
+ */
+ private Date timeOffset(long offset)
+ {
+ return new Date(System.currentTimeMillis() + offset);
+ }
+
+ /**
+ * Sleep for a bit
+ */
+ private void sleep(long time)
+ {
+ try
+ {
+ Thread.sleep(time);
+ }
+ catch (InterruptedException ignored)
+ {
+ }
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/serialization (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/serialization)
Deleted: branches/Branch_5_x/jmx/src/tests/test/serialization/SerializationSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/serialization/SerializationSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/serialization/SerializationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.serialization;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Serialization tests
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-
-public class SerializationSUITE extends TestSuite
-{
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All Serialization Tests");
-
- try
- {
-
- suite.addTest(org.jboss.test.jmx.serialization.SerializationSUITE.suite());
- }
- catch (Exception e)
- {
- e.printStackTrace();
- throw new RuntimeException(e.toString());
- }
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/serialization/SerializationSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/serialization/SerializationSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/serialization/SerializationSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/serialization/SerializationSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.serialization;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Serialization tests
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+
+public class SerializationSUITE extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All Serialization Tests");
+
+ try
+ {
+
+ suite.addTest(org.jboss.test.jmx.serialization.SerializationSUITE.suite());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new RuntimeException(e.toString());
+ }
+
+ return suite;
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/stress (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/stress)
Deleted: branches/Branch_5_x/jmx/src/tests/test/stress/ConcurrencyTestCase.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/stress/ConcurrencyTestCase.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/ConcurrencyTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,288 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.stress;
-
-import java.util.Hashtable;
-import java.util.Random;
-import java.util.Properties;
-import java.util.List;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.Set;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-import junit.framework.TestCase;
-
-/**
- * Stresses concurrent use of the MBeanServer for registration, querying.
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class ConcurrencyTestCase
- extends TestCase
-{
- // Constants ---------------------------------------------------------------
- static final int N = 100000;
- static final int Nadders = 2;
- static final int NDomains = 1;
- static final List names = Collections.synchronizedList(new LinkedList());
-
- // Attributes --------------------------------------------------------------
-
- /**
- * The MBeanServer
- */
- private MBeanServer server;
- private Random rnd;
- private boolean adding;
-
- // Constructor -------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public ConcurrencyTestCase(String s)
- {
- super(s);
- }
-
- // Tests -------------------------------------------------------------------
-
- public void testAddRemoveQuery() throws Exception
- {
- MBeanAdder[] adders = new MBeanAdder[Nadders];
- Thread[] adderThreads = new Thread[Nadders];
- MBeanRemover[] removers = new MBeanRemover[Nadders];
- Thread[] removerThreads = new Thread[Nadders];
- MBeanFinder finder = new MBeanFinder();
- adding = true;
- for(int n = 0; n < adders.length; n ++)
- {
- int minID = n * N / Nadders;
- int maxID = (n+1) * N / Nadders;
- adders[n] = new MBeanAdder(minID, maxID);
- adderThreads[n] = new Thread(adders[n], "MBeanAdder#"+n);
- adderThreads[n].start();
- }
- Thread t1 = new Thread(finder, "MBeanFinder");
- t1.start();
- for(int n = 0; n < adders.length; n ++)
- {
- removers[n] = new MBeanRemover();
- removerThreads[n] = new Thread(removers[n], "MBeanRemover#"+n);
- removerThreads[n].start();
- }
-
- for(int n = 0; n < adders.length; n ++)
- {
- adderThreads[n].join();
- }
- adding = false;
- t1.join();
- for(int n = 0; n < adders.length; n ++)
- {
- removerThreads[n].join();
- }
-
- for(int n = 0; n < adders.length; n ++)
- {
- assertNull("There was no exception in MBeanAdder#"+n, adders[n].getException());
- }
- assertNull("There was no exception in MBeanFinder", finder.getException());
- for(int n = 0; n < adders.length; n ++)
- {
- assertNull("There was no exception in MBeanRemover#"+n, removers[n].getException());
- }
- }
-
- // Support -----------------------------------------------------------------
-
- /**
- * Start a new test
- */
- protected void setUp()
- {
- server = MBeanServerFactory.createMBeanServer();
- rnd = new Random();
- }
-
- /**
- * End the test
- */
- protected void tearDown()
- throws Exception
- {
- MBeanServerFactory.releaseMBeanServer(server);
- }
-
- /**
- * Sleep for a bit
- */
- private void sleep(long time)
- {
- try
- {
- Thread.sleep(time);
- }
- catch (InterruptedException ignored)
- {
- }
- }
-
- class MBeanAdder implements Runnable
- {
- private int minID;
- private int maxID;
- private String domain;
- private Hashtable<String, String> nameProps = new Hashtable<String, String>();
- private Throwable ex;
-
- MBeanAdder(int minID, int maxID)
- {
- this.minID = minID;
- this.maxID = maxID;
- }
- public void run()
- {
- System.out.println("MBeanAdder, min="+minID+", max="+maxID+", starting");
- nameProps.put("type", "simple");
- try
- {
- for(int n = 0; n < N; n ++)
- {
- int id = minID + n % maxID;
- domain = "jboss.test."+ rnd.nextInt(NDomains);
- nameProps.put("id", "#"+id);
- addMBean();
- }
- }
- catch(Throwable t)
- {
- this.ex = t;
- ex.printStackTrace();
- }
- System.out.println("MBeanAdder, min="+minID+", max="+maxID+", ending");
- }
- void addMBean() throws Exception
- {
- ObjectName name = new ObjectName(domain, nameProps);
- if( server.isRegistered(name))
- server.unregisterMBean(name);
- Simple mbean = new Simple(name);
- server.registerMBean(mbean, name);
- names.add(name);
- }
- Throwable getException()
- {
- return ex;
- }
- }
-
- class MBeanRemover implements Runnable
- {
- private Throwable ex;
-
- public void run()
- {
- try
- {
- while( adding )
- {
- int max = names.size();
- if( max == 0 )
- {
- sleep(10);
- continue;
- }
- int index = rnd.nextInt(max);
- try
- {
- ObjectName name = (ObjectName) names.remove(index);
- server.unregisterMBean(name);
- }
- catch(IndexOutOfBoundsException ignore)
- {
- }
- }
- }
- catch(Throwable t)
- {
- this.ex = t;
- ex.printStackTrace();
- }
- }
- Throwable getException()
- {
- return ex;
- }
- }
-
- class MBeanFinder implements Runnable
- {
- private Throwable ex;
- public void run()
- {
- try
- {
- ObjectName query = new ObjectName("jboss.test.*:type=simple,*");
- int count = 0;
- while( adding )
- {
- Set matches = server.queryNames(query, null);
- count ++;
- if( count % 1000 == 0 )
- System.out.println(count+" queries, names.size="+names.size()+", matches.size="+matches.size());
- }
- }
- catch(Throwable t)
- {
- this.ex = t;
- ex.printStackTrace();
- }
- }
- Throwable getException()
- {
- return ex;
- }
- }
-
- static interface SimpleMBean
- {
- public ObjectName getName();
- }
- static class Simple implements SimpleMBean
- {
- private ObjectName name;
- Simple(ObjectName name)
- {
- this.name = name;
- }
- public ObjectName getName()
- {
- return name;
- }
- }
-}
-
Copied: branches/Branch_5_x/jmx/src/tests/test/stress/ConcurrencyTestCase.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/stress/ConcurrencyTestCase.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/stress/ConcurrencyTestCase.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/ConcurrencyTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,288 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.stress;
+
+import java.util.Hashtable;
+import java.util.Random;
+import java.util.Properties;
+import java.util.List;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+import junit.framework.TestCase;
+
+/**
+ * Stresses concurrent use of the MBeanServer for registration, querying.
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ConcurrencyTestCase
+ extends TestCase
+{
+ // Constants ---------------------------------------------------------------
+ static final int N = 100000;
+ static final int Nadders = 2;
+ static final int NDomains = 1;
+ static final List names = Collections.synchronizedList(new LinkedList());
+
+ // Attributes --------------------------------------------------------------
+
+ /**
+ * The MBeanServer
+ */
+ private MBeanServer server;
+ private Random rnd;
+ private boolean adding;
+
+ // Constructor -------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public ConcurrencyTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Tests -------------------------------------------------------------------
+
+ public void testAddRemoveQuery() throws Exception
+ {
+ MBeanAdder[] adders = new MBeanAdder[Nadders];
+ Thread[] adderThreads = new Thread[Nadders];
+ MBeanRemover[] removers = new MBeanRemover[Nadders];
+ Thread[] removerThreads = new Thread[Nadders];
+ MBeanFinder finder = new MBeanFinder();
+ adding = true;
+ for(int n = 0; n < adders.length; n ++)
+ {
+ int minID = n * N / Nadders;
+ int maxID = (n+1) * N / Nadders;
+ adders[n] = new MBeanAdder(minID, maxID);
+ adderThreads[n] = new Thread(adders[n], "MBeanAdder#"+n);
+ adderThreads[n].start();
+ }
+ Thread t1 = new Thread(finder, "MBeanFinder");
+ t1.start();
+ for(int n = 0; n < adders.length; n ++)
+ {
+ removers[n] = new MBeanRemover();
+ removerThreads[n] = new Thread(removers[n], "MBeanRemover#"+n);
+ removerThreads[n].start();
+ }
+
+ for(int n = 0; n < adders.length; n ++)
+ {
+ adderThreads[n].join();
+ }
+ adding = false;
+ t1.join();
+ for(int n = 0; n < adders.length; n ++)
+ {
+ removerThreads[n].join();
+ }
+
+ for(int n = 0; n < adders.length; n ++)
+ {
+ assertNull("There was no exception in MBeanAdder#"+n, adders[n].getException());
+ }
+ assertNull("There was no exception in MBeanFinder", finder.getException());
+ for(int n = 0; n < adders.length; n ++)
+ {
+ assertNull("There was no exception in MBeanRemover#"+n, removers[n].getException());
+ }
+ }
+
+ // Support -----------------------------------------------------------------
+
+ /**
+ * Start a new test
+ */
+ protected void setUp()
+ {
+ server = MBeanServerFactory.createMBeanServer();
+ rnd = new Random();
+ }
+
+ /**
+ * End the test
+ */
+ protected void tearDown()
+ throws Exception
+ {
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+
+ /**
+ * Sleep for a bit
+ */
+ private void sleep(long time)
+ {
+ try
+ {
+ Thread.sleep(time);
+ }
+ catch (InterruptedException ignored)
+ {
+ }
+ }
+
+ class MBeanAdder implements Runnable
+ {
+ private int minID;
+ private int maxID;
+ private String domain;
+ private Hashtable<String, String> nameProps = new Hashtable<String, String>();
+ private Throwable ex;
+
+ MBeanAdder(int minID, int maxID)
+ {
+ this.minID = minID;
+ this.maxID = maxID;
+ }
+ public void run()
+ {
+ System.out.println("MBeanAdder, min="+minID+", max="+maxID+", starting");
+ nameProps.put("type", "simple");
+ try
+ {
+ for(int n = 0; n < N; n ++)
+ {
+ int id = minID + n % maxID;
+ domain = "jboss.test."+ rnd.nextInt(NDomains);
+ nameProps.put("id", "#"+id);
+ addMBean();
+ }
+ }
+ catch(Throwable t)
+ {
+ this.ex = t;
+ ex.printStackTrace();
+ }
+ System.out.println("MBeanAdder, min="+minID+", max="+maxID+", ending");
+ }
+ void addMBean() throws Exception
+ {
+ ObjectName name = new ObjectName(domain, nameProps);
+ if( server.isRegistered(name))
+ server.unregisterMBean(name);
+ Simple mbean = new Simple(name);
+ server.registerMBean(mbean, name);
+ names.add(name);
+ }
+ Throwable getException()
+ {
+ return ex;
+ }
+ }
+
+ class MBeanRemover implements Runnable
+ {
+ private Throwable ex;
+
+ public void run()
+ {
+ try
+ {
+ while( adding )
+ {
+ int max = names.size();
+ if( max == 0 )
+ {
+ sleep(10);
+ continue;
+ }
+ int index = rnd.nextInt(max);
+ try
+ {
+ ObjectName name = (ObjectName) names.remove(index);
+ server.unregisterMBean(name);
+ }
+ catch(IndexOutOfBoundsException ignore)
+ {
+ }
+ }
+ }
+ catch(Throwable t)
+ {
+ this.ex = t;
+ ex.printStackTrace();
+ }
+ }
+ Throwable getException()
+ {
+ return ex;
+ }
+ }
+
+ class MBeanFinder implements Runnable
+ {
+ private Throwable ex;
+ public void run()
+ {
+ try
+ {
+ ObjectName query = new ObjectName("jboss.test.*:type=simple,*");
+ int count = 0;
+ while( adding )
+ {
+ Set matches = server.queryNames(query, null);
+ count ++;
+ if( count % 1000 == 0 )
+ System.out.println(count+" queries, names.size="+names.size()+", matches.size="+matches.size());
+ }
+ }
+ catch(Throwable t)
+ {
+ this.ex = t;
+ ex.printStackTrace();
+ }
+ }
+ Throwable getException()
+ {
+ return ex;
+ }
+ }
+
+ static interface SimpleMBean
+ {
+ public ObjectName getName();
+ }
+ static class Simple implements SimpleMBean
+ {
+ private ObjectName name;
+ Simple(ObjectName name)
+ {
+ this.name = name;
+ }
+ public ObjectName getName()
+ {
+ return name;
+ }
+ }
+}
+
Deleted: branches/Branch_5_x/jmx/src/tests/test/stress/StressSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/stress/StressSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/StressSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.stress;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Stress tests
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-
-public class StressSUITE extends TestSuite
-{
-
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("All Stress Tests");
-
- suite.addTest(test.stress.timer.TimerSUITE.suite());
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/stress/StressSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/stress/StressSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/stress/StressSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/StressSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.stress;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Stress tests
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+
+public class StressSUITE extends TestSuite
+{
+
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("All Stress Tests");
+
+ suite.addTest(test.stress.timer.TimerSUITE.suite());
+
+ return suite;
+ }
+}
Copied: branches/Branch_5_x/jmx/src/tests/test/stress/timer (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/stress/timer)
Deleted: branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerSUITE.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/stress/timer/TimerSUITE.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.stress.timer;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Timer stress tests.
- *
- * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class TimerSUITE
- extends TestSuite
-{
- /**
- * The number of timers to test
- */
- public static int TIMERS = 200;
-
- /**
- * The start offset
- */
- public static int OFFSET = 100;
-
- /**
- * The period
- */
- public static int PERIOD = 500;
-
- /**
- * The number of notifications
- */
- public static int NOTIFICATIONS = 100;
-
- /**
- * Run the tests
- *
- * @param args the arguments for the test
- */
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Get a list of tests.
- *
- * @return the tests
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Timer Stress tests");
-
- suite.addTest(new TestSuite(TimerTestCase.class));
-
- return suite;
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerSUITE.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/stress/timer/TimerSUITE.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerSUITE.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerSUITE.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.stress.timer;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Timer stress tests.
+ *
+ * @author <a href="mailto:AdrianBrock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class TimerSUITE
+ extends TestSuite
+{
+ /**
+ * The number of timers to test
+ */
+ public static int TIMERS = 200;
+
+ /**
+ * The start offset
+ */
+ public static int OFFSET = 100;
+
+ /**
+ * The period
+ */
+ public static int PERIOD = 500;
+
+ /**
+ * The number of notifications
+ */
+ public static int NOTIFICATIONS = 100;
+
+ /**
+ * Run the tests
+ *
+ * @param args the arguments for the test
+ */
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Get a list of tests.
+ *
+ * @return the tests
+ */
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Timer Stress tests");
+
+ suite.addTest(new TestSuite(TimerTestCase.class));
+
+ return suite;
+ }
+}
Deleted: branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerTestCase.java
===================================================================
--- branches/JBPAPP_5_0/jmx/src/tests/test/stress/timer/TimerTestCase.java 2009-07-11 17:18:31 UTC (rev 91128)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -1,281 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package test.stress.timer;
-
-import java.util.Date;
-import java.util.Random;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.timer.Timer;
-
-import junit.framework.TestCase;
-
-/**
- * Timer Stress Tests
- *
- * This test works by starting a lot of notifications at the start and
- * checks the concurrency by performing lots of operations.<p>
- *
- * It then waits for the slow notifications to complete allowing any lag
- * due to slower computers to be caught up with.<p>
- *
- * Any concurrency problem or dropped notifications should show up
- * when the test times out and the target notifications are not reached.
- *
- * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
- */
-public class TimerTestCase
- extends TestCase
- implements NotificationListener
-{
- // Constants ---------------------------------------------------------------
-
- String TIMER_TYPE = "TimerType";
- String MESSAGE = "Message";
- String USER_DATA = "UserData";
-
- // Attributes --------------------------------------------------------------
-
- /**
- * The MBeanServer
- */
- MBeanServer server;
-
- /**
- * The object name of the timer
- */
- ObjectName timerName;
-
- /**
- * The timer
- */
- Timer timer;
-
- /**
- * The number of notifications
- */
- int notifications = 0;
-
- /**
- * The target notifications
- */
- int target = 0;
-
- /**
- * The percentage done
- */
- int nextPercentage = 10;
-
- // Constructor -------------------------------------------------------------
-
- /**
- * Construct the test
- */
- public TimerTestCase(String s)
- {
- super(s);
- }
-
- // Tests -------------------------------------------------------------------
-
- /**
- * Test the timer under stress conditions
- */
- public void testTortureOne()
- throws Exception
- {
- target = TimerSUITE.TIMERS * TimerSUITE.NOTIFICATIONS;
- System.err.println("Timer Torture One: target=" + target);
-
- initTest();
- try
- {
- initTimer();
- startTimer();
-
- // Start lots of timer notifications
- nextPercentage = 10;
- Random random = new Random();
- for (int i = 0; i < TimerSUITE.TIMERS; i++)
- {
- addNotification(TimerSUITE.OFFSET,
- random.nextInt(TimerSUITE.PERIOD),
- TimerSUITE.NOTIFICATIONS);
- }
-
- // Perform some operations
- for (int k = 0; k < target; k++)
- {
- Integer id = addNotification(Timer.ONE_HOUR, Timer.ONE_HOUR, 1);
- timer.getAllNotificationIDs();
- timer.getDate(id);
- timer.getNbNotifications();;
- timer.getNbOccurences(id);
- timer.getNotificationIDs(TIMER_TYPE);
- timer.getNotificationUserData(id);
- timer.getPeriod(id);
- timer.getSendPastNotifications();
- timer.isActive();
- timer.isEmpty();
- timer.setSendPastNotifications(true);
- removeNotification(id);
- }
-
- // Give it time to complete but check for stalled
- for (int j = 0; j < TimerSUITE.NOTIFICATIONS; j++)
- {
- if (notifications >= target)
- break;
- int lastNotifications = notifications;
- sleep(TimerSUITE.PERIOD * 10);
- if (lastNotifications == notifications)
- {
- sleep(TimerSUITE.PERIOD * 10);
- if (lastNotifications == notifications)
- break;
- }
- }
-
- // Test the number of notifications
- assertTrue(notifications == target);
- }
- finally
- {
- endTest();
- }
- }
-
- // Support -----------------------------------------------------------------
-
- /**
- * Start a new test
- */
- private void initTest()
- {
- notifications = 0;
- server = MBeanServerFactory.createMBeanServer();
- }
-
- /**
- * End the test
- */
- private void endTest()
- throws Exception
- {
- server.removeNotificationListener(timerName, this);
- stopTimer();
- MBeanServerFactory.releaseMBeanServer(server);
- }
-
- /**
- * Create a timer and register ourselves as a listener
- */
- private void initTimer()
- {
- try
- {
- timer = new Timer();
- timerName = new ObjectName("test:type=timer");
- server.registerMBean(timer, timerName);
- server.addNotificationListener(timerName, this, null, null);
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- }
-
- /**
- * Start the timer
- */
- private void startTimer()
- {
- timer.start();
- }
-
- /**
- * Stop the timer, does a small wait to avoid problems with the RI
- */
- private void stopTimer()
- {
- timer.removeAllNotifications();
- timer.stop();
- }
-
- /**
- * Add a notification
- */
- private Integer addNotification(long offset, long period, long occurs)
- {
- return timer.addNotification(TIMER_TYPE, MESSAGE, USER_DATA,
- timeOffset(offset), period, occurs);
- }
-
- /**
- * Remove a notification
- */
- private void removeNotification(Integer id)
- throws Exception
- {
- timer.removeNotification(id);
- }
-
- /**
- * Handle the notification, just add it to the list
- */
- public synchronized void handleNotification(Notification n, Object ignored)
- {
- notifications++;
- float percentage = 100 * notifications / target;
- if (percentage >= nextPercentage)
- {
- System.err.println("Done " + nextPercentage + "%");
- nextPercentage += 10;
- }
- }
-
- /**
- * Get the time using and offset
- */
- private Date timeOffset(long offset)
- {
- return new Date(System.currentTimeMillis() + offset);
- }
-
- /**
- * Sleep for a bit
- */
- private void sleep(long time)
- {
- try
- {
- Thread.sleep(time);
- }
- catch (InterruptedException ignored)
- {
- }
- }
-}
Copied: branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerTestCase.java (from rev 91128, branches/JBPAPP_5_0/jmx/src/tests/test/stress/timer/TimerTestCase.java)
===================================================================
--- branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerTestCase.java (rev 0)
+++ branches/Branch_5_x/jmx/src/tests/test/stress/timer/TimerTestCase.java 2009-07-11 19:11:42 UTC (rev 91129)
@@ -0,0 +1,281 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package test.stress.timer;
+
+import java.util.Date;
+import java.util.Random;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.timer.Timer;
+
+import junit.framework.TestCase;
+
+/**
+ * Timer Stress Tests
+ *
+ * This test works by starting a lot of notifications at the start and
+ * checks the concurrency by performing lots of operations.<p>
+ *
+ * It then waits for the slow notifications to complete allowing any lag
+ * due to slower computers to be caught up with.<p>
+ *
+ * Any concurrency problem or dropped notifications should show up
+ * when the test times out and the target notifications are not reached.
+ *
+ * @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
+ */
+public class TimerTestCase
+ extends TestCase
+ implements NotificationListener
+{
+ // Constants ---------------------------------------------------------------
+
+ String TIMER_TYPE = "TimerType";
+ String MESSAGE = "Message";
+ String USER_DATA = "UserData";
+
+ // Attributes --------------------------------------------------------------
+
+ /**
+ * The MBeanServer
+ */
+ MBeanServer server;
+
+ /**
+ * The object name of the timer
+ */
+ ObjectName timerName;
+
+ /**
+ * The timer
+ */
+ Timer timer;
+
+ /**
+ * The number of notifications
+ */
+ int notifications = 0;
+
+ /**
+ * The target notifications
+ */
+ int target = 0;
+
+ /**
+ * The percentage done
+ */
+ int nextPercentage = 10;
+
+ // Constructor -------------------------------------------------------------
+
+ /**
+ * Construct the test
+ */
+ public TimerTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Tests -------------------------------------------------------------------
+
+ /**
+ * Test the timer under stress conditions
+ */
+ public void testTortureOne()
+ throws Exception
+ {
+ target = TimerSUITE.TIMERS * TimerSUITE.NOTIFICATIONS;
+ System.err.println("Timer Torture One: target=" + target);
+
+ initTest();
+ try
+ {
+ initTimer();
+ startTimer();
+
+ // Start lots of timer notifications
+ nextPercentage = 10;
+ Random random = new Random();
+ for (int i = 0; i < TimerSUITE.TIMERS; i++)
+ {
+ addNotification(TimerSUITE.OFFSET,
+ random.nextInt(TimerSUITE.PERIOD),
+ TimerSUITE.NOTIFICATIONS);
+ }
+
+ // Perform some operations
+ for (int k = 0; k < target; k++)
+ {
+ Integer id = addNotification(Timer.ONE_HOUR, Timer.ONE_HOUR, 1);
+ timer.getAllNotificationIDs();
+ timer.getDate(id);
+ timer.getNbNotifications();;
+ timer.getNbOccurences(id);
+ timer.getNotificationIDs(TIMER_TYPE);
+ timer.getNotificationUserData(id);
+ timer.getPeriod(id);
+ timer.getSendPastNotifications();
+ timer.isActive();
+ timer.isEmpty();
+ timer.setSendPastNotifications(true);
+ removeNotification(id);
+ }
+
+ // Give it time to complete but check for stalled
+ for (int j = 0; j < TimerSUITE.NOTIFICATIONS; j++)
+ {
+ if (notifications >= target)
+ break;
+ int lastNotifications = notifications;
+ sleep(TimerSUITE.PERIOD * 10);
+ if (lastNotifications == notifications)
+ {
+ sleep(TimerSUITE.PERIOD * 10);
+ if (lastNotifications == notifications)
+ break;
+ }
+ }
+
+ // Test the number of notifications
+ assertTrue(notifications == target);
+ }
+ finally
+ {
+ endTest();
+ }
+ }
+
+ // Support -----------------------------------------------------------------
+
+ /**
+ * Start a new test
+ */
+ private void initTest()
+ {
+ notifications = 0;
+ server = MBeanServerFactory.createMBeanServer();
+ }
+
+ /**
+ * End the test
+ */
+ private void endTest()
+ throws Exception
+ {
+ server.removeNotificationListener(timerName, this);
+ stopTimer();
+ MBeanServerFactory.releaseMBeanServer(server);
+ }
+
+ /**
+ * Create a timer and register ourselves as a listener
+ */
+ private void initTimer()
+ {
+ try
+ {
+ timer = new Timer();
+ timerName = new ObjectName("test:type=timer");
+ server.registerMBean(timer, timerName);
+ server.addNotificationListener(timerName, this, null, null);
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ }
+
+ /**
+ * Start the timer
+ */
+ private void startTimer()
+ {
+ timer.start();
+ }
+
+ /**
+ * Stop the timer, does a small wait to avoid problems with the RI
+ */
+ private void stopTimer()
+ {
+ timer.removeAllNotifications();
+ timer.stop();
+ }
+
+ /**
+ * Add a notification
+ */
+ private Integer addNotification(long offset, long period, long occurs)
+ {
+ return timer.addNotification(TIMER_TYPE, MESSAGE, USER_DATA,
+ timeOffset(offset), period, occurs);
+ }
+
+ /**
+ * Remove a notification
+ */
+ private void removeNotification(Integer id)
+ throws Exception
+ {
+ timer.removeNotification(id);
+ }
+
+ /**
+ * Handle the notification, just add it to the list
+ */
+ public synchronized void handleNotification(Notification n, Object ignored)
+ {
+ notifications++;
+ float percentage = 100 * notifications / target;
+ if (percentage >= nextPercentage)
+ {
+ System.err.println("Done " + nextPercentage + "%");
+ nextPercentage += 10;
+ }
+ }
+
+ /**
+ * Get the time using and offset
+ */
+ private Date timeOffset(long offset)
+ {
+ return new Date(System.currentTimeMillis() + offset);
+ }
+
+ /**
+ * Sleep for a bit
+ */
+ private void sleep(long time)
+ {
+ try
+ {
+ Thread.sleep(time);
+ }
+ catch (InterruptedException ignored)
+ {
+ }
+ }
+}
More information about the jboss-cvs-commits
mailing list