diff options
author | Michi Henning <michi@zeroc.com> | 2004-02-24 07:09:29 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-02-24 07:09:29 +0000 |
commit | 0802f5204cd7a50007b97e71aa8b58bfe9d03c95 (patch) | |
tree | a624d91c4848c2f5296a868f47bdd6bea161a881 /java/test | |
parent | *** empty log message *** (diff) | |
download | ice-0802f5204cd7a50007b97e71aa8b58bfe9d03c95.tar.bz2 ice-0802f5204cd7a50007b97e71aa8b58bfe9d03c95.tar.xz ice-0802f5204cd7a50007b97e71aa8b58bfe9d03c95.zip |
Added AMI and AMD tests for exception slicing. Removed a few redundant
semicolons from the source.
Diffstat (limited to 'java/test')
-rw-r--r-- | java/test/Freeze/complex/Client.java | 2 | ||||
-rw-r--r-- | java/test/Ice/exceptions/AllTests.java | 34 | ||||
-rw-r--r-- | java/test/Ice/faultTolerance/AllTests.java | 12 | ||||
-rw-r--r-- | java/test/Ice/operations/Twoways.java | 2 | ||||
-rw-r--r-- | java/test/Ice/operations/TwowaysAMI.java | 96 | ||||
-rw-r--r-- | java/test/Ice/operationsAMD/MyDerivedClassI.java | 2 | ||||
-rw-r--r-- | java/test/Ice/slicing/build.xml | 2 | ||||
-rw-r--r-- | java/test/Ice/slicing/exceptions/Test.ice | 4 | ||||
-rw-r--r-- | java/test/Ice/slicing/exceptions/csrc/AllTests.java | 750 | ||||
-rwxr-xr-x | java/test/Ice/slicing/exceptions/run.py | 24 | ||||
-rw-r--r-- | java/test/Ice/slicing/exceptions/ssrc/TestI.java | 2 | ||||
-rw-r--r-- | java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice | 40 | ||||
-rw-r--r-- | java/test/Ice/slicing/exceptionsAMD/TestAMD.ice | 59 | ||||
-rw-r--r-- | java/test/Ice/slicing/exceptionsAMD/TestI.java | 166 | ||||
-rw-r--r-- | java/test/Ice/slicing/exceptionsAMD/build.xml | 61 |
15 files changed, 1165 insertions, 91 deletions
diff --git a/java/test/Freeze/complex/Client.java b/java/test/Freeze/complex/Client.java index 24daa5d68a6..b48f0fb29aa 100644 --- a/java/test/Freeze/complex/Client.java +++ b/java/test/Freeze/complex/Client.java @@ -80,7 +80,7 @@ public class Client "2+(5*3)", "5*(2+3)", "10+(10+(20+(8*(2*(3*2+4+5+6)))))" - }; + } Complex.ComplexDict m = new Complex.ComplexDict(_connection, dbName, true); diff --git a/java/test/Ice/exceptions/AllTests.java b/java/test/Ice/exceptions/AllTests.java index dbc36bc34af..295bd53db71 100644 --- a/java/test/Ice/exceptions/AllTests.java +++ b/java/test/Ice/exceptions/AllTests.java @@ -63,7 +63,7 @@ public class AllTests } private boolean _called; - }; + } private static class AMI_Thrower_throwAasAI extends AMI_Thrower_throwAasA { @@ -104,7 +104,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwAasAObjectNotExistI extends AMI_Thrower_throwAasA { @@ -146,7 +146,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwAasAFacetNotExistI extends AMI_Thrower_throwAasA { @@ -188,7 +188,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwAasAFacetNotExist2I extends AMI_Thrower_throwAasA { @@ -231,7 +231,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwAorDasAorDI extends AMI_Thrower_throwAorDasAorD { @@ -276,7 +276,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwBasAI extends AMI_Thrower_throwBasA { @@ -318,7 +318,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwCasAI extends AMI_Thrower_throwCasA { @@ -361,7 +361,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwBasBI extends AMI_Thrower_throwBasB { @@ -403,7 +403,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwCasBI extends AMI_Thrower_throwCasB { @@ -446,7 +446,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwCasCI extends AMI_Thrower_throwCasC { @@ -489,7 +489,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwUndeclaredAI extends AMI_Thrower_throwUndeclaredA { @@ -523,7 +523,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwUndeclaredBI extends AMI_Thrower_throwUndeclaredB { @@ -557,7 +557,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwUndeclaredCI extends AMI_Thrower_throwUndeclaredC { @@ -591,7 +591,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwLocalExceptionI extends AMI_Thrower_throwLocalException { @@ -625,7 +625,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Thrower_throwNonIceExceptionI extends AMI_Thrower_throwNonIceException { @@ -659,7 +659,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_WrongOperation_noSuchOperationI extends AMI_WrongOperation_noSuchOperation { @@ -694,7 +694,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } public static ThrowerPrx allTests(Ice.Communicator communicator, boolean collocated) diff --git a/java/test/Ice/faultTolerance/AllTests.java b/java/test/Ice/faultTolerance/AllTests.java index 8820f0a7be4..c4c202aff77 100644 --- a/java/test/Ice/faultTolerance/AllTests.java +++ b/java/test/Ice/faultTolerance/AllTests.java @@ -63,7 +63,7 @@ public class AllTests } private boolean _called; - }; + } private static class AMI_Test_pidI extends AMI_Test_pid { @@ -101,7 +101,7 @@ public class AllTests private int _pid; private Callback callback = new Callback(); - }; + } private static class AMI_Test_shutdownI extends AMI_Test_shutdown { @@ -130,7 +130,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Test_abortI extends AMI_Test_abort { @@ -170,7 +170,7 @@ public class AllTests } private Callback callback = new Callback(); - }; + } private static class AMI_Test_idempotentAbortI extends AMI_Test_idempotentAbort { @@ -199,7 +199,7 @@ public class AllTests } private AMI_Test_abortI delegate = new AMI_Test_abortI(); - }; + } private static class AMI_Test_nonmutatingAbortI extends AMI_Test_nonmutatingAbort { @@ -228,7 +228,7 @@ public class AllTests } private AMI_Test_abortI delegate = new AMI_Test_abortI(); - }; + } public static void allTests(Ice.Communicator communicator, int[] ports) diff --git a/java/test/Ice/operations/Twoways.java b/java/test/Ice/operations/Twoways.java index d18e5b23c0d..3f5535d6e96 100644 --- a/java/test/Ice/operations/Twoways.java +++ b/java/test/Ice/operations/Twoways.java @@ -174,7 +174,7 @@ class Twoways (byte)0x11, (byte)0x12, (byte)0x22 - }; + } final byte[] bsi2 = { (byte)0xf1, diff --git a/java/test/Ice/operations/TwowaysAMI.java b/java/test/Ice/operations/TwowaysAMI.java index 08f8ae64d12..237a1e16e95 100644 --- a/java/test/Ice/operations/TwowaysAMI.java +++ b/java/test/Ice/operations/TwowaysAMI.java @@ -63,7 +63,7 @@ class TwowaysAMI } private boolean _called; - }; + } private static class AMI_MyClass_opVoidI extends Test.AMI_MyClass_opVoid { @@ -86,7 +86,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opByteI extends Test.AMI_MyClass_opByte { @@ -111,7 +111,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opBoolI extends Test.AMI_MyClass_opBool { @@ -136,7 +136,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opShortIntLongI extends Test.AMI_MyClass_opShortIntLong { @@ -163,7 +163,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opFloatDoubleI extends Test.AMI_MyClass_opFloatDouble { @@ -189,7 +189,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opStringI extends Test.AMI_MyClass_opString { @@ -214,7 +214,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opMyEnumI extends Test.AMI_MyClass_opMyEnum { @@ -239,7 +239,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opMyClassI extends Test.AMI_MyClass_opMyClass { @@ -275,7 +275,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opStructI extends Test.AMI_MyClass_opStruct { @@ -304,7 +304,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opByteSI extends Test.AMI_MyClass_opByteS { @@ -341,7 +341,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opBoolSI extends Test.AMI_MyClass_opBoolS { @@ -373,7 +373,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opShortIntLongSI extends Test.AMI_MyClass_opShortIntLongS { @@ -417,7 +417,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opFloatDoubleSI extends Test.AMI_MyClass_opFloatDoubleS { @@ -453,7 +453,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opStringSI extends Test.AMI_MyClass_opStringS { @@ -485,7 +485,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opByteSSI extends Test.AMI_MyClass_opByteSS { @@ -527,7 +527,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opBoolSSI extends Test.AMI_MyClass_opBoolSS { @@ -550,7 +550,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opShortIntLongSSI extends Test.AMI_MyClass_opShortIntLongSS { @@ -573,7 +573,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opFloatDoubleSSI extends Test.AMI_MyClass_opFloatDoubleSS { @@ -616,7 +616,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opStringSSI extends Test.AMI_MyClass_opStringSS { @@ -654,7 +654,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opByteBoolDI extends Test.AMI_MyClass_opByteBoolD { @@ -686,7 +686,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opShortIntDI extends Test.AMI_MyClass_opShortIntD { @@ -718,7 +718,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opLongFloatDI extends Test.AMI_MyClass_opLongFloatD { @@ -750,7 +750,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opStringStringDI extends Test.AMI_MyClass_opStringStringD { @@ -782,7 +782,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opStringMyEnumDI extends Test.AMI_MyClass_opStringMyEnumD { @@ -814,7 +814,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opIntSI extends Test.AMI_MyClass_opIntS { @@ -848,7 +848,7 @@ class TwowaysAMI private int _l; private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opContextEqualI extends Test.AMI_MyClass_opContext { @@ -878,7 +878,7 @@ class TwowaysAMI private java.util.Map _d; private Callback callback = new Callback(); - }; + } private static class AMI_MyClass_opContextNotEqualI extends Test.AMI_MyClass_opContext { @@ -908,7 +908,7 @@ class TwowaysAMI private java.util.Map _d; private Callback callback = new Callback(); - }; + } private static class AMI_MyDerivedClass_opDerivedI extends Test.AMI_MyDerivedClass_opDerived { @@ -931,7 +931,7 @@ class TwowaysAMI } private Callback callback = new Callback(); - }; + } static void twowaysAMI(Test.MyClassPrx p) @@ -1014,14 +1014,14 @@ class TwowaysAMI (byte)0x11, (byte)0x12, (byte)0x22 - }; + } final byte[] bsi2 = { (byte)0xf1, (byte)0xf2, (byte)0xf3, (byte)0xf4 - }; + } AMI_MyClass_opByteSI cb = new AMI_MyClass_opByteSI(); p.opByteS_async(cb, bsi1, bsi2); @@ -1029,8 +1029,8 @@ class TwowaysAMI } { - final boolean[] bsi1 = { true, true, false }; - final boolean[] bsi2 = { false }; + final boolean[] bsi1 = { true, true, false } + final boolean[] bsi2 = { false } AMI_MyClass_opBoolSI cb = new AMI_MyClass_opBoolSI(); p.opBoolS_async(cb, bsi1, bsi2); @@ -1038,9 +1038,9 @@ class TwowaysAMI } { - final short[] ssi = { 1, 2, 3 }; - final int[] isi = { 5, 6, 7, 8 }; - final long[] lsi = { 10, 30, 20 }; + final short[] ssi = { 1, 2, 3 } + final int[] isi = { 5, 6, 7, 8 } + final long[] lsi = { 10, 30, 20 } AMI_MyClass_opShortIntLongSI cb = new AMI_MyClass_opShortIntLongSI(); p.opShortIntLongS_async(cb, ssi, isi, lsi); @@ -1048,8 +1048,8 @@ class TwowaysAMI } { - final float[] fsi = { 3.14f, 1.11f }; - final double[] dsi = { 1.1E10, 1.2E10, 1.3E10 }; + final float[] fsi = { 3.14f, 1.11f } + final double[] dsi = { 1.1E10, 1.2E10, 1.3E10 } AMI_MyClass_opFloatDoubleSI cb = new AMI_MyClass_opFloatDoubleSI(); p.opFloatDoubleS_async(cb, fsi, dsi); @@ -1057,8 +1057,8 @@ class TwowaysAMI } { - final String[] ssi1 = { "abc", "de", "fghi" }; - final String[] ssi2 = { "xyz" }; + final String[] ssi1 = { "abc", "de", "fghi" } + final String[] ssi2 = { "xyz" } AMI_MyClass_opStringSI cb = new AMI_MyClass_opStringSI(); p.opStringS_async(cb, ssi1, ssi2); @@ -1070,12 +1070,12 @@ class TwowaysAMI { { (byte)0x01, (byte)0x11, (byte)0x12 }, { (byte)0xff } - }; + } final byte[][] bsi2 = { { (byte)0x0e }, { (byte)0xf2, (byte)0xf1 } - }; + } AMI_MyClass_opByteSSI cb = new AMI_MyClass_opByteSSI(); p.opByteSS_async(cb, bsi1, bsi2); @@ -1088,11 +1088,11 @@ class TwowaysAMI { 3.14f }, { 1.11f }, { }, - }; + } final double[][] dsi = { { 1.1E10, 1.2E10, 1.3E10 } - }; + } AMI_MyClass_opFloatDoubleSSI cb = new AMI_MyClass_opFloatDoubleSSI(); p.opFloatDoubleSS_async(cb, fsi, dsi); @@ -1104,13 +1104,13 @@ class TwowaysAMI { { "abc" }, { "de", "fghi" } - }; + } final String[][] ssi2 = { { }, { }, { "xyz" } - }; + } AMI_MyClass_opStringSSI cb = new AMI_MyClass_opStringSSI(); p.opStringSS_async(cb, ssi1, ssi2); @@ -1188,7 +1188,7 @@ class TwowaysAMI } { - int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; + int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 } for(int l = 0; l < lengths.length; ++l) { @@ -1242,4 +1242,4 @@ class TwowaysAMI test(cb.check()); } } -}; +} diff --git a/java/test/Ice/operationsAMD/MyDerivedClassI.java b/java/test/Ice/operationsAMD/MyDerivedClassI.java index e5c3d7280ea..1cbe9d74664 100644 --- a/java/test/Ice/operationsAMD/MyDerivedClassI.java +++ b/java/test/Ice/operationsAMD/MyDerivedClassI.java @@ -29,7 +29,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass } private Test.AMD_MyClass_opVoid _cb; - }; + } public MyDerivedClassI(Ice.ObjectAdapter adapter, Ice.Identity identity) diff --git a/java/test/Ice/slicing/build.xml b/java/test/Ice/slicing/build.xml index 13f56040963..7c8b1e9eb41 100644 --- a/java/test/Ice/slicing/build.xml +++ b/java/test/Ice/slicing/build.xml @@ -15,11 +15,13 @@ the Free Software Foundation. <target name="all"> <ant dir="exceptions"/> + <ant dir="exceptionsAMD"/> <ant dir="objects"/> </target> <target name="clean"> <ant dir="exceptions" target="clean"/> + <ant dir="exceptionsAMD" target="clean"/> <ant dir="objects" target="clean"/> </target> diff --git a/java/test/Ice/slicing/exceptions/Test.ice b/java/test/Ice/slicing/exceptions/Test.ice index 27b2aa99bd8..cb42aa4d87c 100644 --- a/java/test/Ice/slicing/exceptions/Test.ice +++ b/java/test/Ice/slicing/exceptions/Test.ice @@ -35,7 +35,7 @@ exception KnownMostDerived extends KnownIntermediate string kmd; }; -interface Test +["ami"] interface Test { void baseAsBase() throws Base; void unknownDerivedAsBase() throws Base; @@ -45,7 +45,7 @@ interface Test void unknownIntermediateAsBase() throws Base; void knownIntermediateAsBase() throws Base; void knownMostDerivedAsBase() throws Base; - void knownIntermediateAsknownIntermediate() throws KnownIntermediate; + void knownIntermediateAsKnownIntermediate() throws KnownIntermediate; void knownMostDerivedAsKnownIntermediate() throws KnownIntermediate; void knownMostDerivedAsKnownMostDerived() throws KnownMostDerived; diff --git a/java/test/Ice/slicing/exceptions/csrc/AllTests.java b/java/test/Ice/slicing/exceptions/csrc/AllTests.java index c35685e5a5e..db5758944cf 100644 --- a/java/test/Ice/slicing/exceptions/csrc/AllTests.java +++ b/java/test/Ice/slicing/exceptions/csrc/AllTests.java @@ -23,6 +23,610 @@ public class AllTests } } + private static class Callback + { + Callback() + { + _called = false; + } + + public synchronized boolean + check() + { + while(!_called) + { + try + { + wait(5000); + } + catch(InterruptedException ex) + { + continue; + } + + if(!_called) + { + return false; // Must be timeout. + } + } + + _called = false; + return true; + } + + public synchronized void + called() + { + assert(!_called); + _called = true; + notify(); + } + + private boolean _called; + } + + private static class AMI_Test_baseAsBaseI extends AMI_Test_baseAsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(Base b) + { + test(b.b.equals("Base.b")); + test(b.ice_name().equals("Base")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_unknownDerivedAsBaseI extends AMI_Test_unknownDerivedAsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(Base b) + { + test(b.b.equals("UnknownDerived.b")); + test(b.ice_name().equals("Base")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_knownDerivedAsBaseI extends AMI_Test_knownDerivedAsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownDerived k) + { + test(k.b.equals("KnownDerived.b")); + test(k.kd.equals("KnownDerived.kd")); + test(k.ice_name().equals("KnownDerived")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_knownDerivedAsKnownDerivedI extends AMI_Test_knownDerivedAsKnownDerived + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownDerived k) + { + test(k.b.equals("KnownDerived.b")); + test(k.kd.equals("KnownDerived.kd")); + test(k.ice_name().equals("KnownDerived")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_unknownIntermediateAsBaseI extends AMI_Test_unknownIntermediateAsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(Base b) + { + test(b.b.equals("UnknownIntermediate.b")); + test(b.ice_name().equals("Base")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_knownIntermediateAsBaseI extends AMI_Test_knownIntermediateAsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownIntermediate ki) + { + test(ki.b.equals("KnownIntermediate.b")); + test(ki.ki.equals("KnownIntermediate.ki")); + test(ki.ice_name().equals("KnownIntermediate")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_knownMostDerivedAsBaseI extends AMI_Test_knownMostDerivedAsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownMostDerived kmd) + { + test(kmd.b.equals("KnownMostDerived.b")); + test(kmd.ki.equals("KnownMostDerived.ki")); + test(kmd.kmd.equals("KnownMostDerived.kmd")); + test(kmd.ice_name().equals("KnownMostDerived")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_knownIntermediateAsKnownIntermediateI + extends AMI_Test_knownIntermediateAsKnownIntermediate + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownIntermediate ki) + { + test(ki.b.equals("KnownIntermediate.b")); + test(ki.ki.equals("KnownIntermediate.ki")); + test(ki.ice_name().equals("KnownIntermediate")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_knownMostDerivedAsKnownIntermediateI + extends AMI_Test_knownMostDerivedAsKnownIntermediate + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownMostDerived kmd) + { + test(kmd.b.equals("KnownMostDerived.b")); + test(kmd.ki.equals("KnownMostDerived.ki")); + test(kmd.kmd.equals("KnownMostDerived.kmd")); + test(kmd.ice_name().equals("KnownMostDerived")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_knownMostDerivedAsKnownMostDerivedI + extends AMI_Test_knownMostDerivedAsKnownMostDerived + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownMostDerived kmd) + { + test(kmd.b.equals("KnownMostDerived.b")); + test(kmd.ki.equals("KnownMostDerived.ki")); + test(kmd.kmd.equals("KnownMostDerived.kmd")); + test(kmd.ice_name().equals("KnownMostDerived")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_unknownMostDerived1AsBaseI extends AMI_Test_unknownMostDerived1AsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownIntermediate ki) + { + test(ki.b.equals("UnknownMostDerived1.b")); + test(ki.ki.equals("UnknownMostDerived1.ki")); + test(ki.ice_name().equals("KnownIntermediate")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_unknownMostDerived1AsKnownIntermediateI + extends AMI_Test_unknownMostDerived1AsKnownIntermediate + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(KnownIntermediate ki) + { + test(ki.b.equals("UnknownMostDerived1.b")); + test(ki.ki.equals("UnknownMostDerived1.ki")); + test(ki.ice_name().equals("KnownIntermediate")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + + private static class AMI_Test_unknownMostDerived2AsBaseI extends AMI_Test_unknownMostDerived2AsBase + { + public void + ice_response() + { + test(false); + } + + public void + ice_exception(Ice.LocalException exc) + { + test(false); + } + + public void + ice_exception(Ice.UserException exc) + { + try + { + throw exc; + } + catch(Base b) + { + test(b.b.equals("UnknownMostDerived2.b")); + test(b.ice_name().equals("Base")); + } + catch(Exception ex) + { + test(false); + } + callback.called(); + } + + public boolean + check() + { + return callback.check(); + } + + private Callback callback = new Callback(); + } + public static TestPrx allTests(Ice.Communicator communicator, boolean collocated) { @@ -40,7 +644,7 @@ public class AllTests test(test.equals(base)); System.out.println("ok"); - System.out.print("testing throwing a base exception... "); + System.out.print("base... "); System.out.flush(); { boolean gotException = false; @@ -62,7 +666,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing slicing of unknown derived exception... "); + System.out.print("base (AMI)... "); + System.out.flush(); + { + AMI_Test_baseAsBaseI cb = new AMI_Test_baseAsBaseI(); + test.baseAsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("slicing of unknown derived... "); System.out.flush(); { boolean gotException = false; @@ -84,7 +697,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing non-slicing of known derived exception thrown as base exception... "); + System.out.print("slicing of unknown derived (AMI)... "); + System.out.flush(); + { + AMI_Test_unknownDerivedAsBaseI cb = new AMI_Test_unknownDerivedAsBaseI(); + test.unknownDerivedAsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("non-slicing of known derived as base... "); System.out.flush(); { boolean gotException = false; @@ -107,7 +729,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing non-slicing of known derived exception thrown as derived exception... "); + System.out.print("non-slicing of known derived as base (AMI)... "); + System.out.flush(); + { + AMI_Test_knownDerivedAsBaseI cb = new AMI_Test_knownDerivedAsBaseI(); + test.knownDerivedAsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("non-slicing of known derived as derived... "); System.out.flush(); { boolean gotException = false; @@ -130,7 +761,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing slicing of unknown intermediate exception thrown as base exception... "); + System.out.print("non-slicing of known derived as derived (AMI)... "); + System.out.flush(); + { + AMI_Test_knownDerivedAsKnownDerivedI cb = new AMI_Test_knownDerivedAsKnownDerivedI(); + test.knownDerivedAsKnownDerived_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("slicing of unknown intermediate as base... "); System.out.flush(); { boolean gotException = false; @@ -152,7 +792,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing slicing of known intermediate exception thrown as base exception... "); + System.out.print("slicing of unknown intermediate as base (AMI)... "); + System.out.flush(); + { + AMI_Test_unknownIntermediateAsBaseI cb = new AMI_Test_unknownIntermediateAsBaseI(); + test.unknownIntermediateAsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("slicing of known intermediate as base... "); System.out.flush(); { boolean gotException = false; @@ -175,7 +824,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing slicing of known most derived exception thrown as base exception... "); + System.out.print("slicing of known intermediate as base (AMI)... "); + System.out.flush(); + { + AMI_Test_knownIntermediateAsBaseI cb = new AMI_Test_knownIntermediateAsBaseI(); + test.knownIntermediateAsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("slicing of known most derived as base... "); System.out.flush(); { boolean gotException = false; @@ -199,13 +857,22 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing non-slicing of known intermediate exception thrown as intermediate exception... "); + System.out.print("slicing of known most derived as base (AMI)... "); + System.out.flush(); + { + AMI_Test_knownMostDerivedAsBaseI cb = new AMI_Test_knownMostDerivedAsBaseI(); + test.knownMostDerivedAsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("non-slicing of known intermediate as intermediate... "); System.out.flush(); { boolean gotException = false; try { - test.knownIntermediateAsknownIntermediate(); + test.knownIntermediateAsKnownIntermediate(); } catch(KnownIntermediate ki) { @@ -222,7 +889,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing non-slicing of known most derived thrown as intermediate exception... "); + System.out.print("non-slicing of known intermediate as intermediate (AMI)... "); + System.out.flush(); + { + AMI_Test_knownIntermediateAsKnownIntermediateI cb = new AMI_Test_knownIntermediateAsKnownIntermediateI(); + test.knownIntermediateAsKnownIntermediate_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("non-slicing of known most derived as intermediate... "); System.out.flush(); { boolean gotException = false; @@ -246,7 +922,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing non-slicing of known most derived thrown as most derived exception... "); + System.out.print("non-slicing of known most derived as intermediate (AMI)... "); + System.out.flush(); + { + AMI_Test_knownMostDerivedAsKnownIntermediateI cb = new AMI_Test_knownMostDerivedAsKnownIntermediateI(); + test.knownMostDerivedAsKnownIntermediate_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("non-slicing of known most derived as most derived... "); System.out.flush(); { boolean gotException = false; @@ -270,7 +955,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing slicing of unknown most derived with known intermediate thrown as base exception... "); + System.out.print("non-slicing of known most derived as most derived (AMI)... "); + System.out.flush(); + { + AMI_Test_knownMostDerivedAsKnownMostDerivedI cb = new AMI_Test_knownMostDerivedAsKnownMostDerivedI(); + test.knownMostDerivedAsKnownMostDerived_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("slicing of unknown most derived, known intermediate as base... "); System.out.flush(); { boolean gotException = false; @@ -293,7 +987,16 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing slicing of unknown most derived with known intermediate thrown as intermediate exception... "); + System.out.print("slicing of unknown most derived, known intermediate as base (AMI)... "); + System.out.flush(); + { + AMI_Test_unknownMostDerived1AsBaseI cb = new AMI_Test_unknownMostDerived1AsBaseI(); + test.unknownMostDerived1AsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("slicing of unknown most derived, known intermediate as intermediate... "); System.out.flush(); { boolean gotException = false; @@ -316,7 +1019,17 @@ public class AllTests } System.out.println("ok"); - System.out.print("testing slicing of unknown most derived with unknown intermediate thrown as base exception... "); + System.out.print("slicing of unknown most derived, known intermediate as intermediate (AMI)... "); + System.out.flush(); + { + AMI_Test_unknownMostDerived1AsKnownIntermediateI cb = + new AMI_Test_unknownMostDerived1AsKnownIntermediateI(); + test.unknownMostDerived1AsKnownIntermediate_async(cb); + test(cb.check()); + } + System.out.println("ok"); + + System.out.print("slicing of unknown most derived, unknown intermediate thrown as base... "); System.out.flush(); { boolean gotException = false; @@ -338,6 +1051,15 @@ public class AllTests } System.out.println("ok"); + System.out.print("slicing of unknown most derived, unknown intermediate thrown as base (AMI)... "); + System.out.flush(); + { + AMI_Test_unknownMostDerived2AsBaseI cb = new AMI_Test_unknownMostDerived2AsBaseI(); + test.unknownMostDerived2AsBase_async(cb); + test(cb.check()); + } + System.out.println("ok"); + return test; } } diff --git a/java/test/Ice/slicing/exceptions/run.py b/java/test/Ice/slicing/exceptions/run.py index 94ace071e25..ed558bf0436 100755 --- a/java/test/Ice/slicing/exceptions/run.py +++ b/java/test/Ice/slicing/exceptions/run.py @@ -27,7 +27,31 @@ import TestUtil name = os.path.join("Ice", "slicing", "exceptions") testdir = os.path.join(toplevel, "test", name) +nameAMD = os.path.join("Ice", "slicing", "exceptionsAMD") +testdirAMD = os.path.join(toplevel, "test", nameAMD) +print "tests with regular server." TestUtil.clientServerTestWithClasspath(os.path.join(testdir, "sclasses"), os.path.join(testdir, "cclasses")) +print "tests with AMD server." +server = "java -ea Server --Ice.ProgramName=Server " +client = "java -ea Client --Ice.ProgramName=Client " +print "starting server...", +cp = os.getenv("CLASSPATH", "") +os.environ["CLASSPATH"] = os.path.join(testdirAMD, "classes") + TestUtil.sep + cp +serverPipe = os.popen(server + TestUtil.serverOptions) +TestUtil.getAdapterReady(serverPipe) +print "ok" +print "starting client...", +os.environ["CLASSPATH"] = cp +os.environ["CLASSPATH"] = os.path.join(testdir, "cclasses") + TestUtil.sep + cp +clientPipe = os.popen(client + TestUtil.clientOptions) +print "ok" +TestUtil.printOutputFromPipe(clientPipe) +clientStatus = clientPipe.close() +serverStatus = serverPipe.close() +if clientStatus or serverStatus: + TestUtil.killServers() + sys.exit(1) + sys.exit(0) diff --git a/java/test/Ice/slicing/exceptions/ssrc/TestI.java b/java/test/Ice/slicing/exceptions/ssrc/TestI.java index 86eb89f5885..975194642d3 100644 --- a/java/test/Ice/slicing/exceptions/ssrc/TestI.java +++ b/java/test/Ice/slicing/exceptions/ssrc/TestI.java @@ -97,7 +97,7 @@ public final class TestI extends _TestDisp } public void - knownIntermediateAsknownIntermediate(Ice.Current current) + knownIntermediateAsKnownIntermediate(Ice.Current current) throws KnownIntermediate { KnownIntermediate ki = new KnownIntermediate(); diff --git a/java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice b/java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice new file mode 100644 index 00000000000..074b2b474b8 --- /dev/null +++ b/java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice @@ -0,0 +1,40 @@ +// ********************************************************************** +// +// 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. +// +// ********************************************************************** + +#ifndef SERVERPRIVATE_AMD_ICE +#define SERVERPRIVATE_AMD_ICE + +#include <TestAMD.ice> + +exception UnknownDerived extends Base +{ + string ud; +}; + +exception UnknownIntermediate extends Base +{ + string ui; +}; + +exception UnknownMostDerived1 extends KnownIntermediate +{ + string umd1; +}; + +exception UnknownMostDerived2 extends UnknownIntermediate +{ + string umd2; +}; + +#endif diff --git a/java/test/Ice/slicing/exceptionsAMD/TestAMD.ice b/java/test/Ice/slicing/exceptionsAMD/TestAMD.ice new file mode 100644 index 00000000000..f8dec1fd04e --- /dev/null +++ b/java/test/Ice/slicing/exceptionsAMD/TestAMD.ice @@ -0,0 +1,59 @@ +// ********************************************************************** +// +// 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. +// +// ********************************************************************** + +#ifndef TEST_AMD_ICE +#define TEST_AMD_ICE + +exception Base +{ + string b; +}; + +exception KnownDerived extends Base +{ + string kd; +}; + +exception KnownIntermediate extends Base +{ + string ki; +}; + +exception KnownMostDerived extends KnownIntermediate +{ + string kmd; +}; + +["ami", "amd"] interface Test +{ + void baseAsBase() throws Base; + void unknownDerivedAsBase() throws Base; + void knownDerivedAsBase() throws Base; + void knownDerivedAsKnownDerived() throws KnownDerived; + + void unknownIntermediateAsBase() throws Base; + void knownIntermediateAsBase() throws Base; + void knownMostDerivedAsBase() throws Base; + void knownIntermediateAsKnownIntermediate() throws KnownIntermediate; + void knownMostDerivedAsKnownIntermediate() throws KnownIntermediate; + void knownMostDerivedAsKnownMostDerived() throws KnownMostDerived; + + void unknownMostDerived1AsBase() throws Base; + void unknownMostDerived1AsKnownIntermediate() throws KnownIntermediate; + void unknownMostDerived2AsBase() throws Base; + + void shutdown(); +}; + +#endif diff --git a/java/test/Ice/slicing/exceptionsAMD/TestI.java b/java/test/Ice/slicing/exceptionsAMD/TestI.java new file mode 100644 index 00000000000..35b4f6aae4d --- /dev/null +++ b/java/test/Ice/slicing/exceptionsAMD/TestI.java @@ -0,0 +1,166 @@ +// ********************************************************************** +// +// 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_async(AMD_Test_shutdown cb, Ice.Current current) + { + _adapter.getCommunicator().shutdown(); + cb.ice_response(); + } + + public void + baseAsBase_async(AMD_Test_baseAsBase cb, Ice.Current current) + throws Base + { + Base b = new Base(); + b.b = "Base.b"; + cb.ice_exception(b); + } + + public void + unknownDerivedAsBase_async(AMD_Test_unknownDerivedAsBase cb, Ice.Current current) + throws Base + { + UnknownDerived d = new UnknownDerived(); + d.b = "UnknownDerived.b"; + d.ud = "UnknownDerived.ud"; + cb.ice_exception(d); + } + + public void + knownDerivedAsBase_async(AMD_Test_knownDerivedAsBase cb, Ice.Current current) + throws Base + { + KnownDerived d = new KnownDerived(); + d.b = "KnownDerived.b"; + d.kd = "KnownDerived.kd"; + cb.ice_exception(d); + } + + public void + knownDerivedAsKnownDerived_async(AMD_Test_knownDerivedAsKnownDerived cb, Ice.Current current) + throws KnownDerived + { + KnownDerived d = new KnownDerived(); + d.b = "KnownDerived.b"; + d.kd = "KnownDerived.kd"; + cb.ice_exception(d); + } + + public void + unknownIntermediateAsBase_async(AMD_Test_unknownIntermediateAsBase cb, Ice.Current current) + throws Base + { + UnknownIntermediate ui = new UnknownIntermediate(); + ui.b = "UnknownIntermediate.b"; + ui.ui = "UnknownIntermediate.ui"; + cb.ice_exception(ui); + } + + public void + knownIntermediateAsBase_async(AMD_Test_knownIntermediateAsBase cb, Ice.Current current) + throws Base + { + KnownIntermediate ki = new KnownIntermediate(); + ki.b = "KnownIntermediate.b"; + ki.ki = "KnownIntermediate.ki"; + cb.ice_exception(ki); + } + + public void + knownMostDerivedAsBase_async(AMD_Test_knownMostDerivedAsBase cb, Ice.Current current) + throws Base + { + KnownMostDerived kmd = new KnownMostDerived(); + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + cb.ice_exception(kmd); + } + + public void + knownIntermediateAsKnownIntermediate_async(AMD_Test_knownIntermediateAsKnownIntermediate cb, Ice.Current current) + throws KnownIntermediate + { + KnownIntermediate ki = new KnownIntermediate(); + ki.b = "KnownIntermediate.b"; + ki.ki = "KnownIntermediate.ki"; + cb.ice_exception(ki); + } + + public void + knownMostDerivedAsKnownIntermediate_async(AMD_Test_knownMostDerivedAsKnownIntermediate cb, Ice.Current current) + throws KnownIntermediate + { + KnownMostDerived kmd = new KnownMostDerived(); + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + cb.ice_exception(kmd); + } + + public void + knownMostDerivedAsKnownMostDerived_async(AMD_Test_knownMostDerivedAsKnownMostDerived cb, Ice.Current current) + throws KnownMostDerived + { + KnownMostDerived kmd = new KnownMostDerived(); + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + cb.ice_exception(kmd); + } + + public void + unknownMostDerived1AsBase_async(AMD_Test_unknownMostDerived1AsBase cb, Ice.Current current) + throws Base + { + UnknownMostDerived1 umd1 = new UnknownMostDerived1(); + umd1.b = "UnknownMostDerived1.b"; + umd1.ki = "UnknownMostDerived1.ki"; + umd1.umd1 = "UnknownMostDerived1.umd1"; + cb.ice_exception(umd1); + } + + public void + unknownMostDerived1AsKnownIntermediate_async(AMD_Test_unknownMostDerived1AsKnownIntermediate cb, + Ice.Current current) + throws KnownIntermediate + { + UnknownMostDerived1 umd1 = new UnknownMostDerived1(); + umd1.b = "UnknownMostDerived1.b"; + umd1.ki = "UnknownMostDerived1.ki"; + umd1.umd1 = "UnknownMostDerived1.umd1"; + cb.ice_exception(umd1); + } + + public void + unknownMostDerived2AsBase_async(AMD_Test_unknownMostDerived2AsBase cb, Ice.Current current) + throws Base + { + UnknownMostDerived2 umd2 = new UnknownMostDerived2(); + umd2.b = "UnknownMostDerived2.b"; + umd2.ui = "UnknownMostDerived2.ui"; + umd2.umd2 = "UnknownMostDerived2.umd2"; + cb.ice_exception(umd2); + } + private Ice.ObjectAdapter _adapter; +} diff --git a/java/test/Ice/slicing/exceptionsAMD/build.xml b/java/test/Ice/slicing/exceptionsAMD/build.xml new file mode 100644 index 00000000000..e298857452a --- /dev/null +++ b/java/test/Ice/slicing/exceptionsAMD/build.xml @@ -0,0 +1,61 @@ +<!-- + +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. + +--> +<project name="test_Ice_slicing_exceptionsAMD" default="all" basedir="."> + + <!-- set global properties for this build --> + <property name="top.dir" value="../../../.."/> + <property name="lib.dir" value="${top.dir}/lib"/> + <property name="class.dir" value="classes"/> + <property name="generated.dir" value="generated"/> + + <!-- set common build properties for this build --> + <property file="${top.dir}/config/build.properties"/> + + <!-- install slice2java task --> + <taskdef name="slice2java" classpath="${top.dir}/ant" + classname="Slice2JavaTask" /> + + <target name="init"> + <!-- Create the time stamp --> + <tstamp/> + </target> + + <target name="generate" depends="init"> + <!-- Create the output directory for generated code --> + <mkdir dir="${generated.dir}"/> + <slice2java outputdir="${generated.dir}"> + <includepath> + <pathelement path="."/> + </includepath> + <fileset dir="." includes="TestAMD.ice"/> + <fileset dir="." includes="ServerPrivateAMD.ice"/> + </slice2java> + </target> + + <target name="compile" depends="generate"> + <mkdir dir="${class.dir}"/> + <javac srcdir="${generated.dir}" destdir="${class.dir}" + source="1.4" classpath="${lib.dir}" debug="${debug}"/> + <javac srcdir="." destdir="${class.dir}" source="1.4" + classpath="${lib.dir}" excludes="generated/**" debug="${debug}"/> + </target> + + <target name="all" depends="compile"/> + + <target name="clean"> + <delete dir="${generated.dir}"/> + <delete dir="${class.dir}"/> + </target> + +</project> |