Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClient.execute()


        } catch (Throwable t) {
            throw new UndeclaredThrowableException(t);
        }
        checkXMLRPC112Result(o);
        checkXMLRPC112Result(client.execute(methodName, new Object[]{new Object[]{"1", "2", "3"}}));
        checkXMLRPC112Result(client.execute(methodName, new Object[]{new Object[]{"1", "2", "3"}}));
    }

    private void checkXMLRPC112Result(Object pObject) {
        Object[] args = (Object[]) pObject;
        assertEquals(3, args.length);
View Full Code Here


        XmlRpcClient client = pProvider.getClient();
        client.setConfig(getConfig(pProvider));
        XMLRPC113Handler handler = (XMLRPC113Handler) new ClientFactory(client).newInstance(XMLRPC113Handler.class);
        for (int i = 0;  i < 5;  i++) {
            try {
                client.execute(XMLRPC113Handler.class.getName() + ".throwCode", new Object[]{new Integer(i)});
                fail("Excpected exception");
            } catch (XmlRpcException e) {
                assertEquals(i, e.code);
            }
            try {
View Full Code Here

    private void testXMLRPC119(ClientProvider pProvider) throws Exception {
        XmlRpcClient client = pProvider.getClient();
        client.setConfig(getConfig(pProvider));
        for (int i = 0;  i < 100;  i+= 10) {
            String s = (String) client.execute(XMLRPC119Handler.class.getName() + ".getString", new Object[]{new Integer(i)});
            assertEquals(i*1024, s.length());
        }
    }
}
View Full Code Here

                XmlRpcClient client = new XmlRpcClient();
                XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
                config.setServerURL(new URL("http://127.0.0.1:" + port + "/"));
                client.setConfig(config);
                for (int i = 0;  i < iterations;  i++) {
                    assertEquals(EIGHT, client.execute("Adder.add", new Object[]{THREE, FIVE}));
                }
            } catch (Throwable t) {
                t.printStackTrace();
            }
        }
View Full Code Here

    private void testAdder(ClientProvider pProvider) throws Exception {
        XmlRpcClient client = pProvider.getClient();
        XmlRpcClientConfig config = getConfig(pProvider);
        client.setConfig(config);
        Object o = client.execute("Adder.add", new Object[]{new Integer(3), new Integer(5)});
        assertEquals(new Integer(8), o);
    }

    /**
     * Test for system.listMethods.
View Full Code Here

    private void testListMethods(ClientProvider pProvider) throws Exception {
        XmlRpcClient client = pProvider.getClient();
        XmlRpcClientConfig config = getConfig(pProvider);
        client.setConfig(config);
        Object o = client.execute("system.listMethods", new Object[0]);
        Object[] methodList = (Object[]) o;
        Arrays.sort(methodList, Collator.getInstance(Locale.US));
        assertEquals(4, methodList.length);
        assertEquals("Adder.add", methodList[0]);
        assertEquals("system.listMethods", methodList[1]);
View Full Code Here

    private void testMethodHelp(ClientProvider pProvider) throws Exception {
        XmlRpcClient client = pProvider.getClient();
        XmlRpcClientConfig config = getConfig(pProvider);
        client.setConfig(config);
        String help = (String) client.execute("system.methodHelp", new Object[]{"Adder.add"});
        assertEquals("Invokes the method org.apache.xmlrpc.test.AuthenticationTest$AdderImpl.add(int, int).", help);
    }

    /**
     * Test for system.methodSignature.
View Full Code Here

    private void testMethodSignature(ClientProvider pProvider) throws Exception {
        XmlRpcClient client = pProvider.getClient();
        XmlRpcClientConfig config = getConfig(pProvider);
        client.setConfig(config);
        Object[] signatures = (Object[]) client.execute("system.methodSignature", new Object[]{"Adder.add"});
        assertEquals(signatures.length, 1);
        Object[] signature = (Object[]) signatures[0];
        assertEquals(3, signature.length);
        assertEquals("int", signature[0]);
        assertEquals("int", signature[1]);
View Full Code Here

    }

    private void testClientIpAddress(ClientProvider pProvider) throws Exception {
        final XmlRpcClient client = pProvider.getClient();
        client.setConfig(getConfig(pProvider));
        final String ip = (String) client.execute("getIpAddress", new Object[]{});
        assertEquals("127.0.0.1", ip);
    }
   
    /** Test, whether we can invoke a method, returning a byte.
     * @throws Exception The test failed.
View Full Code Here

            + "</dateTime.iso8601></value></param></params></methodCall>";
        assertEquals(expect, got);
       
        XmlRpcServer server = pProvider.getServer();
        server.setTypeFactory(getCustomDateTypeFactory(server, format));
        Date date = (Date) client.execute(request);
        Calendar cal2 = Calendar.getInstance();
        cal2.setTime(date);
        cal1.add(Calendar.DAY_OF_MONTH, 1);
        assertEquals(cal1, cal2);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.