[jboss-cvs] JBoss Messaging SVN: r6047 - in trunk/tests/jms-tests/src/org/jboss/test/messaging: jms and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 9 10:00:59 EDT 2009


Author: jmesnil
Date: 2009-03-09 10:00:59 -0400 (Mon, 09 Mar 2009)
New Revision: 6047

Removed:
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteContext.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteInitialContextFactory.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteTestServer.java
Modified:
   trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/SecurityTest.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/thirdparty/jbosssx/SecurityAssociationTest.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/ServerManagement.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java
Log:
test suite cleanup

* removed unused legacy code

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -692,9 +692,9 @@
       servers.get(0).setSecurityConfig(defConfig);
    }
 
-   protected void setSecurityConfigOnManager(boolean b, String s, HashSet<Role> lockedConf) throws Exception
+   protected void setSecurityConfigOnManager(String destination, boolean isQueue, Set<Role> roles) throws Exception
    {
-      servers.get(0).configureSecurityForDestination(s, b, lockedConf);
+      servers.get(0).configureSecurityForDestination(destination, isQueue, roles);
    }
 
    protected void kill(int i) throws Exception

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/SecurityTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/SecurityTest.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/SecurityTest.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -612,20 +612,15 @@
          assertTrue(canReadDestination(conn, queue2));
          assertTrue(canWriteDestination(conn, queue2, false));
 
-         // Now set to null
-
-         ServerManagement.configureSecurityForDestination("Queue2", null);
-
-         // Should fall back to the default config
          HashSet<Role> lockedConf = new HashSet<Role>();
          lockedConf.add(new Role("alien", true, true, true));
 
-         setSecurityConfigOnManager(true, "Queue2", lockedConf);
+         setSecurityConfigOnManager("Queue2", true, lockedConf);
 
          assertFalse(canReadDestination(conn, queue2));
          assertFalse(canWriteDestination(conn, queue2, false));
 
-         setSecurityConfigOnManager(true, "Queue2", defConfig);
+         setSecurityConfigOnManager("Queue2", true, defConfig);
 
          assertTrue(canReadDestination(conn, queue2));
          assertTrue(canWriteDestination(conn, queue2, false));

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/thirdparty/jbosssx/SecurityAssociationTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/thirdparty/jbosssx/SecurityAssociationTest.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/thirdparty/jbosssx/SecurityAssociationTest.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -33,10 +33,10 @@
 import javax.jms.TextMessage;
 import javax.security.auth.Subject;
 
+import org.jboss.messaging.core.security.Role;
 import org.jboss.security.SecurityAssociation;
 import org.jboss.security.SimplePrincipal;
 import org.jboss.test.messaging.jms.JMSTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
 import org.jboss.test.messaging.tools.container.MockJBossSecurityManager;
 
 /**
@@ -276,12 +276,11 @@
    {
       super.setUp();
    
-      final String secureQueueConfig =
-         "<security>" +
-            "<role name=\"publisher\" read=\"true\" write=\"true\" create=\"false\"/>" +
-            "<role name=\"guest\" read=\"true\" write=\"true\" create=\"false\"/>" +
-         "</security>";
-      ServerManagement.configureSecurityForDestination("Queue2", secureQueueConfig);
+      Set<Role> roles = new HashSet<Role>();
+      roles.add(new Role("publisher", true, true, false));
+      roles.add(new Role("guest", true, true, false));
+      
+      setSecurityConfigOnManager("Queue2", true, roles);
 
       // make MockSecurityManager simulate JaasSecurityManager behavior. This is the whole point
       // of this test, to catch JBoss AS integreation failure before the integration test suite
@@ -305,7 +304,7 @@
 
       sm.setSimulateJBossJaasSecurityManager(false);
 
-      ServerManagement.configureSecurityForDestination("Queue2", null);
+      setSecurityConfigOnManager("Queue2", true, new HashSet<Role>());
    }
 
    // Private --------------------------------------------------------------------------------------

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/ServerManagement.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -21,7 +21,6 @@
 */
 package org.jboss.test.messaging.tools;
 
-import java.rmi.Naming;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.List;
@@ -29,7 +28,6 @@
 import org.jboss.messaging.core.logging.Logger;
 import org.jboss.test.messaging.tools.container.InVMInitialContextFactory;
 import org.jboss.test.messaging.tools.container.LocalTestServer;
-import org.jboss.test.messaging.tools.container.RMITestServer;
 import org.jboss.test.messaging.tools.container.Server;
 
 
