[jboss-cvs] JBoss Messaging SVN: r6039 - in trunk/tests/jms-tests/src/org/jboss/test/messaging: util and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Mar 9 05:47:36 EDT 2009
Author: jmesnil
Date: 2009-03-09 05:47:36 -0400 (Mon, 09 Mar 2009)
New Revision: 6039
Removed:
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapper.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapperMBean.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/DatabaseClearer.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Example.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/MBeanServerBuilder.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapper.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapperMBean.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NoopInvoker.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NotificationListenerID.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/PortUtil.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ProxyNotificationListener.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapper.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapperMBean.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterService.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterServiceMBean.java
Log:
test suite cleanup
* removed unused legacy code
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapper.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapper.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapper.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,95 +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.reflect.Array;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-/**
- * We extend URLClassLoader just to prevent UnifiedLoaderRepository3 to generate spurious warning
- * (in this case): "Tried to add non-URLClassLoader. Ignored". Extending ClassLoader would be fine
- * otherwise.
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class ClassLoaderJMXWrapper extends URLClassLoader implements ClassLoaderJMXWrapperMBean
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private ClassLoader delegate;
-
- // Constructors --------------------------------------------------
-
- public ClassLoaderJMXWrapper(ClassLoader delegate)
- {
- super(new URL[0]);
- this.delegate = delegate;
- }
-
- // ClassLoaderJMXWrapperMBean implementation ---------------------
-
- public Class loadClass(String name) throws ClassNotFoundException
- {
- if (name.endsWith("[]"))
- {
- name = name.substring(0, name.length() - 2);
-
- //The classloader of an array type is the classloader of it's element (if non primitive)
-
- Class cl = delegate.loadClass(name);
-
- Object arr = Array.newInstance(cl, 0);
-
- return arr.getClass();
- }
- else
- {
- return delegate.loadClass(name);
- }
- }
-
- // ClassLoader overrides -----------------------------------------
-
- public URL getResource(String name)
- {
- return delegate.getResource(name);
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapperMBean.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapperMBean.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ClassLoaderJMXWrapperMBean.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,33 +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>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public interface ClassLoaderJMXWrapperMBean
-{
- Class loadClass(String name) throws ClassNotFoundException;
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/DatabaseClearer.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/DatabaseClearer.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/DatabaseClearer.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,178 +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.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-
-import org.jboss.messaging.core.logging.Logger;
-
-/**
- * @author <a href="ataylor at redhat.com">Andy Taylor</a>
- */
-public class DatabaseClearer
-{
- private static final Logger log = Logger.getLogger(DatabaseClearer.class);
- private DataSource dataSource;
- private TransactionManager transactionManager;
-
- public DataSource getDataSource()
- {
- return dataSource;
- }
-
- public void setDataSource(DataSource dataSource)
- {
- this.dataSource = dataSource;
- }
-
- public TransactionManager getTransactionManager()
- {
- return transactionManager;
- }
-
- public void setTransactionManager(TransactionManager transactionManager)
- {
- this.transactionManager = transactionManager;
- }
-
-
- public void deleteAllData() throws Exception
- {
- log.debug("DELETING ALL DATA FROM DATABASE!");
-
-
- // We need to execute each drop in its own transaction otherwise postgresql will not execute
- // further commands after one fails
-
-
- javax.transaction.Transaction txOld = transactionManager.suspend();
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_POSTOFFICE");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_MSG_REF");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_MSG");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_TX");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_COUNTER");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_USER");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_ROLE");
-
- if (txOld != null)
- {
- transactionManager.resume(txOld);
- }
-
- log.debug("done with the deleting data");
- }
-
- public void deleteData() throws Exception
- {
- log.debug("DELETING ALL DATA FROM DATABASE!");
-
-
- // We need to execute each drop in its own transaction otherwise postgresql will not execute
- // further commands after one fails
-
-
- javax.transaction.Transaction txOld = transactionManager.suspend();
-
- //executeStatement(transactionManager, dataSource, "DELETE FROM JBM_POSTOFFICE");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_MSG_REF");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_MSG");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_TX");
-
- //executeStatement(transactionManager, dataSource, "DELETE FROM JBM_COUNTER");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_USER");
-
- executeStatement(transactionManager, dataSource, "DELETE FROM JBM_ROLE");
-
- if (txOld != null)
- {
- transactionManager.resume(txOld);
- }
-
- log.debug("done with the deleting data");
- }
-
- private void executeStatement(TransactionManager mgr, DataSource ds, String statement) throws Exception
- {
- Connection conn = null;
- boolean exception = false;
-
- try
- {
- try
- {
- mgr.begin();
-
- conn = ds.getConnection();
-
- log.debug("executing " + statement);
-
- PreparedStatement ps = conn.prepareStatement(statement);
-
- ps.executeUpdate();
-
- log.debug(statement + " executed");
-
- ps.close();
- }
- catch (SQLException e)
- {
- // Ignore
- log.debug("Failed to execute statement", e);
- exception = true;
- }
- }
- finally
- {
- if (conn != null)
- {
- conn.close();
- }
-
- if (exception)
- {
- mgr.rollback();
- }
- else
- {
- mgr.commit();
- }
- }
-
-
- }
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Example.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Example.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Example.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,103 +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.sql.Connection;
-import java.sql.ResultSet;
-
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-
-/**
- * An example how to use ServiceContainer to get access to an in-memory database.
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class Example
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- public static void main(String[] args) throws Exception
- {
- /*ServiceContainer sc = new ServiceContainer("transaction, jca, database");
- sc.start();*/
-
- InitialContext ic = new InitialContext();
-
- TransactionManager tm = (TransactionManager)ic.lookup("java:/TransactionManager");
- DataSource ds = (DataSource)ic.lookup("java:/DefaultDS");
- Connection c;
-
-
- tm.begin();
-
- c = ds.getConnection();
- c.createStatement().executeUpdate("CREATE TABLE SOME_TABLE (SOME_FIELD VARCHAR)");
-
- tm.commit();
-
- tm.begin();
- c = ds.getConnection();
- c.createStatement().executeUpdate("INSERT INTO SOME_TABLE VALUES ('this shouldnt get into db')");
-
- tm.rollback();
-
- tm.begin();
- c = ds.getConnection();
- c.createStatement().executeUpdate("INSERT INTO SOME_TABLE VALUES ('some value')");
-
- tm.commit();
-
-
- c = ds.getConnection();
- ResultSet rs = c.createStatement().executeQuery("SELECT SOME_FIELD FROM SOME_TABLE");
- while (rs.next())
- {
- String a = rs.getString("SOME_FIELD");
- System.out.println(a);
- }
-
-
- c.close();
- //sc.stop();
- }
-
- // Attributes ----------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/MBeanServerBuilder.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/MBeanServerBuilder.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/MBeanServerBuilder.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,56 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.test.messaging.tools.container;
-
-import javax.management.MBeanServerDelegate;
-
-//import org.jboss.mx.server.MBeanServerImpl;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class MBeanServerBuilder extends javax.management.MBeanServerBuilder
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public MBeanServerBuilder()
- {
- }
-
- // MBeanServerBuilder overrides ----------------------------------
-
- /*public MBeanServer newMBeanServer(String defaultDomain,
- MBeanServer outer,
- MBeanServerDelegate connectionFactory)
- {
- return new MBeanServerImpl("jboss", outer, connectionFactory);
- }
-*/
- public MBeanServerDelegate newMBeanServerDelegate()
- {
- return new MBeanServerDelegate();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapper.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapper.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapper.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,103 +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.ArrayList;
-import java.util.List;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.NotificationBroadcaster;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.resource.spi.ManagedConnectionFactory;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class ManagedConnectionFactoryJMXWrapper
- implements ManagedConnectionFactoryJMXWrapperMBean, NotificationBroadcaster
-{
-
- // Attributes ----------------------------------------------------
-
- private ManagedConnectionFactory mcf;
- private List listeners;
-
- // Constructors --------------------------------------------------
-
- public ManagedConnectionFactoryJMXWrapper(ManagedConnectionFactory mcf)
- {
- this.mcf = mcf;
- listeners = new ArrayList();
- }
-
- // ManagedConnectionFactoryJMXWrapperMBean implementation --------
-
- public ManagedConnectionFactory getManagedConnectionFactory()
- {
- return mcf;
- }
-
- public ManagedConnectionFactory getMcfInstance()
- {
- return mcf;
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop() throws Exception
- {
- }
-
- // NotificationBroadcaster implementation ------------------------
-
- public void addNotificationListener(NotificationListener listener, NotificationFilter filter,
- Object handback) throws IllegalArgumentException
- {
- listeners.add(listener);
- }
-
- public void removeNotificationListener(NotificationListener listener)
- throws ListenerNotFoundException
- {
- listeners.remove(listener);
- }
-
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- return new MBeanNotificationInfo[0];
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapperMBean.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapperMBean.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ManagedConnectionFactoryJMXWrapperMBean.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,42 +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 javax.resource.spi.ManagedConnectionFactory;
-
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public interface ManagedConnectionFactoryJMXWrapperMBean
-{
-
- ManagedConnectionFactory getManagedConnectionFactory();
- ManagedConnectionFactory getMcfInstance();
-
- void start() throws Exception;
- void stop() throws Exception;
-
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NoopInvoker.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NoopInvoker.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NoopInvoker.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,69 +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.io.Serializable;
-
-//import org.jboss.invocation.Invocation;
-//import org.jboss.invocation.Invoker;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-class NoopInvoker implements Serializable//, Invoker
-{
- // Constants -----------------------------------------------------
-
- private static final long serialVersionUID = -7508123339922333502L;
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Invoker implementation ----------------------------------------
-
- public String getServerHostName() throws Exception
- {
- return "localhost";
- }
-
- /*public Object invoke(Invocation invocation) throws Exception
- {
- return null;
- }*/
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NotificationListenerID.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NotificationListenerID.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/NotificationListenerID.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,59 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.test.messaging.tools.container;
-
-import java.io.Serializable;
-
-import javax.management.Notification;
-import javax.management.NotificationListener;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- * $Id: NotificationListenerID.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class NotificationListenerID implements Serializable, NotificationListener
-{
- // Constants -----------------------------------------------------
-
- private static final long serialVersionUID = -39839086486546L;
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long id;
-
- // Constructors --------------------------------------------------
-
- public NotificationListenerID(long id)
- {
- this.id = id;
- }
-
- // NotificationListener implementation ---------------------------
-
- public void handleNotification(Notification notification, Object object)
- {
- throw new IllegalStateException("Do not use this method directly!");
- }
-
- // Public --------------------------------------------------------
-
- public long getID()
- {
- return id;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/PortUtil.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/PortUtil.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/PortUtil.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,153 +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.io.IOException;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.security.SecureRandom;
-
-import org.jboss.messaging.core.logging.Logger;
-
-/**
- * PortUtil is a set of utilities for dealing with TCP/IP ports
- *
- * @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
- * @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
- * @version $Revision$
- */
-public class PortUtil
-{
- private static final Logger log = Logger.getLogger(PortUtil.class);
- private static final int MIN_UNPRIVILEGED_PORT = 1024;
- private static final int MAX_LEGAL_PORT = 65535;
-
- private static int portCounter = 0;
- private static int retryMax = 50;
-
- static
- {
- portCounter = getRandomStartingPort();
- }
-
- /**
- * Checks to see if the specified port is free.
- *
- * @param p
- * @return true if available, false if already in use
- */
- public static boolean checkPort(int p, String host)
- {
- boolean available = true;
- ServerSocket socket = null;
- try
- {
- InetAddress inetAddress = InetAddress.getByName(host);
- socket = new ServerSocket(p, 0, inetAddress);
- }
- catch(IOException e)
- {
- log.debug("port " + p + " already in use. Will try another.");
- available = false;
- }
- finally
- {
- if(socket != null)
- {
- try
- {
- socket.close();
- }
- catch(IOException e)
- {
-
- }
- }
- }
- return available;
-
- }
-
- /**
- * Will try to find a port that is not in use up to 50 tries, at which point,
- * will throw an exception.
- * @return
- */
- public static int findFreePort(String host) throws IOException
- {
- Integer port = null;
- int tryCount = 0;
- while(port == null && tryCount < retryMax)
- {
- port = getFreePort(host);
- if(port != null)
- {
- // validate port again, just in case two instances start on the port at same time.
- if(!checkPort(port.intValue(), host))
- {
- port = null;
- }
- }
- tryCount++;
- }
- if(tryCount >= retryMax)
- {
- throw new IOException("Can not find a free port for use.");
- }
- return port.intValue();
- }
-
- private static Integer getFreePort(String host)
- {
- int p = getNextPort();
-
- if(checkPort(p, host))
- {
- return new Integer(p);
- }
- else
- {
- return null;
- }
- }
-
- private static synchronized int getNextPort()
- {
- if (portCounter < MAX_LEGAL_PORT)
- return portCounter++;
-
- portCounter = MIN_UNPRIVILEGED_PORT;
- return MAX_LEGAL_PORT;
- }
-
- public static int getRandomStartingPort()
- {
- Object o = new Object();
- String os = o.toString();
- os = os.substring(17);
- int n = Integer.parseInt(os, 16);
- int p = Math.abs(new SecureRandom(String.valueOf(System.currentTimeMillis() + n).getBytes()).nextInt(2000)) + 2000;
- return p;
- }
-
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ProxyNotificationListener.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ProxyNotificationListener.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/ProxyNotificationListener.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,83 +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.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.management.Notification;
-import javax.management.NotificationListener;
-
-/**
- * Stores notifications until they're transferred to the remote client.
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- * $Id: ProxyNotificationListener.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class ProxyNotificationListener implements NotificationListener
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private List notifications;
-
- // Constructors --------------------------------------------------
-
- ProxyNotificationListener()
- {
- notifications = new ArrayList();
- }
-
- // NotificationListener implementation ---------------------------
-
- public synchronized void handleNotification(Notification notification, Object object)
- {
- notifications.add(notification);
- }
-
- // Public --------------------------------------------------------
-
- public synchronized List drain()
- {
- if (notifications.size() == 0)
- {
- return Collections.EMPTY_LIST;
- }
-
- List old = notifications;
- notifications = new ArrayList();
- return old;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapper.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapper.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapper.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,75 +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 javax.transaction.TransactionManager;
-
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class TransactionManagerJMXWrapper implements TransactionManagerJMXWrapperMBean
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private TransactionManager tm;
-
- // Constructors --------------------------------------------------
-
- public TransactionManagerJMXWrapper(TransactionManager tm)
- {
- this.tm = tm;
- }
-
- // TransactionManagerJMXWrapperMBean implementation --------------
-
- public TransactionManager getTransactionManager()
- {
- return tm;
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop() throws Exception
- {
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapperMBean.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapperMBean.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/TransactionManagerJMXWrapperMBean.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,39 +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 javax.transaction.TransactionManager;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public interface TransactionManagerJMXWrapperMBean
-{
- TransactionManager getTransactionManager();
-
- void start() throws Exception;
- void stop() throws Exception;
-
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterService.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterService.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterService.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,64 +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.util;
-
-import java.util.Hashtable;
-
-import javax.naming.InitialContext;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- * $Id$
- */
-public class JNDITesterService implements JNDITesterServiceMBean
-{
- // Constants ------------------------------------------------------------------------------------
-
- // Static ---------------------------------------------------------------------------------------
-
- // Attributes -----------------------------------------------------------------------------------
-
- // Constructors ---------------------------------------------------------------------------------
-
- // JNDITesterServiceMBean implementation --------------------------------------------------------
-
- public Object installAndUseJNDIEnvironment(Hashtable environment, String thingToLookUp)
- throws Exception
- {
-
- InitialContext ic = new InitialContext(environment);
-
- return ic.lookup(thingToLookUp);
- }
-
- // Public ---------------------------------------------------------------------------------------
-
- // Package protected ----------------------------------------------------------------------------
-
- // Protected ------------------------------------------------------------------------------------
-
- // Private --------------------------------------------------------------------------------------
-
- // Inner classes --------------------------------------------------------------------------------
-
-}
Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterServiceMBean.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterServiceMBean.java 2009-03-07 15:41:13 UTC (rev 6038)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/util/JNDITesterServiceMBean.java 2009-03-09 09:47:36 UTC (rev 6039)
@@ -1,35 +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.util;
-
-import java.util.Hashtable;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- * $Id$
- */
-public interface JNDITesterServiceMBean
-{
- Object installAndUseJNDIEnvironment(Hashtable environment, String thingToLookUp)
- throws Exception;
-}
More information about the jboss-cvs-commits
mailing list