All files / test/Ice/operations Client.js

100% Statements 41/41
100% Branches 3/3
100% Functions 2/2
100% Lines 41/41

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 421x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
// Copyright (c) ZeroC, Inc.
import { Test } from "./Test.js";
import { TestHelper } from "../../Common/TestHelper.js";
import { twoways } from "./Twoways.js";
import { oneways } from "./Oneways.js";
import { batchOneways } from "./BatchOneways.js";
export class Client extends TestHelper {
    async allTests(bidir) {
        const out = this.getWriter();
        const communicator = this.communicator();
        out.write("testing twoway operations... ");
        const cl = new Test.MyClassPrx(communicator, `test:${this.getTestEndpoint()}`);
        const derived = Test.MyDerivedClassPrx.uncheckedCast(cl);
        await twoways(communicator, cl, bidir, this);
        await twoways(communicator, derived, bidir, this);
        out.writeLine("ok");
        out.write("testing oneway operations... ");
        await oneways(cl);
        out.writeLine("ok");
        out.write("testing batch oneway operations... ");
        await batchOneways(cl);
        out.writeLine("ok");
        await cl.shutdown();
    }
    async run(args) {
        let communicator = null;
        try {
            const [properties] = this.createTestProperties(args);
            properties.setProperty("Ice.BatchAutoFlushSize", "100");
            properties.setProperty("Ice.Trace.Protocol", "1");
            properties.setProperty("Ice.Trace.Network", "3");
            [communicator] = this.initialize(properties);
            await this.allTests(false);
        }
        finally {
            if (communicator) {
                await communicator.destroy();
            }
        }
    }
}