[jboss-cvs] JBossAS SVN: r64215 - in trunk/testsuite/src/main/org/jboss/test/cluster: hasingleton and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 23 22:38:10 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-07-23 22:38:10 -0400 (Mon, 23 Jul 2007)
New Revision: 64215

Added:
   trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/
   trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/HASingletonControllerTester.java
   trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/HASingletonSupportTester.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/hasingleton/HASingletonControllerTester.java (from rev 64055, trunk/testsuite/src/main/org/jboss/test/ha/singleton/HASingletonControllerTester.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/HASingletonControllerTester.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/HASingletonControllerTester.java	2007-07-24 02:38:10 UTC (rev 64215)
@@ -0,0 +1,53 @@
+/*
+  * 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.hasingleton;
+
+import java.security.InvalidParameterException;
+import java.util.Stack;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+
+import org.jboss.ha.singleton.HASingletonController;
+
+/**
+ * 
+ * @author  Ivelin Ivanov <ivelin at apache.org>
+ *
+ */
+public class HASingletonControllerTester extends HASingletonController
+{
+
+  public Stack __invokationStack__ = new Stack();
+
+  protected Object invokeSingletonMBeanMethod(ObjectName name,
+     String operationName, Object param)
+     throws InstanceNotFoundException, MBeanException, ReflectionException
+  {
+    __invokationStack__.push("invokeMBeanMethod:" + name.getCanonicalName() + "." + operationName);
+    return null;
+  }
+
+}

Copied: trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/HASingletonSupportTester.java (from rev 64055, trunk/testsuite/src/main/org/jboss/test/ha/singleton/HASingletonSupportTester.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/HASingletonSupportTester.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/hasingleton/HASingletonSupportTester.java	2007-07-24 02:38:10 UTC (rev 64215)
@@ -0,0 +1,111 @@
+/*
+  * 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.hasingleton;
+
+import java.util.Stack;
+
+import javax.management.Notification;
+
+import org.jboss.ha.singleton.HASingletonSupport;
+import org.jboss.test.cluster.testutil.MockHAPartition;
+
+
+/**
+ * 
+ * @author  Ivelin Ivanov <ivelin at apache.org>
+ *
+ */
+public class HASingletonSupportTester extends HASingletonSupport
+{
+
+  public Stack __invokationStack__ = new Stack();
+
+  public boolean __isDRMMasterReplica__ = false;
+
+  public boolean __isSingletonStarted__ = false;
+
+  public HASingletonSupportTester()
+  {
+     // Comply with startService() requirement that we have a partition
+     setHAPartition(new MockHAPartition());
+  }
+  
+  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);
+  }
+
+  public void startSingleton()
+  {
+    __invokationStack__.push("startSingleton");
+  }
+
+  public void stopSingleton()
+  {
+    __invokationStack__.push("stopSingleton");
+  }
+
+  protected void makeThisNodeMaster()
+  {
+    __invokationStack__.push("makeThisNodeMaster");
+    super.makeThisNodeMaster();
+  }
+
+
+  public void sendNotification(Notification notification)
+  {
+    return;
+  }
+
+}




More information about the jboss-cvs-commits mailing list