summaryrefslogtreecommitdiff
path: root/java/test/Ice/operations/AllTests.java
blob: d88186cba551d68e300b3dd78b0909b82423df66 (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
// **********************************************************************
//
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

package test.Ice.operations;
import java.io.PrintWriter;

import test.Ice.operations.Test.MyClassPrx;
import test.Ice.operations.Test.MyClassPrxHelper;
import test.Ice.operations.Test.MyDerivedClassPrx;
import test.Ice.operations.Test.MyDerivedClassPrxHelper;

public class AllTests
{
    public static MyClassPrx
    allTests(test.Util.Application app, boolean collocated, PrintWriter out)
    {
        Ice.Communicator communicator = app.communicator();
        String ref = "test:default -p 12010";
        Ice.ObjectPrx base = communicator.stringToProxy(ref);
        MyClassPrx cl = MyClassPrxHelper.checkedCast(base);
        MyDerivedClassPrx derived = MyDerivedClassPrxHelper.checkedCast(cl);

        out.print("testing twoway operations... ");
        out.flush();
        Twoways.twoways(app, cl);
        Twoways.twoways(app, derived);
        derived.opDerived();
        out.println("ok");

        out.print("testing oneway operations... ");
        out.flush();
        Oneways.oneways(app, cl);
        out.println("ok");

        if(!collocated)
        {
            out.print("testing twoway operations with AMI... ");
            out.flush();
            TwowaysAMI.twowaysAMI(app, cl);
            TwowaysAMI.twowaysAMI(app, derived);
            out.println("ok");

            out.print("testing twoway operations with new AMI mapping... ");
            out.flush();
            TwowaysNewAMI.twowaysNewAMI(app, cl);
            TwowaysNewAMI.twowaysNewAMI(app, derived);
            out.println("ok");

            out.print("testing oneway operations with AMI... ");
            out.flush();
            OnewaysAMI.onewaysAMI(app, cl);
            out.println("ok");

            out.print("testing oneway operations with new AMI mapping... ");
            out.flush();
            OnewaysNewAMI.onewaysNewAMI(app, cl);
            out.println("ok");

            out.print("testing batch oneway operations... ");
            out.flush();
            BatchOneways.batchOneways(cl, out);
            BatchOneways.batchOneways(derived, out);
            out.println("ok");
        }

        return cl;
    }
}