@@ -236,18 +234,6 @@
       servers.get(0).stopServerPeer();
    }
 
-   public static void configureSecurityForDestination(String destName, String config)
-           throws Exception
-   {
-      configureSecurityForDestination(0, destName, config);
-   }
-
-   public static void configureSecurityForDestination(int serverID, String destName, String config)
-           throws Exception
-   {
-      //servers.get(0).configureSecurityForDestination(destName, config);
-   }
-
    public static Hashtable getJNDIEnvironment()
    {
       return getJNDIEnvironment(0);
@@ -258,57 +244,6 @@
       return InVMInitialContextFactory.getJNDIEnvironment(serverIndex);
    }
 
-   public static Server acquireRemote(int initialRetries, int index, boolean quiet)
-   {
-      String name =
-              "//localhost:" + RMITestServer.DEFAULT_REGISTRY_PORT + "/" +
-                      RMITestServer.RMI_SERVER_PREFIX + index;
-
-      Server s = null;
-      int retries = initialRetries;
-
-      while (s == null && retries > 0)
-      {
-         int attempt = initialRetries - retries + 1;
-         try
-         {
-            String msg = "trying to connect to the remote RMI server " + index +
-                    (attempt == 1 ? "" : ", attempt " + attempt);
-
-            if (quiet)
-            {
-               log.debug(msg);
-            }
-            else
-            {
-               log.info(msg);
-            }
-
-            s = (Server) Naming.lookup(name);
-
-            log.debug("connected to remote server " + index);
-         }
-         catch (Exception e)
-         {
-            log.debug("failed to get the RMI server stub, attempt " +
-                    (initialRetries - retries + 1), e);
-
-            try
-            {
-               Thread.sleep(500);
-            }
-            catch (InterruptedException e2)
-            {
-               // OK
-            }
-
-            retries--;
-         }
-      }
-
-      return s;
-   }
-
    // Attributes ----------------------------------------------------
 
    // Constructors --------------------------------------------------
@@ -321,25 +256,6 @@
 
    // Private -------------------------------------------------------
 
