package org.jenkinsci.plugins.koji;

import java.util.Map;

public class XMLRPCTest {

    private KojiClient koji;

    public static void main(String[] args) {
        String kojiInstanceURL = "http://koji.fedoraproject.org/kojihub";

        XMLRPCTest kojiTest = new XMLRPCTest(kojiInstanceURL);
        kojiTest.test();
    }

    public void test() {
        String hello = koji.sayHello();
        System.out.println(hello);

        Object[] result;
        result = koji.getLatestBuilds("f21", "kernel");
        for (Object object : result) {
            System.out.println(object);
        }

        String build = "kernel-3.15.0-0.rc3.git5.3.fc21";
        Map<String, String> buildInfo;
        buildInfo = koji.getBuildInfo(build);
        for (Map.Entry<String, String> entry : buildInfo.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();

            System.out.println(key + ": " + value);
        }
    }

    public XMLRPCTest(String kojiInstanceURL) {
        this.koji = KojiClient.getKojiClient(kojiInstanceURL);
    }

}

@@ -310,20 +310,28 @@
 ojiTest.
-t
+executeT
 est
+s
 ();%0A    
@@ -349,20 +349,28 @@
 ic void 
-t
+executeT
 est
+s
 () %7B%0A   
@@ -378,205 +378,213 @@
     
-String hello = koji.sayHello();%0A        System.out.println(hello);%0A%0A        Object%5B%5D result
+testKojiHello();%0A%0A//        koji.getSession();%0A//%0A//        testGetLatestBuilds();%0A//%0A//        testGeBuildInfo()
 ;%0A    
+%7D%0A%0A
     
-result = koji.getLatestBuilds(%22f21%22, %22kernel%22);%0A        for (Object object : result) %7B%0A 
+private void testKojiHello() %7B%0A        String hello = koji.sayHello();%0A
         
    S
@@ -571,35 +571,32 @@
 ello();%0A        
-   
 System.out.print
@@ -602,27 +602,59 @@
 tln(
-object
+hello
 );%0A    
+%7D%0A%0A
     
-%7D%0A
+private void testGeBuildInfo() %7B
 %0A   
@@ -1012,32 +1012,250 @@
        %7D%0A    %7D%0A%0A
+    private void testGetLatestBuilds() %7B%0A        Object%5B%5D result;%0A        result = koji.getLatestBuilds(%22f21%22, %22kernel%22);%0A        for (Object object : result) %7B%0A            System.out.println(object);%0A        %7D%0A    %7D%0A%0A
     public XMLRP

Refactor the XML-RPC testing class.