All files / test/Ice/exceptions ThrowerI.js

97.5% Statements 78/80
100% Branches 23/23
95.23% Functions 20/21
97.5% Lines 78/80

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 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 79 80 811x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 1x 1x 1x 1x 1x 2x 1x 1x 1x 1x 3x 3x 1x 1x 1x 1x 1x 1x 1x 4x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 1x 1x 1x 1x     1x 1x 1x 1x 3x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
// Copyright (c) ZeroC, Inc.
import { Ice } from "@zeroc/ice";
import { Test } from "./Test.js";
import { test } from "../../Common/TestHelper.js";
export class ThrowerI extends Test.Thrower {
    shutdown(current) {
        current.adapter.getCommunicator().shutdown();
    }
    supportsUndeclaredExceptions(_) {
        return true;
    }
    supportsAssertException(_) {
        return false;
    }
    throwAasA(a, _) {
        throw new Test.A(a);
    }
    throwAorDasAorD(a, _) {
        if (a > 0) {
            throw new Test.A(a);
        }
        else {
            throw new Test.D(a);
        }
    }
    throwBasA(a, b, current) {
        this.throwBasB(a, b, current);
    }
    throwBasB(a, b, _) {
        throw new Test.B(a, b);
    }
    throwCasA(a, b, c, current) {
        this.throwCasC(a, b, c, current);
    }
    throwCasB(a, b, c, current) {
        this.throwCasC(a, b, c, current);
    }
    throwCasC(a, b, c, _) {
        throw new Test.C(a, b, c);
    }
    throwUndeclaredA(a, _) {
        throw new Test.A(a);
    }
    throwUndeclaredB(a, b, _) {
        throw new Test.B(a, b);
    }
    throwUndeclaredC(a, b, c, _) {
        throw new Test.C(a, b, c);
    }
    throwLocalException(_) {
        throw new Ice.TimeoutException();
    }
    throwLocalExceptionIdempotent(_) {
        throw new Ice.TimeoutException();
    }
    throwNonIceException(_) {
        throw new Error();
    }
    throwAssertException(_) {
        test(false);
    }
    throwMemoryLimitException(_seq, _) {
        return new Uint8Array(1024 * 20); // 20KB is over the configured 10KB message size max.
    }
    throwDispatchException(replyStatusValue, _) {
        const replyStatus = Ice.ReplyStatus.valueOf(replyStatusValue) || new Ice.ReplyStatus(`${replyStatusValue}`, replyStatusValue);
        throw new Ice.DispatchException(replyStatus);
    }
    throwAfterResponse(_) {
        //
        // Only relevant for AMD.
        //
    }
    throwAfterException(_) {
        //
        // Only relevant for AMD.
        //
        throw new Test.A();
    }
}