-
-//   private static JmsServer getJmsServer(int id)
-//   {
-//      try
-//      {
-//         if (isLocal())
-//         {
-//            return servers.get(id).getJmsServer();
-//         }
-//         else
-//         {
-//            return null;
-//         }
-//      }
-//      catch (Exception e)
-//      {
-//         throw new RuntimeException();
-//      }
-//   }
    // Inner classes -------------------------------------------------
 
 }

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -1,111 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
-* 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.messaging.tools.container;
-
-
-
-import java.rmi.server.UnicastRemoteObject;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- *
- * $Id: RMINamingDelegate.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class RMINamingDelegate extends UnicastRemoteObject implements NamingDelegate
-{
-   // Constants -----------------------------------------------------
-	
-	private static final long serialVersionUID = -7123818911636174877L;
-	
-   // Static --------------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-	private InitialContextAccess ica;
-   private int serverIndex;
-
-   // Constructors --------------------------------------------------
-
-   public RMINamingDelegate(int serverIndex) throws Exception
-   {
-      super();
-      this.serverIndex = serverIndex;
-      ica = new InitialContextAccess();
-   }
-
-   // NamingDelegate implementation ---------------------------------
-
-   public Object lookup(String name) throws Exception
-   {
-      return getInitialContext().lookup(name);
-   }
-
-   public void bind(String name, Object obj) throws Exception
-   {
-      getInitialContext().bind(name, obj);
-   }
-
-   // Public --------------------------------------------------------
-
-   public void reset()
-   {
-      ica.reset();
-   }
-
-   // Package protected ---------------------------------------------
-   
-   // Protected -----------------------------------------------------
-   
-   // Private -------------------------------------------------------
-
-   private InitialContext getInitialContext() throws NamingException
-   {
-      return ica.getInitialContext();
-   }
-
-   // Inner classes -------------------------------------------------
-
-   private class InitialContextAccess
-   {
-      private InitialContext ic;
-
-      InitialContext getInitialContext() throws NamingException
-      {
-         if (ic == null)
-         {
-            ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment(serverIndex));
-         }
-         return ic;
-      }
-
-      public void reset()
-      {
-         ic = null;
-         
-         InVMInitialContextFactory.reset();
-      }
-   }
-}

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -1,366 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
-  * 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.messaging.tools.container;
-
-import java.lang.management.ManagementFactory;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UnicastRemoteObject;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.ObjectNames;
-import org.jboss.messaging.core.security.Role;
-import org.jboss.messaging.core.server.MessagingServer;
-import org.jboss.messaging.jms.server.JMSServerManager;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.SubscriptionInfo;
-import org.jboss.messaging.jms.server.management.TopicControlMBean;
-
-/**
- * An RMI wrapper to access the ServiceContainer from a different address space.
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox at jboss.com>Tim Fox</a>
- * @version <tt>1.1</tt>
- *
- * RMITestServer.java,v 1.1 2006/02/21 08:25:33 timfox Exp
- */
-public class RMITestServer extends UnicastRemoteObject implements Server
-{
-   // Constants -----------------------------------------------------
-
-   public static final String RMI_SERVER_PREFIX = "messaging_rmi_server_";
-   public static final String NAMING_SERVER_PREFIX = "naming_rmi_server_";
-
-   public static final int DEFAULT_REGISTRY_PORT = 33777;
-   public static final int DEFAULT_SERVER_INDEX = 0;
-   public static final String DEFAULT_SERVER_HOST = "localhost";
-
-   private static final long serialVersionUID = -368445344011004778L;
-   private static final Logger log = Logger.getLogger(RMITestServer.class);
-
-   // Static --------------------------------------------------------
-
-   public static void main(String[] args) throws Exception
-   {
-      log.debug("initializing RMI runtime");
-
-      String host = System.getProperty("test.bind.address");
-
-      if (host == null)
-      {
-         host = DEFAULT_SERVER_HOST;
-      }
-
-      int serverIndex = DEFAULT_SERVER_INDEX;
-
-      String s = System.getProperty("test.server.index");
-
-      if (s != null)
-      {
-         serverIndex = Integer.parseInt(s);
-      }
-
-      log.info("RMI server " + serverIndex + ", bind address " + host);
-
-      RMITestServer testServer = new RMITestServer(serverIndex);
-      log.debug("RMI server " + serverIndex + " created");
-
-      // let RMI know the bind address
-      System.setProperty("java.rmi.server.hostname", host);
-
-      Registry registry;
-
-      // try to bind first
-      try
-      {
-         registry = LocateRegistry.getRegistry(DEFAULT_REGISTRY_PORT);
-         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
-         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());
-      }
-      catch(Exception e)
-      {
-         log.info("Failure using an existing registry, trying creating it");
-
-         // try to create it
-         registry = LocateRegistry.createRegistry(DEFAULT_REGISTRY_PORT);
-
-         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
-         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());
-      }
-
-      log.info("RMI server " + serverIndex + " bound");     
-   }
-
-   // Attributes ----------------------------------------------------
-
-   protected RemoteTestServer server;
-   private RMINamingDelegate namingDelegate;
-
-   // Constructors --------------------------------------------------
-
-   public RMITestServer(int index) throws Exception
-   {
-      namingDelegate = new RMINamingDelegate(index);
-      server = new RemoteTestServer(index);
-   }
-
-   // Server implementation -----------------------------------------
-
-   public int getServerID()
-   {
-      return server.getServerID();
-   }
-
-
-   public void start(String[] containerConfig, HashMap<String, Object> configuration, boolean clearDatabase) throws Exception
-   {
-      server.start(containerConfig, configuration, clearDatabase);
-   }
-
-
-
-   public boolean stop() throws Exception
-   {
-      boolean result = server.stop();
-      namingDelegate.reset();
-      return result;
-   }
-
-   public synchronized void kill() throws Exception
-   {
-   	log.info("kill() invoked - first deregistering from the rmi registry");
-
-      // unregister myself from the RMI registry
-
-      Registry registry = LocateRegistry.getRegistry(DEFAULT_REGISTRY_PORT);
-
-      String name = RMI_SERVER_PREFIX + server.getServerID();
-      registry.unbind(name);
-      log.info("unregistered " + name + " from registry");
-
-      // unregister myself from the RMI registry
-
-      name = NAMING_SERVER_PREFIX + server.getServerID();
-      registry.unbind(name);
-      log.info("unregistered " + name + " from registry");
-
-      log.info("Killing VM!!!!");
-      
-      Runtime.getRuntime().halt(1);
-   }
-
-   public void ping() throws Exception
-   {
-      //noop - nothing to be done
-   }
-
-   public void log(int level, String text) throws Exception
-   {
-      server.log(level, text);
-   }
-
-   public void startServerPeer(int serverPeerID) throws Exception
-   {
-      server.startServerPeer(serverPeerID);
-   }
-
-   public void stopServerPeer() throws Exception
-   {
-      server.stopServerPeer();
-   }
-
-   public boolean isStarted() throws Exception
-   {
-      return server.isStarted();
-   }
-
-   public MessagingServer getServerPeer() throws Exception
-   {
-      return server.getServerPeer();
-   }
-
-   public void destroyQueue(String name, String jndiName) throws Exception
-   {
-      server.destroyQueue(name, jndiName);
-   }
-   
-   public void destroyTopic(String name, String jndiName) throws Exception
-   {
-      server.destroyTopic(name, jndiName);
-   }
-   
-   public void createQueue(String name, String jndiName) throws Exception
-   {
-      server.createQueue(name, jndiName);
-   }
-   
-   public void createTopic(String name, String jndiName) throws Exception
-   {
-      server.createTopic(name, jndiName);
-   }
-
-   public void deployConnectionFactory(String objectName, List<String> jndiBindings)
-      throws Exception
-   {
-      server.deployConnectionFactory(objectName, jndiBindings);
-   }
-
-   public void deployConnectionFactory(String clientID, String objectName, List<String> jndiBindings) throws Exception
-   {
-      server.deployConnectionFactory(clientID, objectName, jndiBindings);
-   }
-
-   public void deployConnectionFactory(String objectName, List<String> jndiBindings, int prefetchSize)
-      throws Exception
-   {
-      server.deployConnectionFactory(objectName, jndiBindings, prefetchSize);
-   }
-
-   public void deployConnectionFactory(String clientId,
-                                        String objectName,
-                                        List<String> jndiBindings,
-                                        int prefetchSize,
-                                        int defaultTempQueueFullSize,
-                                        int defaultTempQueuePageSize,
-                                        int defaultTempQueueDownCacheSize,
-                                        boolean supportsFailover,
-                                        boolean supportsLoadBalancing,
-                                        int dupsOkBatchSize,
-                                        boolean blockOnAcknowledge) throws Exception
-   {
-      server.deployConnectionFactory(clientId, objectName, jndiBindings, prefetchSize, defaultTempQueueFullSize, defaultTempQueuePageSize, defaultTempQueueDownCacheSize,
-              supportsFailover, supportsLoadBalancing, dupsOkBatchSize, blockOnAcknowledge);  
-   }
-    public void deployConnectionFactory(String objectName,
-                                       List<String> jndiBindings,
-                                       int prefetchSize,
-                                       int defaultTempQueueFullSize,
-                                       int defaultTempQueuePageSize,
-                                       int defaultTempQueueDownCacheSize) throws Exception
-   {
-      server.deployConnectionFactory(objectName, jndiBindings, prefetchSize,
-                                     defaultTempQueueFullSize, defaultTempQueuePageSize, defaultTempQueueDownCacheSize);
-   }
-   
-   public void deployConnectionFactory(String objectName,
-         List<String> jndiBindings, boolean supportsFailover, boolean supportsLoadBalancing) throws Exception
-   {
-   	server.deployConnectionFactory(objectName, jndiBindings, supportsFailover, supportsLoadBalancing);
-   }
-
-   public void undeployConnectionFactory(String objectName) throws Exception
-   {
-      server.undeployConnectionFactory(objectName);
-   }
-
-   public void configureSecurityForDestination(String destName, boolean isQueue, Set<Role> roles) throws Exception
-   {
-      server.configureSecurityForDestination(destName, isQueue, roles);
-   }
- 
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   private RMINamingDelegate getNamingDelegate()
-   {
-      return namingDelegate;
-   }
-
-   public MessagingServer getMessagingServer() throws Exception
-   {
-      return server.getMessagingServer();
-   }
-
-   public JMSServerManager getJMSServerManager()
-   {
-      return server.getJMSServerManager();
-   }
-
-   public void removeAllMessages(String destination, boolean isQueue) throws Exception
-   {
-      server.removeAllMessages(destination, isQueue);
-   }
-
-   public Integer getMessageCountForQueue(String queueName) throws Exception
-   {
-      ObjectName objectName = ObjectNames.getJMSQueueObjectName(queueName);
-      JMSQueueControlMBean queue = (JMSQueueControlMBean) MBeanServerInvocationHandler.newProxyInstance(
-            ManagementFactory.getPlatformMBeanServer(), objectName, JMSQueueControlMBean.class, false);
-      return queue.getMessageCount();
-   }
-
-
-   public List<String> listAllSubscribersForTopic(String s) throws Exception
-   {
-      ObjectName objectName = ObjectNames.getJMSTopicObjectName(s);
-      TopicControlMBean topic = (TopicControlMBean) MBeanServerInvocationHandler.newProxyInstance(
-            ManagementFactory.getPlatformMBeanServer(), objectName, TopicControlMBean.class, false);
-      SubscriptionInfo[] subInfos = topic.listAllSubscriptionInfos();
-      List<String> subs = new ArrayList<String>();
-      for (SubscriptionInfo info : subInfos)
-      {
-         subs.add(info.getName());
-      }
-      return subs;
-   }
-
-
-   public Set<Role> getSecurityConfig() throws Exception
-   {
-      return server.getSecurityConfig();
-   }
-
-   public void setSecurityConfig(Set<Role> defConfig) throws Exception
-   {
-      server.setSecurityConfig(defConfig);
-   }
-
-   public InitialContext getInitialContext() throws Exception
-   {
-      Hashtable env = new Hashtable();
-      env.put("java.naming.factory.initial",
-              "org.jboss.test.messaging.tools.container.RemoteInitialContextFactory");
-      env.put("java.naming.provider.url", "");
-      env.put("java.naming.factory.url.pkgs", "");
-      env.put(Constants.SERVER_INDEX_PROPERTY_NAME, ""+getServerID());
-
-      return new InitialContext(env);
-   }
-   
-
-   // Inner classes -------------------------------------------------
-}

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteContext.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteContext.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteContext.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -1,240 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
-* 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.messaging.tools.container;
-
-import java.rmi.Naming;
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NameParser;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-import org.jboss.messaging.core.logging.Logger;
-
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- *
- * $Id: RemoteContext.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class RemoteContext implements Context
-{
-   // Constants -----------------------------------------------------
-
-   private static final Logger log = Logger.getLogger(RemoteContext.class);
-
-   // Static --------------------------------------------------------
-   
-   // Attributes ----------------------------------------------------
-
-   private NamingDelegate namingDelegate;
-   
-   // Constructors --------------------------------------------------
-
-   public RemoteContext(int remoteServerIndex) throws Exception
-   {
-      String n =
-         "//localhost:" + RMITestServer.DEFAULT_REGISTRY_PORT + "/" +
-          RMITestServer.NAMING_SERVER_PREFIX + remoteServerIndex;
-      
-      namingDelegate = (NamingDelegate)Naming.lookup(n);
-
-      log.debug("remote context for server " + remoteServerIndex + " acquired from rmi:" + n);
-   }
-
-   // Context implementation ----------------------------------------
-
-   public Object lookup(Name name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Object lookup(String name) throws NamingException
-   {
-      try
-      {
-         return namingDelegate.lookup(name);
-      }
-      catch(Exception e)
-      {
-         log.error("naming operation failed", e);
-         throw new NamingException(e.getMessage());
-      }
-   }
-
-   public void bind(Name name, Object obj) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void bind(String name, Object obj) throws NamingException
-   {
-      try
-      {
-         namingDelegate.bind(name, obj);
-      }
-      catch(Exception e)
-      {
-         log.error("naming operation failed", e);
-         throw new NamingException(e.getMessage());
-      }
-   }
-
-   public void rebind(Name name, Object obj) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void rebind(String name, Object obj) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void unbind(Name name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void unbind(String name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void rename(Name oldName, Name newName) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void rename(String oldName, String newName) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public NamingEnumeration list(Name name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public NamingEnumeration list(String name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public NamingEnumeration listBindings(Name name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public NamingEnumeration listBindings(String contextName) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void destroySubcontext(Name name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void destroySubcontext(String name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Context createSubcontext(Name name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Context createSubcontext(String name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Object lookupLink(Name name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Object lookupLink(String name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public NameParser getNameParser(Name name) throws NamingException
-   {
-      return getNameParser(name.toString());
-   }
-
-   public NameParser getNameParser(String name) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Name composeName(Name name, Name prefix) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public String composeName(String name, String prefix) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Object addToEnvironment(String propName, Object propVal) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Object removeFromEnvironment(String propName) throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public Hashtable getEnvironment() throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   public void close() throws NamingException
-   {
-   }
-
-   public String getNameInNamespace() throws NamingException
-   {
-      throw new UnsupportedOperationException();
-   }
-
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-   
-   // Protected -----------------------------------------------------
-   
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}
-

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteInitialContextFactory.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteInitialContextFactory.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteInitialContextFactory.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -1,97 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
-* 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.messaging.tools.container;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.spi.InitialContextFactory;
-
-import org.jboss.messaging.core.logging.Logger;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- *
- * $Id: RemoteInitialContextFactory.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class RemoteInitialContextFactory implements InitialContextFactory
-{
-   // Constants -----------------------------------------------------
-
-   private static final Logger log = Logger.getLogger(RemoteInitialContextFactory.class);
-
-   // Static --------------------------------------------------------
-
-   /**
-    * @return the JNDI environment to use to get this InitialContextFactory.
-    */
-   public static Hashtable getJNDIEnvironment(int serverIndex)
-   {
-      Hashtable env = new Hashtable();
-      env.put("java.naming.factory.initial",
-              "org.jboss.test.messaging.tools.container.RemoteInitialContextFactory");
-      env.put("java.naming.provider.url", "");
-      //env.put("java.naming.factory.url.pkgs", "");
-      env.put(Constants.SERVER_INDEX_PROPERTY_NAME, Integer.toString(serverIndex));
-      return env;
-   }
-
-   // Attributes ----------------------------------------------------
-   
-   // Constructors --------------------------------------------------
-   
-   // Public --------------------------------------------------------
-
-   public Context getInitialContext(Hashtable environment) throws NamingException
-   {
-      String s = (String)environment.get(Constants.SERVER_INDEX_PROPERTY_NAME);
-      
-      if (s == null)
-      {
-         throw new IllegalArgumentException("Initial context environment must contain " +
-                                            "entry for " + Constants.SERVER_INDEX_PROPERTY_NAME);
-      }
-
-      int remoteServerIndex = Integer.parseInt(s);
-
-      try
-      {
-         return new RemoteContext(remoteServerIndex);
-      }
-      catch(Exception e)
-      {
-         log.error("Cannot get the remote context", e);
-         throw new NamingException("Cannot get the remote context");
-      }
-
-   }
-
-   // Package protected ---------------------------------------------
-   
-   // Protected -----------------------------------------------------
-   
-   // Private -------------------------------------------------------
-   
-   // Inner classes -------------------------------------------------   
-}

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteTestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteTestServer.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RemoteTestServer.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -1,84 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
-* 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.messaging.tools.container;
-
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>1.1</tt>
- *
- * RemoteTestServer.java,v 1.1 2006/02/21 08:25:33 timfox Exp
- */
-public class RemoteTestServer extends LocalTestServer
-{
-   // Constants ------------------------------------------------------------------------------------
-
-   // Static ---------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   public RemoteTestServer(int serverIndex)
-   {
-      super(serverIndex);
-   }
-
-   // Server implementation ------------------------------------------------------------------------
-
-//   /**
-//    * Only for in-VM use!
-//    */
-//   public MessageStore getMessageStore() throws Exception
-//   {
-//      throw new UnsupportedOperationException("This method shouldn't be invoked on a remote server");
-//   }
-
-//   /**
-//    * Only for in-VM use!
-//    */
-//   public DestinationManager getDestinationManager() throws Exception
-//   {
-//      throw new UnsupportedOperationException("This method shouldn't be invoked on a remote server");
-//   }
-//
-//   /**
-//    * Only for in-VM use!
-//    */
-//   public StorageManager getPersistenceManager()
-//   {
-//      throw new UnsupportedOperationException("This method shouldn't be invoked on a remote server");
-//   }
-
-
-   // Public ---------------------------------------------------------------------------------------
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   // Private --------------------------------------------------------------------------------------
-
-   // Inner classes --------------------------------------------------------------------------------
-
-}

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java	2009-03-09 13:24:11 UTC (rev 6046)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java	2009-03-09 14:00:59 UTC (rev 6047)
@@ -193,10 +193,6 @@
 
    void undeployConnectionFactory(String objectName) throws Exception;
 
-   /**
-    * @param config - sending 'config' as a String and not as an org.w3c.dom.Element to avoid
-    *        NotSerializableExceptions that show up when running tests on JDK 1.4.
-    */
    void configureSecurityForDestination(String destName, boolean isQueue, Set<Role> roles) throws Exception;
 
    MessagingServer getMessagingServer() throws Exception;




More information about the jboss-cvs-commits mailing list