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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | 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 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 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 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | // Copyright (c) ZeroC, Inc.
import { Test } from "./Test.js";
import { TestHelper, test } from "../../../Common/TestHelper.js";
export class Client extends TestHelper {
async allTests() {
const out = this.getWriter();
const communicator = this.communicator();
const prx = new Test.TestIntfPrx(communicator, `Test:${this.getTestEndpoint()} -t 10000`);
out.write("base... ");
try {
await prx.baseAsBase();
test(false);
}
catch (ex) {
if (ex instanceof Test.Base) {
test(ex.b == "Base.b");
test(ex.ice_id() == "::Test::Base");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("slicing of unknown derived... ");
try {
await prx.unknownDerivedAsBase();
test(false);
}
catch (ex) {
if (ex instanceof Test.Base) {
test(ex.b == "UnknownDerived.b");
test(ex.ice_id() == "::Test::Base");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("non-slicing of known derived as base... ");
try {
await prx.knownDerivedAsBase();
test(false);
}
catch (ex) {
if (ex instanceof Test.KnownDerived) {
test(ex.b == "KnownDerived.b");
test(ex.kd == "KnownDerived.kd");
test(ex.ice_id() == "::Test::KnownDerived");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("non-slicing of known derived as derived... ");
try {
await prx.knownDerivedAsKnownDerived();
test(false);
}
catch (ex) {
if (ex instanceof Test.KnownDerived) {
test(ex.b == "KnownDerived.b");
test(ex.kd == "KnownDerived.kd");
test(ex.ice_id() == "::Test::KnownDerived");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("slicing of unknown intermediate as base... ");
try {
await prx.unknownIntermediateAsBase();
test(false);
}
catch (ex) {
if (ex instanceof Test.Base) {
test(ex.b == "UnknownIntermediate.b");
test(ex.ice_id() == "::Test::Base");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("slicing of known intermediate as base... ");
try {
await prx.knownIntermediateAsBase();
test(false);
}
catch (ex) {
if (ex instanceof Test.KnownIntermediate) {
test(ex.b == "KnownIntermediate.b");
test(ex.ki == "KnownIntermediate.ki");
test(ex.ice_id() == "::Test::KnownIntermediate");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("slicing of known most derived as base... ");
try {
await prx.knownMostDerivedAsBase();
test(false);
}
catch (ex) {
if (ex instanceof Test.KnownMostDerived) {
test(ex.b == "KnownMostDerived.b");
test(ex.ki == "KnownMostDerived.ki");
test(ex.kmd == "KnownMostDerived.kmd");
test(ex.ice_id() == "::Test::KnownMostDerived");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("non-slicing of known intermediate as intermediate... ");
try {
await prx.knownIntermediateAsKnownIntermediate();
test(false);
}
catch (ex) {
if (ex instanceof Test.KnownIntermediate) {
test(ex.b == "KnownIntermediate.b");
test(ex.ki == "KnownIntermediate.ki");
test(ex.ice_id() == "::Test::KnownIntermediate");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("non-slicing of known most derived as intermediate... ");
try {
await prx.knownMostDerivedAsKnownIntermediate();
test(false);
}
catch (ex) {
if (ex instanceof Test.KnownMostDerived) {
test(ex.b == "KnownMostDerived.b");
test(ex.ki == "KnownMostDerived.ki");
test(ex.kmd == "KnownMostDerived.kmd");
test(ex.ice_id() == "::Test::KnownMostDerived");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
out.write("non-slicing of known most derived as most derived... ");
try {
await prx.knownMostDerivedAsKnownMostDerived();
test(false);
}
catch (ex) {
if (ex instanceof Test.KnownMostDerived) {
test(ex.b == "KnownMostDerived.b");
test(ex.ki == "KnownMostDerived.ki");
test(ex.kmd == "KnownMostDerived.kmd");
test(ex.ice_id() == "::Test::KnownMostDerived");
}
else {
test(false, ex);
}
}
out.writeLine("ok");
await prx.shutdown();
}
async run(args) {
let communicator = null;
try {
[communicator] = this.initialize(args);
await this.allTests();
}
finally {
if (communicator) {
await communicator.destroy();
}
}
}
}
|