qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r732332 - in /qpid/trunk/qpid/java/management/tools/qpid-cli: ./ bin/ src/org/apache/qpid/ src/org/apache/qpid/utils/ test/org/apache/qpid/ test/org/apache/qpid/commands/ test/org/apache/qpid/commands/objects/
Date Wed, 07 Jan 2009 13:41:41 GMT
Author: aidan
Date: Wed Jan  7 05:41:40 2009
New Revision: 732332

URL: http://svn.apache.org/viewvc?rev=732332&view=rev
Log:
QPID-1548: Make the CLI depend on management-common, use the login logic there.

Modified:
    qpid/trunk/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat
    qpid/trunk/qpid/java/management/tools/qpid-cli/build.xml
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
    qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat Wed Jan  7 05:41:40 2009
@@ -19,6 +19,7 @@
 set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/jline-0.9.94.jar
 set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/junit-4.4.jar
 set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/qpid-cli-1.0.jar
+set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/qpid-management-common-M4.jar
 set CLASSPATH=%CLASSPATH%;%QPID_HOME%/management/tools/qpid-cli/main/classes/
 java -classpath %CLASSPATH% org.apache.qpid.CommandLineInterpreter %1
 

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/build.xml?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/build.xml (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/build.xml Wed Jan  7 05:41:40 2009
@@ -20,7 +20,7 @@
  -->
 <project name="qpid-cli">
 
-  <property name="module.depends" value="common" />
+  <property name="module.depends" value="common management/common" />
   <property name="module.test.depends" value="common client" />
   <property name="module.src" value="src" />
   <!-- Disable tests as per QPID-1342 -->

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
Wed Jan  7 05:41:40 2009
@@ -96,7 +96,8 @@
                     commandlineoptionparser = new CommandLineOptionParser(args);
 
                 JMXConfiguration config = new JMXConfiguration(commandlineoptionparser.getAlloptions());
-                conn = ConnectorFactory.getConnector(config.gethostname(), config.getport());
+                conn = ConnectorFactory.getConnector(config.gethostname(), config.getport(),

+                                                     config.getUsername(), config.getPassword());
                 jmxc = conn.getConnector();
                 mbsc = conn.getMBeanServerConnection();
                 if (config.checkoptionsetting("r", commandlineoptionparser.getAlloptions()))
{
@@ -123,7 +124,7 @@
                     }
                 }
             } catch (Exception ex) {
-                connectionrefuse();
+                connectionrefuse(ex);
                 return;
             }
             /* In this point connection has been established */
@@ -183,9 +184,23 @@
         return t;
     }
 
