[jboss-cvs] JBossAS SVN: r104705 - in branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging: test and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 11 23:58:25 EDT 2010


Author: clebert.suconic at jboss.com
Date: 2010-05-11 23:58:24 -0400 (Tue, 11 May 2010)
New Revision: 104705

Removed:
   branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
   branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java
Modified:
   branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/joram/JoramTestAdminDelegate.java
Log:
Tweaks on joram-tests

Deleted: branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java	2010-05-12 02:14:17 UTC (rev 104704)
+++ branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java	2010-05-12 03:58:24 UTC (rev 104705)
@@ -1,220 +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 org.jboss.test.jbossmessaging;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NestedRuntimeException;
-
-import org.objectweb.jtests.jms.admin.Admin;
-
-/**
- * JBossMessagingAdmin.
- * 
- * @author <a href="richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public class JBossMessagingAdmin implements Admin
-{
-   private Logger log = Logger.getLogger(JBossMessagingAdmin.class);
-
-   private InitialContext initialContext ;
-   private MBeanServerConnection server ;
-
-   protected static final String name ;
-   protected static final ObjectName serverPeer;
-   protected static final ObjectName namingService;
-   
-   static
-   {
-      try
-      {
-	 name =  JBossMessagingAdmin.class.getName() ;
-         serverPeer = new ObjectName("jboss.messaging:service=ServerPeer");
-         namingService = new ObjectName("jboss:service=Naming");
-      }
-      catch (Exception e)
-      {
-         throw new NestedRuntimeException(e);
-      }
-   }
-   
-   public JBossMessagingAdmin(Class clazz) throws Exception
-   {
-	   this();
-   }
-   public JBossMessagingAdmin() throws Exception
-   {
-      try {
-	  log.info("Initializing...") ;
-
-          // set up the initial naming service context
-          initialContext = new InitialContext() ;
-
-          // set up the MBean server connection
-          String adaptorName = System.getProperty("jbosstest.server.name","jmx/invoker/RMIAdaptor") ;
-          server = (MBeanServerConnection) initialContext.lookup(adaptorName) ;
-	   
-      } catch (Exception e) {
-         throw new NestedRuntimeException(e);
-      }
-   }
-
-   public String getName() {
-      return name ;
-   }
-
-   private MBeanServerConnection getServer() {
-       return server ;
-   }
-
-   public InitialContext createInitialContext() throws NamingException {
-      return initialContext ;
-   }
-
-   public void createQueue(String name)
-   {
-      try
-      {
-         MBeanServerConnection server = getServer();
-         try
-         {
-            server.invoke(serverPeer, "deployQueue", new Object[] { name, name },  new String[] { String.class.getName(), String.class.getName() } );
-         }
-         catch (Exception ignored)
-         {
-            log.trace("Ignored", ignored);
-         }
-         ObjectName queueName = new ObjectName("jboss.messaging.destination:service=Queue,name=" + name);
-         server.invoke(queueName, "removeAllMessages", null, null);
-      }
-      catch (Exception e)
-      {
-         throw new NestedRuntimeException(e);
-      }
-   }
-
-   public void deleteQueue(String name)
-   {
-      try
-      {
-         MBeanServerConnection server = getServer();
-         ObjectName queueName = new ObjectName("jboss.messaging.destination:service=Queue,name=" + name);
-         server.invoke(queueName, "removeAllMessages", null, null);
-         server.invoke(serverPeer, "destroyQueue", new Object[] { name },  new String[] { String.class.getName() } );
-      }
-      catch (Exception e)
-      {
-         throw new NestedRuntimeException(e);
-      }
-   }
-
-   public void createTopic(String name)
-   {
-      try
-      {
-         MBeanServerConnection server = getServer();
-         try
-         {
-            server.invoke(serverPeer, "deployTopic", new Object[] { name, name },  new String[] { String.class.getName(), String.class.getName() } );
-         }
-         catch (Exception ignored)
-         {
-        	 ignored.printStackTrace();
-         }
-         ObjectName topicName = new ObjectName("jboss.messaging.destination:service=Topic,name=" + name);
-         server.invoke(topicName, "removeAllMessages", null, null);
-      }
-      catch (Exception e)
-      {
-    	 e.printStackTrace();
-         throw new NestedRuntimeException(e);
-      }
-   }
-
-   public void deleteTopic(String name)
-   {
-      try
-      {
-         MBeanServerConnection server = getServer();
-         ObjectName topicName = new ObjectName("jboss.messaging.destination:service=Topic,name=" + name);
-         server.invoke(topicName, "removeAllMessages", null, null);
-         server.invoke(serverPeer, "destroyTopic", new Object[] { name },  new String[] { String.class.getName() } );
-      }
-      catch (Exception e)
-      {
-         throw new NestedRuntimeException(e);
-      }
-   }
-
-   public void createConnectionFactory(String name)
-   {
-      try
-      {
-         MBeanServerConnection server = getServer();
-         server.invoke(namingService, "createAlias", new Object[] { name, "ConnectionFactory" },  new String[] { String.class.getName(), String.class.getName() } );
-      }
-      catch (Exception e)
-      {
-         throw new NestedRuntimeException(e);
-      }
-   }
-
-   public void deleteConnectionFactory(String name)
-   {
-      try
-      {
-         MBeanServerConnection server = getServer();
-         server.invoke(namingService, "removeAlias", new Object[] { name },  new String[] { String.class.getName() } );
-      }
-      catch (Exception e)
-      {
-         throw new NestedRuntimeException(e);
-      }
-   }
-
-   public void createQueueConnectionFactory(String name)
-   {
-       createConnectionFactory(name) ;
-   }
-
-   public void deleteQueueConnectionFactory(String name)
-   {
-       deleteConnectionFactory(name) ;
-   }
-
-   public void createTopicConnectionFactory(String name)
-   {
-       createConnectionFactory(name) ;
-   }
-
-   public void deleteTopicConnectionFactory(String name)
-   {
-       deleteConnectionFactory(name) ;
-   }
-
-}

Deleted: branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java	2010-05-12 02:14:17 UTC (rev 104704)
+++ branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java	2010-05-12 03:58:24 UTC (rev 104705)
@@ -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 org.jboss.test.jbossmessaging.test;
-
-import junit.framework.Test;
-
-import org.jboss.test.AbstractTestDelegate;
-
-/**
- * Joram unit tests
- *
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- * @version $Revision$
- */
-public class JBossMessagingJoramUnitTestCase extends org.jboss.test.jms.JoramUnitTestCase
-{
-   public JBossMessagingJoramUnitTestCase(String name)
-   {
-      super(name);
-   }
-   
-   /**
-    * Get the test delegate
-    * 
-    * @param clazz the test class
-    * @return the delegate
-    * @throws Exception for any error
-    */
-   public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
-   {
-      return getDelegate(clazz, "org.jboss.test.jbossmessaging.JBossMessagingAdmin");
-   }
-
-   public static Test suite() throws Exception
-   {
-      return getTestSuite(JBossMessagingJoramUnitTestCase.class);
-   }
-   
-}

