[jboss-cvs] JBossAS SVN: r64212 - in trunk/testsuite/src/main/org/jboss/test/cluster: ejb2 and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 23 22:35:56 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-07-23 22:35:56 -0400 (Mon, 23 Jul 2007)
New Revision: 64212

Added:
   trunk/testsuite/src/main/org/jboss/test/cluster/ejb2/
   trunk/testsuite/src/main/org/jboss/test/cluster/ejb2/basic/
   trunk/testsuite/src/main/org/jboss/test/cluster/hapartition/
   trunk/testsuite/src/main/org/jboss/test/cluster/haservice/
   trunk/testsuite/src/main/org/jboss/test/cluster/haservice/HAServiceMBeanSupportTester.java
Log:
[JBAS-4552] Move cluster tests into cluster package
[JBAS-4553] Reorg cluster tests to prevent unnecessary repetition

Copied: trunk/testsuite/src/main/org/jboss/test/cluster/haservice/HAServiceMBeanSupportTester.java (from rev 64055, trunk/testsuite/src/main/org/jboss/test/ha/jmx/HAServiceMBeanSupportTester.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/haservice/HAServiceMBeanSupportTester.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/haservice/HAServiceMBeanSupportTester.java	2007-07-24 02:35:56 UTC (rev 64212)
@@ -0,0 +1,117 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt 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.cluster.haservice;
+
+import java.util.Stack;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.ObjectName;
+
+import org.jboss.ha.jmx.HAServiceMBeanSupport;
+
+/**
+ * 
+ * @author  Ivelin Ivanov <ivelin at apache.org>
+ *
+ */
+public class HAServiceMBeanSupportTester extends HAServiceMBeanSupport
+{
+  public static final String SERVICE_NAME = "jboss.examples:name=HAServiceMBeanSupportTester";
+  
+  public Stack __invokationStack__ = new Stack();
+
+  public boolean __isDRMMasterReplica__ = false;
+
+  public boolean __isSingletonStarted__ = false;
+
+  public boolean __shouldSendNotificationRemoteFail__ = false;
+
+  protected void setupPartition() throws Exception
+  {
+    __invokationStack__.push("setupPartition");
+  }
+
+  protected void registerRPCHandler()
+  {
+    __invokationStack__.push("registerRPCHandler");
+  }
+
+  protected void unregisterRPCHandler()
+  {
+    __invokationStack__.push("unregisterRPCHandler");
+  }
+
+  protected void registerDRMListener() throws Exception
+  {
+    __invokationStack__.push("registerDRMListener");
+  }
+
+  protected void unregisterDRMListener() throws Exception
+  {
+    __invokationStack__.push("unregisterDRMListener");
+  }
+
+  protected boolean isDRMMasterReplica()
+  {
+    __invokationStack__.push("isDRMMasterReplica");
+    return __isDRMMasterReplica__;
+  }
+
+  public void callMethodOnPartition(String methodName, Object[] args)
+    throws Exception
+  {
+    __invokationStack__.push("callMethodOnCluster:" + methodName);
+  }
+
+  protected void sendNotificationRemote(Notification notification)
+    throws Exception
+  {
+    if (__shouldSendNotificationRemoteFail__)
+      throw new Exception("simulated exception");
+    __invokationStack__.push("sendNotificationRemote");
+    __invokationStack__.push(notification);
+  }
+
+  protected void sendNotificationToLocalListeners(Notification notification)
+  {
+    __invokationStack__.push("sendNotificationToLocalListeners");
+    __invokationStack__.push(notification);
+  }
+
+  public ObjectName getServiceName()
+  {
+    ObjectName oname = null;
+    try
+    {
+      oname = new ObjectName(SERVICE_NAME);
+    }
+    catch (MalformedObjectNameException e)
+    {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+    }
+    return oname;
+  }
+
+}




More information about the jboss-cvs-commits mailing list