diff options
author | Michi Henning <michi@zeroc.com> | 2003-05-21 00:38:14 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-05-21 00:38:14 +0000 |
commit | d199514de764836c345483427f067afbb80bf4dd (patch) | |
tree | 0c1518021bfe5cd5349307dfbd6e10108be2a1a3 /java/test/Ice/slicing/exceptions/ssrc/TestI.java | |
parent | Fixed incorrect code generation for Patcher constructor for dictionaries (diff) | |
download | ice-d199514de764836c345483427f067afbb80bf4dd.tar.bz2 ice-d199514de764836c345483427f067afbb80bf4dd.tar.xz ice-d199514de764836c345483427f067afbb80bf4dd.zip |
Fixed exception slicing tests for icej to properly segregate client and
server. Added additional tests to ice and icej exception slicing tests
to make sure that the received exception instance is indeed sliced by
checking ice_name().
Diffstat (limited to 'java/test/Ice/slicing/exceptions/ssrc/TestI.java')
-rw-r--r-- | java/test/Ice/slicing/exceptions/ssrc/TestI.java | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/java/test/Ice/slicing/exceptions/ssrc/TestI.java b/java/test/Ice/slicing/exceptions/ssrc/TestI.java new file mode 100644 index 00000000000..86eb89f5885 --- /dev/null +++ b/java/test/Ice/slicing/exceptions/ssrc/TestI.java @@ -0,0 +1,164 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +public final class TestI extends _TestDisp +{ + public + TestI(Ice.ObjectAdapter adapter) + { + _adapter = adapter; + } + + public void + shutdown(Ice.Current current) + { + _adapter.getCommunicator().shutdown(); + } + + public void + baseAsBase(Ice.Current current) + throws Base + { + Base b = new Base(); + b.b = "Base.b"; + throw b; + } + + public void + unknownDerivedAsBase(Ice.Current current) + throws Base + { + UnknownDerived d = new UnknownDerived(); + d.b = "UnknownDerived.b"; + d.ud = "UnknownDerived.ud"; + throw d; + } + + public void + knownDerivedAsBase(Ice.Current current) + throws Base + { + KnownDerived d = new KnownDerived(); + d.b = "KnownDerived.b"; + d.kd = "KnownDerived.kd"; + throw d; + } + + public void + knownDerivedAsKnownDerived(Ice.Current current) + throws KnownDerived + { + KnownDerived d = new KnownDerived(); + d.b = "KnownDerived.b"; + d.kd = "KnownDerived.kd"; + throw d; + } + + public void + unknownIntermediateAsBase(Ice.Current current) + throws Base + { + UnknownIntermediate ui = new UnknownIntermediate(); + ui.b = "UnknownIntermediate.b"; + ui.ui = "UnknownIntermediate.ui"; + throw ui; + } + + public void + knownIntermediateAsBase(Ice.Current current) + throws Base + { + KnownIntermediate ki = new KnownIntermediate(); + ki.b = "KnownIntermediate.b"; + ki.ki = "KnownIntermediate.ki"; + throw ki; + } + + public void + knownMostDerivedAsBase(Ice.Current current) + throws Base + { + KnownMostDerived kmd = new KnownMostDerived(); + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + throw kmd; + } + + public void + knownIntermediateAsknownIntermediate(Ice.Current current) + throws KnownIntermediate + { + KnownIntermediate ki = new KnownIntermediate(); + ki.b = "KnownIntermediate.b"; + ki.ki = "KnownIntermediate.ki"; + throw ki; + } + + public void + knownMostDerivedAsKnownIntermediate(Ice.Current current) + throws KnownIntermediate + { + KnownMostDerived kmd = new KnownMostDerived(); + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + throw kmd; + } + + public void + knownMostDerivedAsKnownMostDerived(Ice.Current current) + throws KnownMostDerived + { + KnownMostDerived kmd = new KnownMostDerived(); + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + throw kmd; + } + + public void + unknownMostDerived1AsBase(Ice.Current current) + throws Base + { + UnknownMostDerived1 umd1 = new UnknownMostDerived1(); + umd1.b = "UnknownMostDerived1.b"; + umd1.ki = "UnknownMostDerived1.ki"; + umd1.umd1 = "UnknownMostDerived1.umd1"; + throw umd1; + } + + public void + unknownMostDerived1AsKnownIntermediate(Ice.Current current) + throws KnownIntermediate + { + UnknownMostDerived1 umd1 = new UnknownMostDerived1(); + umd1.b = "UnknownMostDerived1.b"; + umd1.ki = "UnknownMostDerived1.ki"; + umd1.umd1 = "UnknownMostDerived1.umd1"; + throw umd1; + } + + public void + unknownMostDerived2AsBase(Ice.Current current) + throws Base + { + UnknownMostDerived2 umd2 = new UnknownMostDerived2(); + umd2.b = "UnknownMostDerived2.b"; + umd2.ui = "UnknownMostDerived2.ui"; + umd2.umd2 = "UnknownMostDerived2.umd2"; + throw umd2; + } + private Ice.ObjectAdapter _adapter; +} |