summaryrefslogtreecommitdiffstats
path: root/dcopjava/tests/test.java
blob: 665b5673b61b2417ed5a492d11e3dbdf2c835cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import org.trinitydesktop.DCOP.*;


class test
{

    public static void main(String[] argv)
    {
	test_stub test = new test_stub("test-server", "test");

	System.out.println("Calling server without args:");
	test.noArg();
	System.out.println("");

	System.out.println("Calling server asynchronously without args:");
	test.asyncNoArg();
	System.out.println("");	

	System.out.println("Calling server with one argument: bool=true:");
	test.oneArg(true);
	System.out.println("");	

	System.out.println("Calling server with one argument: bool=false:");
	test.oneArg(false);
	System.out.println("");	

	System.out.println("Calling server: returnFalse");
	boolean ret = test.returnFalse();
	System.out.print("Returned: ");
	if (ret)
	  System.out.println("True");
	else
	  System.out.println("False");
	System.out.println();

	System.out.println("Calling server: returnTrue");
	ret = test.returnTrue();
	System.out.print("Returned: ");
	if (ret)
	  System.out.println("True");
	else
	  System.out.println("False");
	System.out.println();

	System.out.println("Calling server: short");
	System.out.println(test.shortArg((short)(51)));
	
	System.out.println("Calling server: int");
	System.out.println(test.intArg(512));
	
	System.out.println("Calling server: long");
	System.out.println(test.longArg(999999));
	
	System.out.println("Calling server: float");
	System.out.println(test.floatArg(5.1212f));
	
	System.out.println("Calling server: double");
	System.out.println(test.doubleArg(0.001122));

	System.out.println("Calling server: String");
	System.out.println(test.stringArg("Hallo Server"));

	String[] in = { "alpha", "beta", "gamma", "delta" };
	System.out.println("Calling server: String[]");	
	String[] out = test.stringListArg(in);
	for (int i=0; i<out.length; ++i)
	    System.out.println(out[i]);

	System.out.println("Calling server: CString");
	System.out.println(test.cstringArg("Hallo Server"));

	DCOPRef rin = new DCOPRef("app", "obj", "typ");
	System.out.println("Calling server: DCOPRef");
	DCOPRef rout = test.DCOPRefArg(rin);
	System.out.println("Reference: " + rout.app() + ", " +
			   rout.object() + ", " + rout.type());
    }
}