[jboss-cvs] JBossAS SVN: r59767 - branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jan 18 08:31:53 EST 2007
Author: dimitris at jboss.org
Date: 2007-01-18 08:31:53 -0500 (Thu, 18 Jan 2007)
New Revision: 59767
Added:
branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerBasicTestCase.java
branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerPeriodTestCase.java
Modified:
branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/BasicTestCase.java
branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/PeriodTestCase.java
Log:
JBAS-3870, clone jbossmx javax.management.timer.Timer implementation
Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/BasicTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/BasicTestCase.java 2007-01-18 13:29:01 UTC (rev 59766)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/BasicTestCase.java 2007-01-18 13:31:53 UTC (rev 59767)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.jbossmx.compliance.timer;
-import org.jboss.test.jbossmx.compliance.TestCase;
-
import java.util.ArrayList;
import java.util.Date;
@@ -33,6 +31,8 @@
import javax.management.ObjectName;
import javax.management.timer.TimerNotification;
+import org.jboss.test.jbossmx.compliance.TestCase;
+
/**
* Basic timer test.<p>
*
@@ -41,8 +41,7 @@
*
* @author <a href="mailto:Adrian.Brock at HappeningTimes.com">Adrian Brock</a>.
*/
-public class BasicTestCase
- extends TestCase
+public class BasicTestCase extends TestCase
implements NotificationListener
{
// Attributes ----------------------------------------------------------------
@@ -200,7 +199,18 @@
}
}
- // Support functions ---------------------------------------------------------
+ // Overrides -----------------------------------------------------------------
+
+ /**
+ * The timer class to test
+ */
+ protected String getTestedTimerClass()
+ {
+ // the standard JMX timer
+ return "javax.management.timer.Timer";
+ }
+
+ // Support functions ---------------------------------------------------------
/**
* Get an MBeanServer, install the timer service and a notification
@@ -212,7 +222,7 @@
server = MBeanServerFactory.createMBeanServer("Timer");
timerName = new ObjectName("Timer:type=TimerService");
- server.createMBean("javax.management.timer.Timer", timerName,
+ server.createMBean(getTestedTimerClass(), timerName,
new Object[0], new String[0]);
server.invoke(timerName, "start", new Object[0], new String[0]);
Added: branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerBasicTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerBasicTestCase.java (rev 0)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerBasicTestCase.java 2007-01-18 13:31:53 UTC (rev 59767)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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 org.jboss.test.jbossmx.compliance.timer;
+
+/**
+ * Basic timer test, targeting org.jboss.mx.timer.JBossTimer.
+ *
+ * @see BasicTestCase
+ *
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ */
+public class JBossTimerBasicTestCase extends BasicTestCase
+{
+ // Constructor ---------------------------------------------------------------
+
+ public JBossTimerBasicTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Overrides -----------------------------------------------------------------
+
+ /**
+ * The timer class to test
+ */
+ protected String getTestedTimerClass()
+ {
+ // the jboss timer
+ return "org.jboss.mx.timer.JBossTimer";
+ }
+}
Added: branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerPeriodTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerPeriodTestCase.java (rev 0)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/JBossTimerPeriodTestCase.java 2007-01-18 13:31:53 UTC (rev 59767)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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 org.jboss.test.jbossmx.compliance.timer;
+
+/**
+ * Period timer test, targeting org.jboss.mx.timer.JBossTimer.
+ *
+ * @see PeriodTestCase
+ *
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ */
+public class JBossTimerPeriodTestCase extends PeriodTestCase
+{
+ // Constructor ---------------------------------------------------------------
+
+ public JBossTimerPeriodTestCase(String s)
+ {
+ super(s);
+ }
+
+ // Overrides -----------------------------------------------------------------
+
+ /**
+ * The timer class to test
+ */
+ protected String getTestedTimerClass()
+ {
+ // the jboss timer
+ return "org.jboss.mx.timer.JBossTimer";
+ }
+}
Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/PeriodTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/PeriodTestCase.java 2007-01-18 13:29:01 UTC (rev 59766)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/jbossmx/compliance/timer/PeriodTestCase.java 2007-01-18 13:31:53 UTC (rev 59767)
@@ -34,7 +34,6 @@
import org.jboss.test.jbossmx.compliance.TestCase;
-
/**
* Test fixed-delay/fixed-rate timer execution modes.
*
@@ -90,6 +89,17 @@
super(s);
}
+ // Overrides -----------------------------------------------------------------
+
+ /**
+ * The timer class to test
+ */
+ protected String getTestedTimerClass()
+ {
+ // the standard JMX timer
+ return "javax.management.timer.Timer";
+ }
+
// Tests ---------------------------------------------------------------------
/**
@@ -209,7 +219,7 @@
{
server = MBeanServerFactory.createMBeanServer("Timer");
timerName = new ObjectName("Timer:type=TimerService");
- server.createMBean("javax.management.timer.Timer", timerName, new Object[0], new String[0]);
+ server.createMBean(getTestedTimerClass(), timerName, new Object[0], new String[0]);
server.invoke(timerName, "start", new Object[0], new String[0]);
server.addNotificationListener(timerName, this, null, null);
receivedNotifications.clear();
More information about the jboss-cvs-commits
mailing list