Modified: branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/joram/JoramTestAdminDelegate.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/joram/JoramTestAdminDelegate.java	2010-05-12 02:14:17 UTC (rev 104704)
+++ branches/JBPAPP_5_1_hornetq-int/testsuite/src/main/org/jboss/test/jbossmessaging/test/joram/JoramTestAdminDelegate.java	2010-05-12 03:58:24 UTC (rev 104705)
@@ -26,9 +26,8 @@
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
+import org.jboss.logging.Logger;
 import org.jboss.test.jms.JMSTestAdmin;
-import org.jboss.test.jms.TestRole;
-import org.jboss.logging.Logger;
 import org.jboss.util.NestedRuntimeException;
 import org.objectweb.jtests.jms.admin.Admin;
 
@@ -52,7 +51,7 @@
    {
       try
       {
-         namingService = new ObjectName("jboss:service=NamingBeanImpl");
+         namingService = new ObjectName("jboss:service=Naming");
       }
       catch (Exception e)
       {
@@ -158,6 +157,9 @@
       }
       catch (Exception e)
       {
+    	  log.warn("naming = " + namingService);
+    	  log.warn(e.getMessage(), e);
+
          throw new NestedRuntimeException(e);
       }
    }
@@ -195,4 +197,4 @@
       deleteConnectionFactory(name);
    }
 
-}
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list