diff options
| author | Aidan Skinner <aidan@apache.org> | 2009-01-09 16:24:01 +0000 |
|---|---|---|
| committer | Aidan Skinner <aidan@apache.org> | 2009-01-09 16:24:01 +0000 |
| commit | e8bc90906d322a676b931834a894d5c6bd2aa97e (patch) | |
| tree | 78e0064a5eecb8b57cb73d02015a08e3d71b7a3d /java/management/tools/qpid-cli/test/org | |
| parent | bd5ae249ef74e1707eb05dd6cc70bb816e318757 (diff) | |
| download | qpid-python-e8bc90906d322a676b931834a894d5c6bd2aa97e.tar.gz | |
QPID-1564: Remove duplicate ASL header and unusued imports. Format code according to qpid conventions.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@733073 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/management/tools/qpid-cli/test/org')
25 files changed, 450 insertions, 993 deletions
diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java b/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java index db707993ed..d9758245cd 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java @@ -18,23 +18,6 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid; import org.junit.runner.RunWith; @@ -45,36 +28,14 @@ import org.apache.qpid.utils.TestCommandLineOption; import org.apache.qpid.utils.TestCommandLineOptionParser; import org.apache.qpid.utils.TestJMXConfiguration; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jul 7, 2008 - * Time: 1:09:50 PM - * To change this template use File | Settings | File Templates. - */ @RunWith(Suite.class) -@Suite.SuiteClasses({ - TestCommand.class, - TestCommandExecutionEngine.class, - TestCommandLineOption.class, - TestCommandLineOptionParser.class, - TestConnector.class, - TestJMXConfiguration.class, - TestAllObject.class, - TestConnectionObject.class, - TestExchangeObject.class, - TestQueueObject.class, - TestVirtualHostObject.class, - TestUserManagementObject.class, - TestCommanddelete.class, - TestCommandlist.class, - TestCommandinfo.class, - TestCommandmove.class, - TestCommandview.class, - TestCommandviewcontent.class, - TestCommandLineInterpreter.class - +@Suite.SuiteClasses( { TestCommand.class, TestCommandExecutionEngine.class, TestCommandLineOption.class, + TestCommandLineOptionParser.class, TestConnector.class, TestJMXConfiguration.class, TestAllObject.class, + TestConnectionObject.class, TestExchangeObject.class, TestQueueObject.class, TestVirtualHostObject.class, + TestUserManagementObject.class, TestCommanddelete.class, TestCommandlist.class, TestCommandinfo.class, + TestCommandmove.class, TestCommandview.class, TestCommandviewcontent.class, TestCommandLineInterpreter.class - }) -public class AllTest { +}) +public class AllTest +{ } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java b/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java index 5ed8b29c0e..90163460ce 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java @@ -18,36 +18,13 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Aug 16, 2008 - * Time: 4:55:21 PM - * To change this template use File | Settings | File Templates. - */ -public interface ConnectionConstants { - String BROKER_HOSTNAME="localhost"; - String BROKER_PORT="8999"; +public interface ConnectionConstants +{ + String BROKER_HOSTNAME = "localhost"; + String BROKER_PORT = "8999"; String USERNAME = "guest"; String PASSWORD = "guest"; } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java b/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java index 4f553ce74d..6889e8faad 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecutionEngine.java @@ -18,73 +18,56 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid; -import junit.framework.TestCase; -import org.apache.qpid.utils.JMXinfo; +import java.io.IOException; + import org.apache.qpid.utils.CommandLineOptionParser; +import org.apache.qpid.utils.JMXinfo; +import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.Assert; -import org.junit.After; -import java.io.IOException; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:06:25 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandExecutionEngine { +public class TestCommandExecutionEngine +{ String line; - String [] command; + String[] command; CommandLineOptionParser commandlineoptionparser; JMXinfo info; CommandExecutionEngine engine; Connector connector; - @Before - public void setup() throws Exception{ - connector = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + @Before + public void setup() throws Exception + { + connector = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT, + ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); } + @Test public void TestCommandSelector() throws Exception { line = "list -o queue"; command = line.split(" "); commandlineoptionparser = new CommandLineOptionParser(command); - info = new JMXinfo(connector.getConnector(), commandlineoptionparser,connector.getMBeanServerConnection()); + info = new JMXinfo(connector.getConnector(), commandlineoptionparser, connector.getMBeanServerConnection()); engine = new CommandExecutionEngine(info); - Assert.assertEquals(engine.CommandSelector(),true); + Assert.assertEquals(engine.CommandSelector(), true); } + @After public void cleanup() { - try { + try + { connector.getConnector().close(); - } catch (IOException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } + catch (IOException e) + { + e.printStackTrace(); } } } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java b/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java index 1b2d93808e..07344598bf 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java @@ -18,78 +18,58 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid; -import junit.framework.TestCase; -import org.apache.qpid.utils.JMXinfo; +import javax.management.MBeanServerConnection; +import javax.management.remote.JMXConnector; + import org.apache.qpid.utils.CommandLineOptionParser; -import org.apache.qpid.commands.Commandinfo; +import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.Assert; -import org.junit.After; - -import javax.management.remote.JMXConnector; -import javax.management.MBeanServerConnection; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:08:52 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandLineInterpreter { +public class TestCommandLineInterpreter +{ -// CommandLineInterpreter test = new CommandLineInterpreter(); - /* In this class there are only methodes which are displaying data on console so no test can be written*/ - String command = "-h " + ConnectionConstants.BROKER_HOSTNAME + " -p " + ConnectionConstants.BROKER_PORT + " info -o queue -n ping -v test"; - Connector conn= null; - JMXConnector jmxc=null; - MBeanServerConnection mbsc=null; - CommandLineOptionParser parser=null; + // CommandLineInterpreter test = new CommandLineInterpreter(); + /* + * In this class there are only methodes which are displaying data on + * console so no test can be written + */ + String command = "-h " + ConnectionConstants.BROKER_HOSTNAME + " -p " + ConnectionConstants.BROKER_PORT + + " info -o queue -n ping -v test"; + Connector conn = null; + JMXConnector jmxc = null; + MBeanServerConnection mbsc = null; + CommandLineOptionParser parser = null; + String[] args = null; - String [] args = null; @Before public void startup() throws Exception { args = command.split(" "); -// System.out.println(args[0]); - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + // System.out.println(args[0]); + 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]); + parser = new CommandLineOptionParser(args, args[0]); } + @Test public void TestSetQueryString() throws Exception { - CommandLineInterpreter.oneshotmode(args,parser,jmxc,mbsc); - Assert.assertEquals(args[0],"info"); - Assert.assertEquals(args[1],"-o"); - Assert.assertEquals(args[2],"queue"); - Assert.assertEquals(args[3],"-n"); - Assert.assertEquals(args[4],"ping"); - Assert.assertEquals(args[5],"-v"); - Assert.assertEquals(args[6],"test"); + CommandLineInterpreter.oneshotmode(args, parser, jmxc, mbsc); + Assert.assertEquals(args[0], "info"); + Assert.assertEquals(args[1], "-o"); + Assert.assertEquals(args[2], "queue"); + Assert.assertEquals(args[3], "-n"); + Assert.assertEquals(args[4], "ping"); + Assert.assertEquals(args[5], "-v"); + Assert.assertEquals(args[6], "test"); } @After @@ -98,4 +78,3 @@ public class TestCommandLineInterpreter { } } - diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java b/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java index ea1325a6a8..ea450b5caa 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java @@ -1,64 +1,38 @@ /* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ -/* - * - * Copyright (c) 2006 The Apache Software Foundation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. * */ package org.apache.qpid; -import junit.framework.TestCase; +import java.io.IOException; -import javax.management.remote.JMXServiceURL; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXConnector; import javax.management.MBeanServerConnection; -import java.net.MalformedURLException; -import java.io.IOException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXServiceURL; -import org.junit.Test; -import org.junit.Before; import org.junit.After; import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:11:50 PM - * To change this template use File | Settings | File Templates. - */ -public class TestConnector { +public class TestConnector +{ Connector test; JMXServiceURL svc_url; JMXConnector connector; @@ -67,33 +41,39 @@ public class TestConnector { @Before public void setup() throws Exception { - test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + 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 testGetConnector() { - Assert.assertEquals(test.getConnector(),test.getConnector()); + Assert.assertEquals(test.getConnector(), test.getConnector()); } + @Test public void testGetMBeanServerConnection() { - Assert.assertEquals(test.getMBeanServerConnection(),test.getMBeanServerConnection()); + Assert.assertEquals(test.getMBeanServerConnection(), test.getMBeanServerConnection()); } + @After public void cleanup() { - try { + try + { - test.getConnector().close(); - test = null; - } catch (IOException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + test.getConnector().close(); + test = null; + } + catch (IOException e) + { + e.printStackTrace(); // To change body of catch statement use File | + // Settings | File Templates. } test = null; } - } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java b/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java index a2ed94d948..c14f4bb1bb 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java @@ -1,50 +1,26 @@ /* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ -/* - * - * Copyright (c) 2006 The Apache Software Foundation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. * */ package org.apache.qpid; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Aug 13, 2008 - * Time: 7:16:17 PM - * To change this template use File | Settings | File Templates. - */ -public class TestReportGenerator { - - +public class TestReportGenerator +{ + } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java index 1fab7106e7..085d7220e9 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java @@ -18,77 +18,56 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands; -import junit.framework.TestCase; -import junit.framework.TestSuite; -import junit.framework.JUnit4TestAdapter; -import org.junit.Before; -import org.junit.Test; -import org.junit.After; -import org.junit.Assert; +import javax.management.MBeanServerConnection; + import org.apache.qpid.Command; +import org.apache.qpid.ConnectionConstants; import org.apache.qpid.Connector; import org.apache.qpid.ConnectorFactory; -import org.apache.qpid.ConnectionConstants; -import org.apache.qpid.utils.JMXinfo; import org.apache.qpid.utils.CommandLineOptionParser; +import org.apache.qpid.utils.JMXinfo; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:21:32 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommand{ +public class TestCommand +{ String command = "list -o queue"; - String [] list; + String[] list; Connector test; MBeanServerConnection mbsc; JMXinfo info; CommandLineOptionParser parser; Command cmd; + @Before public void setup() throws Exception { list = command.split(" "); parser = new CommandLineOptionParser(list); - test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); - info = new JMXinfo(test.getConnector(),parser,test.getMBeanServerConnection()); + 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); } + @Test public void TestOptionChecker() { - Assert.assertEquals(cmd.optionchecker("o"),"queue"); + Assert.assertEquals(cmd.optionchecker("o"), "queue"); } + @Test public void TestCheckOptionSetting() { - Assert.assertEquals(cmd.checkoptionsetting("o"),true); - Assert.assertEquals(cmd.checkoptionsetting("p"),false); + Assert.assertEquals(cmd.checkoptionsetting("o"), true); + Assert.assertEquals(cmd.checkoptionsetting("p"), false); } + @After public void cleanup() { diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java index 0ebd401c60..60249c6940 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java @@ -18,23 +18,6 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands; import org.junit.After; @@ -50,48 +33,45 @@ import org.apache.qpid.utils.CommandLineOptionParser; import javax.management.remote.JMXConnector; import javax.management.MBeanServerConnection; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Aug 11, 2008 - * Time: 10:13:45 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommanddelete { - JMXinfo info=null; +public class TestCommanddelete +{ + JMXinfo info = null; String command = "delete -o queue -n ping -v test -t 1"; Commanddelete delete = null; Connector conn; + @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + 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(" ")); - info = new JMXinfo(jmxc,parser,mbsc); + info = new JMXinfo(jmxc, parser, mbsc); delete = new Commanddelete(info); - - } + @Test public void TestSetQueryString() { - delete.execute(); - Assert.assertEquals(delete.getObject(),"queue"); - Assert.assertEquals(delete.getVirtualhost(),"test"); - Assert.assertEquals(delete.getName(),"ping"); - Assert.assertEquals(delete.getnumber(),1); + delete.execute(); + Assert.assertEquals(delete.getObject(), "queue"); + Assert.assertEquals(delete.getVirtualhost(), "test"); + Assert.assertEquals(delete.getName(), "ping"); + Assert.assertEquals(delete.getnumber(), 1); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java index fa0bd6cecc..24263eea73 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java @@ -18,23 +18,6 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands; import org.apache.qpid.utils.JMXinfo; @@ -50,44 +33,43 @@ import org.junit.After; import javax.management.remote.JMXConnector; import javax.management.MBeanServerConnection; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Aug 16, 2008 - * Time: 6:30:24 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandinfo { - JMXinfo info=null; +public class TestCommandinfo +{ + JMXinfo info = null; String command = "info -o queue -n ping -v test"; CommandImpl infocommand = null; Connector conn = null; + @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + 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(" ")); - info = new JMXinfo(jmxc,parser,mbsc); + info = new JMXinfo(jmxc, parser, mbsc); infocommand = new Commandinfo(info); } + @Test public void TestSetQueryString() { infocommand.execute(); - Assert.assertEquals(infocommand.getObject(),"queue"); - Assert.assertEquals(infocommand.getVirtualhost(),"test"); - Assert.assertEquals(infocommand.getName(),"ping"); + Assert.assertEquals(infocommand.getObject(), "queue"); + Assert.assertEquals(infocommand.getVirtualhost(), "test"); + Assert.assertEquals(infocommand.getName(), "ping"); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java index 4252959155..ac759889fd 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java @@ -18,80 +18,62 @@ * under the License. * */ - /* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands; -import junit.framework.TestCase; +import javax.management.MBeanServerConnection; +import javax.management.remote.JMXConnector; + import org.apache.qpid.ConnectionConstants; import org.apache.qpid.Connector; import org.apache.qpid.ConnectorFactory; import org.apache.qpid.utils.CommandLineOptionParser; import org.apache.qpid.utils.JMXinfo; -import org.junit.Test; -import org.junit.Before; import org.junit.After; import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import javax.management.remote.JMXConnector; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:18:28 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandlist { - /* All the methods in Commandlist doesn't have any arguments - and no return type. - */ - JMXinfo info=null; +public class TestCommandlist +{ + /* + * All the methods in Commandlist doesn't have any arguments and no return + * type. + */ + JMXinfo info = null; String command = "list -o queue -n ping -v test"; Commandlist list = null; Connector conn = null; + @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + 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(" ")); - info = new JMXinfo(jmxc,parser,mbsc); + info = new JMXinfo(jmxc, parser, mbsc); list = new Commandlist(info); } + @Test public void TestSetQueryString() { list.execute(); - Assert.assertEquals(list.getObject(),"queue"); - Assert.assertEquals(list.getVirtualhost(),"test"); - Assert.assertEquals(list.getName(),"ping"); + Assert.assertEquals(list.getObject(), "queue"); + Assert.assertEquals(list.getVirtualhost(), "test"); + Assert.assertEquals(list.getName(), "ping"); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java index 0d810f8444..3ff7890662 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java @@ -18,23 +18,6 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands; import org.apache.qpid.ConnectionConstants; @@ -50,49 +33,46 @@ import org.junit.Assert; import javax.management.remote.JMXConnector; import javax.management.MBeanServerConnection; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Aug 11, 2008 - * Time: 10:14:34 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandmove { - JMXinfo info=null; +public class TestCommandmove +{ + JMXinfo info = null; String command = "move -o queue -n1 ping -v1 test -n2 message_queue -fmid 10 -tmid 12"; Commandmove move = null; - Connector conn=null; + Connector conn = null; + @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + 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(" ")); - info = new JMXinfo(jmxc,parser,mbsc); + info = new JMXinfo(jmxc, parser, mbsc); move = new Commandmove(info); - - } + @Test public void TestSetQueryString() { move.execute(); - Assert.assertEquals(move.getObject(),"queue"); - Assert.assertEquals(move.getVirtualhost(),"test"); - Assert.assertEquals(move.getname1(),"ping"); - Assert.assertEquals(move.getname2(),"message_queue"); - Assert.assertEquals(move.getfmid(),10); - Assert.assertEquals(move.gettmid(),12); + Assert.assertEquals(move.getObject(), "queue"); + Assert.assertEquals(move.getVirtualhost(), "test"); + Assert.assertEquals(move.getname1(), "ping"); + Assert.assertEquals(move.getname2(), "message_queue"); + Assert.assertEquals(move.getfmid(), 10); + Assert.assertEquals(move.gettmid(), 12); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java index 5038f79821..f46b8626b8 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java @@ -18,23 +18,6 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands; import org.apache.qpid.ConnectionConstants; @@ -50,45 +33,44 @@ import org.junit.Assert; import javax.management.MBeanServerConnection; import javax.management.remote.JMXConnector; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Aug 11, 2008 - * Time: 10:14:58 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandview { - JMXinfo info=null; +public class TestCommandview +{ + JMXinfo info = null; String command = "view -o queue -n ping -v test -t 10"; - Commandview view =null; - Connector conn=null; + Commandview view = null; + Connector conn = null; + @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + 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(" ")); - info = new JMXinfo(jmxc,parser,mbsc); + info = new JMXinfo(jmxc, parser, mbsc); view = new Commandview(info); } + @Test public void TestSetQueryString() { view.execute(); - Assert.assertEquals(view.getObject(),"queue"); - Assert.assertEquals(view.getVirtualhost(),"test"); - Assert.assertEquals(view.getName(),"ping"); - Assert.assertEquals(view.getnumber(),10); + Assert.assertEquals(view.getObject(), "queue"); + Assert.assertEquals(view.getVirtualhost(), "test"); + Assert.assertEquals(view.getName(), "ping"); + Assert.assertEquals(view.getnumber(), 10); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java index a70389aa54..f4a8f22aff 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java @@ -18,23 +18,6 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands; import org.apache.qpid.utils.JMXinfo; @@ -50,47 +33,44 @@ import org.junit.Assert; import javax.management.remote.JMXConnector; import javax.management.MBeanServerConnection; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Aug 11, 2008 - * Time: 10:15:17 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandviewcontent { - JMXinfo info=null; +public class TestCommandviewcontent +{ + JMXinfo info = null; String command = "viewcontent -o queue -n ping -v test -id 10"; - Commandviewcontent viewcontent =null; + Commandviewcontent viewcontent = null; Connector conn = null; + @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + 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(" ")); - info = new JMXinfo(jmxc,parser,mbsc); + info = new JMXinfo(jmxc, parser, mbsc); viewcontent = new Commandviewcontent(info); - - } + @Test public void TestSetQueryString() { viewcontent.execute(); - Assert.assertEquals(viewcontent.getObject(),"queue"); - Assert.assertEquals(viewcontent.getnumber(),10); - Assert.assertEquals(viewcontent.getName(),"ping"); - Assert.assertEquals(viewcontent.getVirtualhost(),"test"); + Assert.assertEquals(viewcontent.getObject(), "queue"); + Assert.assertEquals(viewcontent.getnumber(), 10); + Assert.assertEquals(viewcontent.getName(), "ping"); + Assert.assertEquals(viewcontent.getVirtualhost(), "test"); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java index 1a9b0f5fc3..af993e9205 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java @@ -18,43 +18,18 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands.objects; -import junit.framework.TestCase; -import org.junit.Before; -import org.junit.Test; -import org.junit.After; -import org.junit.Assert; +import javax.management.MBeanServerConnection; + import org.apache.qpid.ConnectionConstants; -import org.apache.qpid.ConnectorFactory; import org.apache.qpid.Connector; +import org.apache.qpid.ConnectorFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:23:25 PM - * To change this template use File | Settings | File Templates. - */ public class TestAllObject { Connector conn; MBeanServerConnection mbsc; diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java index 10e04800e5..f91a519108 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java @@ -18,87 +18,63 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands.objects; -import junit.framework.TestCase; +import javax.management.MBeanServerConnection; import org.apache.qpid.ConnectionConstants; -import org.apache.qpid.ConnectorFactory; import org.apache.qpid.Connector; +import org.apache.qpid.ConnectorFactory; import org.junit.After; -import org.junit.Test; import org.junit.Assert; import org.junit.Before; +import org.junit.Test; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:24:14 PM - * To change this template use File | Settings | File Templates. - */ -public class TestConnectionObject { +public class TestConnectionObject +{ Connector conn; MBeanServerConnection mbsc; ConnectionObject test; - String test1,test2,test3; + String test1, test2, test3; @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT, + ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); mbsc = conn.getMBeanServerConnection(); test = new ConnectionObject(mbsc); test1 = "ping"; test2 = "test"; test3 = "object"; - } + @Test public void TestSetQueryString() { - test.setQueryString(test3,test1,null); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,name=ping,*"); + test.setQueryString(test3, test1, null); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=Connection,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,VirtualHost=test,*"); + test.setQueryString(test3, null, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=Connection,VirtualHost=test,*"); test.querystring = null; - test.setQueryString(test3,test1,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,VirtualHost=test,name=ping,*"); + test.setQueryString(test3, test1, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=Connection,VirtualHost=test,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,null); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,*"); - - + test.setQueryString(test3, null, null); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=Connection,*"); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java index b7bcb6f7d3..5ffbe9854f 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java @@ -18,84 +18,63 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands.objects; -import junit.framework.TestCase; -import org.junit.Assert; -import org.junit.Test; -import org.junit.After; -import org.junit.Before; +import javax.management.MBeanServerConnection; + import org.apache.qpid.ConnectionConstants; import org.apache.qpid.Connector; import org.apache.qpid.ConnectorFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:24:49 PM - * To change this template use File | Settings | File Templates. - */ -public class TestExchangeObject { +public class TestExchangeObject +{ Connector conn; MBeanServerConnection mbsc; ExchangeObject test; - String test1,test2,test3; + String test1, test2, test3; @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT, + ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); mbsc = conn.getMBeanServerConnection(); test = new ExchangeObject(mbsc); test1 = "ping"; test2 = "test"; test3 = "object"; - } + @Test public void TestSetQueryString() { - test.setQueryString(test3,test1,null); -// System.out.println(test.querystring); -// System.out.println("org.apache.qpid:type=VitualHost.Exchange,name=ping,*"); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Exchange,name=ping,*"); + test.setQueryString(test3, test1, null); + // System.out.println(test.querystring); + // System.out.println("org.apache.qpid:type=VitualHost.Exchange,name=ping,*"); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.Exchange,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=test,*"); + test.setQueryString(test3, null, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=test,*"); test.querystring = null; - test.setQueryString(test3,test1,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=test,name=ping,*"); + test.setQueryString(test3, test1, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=test,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,null); + test.setQueryString(test3, null, null); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java index b26d1f5a82..600c567368 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java @@ -18,34 +18,9 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands.objects; -import junit.framework.TestCase; +public class TestObjectNames +{ -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:22:54 PM - * To change this template use File | Settings | File Templates. - */ -public class TestObjectNames { - } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java index ccae0c6266..fb7f42e1ae 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java @@ -18,90 +18,66 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands.objects; -import junit.framework.TestCase; -import org.junit.Assert; -import org.junit.Test; -import org.junit.After; -import org.junit.Before; +import javax.management.MBeanServerConnection; + import org.apache.qpid.ConnectionConstants; import org.apache.qpid.Connector; import org.apache.qpid.ConnectorFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:25:21 PM - * To change this template use File | Settings | File Templates. - */ -public class TestQueueObject{ +public class TestQueueObject +{ Connector conn; MBeanServerConnection mbsc; QueueObject test; - String test1,test2,test3; + String test1, test2, test3; @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT, + ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); mbsc = conn.getMBeanServerConnection(); test = new QueueObject(mbsc); test1 = "ping"; test2 = "test"; test3 = "object"; - } + @Test public void TestSetQueryString() { - test.setQueryString(test3,test1,null); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,name=ping,*"); + test.setQueryString(test3, test1, null); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.Queue,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,*"); + test.setQueryString(test3, null, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,*"); test.querystring = null; - test.setQueryString(test3,test1,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,name=ping,*"); + test.setQueryString(test3, test1, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,null); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,*"); - - + test.setQueryString(test3, null, null); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.Queue,*"); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } } } - diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java index 930e544c08..863bf62311 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java @@ -18,86 +18,57 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.commands.objects; -import junit.framework.TestCase; -import org.junit.Assert; -import org.junit.After; -import org.junit.Test; -import org.junit.Before; +import javax.management.MBeanServerConnection; + import org.apache.qpid.ConnectionConstants; import org.apache.qpid.Connector; import org.apache.qpid.ConnectorFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:26:09 PM - * To change this template use File | Settings | File Templates. - */ - - - -public class TestUserManagementObject{ +public class TestUserManagementObject +{ Connector conn; MBeanServerConnection mbsc; UserManagementObject test; - String test1,test2,test3; + String test1, test2, test3; @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT, + ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); mbsc = conn.getMBeanServerConnection(); test = new UserManagementObject(mbsc); test1 = "ping"; test2 = "test"; test3 = "object"; - } + @Test public void TestSetQueryString() { - test.setQueryString(test3,test1,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=UserManagement,*"); - - - + test.setQueryString(test3, test1, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=UserManagement,*"); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } } } - - diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java index d1699fdb9c..29c4db30a5 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java @@ -1,86 +1,81 @@ /* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ package org.apache.qpid.commands.objects; -import junit.framework.TestCase; -import org.junit.Assert; -import org.junit.After; -import org.junit.Test; -import org.junit.Before; +import javax.management.MBeanServerConnection; + import org.apache.qpid.ConnectionConstants; import org.apache.qpid.Connector; import org.apache.qpid.ConnectorFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import javax.management.MBeanServerConnection; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:26:40 PM - * To change this template use File | Settings | File Templates. - */ -public class TestVirtualHostObject{ +public class TestVirtualHostObject +{ Connector conn; MBeanServerConnection mbsc; VirtualHostObject test; - String test1,test2,test3; + String test1, test2, test3; @Before public void startup() throws Exception { - conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT, ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); + conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT, + ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD); mbsc = conn.getMBeanServerConnection(); test = new VirtualHostObject(mbsc); test1 = "ping"; test2 = "test"; test3 = "object"; - } + @Test public void TestSetQueryString() { - test.setQueryString(test3,test1,null); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,name=ping,*"); + test.setQueryString(test3, test1, null); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.VirtualHostManager,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=test,*"); + test.setQueryString(test3, null, test2); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=test,*"); test.querystring = null; - test.setQueryString(test3,test1,test2); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=test,name=ping,*"); + test.setQueryString(test3, test1, test2); + Assert.assertEquals(test.querystring, + "org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=test,name=ping,*"); test.querystring = null; - test.setQueryString(test3,null,null); - Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,*"); - - + test.setQueryString(test3, null, null); + Assert.assertEquals(test.querystring, "org.apache.qpid:type=VirtualHost.VirtualHostManager,*"); } @After public void cleanup() { - try{ + try + { conn.getConnector().close(); - }catch(Exception ex) + } + catch (Exception ex) { ex.printStackTrace(); } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java index 58d71a4de6..e2a03f52ad 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java @@ -18,43 +18,19 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.utils; -import junit.framework.TestCase; +import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.Assert; -import org.junit.After; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:17:26 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandLineOption { +public class TestCommandLineOption +{ String input1; String input2; String options; - String [] list; + String[] list; CommandLineOption option; @Before @@ -64,19 +40,22 @@ public class TestCommandLineOption { input2 = "--help"; options = "localhost testing"; list = options.split(" "); - option = new CommandLineOption(input1,list); - + option = new CommandLineOption(input1, list); + } + @Test public void TestGetOptinValue() { - Assert.assertEquals(option.getOptionValue(),"localhost"); + Assert.assertEquals(option.getOptionValue(), "localhost"); } + @Test public void TestGetOptionType() { - Assert.assertEquals(option.getOptionType(),"h"); + Assert.assertEquals(option.getOptionType(), "h"); } + @After public void cleanup() { diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java index 989fc61418..964c350fc5 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java @@ -18,49 +18,26 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.utils; -import junit.framework.TestCase; -import org.junit.Before; -import org.junit.Test; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + import org.junit.After; import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import java.util.Map; -import java.util.HashMap; -import java.util.ArrayList; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:16:30 PM - * To change this template use File | Settings | File Templates. - */ -public class TestCommandLineOptionParser { +public class TestCommandLineOptionParser +{ CommandLineOptionParser parser; - String [] input; + String[] input; CommandLineOption option1; CommandLineOption option2; ArrayList list1; ArrayList list2; + @Before public void setup() { @@ -70,6 +47,7 @@ public class TestCommandLineOptionParser { list1 = new ArrayList(); list2 = new ArrayList(); } + @Test public void TestParse() { @@ -77,18 +55,19 @@ public class TestCommandLineOptionParser { list1.add("localhost"); list2.add("23232"); - option1 = new CommandLineOption("h",list1); - option2 = new CommandLineOption("p",list2); - hash.put("h",option1); - hash.put("p",option2); - option1 = (CommandLineOption)parser.parse(input).get("h"); - Assert.assertEquals(option1.getOptionType(),"h"); - Assert.assertEquals(option1.getOptionValue(),"localhost"); - option1 = (CommandLineOption)parser.parse(input).get("p"); - Assert.assertEquals(option1.getOptionType(),"p"); - Assert.assertEquals(option1.getOptionValue(),"23232"); - Assert.assertEquals(parser.parse(input).size(),hash.size()); + option1 = new CommandLineOption("h", list1); + option2 = new CommandLineOption("p", list2); + hash.put("h", option1); + hash.put("p", option2); + option1 = (CommandLineOption) parser.parse(input).get("h"); + Assert.assertEquals(option1.getOptionType(), "h"); + Assert.assertEquals(option1.getOptionValue(), "localhost"); + option1 = (CommandLineOption) parser.parse(input).get("p"); + Assert.assertEquals(option1.getOptionType(), "p"); + Assert.assertEquals(option1.getOptionValue(), "23232"); + Assert.assertEquals(parser.parse(input).size(), hash.size()); } + @After public void cleanup() { diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java index a5d3122406..20234d1153 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java @@ -18,34 +18,9 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.utils; -import junit.framework.TestCase; +public class TestJMXConfigProperty +{ -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:15:35 PM - * To change this template use File | Settings | File Templates. - */ -public class TestJMXConfigProperty { - } diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java index 02dd7219db..40cde00953 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java @@ -18,45 +18,22 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ package org.apache.qpid.utils; -import junit.framework.TestCase; -import org.junit.Before; -import org.junit.Test; +import java.util.ArrayList; + import org.junit.After; import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -import java.util.ArrayList; - -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:14:32 PM - * To change this template use File | Settings | File Templates. - */ -public class TestJMXConfiguration { +public class TestJMXConfiguration +{ CommandLineOptionParser clop; JMXConfiguration jmc; CommandLineOption option; - String [] input; + String[] input; + @Before public void setup() { @@ -65,16 +42,18 @@ public class TestJMXConfiguration { clop = new CommandLineOptionParser(input); jmc = new JMXConfiguration(clop.getAlloptions()); } + @Test public void TestLoadOption() { ArrayList list = new ArrayList(); list.add("127.0.0.1"); - option = new CommandLineOption("-h",list); - CommandLineOption expect = jmc.loadoption("h",clop.getAlloptions()); - Assert.assertEquals(expect.getOptionType(),option.getOptionType()); - Assert.assertEquals(expect.getOptionValue(),option.getOptionValue()); + option = new CommandLineOption("-h", list); + CommandLineOption expect = jmc.loadoption("h", clop.getAlloptions()); + Assert.assertEquals(expect.getOptionType(), option.getOptionType()); + Assert.assertEquals(expect.getOptionValue(), option.getOptionValue()); } + @After public void cleanup() { diff --git a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java index 449609c639..aae39bcb37 100644 --- a/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java +++ b/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java @@ -18,36 +18,13 @@ * under the License. * */ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.qpid.utils; -import junit.framework.TestCase; +package org.apache.qpid.utils; -/** - * Created by IntelliJ IDEA. - * User: lahiru - * Date: Jun 30, 2008 - * Time: 12:12:43 PM - * To change this template use File | Settings | File Templates. - */ -public class TestJMXinfo { - /* this class is having only three simple getter methods. Therefore no - testcases +public class TestJMXinfo +{ + /* + * this class is having only three simple getter methods. Therefore no + * testcases */ } |
