You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by la...@apache.org on 2008/10/07 11:07:36 UTC

svn commit: r702402 [4/4] - in /incubator/qpid/trunk/qpid/java/management/tools: ./ qpid-cli/ qpid-cli/bin/ qpid-cli/lib/ qpid-cli/src/ qpid-cli/src/org/ qpid-cli/src/org/apache/ qpid-cli/src/org/apache/qpid/ qpid-cli/src/org/apache/qpid/commands/ qpid...

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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
+ *
+ *    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;
+
+/**
+ * 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 {
+    
+}

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,106 @@
+/*
+ *
+ * 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
+ *
+ *    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 org.apache.qpid.Connector;
+import org.apache.qpid.ConnectorFactory;
+
+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{
+    Connector conn;
+    MBeanServerConnection mbsc;
+    QueueObject test;
+    String test1,test2,test3;
+
+    @Before
+    public void startup()
+    {
+        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        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.querystring = null;
+        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.querystring = null;
+        test.setQueryString(test3,null,null);
+        Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,*");
+
+
+
+    }
+
+    @After
+    public void cleanup()
+    {
+        try{
+            conn.getConnector().close();
+        }catch(Exception ex)
+        {
+            ex.printStackTrace();
+        }
+
+    }
+}
+

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,102 @@
+/*
+ *
+ * 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
+ *
+ *    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 org.apache.qpid.Connector;
+import org.apache.qpid.ConnectorFactory;
+
+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{
+    Connector conn;
+    MBeanServerConnection mbsc;
+    UserManagementObject test;
+    String test1,test2,test3;
+
+    @Before
+    public void startup()
+    {
+        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        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,*");
+
+
+
+
+    }
+
+    @After
+    public void cleanup()
+    {
+        try{
+            conn.getConnector().close();
+        }catch(Exception ex)
+        {
+            ex.printStackTrace();
+        }
+
+    }
+}
+
+

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,88 @@
+/*
+*
+* 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 org.apache.qpid.Connector;
+import org.apache.qpid.ConnectorFactory;
+
+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{
+    Connector conn;
+    MBeanServerConnection mbsc;
+    VirtualHostObject test;
+    String test1,test2,test3;
+
+    @Before
+    public void startup()
+    {
+        conn  = ConnectorFactory.getConnector("localhost", "8999");
+        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.querystring = null;
+        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.querystring = null;
+        test.setQueryString(test3,null,null);
+        Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,*");
+
+
+
+    }
+
+    @After
+    public void cleanup()
+    {
+        try{
+            conn.getConnector().close();
+        }catch(Exception ex)
+        {
+            ex.printStackTrace();
+        }
+
+    }
+}

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,85 @@
+/*
+ *
+ * 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
+ *
+ *    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 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 {
+    String input1;
+    String input2;
+    String options;
+    String [] list;
+    CommandLineOption option;
+
+    @Before
+    public void setup()
+    {
+        input1 = "-h";
+        input2 = "--help";
+        options = "localhost testing";
+        list = options.split(" ");
+        option = new CommandLineOption(input1,list);
+        
+    }
+    @Test
+    public void TestGetOptinValue()
+    {
+        Assert.assertEquals(option.getOptionValue(),"localhost");
+    }
+    @Test
+    public void TestGetOptionType()
+    {
+        Assert.assertEquals(option.getOptionType(),"h");
+    }
+    @After
+    public void cleanup()
+    {
+        option = null;
+    }
+}

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,100 @@
+/*
+ *
+ * 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
+ *
+ *    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 org.junit.After;
+import org.junit.Assert;
+
+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 {
+    CommandLineOptionParser parser;
+    String [] input;
+    CommandLineOption option1;
+    CommandLineOption option2;
+    ArrayList list1;
+    ArrayList list2;
+    @Before
+    public void setup()
+    {
+        String temp = "run -h localhost -p 23232";
+        input = temp.split(" ");
+        parser = new CommandLineOptionParser(input);
+        list1 = new ArrayList();
+        list2 = new ArrayList();
+    }
+    @Test
+    public void TestParse()
+    {
+        Map hash = new HashMap();
+
+        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());
+    }
+    @After
+    public void cleanup()
+    {
+        parser = null;
+        option1 = null;
+        option2 = null;
+
+    }
+}

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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
+ *
+ *    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;
+
+/**
+ * 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 {
+    
+}

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,85 @@
+/*
+ *
+ * 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
+ *
+ *    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 org.junit.After;
+import org.junit.Assert;
+
+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 {
+    CommandLineOptionParser clop;
+    JMXConfiguration jmc;
+    CommandLineOption option;
+    String [] input;
+    @Before
+    public void setup()
+    {
+        String temp = "command -h 127.0.0.1 -p 1234";
+        input = temp.split(" ");
+        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());
+    }
+    @After
+    public void cleanup()
+    {
+        clop = null;
+        jmc = null;
+        option = null;
+    }
+}

Added: incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java?rev=702402&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java (added)
+++ incubator/qpid/trunk/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java Tue Oct  7 02:07:34 2008
@@ -0,0 +1,53 @@
+/*
+ *
+ * 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
+ *
+ *    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;
+
+/**
+ * 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
+     */
+}