KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > js > junit > XmlRpcClientTestRemoteClass


1 package org.apache.ws.jaxme.js.junit;
2
3 import java.io.IOException JavaDoc;
4 import java.net.MalformedURLException JavaDoc;
5
6
7 /** A test class, does nothing useful.
8  */

9 public class XmlRpcClientTestRemoteClass {
10     private static int sum = 0;
11     /** Adds <code>pValue</code> to the sum.
12      */

13     public void add(int pValue) {
14         sum += pValue;
15     }
16     /** Adds the given <code>pValues</code> to the sum.
17      */

18     public void add(int[] pValues) {
19         for (int i = 0; i < pValues.length; i++) {
20             add(pValues[i]);
21         }
22     }
23
24     /** Converts the given string into an int and
25      * adds it to the sum.
26      */

27     public void add(String JavaDoc pValue) {
28         add(Integer.parseInt(pValue));
29     }
30
31     /** Returns the sum.
32      */

33     public int getSum() {
34         return sum;
35     }
36
37     /** Converts the sum into a string and returns it.
38      * @throws IOException Never actually thrown, just to verify
39      * whether exceptions in the signature are handled properly.
40      */

41     public String JavaDoc getSumAsString() throws IOException JavaDoc, MalformedURLException JavaDoc {
42         return Integer.toString(sum);
43     }
44 }
Popular Tags