-    private static void connectionrefuse() {
-        System.out.println("Cannot connect with the broker in given host with given port");
-        System.out.println("Please check the host name and the port given");
+    private static void connectionrefuse(Exception e) {
+        String message = e.getLocalizedMessage();
+        if (e instanceof SecurityException)
+        {
+            message = " authentication failed, please check username and password";
+        }
+        else
+        {
+            Throwable cause = e.getCause();
+            while (cause != null)
+            {
+                message = cause.getMessage();
+                cause = cause.getCause();
+            }
+        }
+
+        System.out.println("Cannot connect with the broker: " + message);
     }
 
     public static String[] oneshotmode(String[] args,CommandLineOptionParser commandlineoptionparser,JMXConnector
jmxc,MBeanServerConnection mbsc) throws Exception

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java Wed
Jan  7 05:41:40 2009
@@ -45,25 +45,18 @@
 
 
 public class Connector {
-    private JMXServiceURL url = null;
     private JMXConnector jmxc = null;
     private MBeanServerConnection mbsc = null;
 
 
-    public Connector(JMXServiceURL url, JMXConnector jmxc, MBeanServerConnection mbsc) {
+    public Connector(JMXConnector jmxc, MBeanServerConnection mbsc) {
 
-
-        this.url = url;
         this.jmxc = jmxc;
         this.mbsc = mbsc;
 
 
     }
 
-    public JMXServiceURL getURL() {
-        return url;
-    }
-
     public JMXConnector getConnector() {
         return jmxc;
     }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
Wed Jan  7 05:41:40 2009
@@ -37,12 +37,13 @@
  */
 package org.apache.qpid;
 
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
 import java.io.IOException;
 
+import javax.management.MBeanServerConnection;
+import javax.management.remote.JMXConnector;
+
+import org.apache.qpid.management.common.JMXConnnectionFactory;
+
 /**
  * Created by IntelliJ IDEA.
  * User: lahiru
@@ -52,20 +53,21 @@
  */
 public class ConnectorFactory {
 
-    public static Connector getConnector(String host, String port) {
+    private static final long TIMEOUT = 30 * 1000;
 
-        String url_string = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";
-        JMXServiceURL url;
-        JMXConnector jmxc;
-        MBeanServerConnection mbsc;
+    public static Connector getConnector(String host, String port, String username, String
password) throws Exception {
+
+        JMXConnector jmxc = null;
+        MBeanServerConnection mbsc = null;
         try {
-            url = new JMXServiceURL(url_string);
-            jmxc = JMXConnectorFactory.connect(url, null);
+            jmxc = JMXConnnectionFactory.getJMXConnection(TIMEOUT, host, Integer.parseInt(port),
username, password);
             mbsc = jmxc.getMBeanServerConnection();
-
-        } catch (IOException e) {
-            throw new RuntimeException(e);
+        } 
+        catch (NumberFormatException e)
+        {
+            System.out.println("Illegal port entered:"+port);
+            System.exit(1);
         }
-        return new Connector(url, jmxc, mbsc);
+        return new Connector(jmxc, mbsc);
     }
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java
Wed Jan  7 05:41:40 2009
@@ -46,6 +46,8 @@
         String PORT_OPTION = "p";
         String INTERVAL_OPTION = "i";
         String REPORT_OPTION = "r";
+        String USER_OPTION = "u";
+        String PASSWORD_OPTION = "w";
 
     }
 

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java
Wed Jan  7 05:41:40 2009
@@ -49,6 +49,8 @@
     private String outputpath = ".";
     private String report_file = "report.output";
     private boolean isreport_mode = false;
+    private String username = null;
+    private String password = null;
 
     public JMXConfiguration(Map map) {
         if (checkoptionsetting(CommandLineOptionConstants.JMXCommandLineOptionConstants.HOST_OPTION,
map)) {
@@ -61,6 +63,14 @@
 
             this.report_file = optionchecker(CommandLineOptionConstants.JMXCommandLineOptionConstants.REPORT_OPTION,
map);
         }
+        if (checkoptionsetting(CommandLineOptionConstants.JMXCommandLineOptionConstants.USER_OPTION,
map)) {
+
+            this.setUsername(optionchecker(CommandLineOptionConstants.JMXCommandLineOptionConstants.USER_OPTION,
map));
+        }
+
+        if (checkoptionsetting(CommandLineOptionConstants.JMXCommandLineOptionConstants.PASSWORD_OPTION,
map)) {
+            this.setPassword(optionchecker(CommandLineOptionConstants.JMXCommandLineOptionConstants.PASSWORD_OPTION,
map));
+        }
 
     }
 
@@ -145,4 +155,24 @@
             return false;
     }
 
+    public void setUsername(String username)
+    {
+        this.username = username;
+    }
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java
Wed Jan  7 05:41:40 2009
@@ -48,4 +48,6 @@
 public interface ConnectionConstants {
     String BROKER_HOSTNAME="localhost";
     String BROKER_PORT="8999";
+    String USERNAME = "guest";
+    String PASSWORD = "guest";
 }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java
Wed Jan  7 05:41:40 2009
@@ -62,9 +62,9 @@
     CommandExecutionEngine engine;
     Connector connector;
     @Before
-    public void setup(){
+    public void setup() throws Exception{
 
-        connector = ConnectorFactory.getConnector("localhost","8999");
+        connector = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
 
 
     }

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
Wed Jan  7 05:41:40 2009
@@ -69,11 +69,11 @@
 
     String [] args = null;
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
         args = command.split(" ");
 //        System.out.println(args[0]);
-        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         jmxc = conn.getConnector();
         mbsc = conn.getMBeanServerConnection();
         parser = new CommandLineOptionParser(args,args[0]);

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java
Wed Jan  7 05:41:40 2009
@@ -65,20 +65,13 @@
     MBeanServerConnection mbsc;
 
     @Before
-    public void setup()
+    public void setup() throws Exception
     {
-        test = ConnectorFactory.getConnector("localhost","8999");
+        test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         String url = "service:jmx:rmi:///jndi/rmi://localhost:8999/jmxrmi";
 
     }
-    @Test
-    public void testGetURL()
-    {
-
-
-//        Assert.assertNotNull(test);
-        Assert.assertEquals(test.getURL(),test.getURL());
-    }
+    
     @Test
     public void testGetConnector()
     {

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
Wed Jan  7 05:41:40 2009
@@ -69,11 +69,11 @@
     CommandLineOptionParser parser;
     Command cmd;
     @Before
-    public void setup()
+    public void setup() throws Exception
     {
         list = command.split(" ");
         parser = new CommandLineOptionParser(list);
-        test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT);
+        test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         info = new JMXinfo(test.getConnector(),parser,test.getMBeanServerConnection());
         cmd = new Commandinfo(info);
 

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
Wed Jan  7 05:41:40 2009
@@ -63,9 +63,9 @@
     Commanddelete delete = null;
     Connector conn;
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         JMXConnector jmxc = conn.getConnector();
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
Wed Jan  7 05:41:40 2009
@@ -63,9 +63,9 @@
     CommandImpl infocommand = null;
     Connector conn = null;
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         JMXConnector jmxc = conn.getConnector();
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
Wed Jan  7 05:41:40 2009
@@ -67,9 +67,9 @@
     Commandlist list = null;
     Connector conn = null;
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         JMXConnector jmxc = conn.getConnector();
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
Wed Jan  7 05:41:40 2009
@@ -63,9 +63,9 @@
     Commandmove move = null;
     Connector conn=null;
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         JMXConnector jmxc = conn.getConnector();
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
Wed Jan  7 05:41:40 2009
@@ -63,9 +63,9 @@
     Commandview view =null;
     Connector conn=null;
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         JMXConnector jmxc = conn.getConnector();
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
Wed Jan  7 05:41:40 2009
@@ -63,9 +63,9 @@
     Commandviewcontent viewcontent =null;
     Connector conn = null;
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         JMXConnector jmxc = conn.getConnector();
         MBeanServerConnection mbsc = conn.getMBeanServerConnection();
         CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java
Wed Jan  7 05:41:40 2009
@@ -42,6 +42,7 @@
 import org.junit.Test;
 import org.junit.After;
 import org.junit.Assert;
+import org.apache.qpid.ConnectionConstants;
 import org.apache.qpid.ConnectorFactory;
 import org.apache.qpid.Connector;
 
@@ -61,9 +62,9 @@
     String test1,test2;
 
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        conn  = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         mbsc = conn.getMBeanServerConnection();
         test = new AllObjects(mbsc);
         test1 = "empty input1";

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java
Wed Jan  7 05:41:40 2009
@@ -38,6 +38,8 @@
 package org.apache.qpid.commands.objects;
 
 import junit.framework.TestCase;
+
+import org.apache.qpid.ConnectionConstants;
 import org.apache.qpid.ConnectorFactory;
 import org.apache.qpid.Connector;
 import org.junit.After;
@@ -61,9 +63,9 @@
     String test1,test2,test3;
 
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         mbsc = conn.getMBeanServerConnection();
         test = new ConnectionObject(mbsc);
         test1 = "ping";

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java
Wed Jan  7 05:41:40 2009
@@ -42,6 +42,7 @@
 import org.junit.Test;
 import org.junit.After;
 import org.junit.Before;
+import org.apache.qpid.ConnectionConstants;
 import org.apache.qpid.Connector;
 import org.apache.qpid.ConnectorFactory;
 
@@ -61,9 +62,9 @@
     String test1,test2,test3;
 
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         mbsc = conn.getMBeanServerConnection();
         test = new ExchangeObject(mbsc);
         test1 = "ping";

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
Wed Jan  7 05:41:40 2009
@@ -42,6 +42,7 @@
 import org.junit.Test;
 import org.junit.After;
 import org.junit.Before;
+import org.apache.qpid.ConnectionConstants;
 import org.apache.qpid.Connector;
 import org.apache.qpid.ConnectorFactory;
 
@@ -61,9 +62,9 @@
     String test1,test2,test3;
 
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         mbsc = conn.getMBeanServerConnection();
         test = new QueueObject(mbsc);
         test1 = "ping";

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
Wed Jan  7 05:41:40 2009
@@ -42,6 +42,7 @@
 import org.junit.After;
 import org.junit.Test;
 import org.junit.Before;
+import org.apache.qpid.ConnectionConstants;
 import org.apache.qpid.Connector;
 import org.apache.qpid.ConnectorFactory;
 
@@ -64,9 +65,9 @@
     String test1,test2,test3;
 
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         mbsc = conn.getMBeanServerConnection();
         test = new UserManagementObject(mbsc);
         test1 = "ping";

Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java?rev=732332&r1=732331&r2=732332&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java
(original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java
Wed Jan  7 05:41:40 2009
@@ -25,6 +25,7 @@
 import org.junit.After;
 import org.junit.Test;
 import org.junit.Before;
+import org.apache.qpid.ConnectionConstants;
 import org.apache.qpid.Connector;
 import org.apache.qpid.ConnectorFactory;
 
@@ -44,9 +45,9 @@
     String test1,test2,test3;
 
     @Before
-    public void startup()
+    public void startup() throws Exception
     {
-        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT,
ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
         mbsc = conn.getMBeanServerConnection();
         test = new VirtualHostObject(mbsc);
         test1 = "ping";



Mime
View raw message