summaryrefslogtreecommitdiff
path: root/java/test
diff options
context:
space:
mode:
Diffstat (limited to 'java/test')
-rw-r--r--java/test/Freeze/complex/Client.java350
-rw-r--r--java/test/Freeze/complex/Complex/AddNodeI.java6
-rw-r--r--java/test/Freeze/complex/Complex/MultiplyNodeI.java6
-rw-r--r--java/test/Freeze/complex/Complex/NumberNodeI.java4
-rw-r--r--java/test/Freeze/complex/Complex/ObjectFactoryI.java30
-rw-r--r--java/test/Freeze/complex/ParseError.java2
-rw-r--r--java/test/Freeze/complex/Parser.java242
-rw-r--r--java/test/Freeze/dbmap/Client.java1454
-rw-r--r--java/test/Freeze/evictor/Client.java1618
-rw-r--r--java/test/Freeze/evictor/FacetI.java22
-rw-r--r--java/test/Freeze/evictor/RemoteEvictorFactoryI.java8
-rw-r--r--java/test/Freeze/evictor/RemoteEvictorI.java108
-rw-r--r--java/test/Freeze/evictor/ServantI.java152
-rw-r--r--java/test/Freeze/evictor/Server.java16
-rw-r--r--java/test/Freeze/evictor/Test.ice2
-rw-r--r--java/test/Freeze/oldevictor/Client.java1618
-rw-r--r--java/test/Freeze/oldevictor/FacetI.java22
-rw-r--r--java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java8
-rw-r--r--java/test/Freeze/oldevictor/RemoteEvictorI.java108
-rw-r--r--java/test/Freeze/oldevictor/ServantI.java152
-rw-r--r--java/test/Freeze/oldevictor/Server.java16
-rw-r--r--java/test/Freeze/oldevictor/Test.ice2
-rw-r--r--java/test/Glacier2/attack/AttackClient.java206
-rw-r--r--java/test/Glacier2/attack/BackendServer.java4
-rw-r--r--java/test/Glacier2/attack/Client.java18
-rw-r--r--java/test/Glacier2/attack/Server.java2
-rwxr-xr-xjava/test/Glacier2/attack/run.py2
-rw-r--r--java/test/Glacier2/router/Callback.ice4
-rw-r--r--java/test/Glacier2/router/CallbackClient.java236
-rw-r--r--java/test/Glacier2/router/CallbackI.java4
-rw-r--r--java/test/Glacier2/router/CallbackServer.java18
-rw-r--r--java/test/Glacier2/router/Client.java22
-rw-r--r--java/test/Glacier2/router/Server.java2
-rw-r--r--java/test/Ice/adapterDeactivation/AllTests.java36
-rw-r--r--java/test/Ice/adapterDeactivation/ServantLocatorI.java24
-rw-r--r--java/test/Ice/adapterDeactivation/Server.java2
-rw-r--r--java/test/Ice/binding/AllTests.java1340
-rw-r--r--java/test/Ice/binding/Client.java4
-rw-r--r--java/test/Ice/binding/RemoteCommunicatorI.java12
-rw-r--r--java/test/Ice/binding/RemoteObjectAdapterI.java24
-rw-r--r--java/test/Ice/binding/TestI.java2
-rw-r--r--java/test/Ice/checksum/client/Client.java2
-rw-r--r--java/test/Ice/checksum/server/Server.java2
-rw-r--r--java/test/Ice/custom/Client.java2
-rw-r--r--java/test/Ice/custom/Server.java2
-rw-r--r--java/test/Ice/custom/jdk1.5/AllTests.java400
-rw-r--r--java/test/Ice/exceptions/AllTests.java2090
-rw-r--r--java/test/Ice/exceptions/Client.java10
-rw-r--r--java/test/Ice/exceptions/Server.java12
-rw-r--r--java/test/Ice/exceptionsAMD/Server.java14
-rw-r--r--java/test/Ice/exceptionsAMD/ThrowerI.java48
-rw-r--r--java/test/Ice/facets/AllTests.java86
-rw-r--r--java/test/Ice/facets/Client.java2
-rw-r--r--java/test/Ice/facets/Collocated.java4
-rw-r--r--java/test/Ice/facets/Server.java6
-rw-r--r--java/test/Ice/faultTolerance/AllTests.java524
-rw-r--r--java/test/Ice/faultTolerance/Client.java36
-rw-r--r--java/test/Ice/faultTolerance/Server.java18
-rw-r--r--java/test/Ice/faultTolerance/TestI.java6
-rw-r--r--java/test/Ice/hold/AllTests.java54
-rw-r--r--java/test/Ice/hold/Client.java2
-rw-r--r--java/test/Ice/hold/HoldI.java22
-rw-r--r--java/test/Ice/hold/Server.java2
-rw-r--r--java/test/Ice/inheritance/Client.java2
-rw-r--r--java/test/Ice/inheritance/Server.java2
-rw-r--r--java/test/Ice/location/AllTests.java576
-rw-r--r--java/test/Ice/location/Client.java8
-rw-r--r--java/test/Ice/location/Server.java62
-rw-r--r--java/test/Ice/location/ServerLocator.java22
-rw-r--r--java/test/Ice/location/ServerLocatorRegistry.java46
-rw-r--r--java/test/Ice/location/ServerManagerI.java82
-rw-r--r--java/test/Ice/location/TestI.java34
-rw-r--r--java/test/Ice/objects/AllTests.java52
-rw-r--r--java/test/Ice/objects/Client.java2
-rw-r--r--java/test/Ice/objects/Server.java2
-rw-r--r--java/test/Ice/objects/UnexpectedObjectExceptionTestI.java14
-rw-r--r--java/test/Ice/operations/AllTests.java214
-rw-r--r--java/test/Ice/operations/BatchOneways.java70
-rw-r--r--java/test/Ice/operations/Client.java42
-rw-r--r--java/test/Ice/operations/Collocated.java8
-rw-r--r--java/test/Ice/operations/MyDerivedClassI.java116
-rw-r--r--java/test/Ice/operations/Server.java10
-rw-r--r--java/test/Ice/operations/Test.ice44
-rw-r--r--java/test/Ice/operations/Twoways.java416
-rw-r--r--java/test/Ice/operations/TwowaysAMI.java2600
-rw-r--r--java/test/Ice/operationsAMD/MyDerivedClassI.java234
-rw-r--r--java/test/Ice/operationsAMD/Server.java10
-rw-r--r--java/test/Ice/operationsAMD/TestAMD.ice44
-rw-r--r--java/test/Ice/package/Client.java2
-rw-r--r--java/test/Ice/package/Server.java2
-rw-r--r--java/test/Ice/retry/AllTests.java82
-rw-r--r--java/test/Ice/retry/Client.java26
-rw-r--r--java/test/Ice/retry/RetryI.java6
-rw-r--r--java/test/Ice/retry/Server.java20
-rw-r--r--java/test/Ice/servantLocator/AllTests.java276
-rw-r--r--java/test/Ice/servantLocator/Client.java2
-rw-r--r--java/test/Ice/servantLocator/Collocated.java4
-rw-r--r--java/test/Ice/servantLocator/ServantLocatorI.java128
-rw-r--r--java/test/Ice/servantLocator/Server.java6
-rw-r--r--java/test/Ice/servantLocatorAMD/ServantLocatorI.java128
-rw-r--r--java/test/Ice/servantLocatorAMD/Server.java6
-rw-r--r--java/test/Ice/servantLocatorAMD/TestI.java14
-rw-r--r--java/test/Ice/slicing/exceptions/csrc/AllTests.java1844
-rw-r--r--java/test/Ice/slicing/exceptions/csrc/Client.java2
-rw-r--r--java/test/Ice/slicing/exceptions/ssrc/Server.java2
-rw-r--r--java/test/Ice/slicing/exceptions/ssrc/TestI.java112
-rw-r--r--java/test/Ice/slicing/exceptionsAMD/Server.java2
-rw-r--r--java/test/Ice/slicing/exceptionsAMD/TestI.java120
-rw-r--r--java/test/Ice/slicing/objects/Test.ice4
-rw-r--r--java/test/Ice/slicing/objects/csrc/AllTests.java4296
-rw-r--r--java/test/Ice/slicing/objects/csrc/Client.java2
-rw-r--r--java/test/Ice/slicing/objects/ssrc/Server.java2
-rw-r--r--java/test/Ice/slicing/objects/ssrc/TestI.java390
-rw-r--r--java/test/Ice/slicing/objectsAMD/Server.java2
-rw-r--r--java/test/Ice/slicing/objectsAMD/TestAMD.ice4
-rw-r--r--java/test/Ice/slicing/objectsAMD/TestI.java438
-rw-r--r--java/test/Ice/stream/Client.java52
-rw-r--r--java/test/Ice/timeout/AllTests.java768
-rw-r--r--java/test/Ice/timeout/Client.java88
-rw-r--r--java/test/Ice/timeout/Server.java96
-rw-r--r--java/test/Ice/timeout/TimeoutI.java62
-rw-r--r--java/test/Ice/translator/Metadata.ice22
-rw-r--r--java/test/Ice/translator/Metadata2.ice22
-rw-r--r--java/test/IceGrid/simple/AllTests.java418
-rw-r--r--java/test/IceGrid/simple/Client.java40
-rw-r--r--java/test/IceGrid/simple/Server.java30
-rwxr-xr-xjava/test/IceGrid/simple/run.py2
-rwxr-xr-xjava/test/IceSSL/certs/makecerts.py42
-rw-r--r--java/test/IceSSL/configuration/AllTests.java2580
-rw-r--r--java/test/IceSSL/configuration/Client.java92
-rw-r--r--java/test/IceSSL/configuration/Server.java70
-rw-r--r--java/test/IceSSL/configuration/ServerFactoryI.java56
-rw-r--r--java/test/IceSSL/configuration/ServerI.java72
-rw-r--r--java/test/IceUtil/inputUtil/Client.java148
134 files changed, 14273 insertions, 14273 deletions
diff --git a/java/test/Freeze/complex/Client.java b/java/test/Freeze/complex/Client.java
index 5ab5e5ff25a..e4257f9bee9 100644
--- a/java/test/Freeze/complex/Client.java
+++ b/java/test/Freeze/complex/Client.java
@@ -24,215 +24,215 @@ public class Client
private int
validate(String dbName)
- throws DatabaseException
+ throws DatabaseException
{
- Complex.ComplexDict m = new Complex.ComplexDict(_connection, dbName, true);
-
- try
- {
- Parser parser = new Parser();
-
- System.out.print("testing database expressions... ");
- java.util.Iterator p = m.entrySet().iterator();
- while(p.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)p.next();
-
- Complex.Key key = (Complex.Key)e.getKey();
-
- //
- // Verify the stored record is correct.
- //
- test(key.result == ((Complex.Node)e.getValue()).calc());
-
- //
- // Verify that the expression & result again.
- //
- Complex.Node root = parser.parse(key.expression);
- test(root.calc(null) == key.result);
- }
- System.out.println("ok");
- }
- catch(ParseError e)
- {
- e.printStackTrace();
- test(false);
- }
-
- m.close();
-
- return 0;
+ Complex.ComplexDict m = new Complex.ComplexDict(_connection, dbName, true);
+
+ try
+ {
+ Parser parser = new Parser();
+
+ System.out.print("testing database expressions... ");
+ java.util.Iterator p = m.entrySet().iterator();
+ while(p.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)p.next();
+
+ Complex.Key key = (Complex.Key)e.getKey();
+
+ //
+ // Verify the stored record is correct.
+ //
+ test(key.result == ((Complex.Node)e.getValue()).calc());
+
+ //
+ // Verify that the expression & result again.
+ //
+ Complex.Node root = parser.parse(key.expression);
+ test(root.calc(null) == key.result);
+ }
+ System.out.println("ok");
+ }
+ catch(ParseError e)
+ {
+ e.printStackTrace();
+ test(false);
+ }
+
+ m.close();
+
+ return 0;
}
private int
populate(String dbName)
- throws DatabaseException
+ throws DatabaseException
{
- String[] expressions =
- {
- "2",
- "10",
- "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);
-
- try
- {
- Parser parser = new Parser();
-
- System.out.print("populating the database... ");
- for(int i = 0 ; i < expressions.length; ++i)
- {
- Complex.Node root = parser.parse(expressions[i]);
- assert(root != null);
- Complex.Key k = new Complex.Key();
- k.expression = expressions[i];
- k.result = root.calc(null);
- m.put(k, root);
- }
- System.out.println("ok");
- }
- catch(ParseError e)
- {
- e.printStackTrace();
- test(false);
- }
-
- m.close();
- return 0;
+ String[] expressions =
+ {
+ "2",
+ "10",
+ "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);
+
+ try
+ {
+ Parser parser = new Parser();
+
+ System.out.print("populating the database... ");
+ for(int i = 0 ; i < expressions.length; ++i)
+ {
+ Complex.Node root = parser.parse(expressions[i]);
+ assert(root != null);
+ Complex.Key k = new Complex.Key();
+ k.expression = expressions[i];
+ k.result = root.calc(null);
+ m.put(k, root);
+ }
+ System.out.println("ok");
+ }
+ catch(ParseError e)
+ {
+ e.printStackTrace();
+ test(false);
+ }
+
+ m.close();
+ return 0;
}
static void
usage(String name)
{
- System.out.println("Usage: " + name + " [options] validate|populate");
- System.out.println("Options:");
- System.out.println("--dbdir Location of the database directory.");
+ System.out.println("Usage: " + name + " [options] validate|populate");
+ System.out.println("Options:");
+ System.out.println("--dbdir Location of the database directory.");
}
private int
run(String[] args, String dbName)
- throws DatabaseException
+ throws DatabaseException
{
- //
- // Register a factory for the node types.
- //
- Ice.ObjectFactory factory = new Complex.ObjectFactoryI();
- _communicator.addObjectFactory(factory, "::Complex::NumberNode");
- _communicator.addObjectFactory(factory, "::Complex::AddNode");
- _communicator.addObjectFactory(factory, "::Complex::MultiplyNode");
-
- if(args.length != 0 && args[0].equals("populate"))
- {
- return populate(dbName);
- }
- if(args.length != 0 && args[0].equals("validate"))
- {
- return validate(dbName);
- }
- usage(progName);
-
+ //
+ // Register a factory for the node types.
+ //
+ Ice.ObjectFactory factory = new Complex.ObjectFactoryI();
+ _communicator.addObjectFactory(factory, "::Complex::NumberNode");
+ _communicator.addObjectFactory(factory, "::Complex::AddNode");
+ _communicator.addObjectFactory(factory, "::Complex::MultiplyNode");
+
+ if(args.length != 0 && args[0].equals("populate"))
+ {
+ return populate(dbName);
+ }
+ if(args.length != 0 && args[0].equals("validate"))
+ {
+ return validate(dbName);
+ }
+ usage(progName);
+
return 0;
}
private void
close()
{
- _connection.close();
+ _connection.close();
}
private
Client(Ice.Communicator communicator, String envName)
{
- _communicator = communicator;
- _connection = Freeze.Util.createConnection(communicator, envName);
+ _communicator = communicator;
+ _connection = Freeze.Util.createConnection(communicator, envName);
}
static public void
main(String[] args)
{
- int status;
- Ice.Communicator communicator = null;
- String envName = "db";
-
- try
- {
- //
- // Scan for --dbdir command line argument.
- //
- int i = 0;
- while(i < args.length)
- {
- if(args[i].equals("--dbdir"))
- {
- if(i +1 >= args.length)
- {
- usage(progName);
- System.exit(1);
- }
-
- envName = args[i+1];
- envName += "/";
- envName += "db";
-
- //
- // Consume arguments
- //
- String[] arr = new String[args.length - 2];
- System.arraycopy(args, 0, arr, 0, i);
- if(i < args.length - 2)
- {
- System.arraycopy(args, i + 2, arr, i, args.length - i - 2);
- }
- args = arr;
- }
- else
- {
- ++i;
- }
- }
-
- Ice.StringSeqHolder holder = new Ice.StringSeqHolder();
- holder.value = args;
- communicator = Ice.Util.initialize(holder);
- args = holder.value;
- Client client = new Client(communicator, envName);
- try
- {
- status = client.run(args, "test");
- }
- finally
- {
- client.close();
- }
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- System.err.println(ex);
- status = 1;
- }
-
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Exception ex)
- {
- System.err.println(ex);
- status = 1;
- }
- }
-
- System.gc();
- System.exit(status);
+ int status;
+ Ice.Communicator communicator = null;
+ String envName = "db";
+
+ try
+ {
+ //
+ // Scan for --dbdir command line argument.
+ //
+ int i = 0;
+ while(i < args.length)
+ {
+ if(args[i].equals("--dbdir"))
+ {
+ if(i +1 >= args.length)
+ {
+ usage(progName);
+ System.exit(1);
+ }
+
+ envName = args[i+1];
+ envName += "/";
+ envName += "db";
+
+ //
+ // Consume arguments
+ //
+ String[] arr = new String[args.length - 2];
+ System.arraycopy(args, 0, arr, 0, i);
+ if(i < args.length - 2)
+ {
+ System.arraycopy(args, i + 2, arr, i, args.length - i - 2);
+ }
+ args = arr;
+ }
+ else
+ {
+ ++i;
+ }
+ }
+
+ Ice.StringSeqHolder holder = new Ice.StringSeqHolder();
+ holder.value = args;
+ communicator = Ice.Util.initialize(holder);
+ args = holder.value;
+ Client client = new Client(communicator, envName);
+ try
+ {
+ status = client.run(args, "test");
+ }
+ finally
+ {
+ client.close();
+ }
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ System.err.println(ex);
+ status = 1;
+ }
+
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Exception ex)
+ {
+ System.err.println(ex);
+ status = 1;
+ }
+ }
+
+ System.gc();
+ System.exit(status);
}
private Ice.Communicator _communicator;
diff --git a/java/test/Freeze/complex/Complex/AddNodeI.java b/java/test/Freeze/complex/Complex/AddNodeI.java
index 80f58f00fd5..0345fe740b4 100644
--- a/java/test/Freeze/complex/Complex/AddNodeI.java
+++ b/java/test/Freeze/complex/Complex/AddNodeI.java
@@ -19,13 +19,13 @@ public class AddNodeI extends AddNode
public
AddNodeI(Node left, Node right)
{
- this.left = left;
- this.right = right;
+ this.left = left;
+ this.right = right;
}
public int
calc(Ice.Current current)
{
- return left.calc(current) + right.calc(current);
+ return left.calc(current) + right.calc(current);
}
}
diff --git a/java/test/Freeze/complex/Complex/MultiplyNodeI.java b/java/test/Freeze/complex/Complex/MultiplyNodeI.java
index a69d45a6ae4..2f5ea93a466 100644
--- a/java/test/Freeze/complex/Complex/MultiplyNodeI.java
+++ b/java/test/Freeze/complex/Complex/MultiplyNodeI.java
@@ -19,13 +19,13 @@ public class MultiplyNodeI extends MultiplyNode
public
MultiplyNodeI(Node left, Node right)
{
- this.left = left;
- this.right = right;
+ this.left = left;
+ this.right = right;
}
public int
calc(Ice.Current current)
{
- return left.calc(current) * right.calc(current);
+ return left.calc(current) * right.calc(current);
}
}
diff --git a/java/test/Freeze/complex/Complex/NumberNodeI.java b/java/test/Freeze/complex/Complex/NumberNodeI.java
index 1b0ffd6cd97..4faec76deef 100644
--- a/java/test/Freeze/complex/Complex/NumberNodeI.java
+++ b/java/test/Freeze/complex/Complex/NumberNodeI.java
@@ -19,12 +19,12 @@ public class NumberNodeI extends NumberNode
public
NumberNodeI(int number)
{
- this.number = number;
+ this.number = number;
}
public int
calc(Ice.Current current)
{
- return number;
+ return number;
}
}
diff --git a/java/test/Freeze/complex/Complex/ObjectFactoryI.java b/java/test/Freeze/complex/Complex/ObjectFactoryI.java
index 1684152ee73..32fe08f7c9b 100644
--- a/java/test/Freeze/complex/Complex/ObjectFactoryI.java
+++ b/java/test/Freeze/complex/Complex/ObjectFactoryI.java
@@ -14,27 +14,27 @@ public class ObjectFactoryI extends Ice.LocalObjectImpl implements Ice.ObjectFac
public Ice.Object
create(String type)
{
- if(type.equals("::Complex::MultiplyNode"))
- {
- return new MultiplyNodeI();
- }
- if(type.equals("::Complex::AddNode"))
- {
- return new AddNodeI();
- }
+ if(type.equals("::Complex::MultiplyNode"))
+ {
+ return new MultiplyNodeI();
+ }
+ if(type.equals("::Complex::AddNode"))
+ {
+ return new AddNodeI();
+ }
if(type.equals("::Complex::NumberNode"))
- {
- return new NumberNodeI();
- }
+ {
+ return new NumberNodeI();
+ }
- System.err.println( "create: " + type);
- assert(false);
- return null;
+ System.err.println( "create: " + type);
+ assert(false);
+ return null;
}
public void
destroy()
{
- // Nothing to do
+ // Nothing to do
}
}
diff --git a/java/test/Freeze/complex/ParseError.java b/java/test/Freeze/complex/ParseError.java
index 2be50466196..6cd2757f16d 100644
--- a/java/test/Freeze/complex/ParseError.java
+++ b/java/test/Freeze/complex/ParseError.java
@@ -11,6 +11,6 @@ public class ParseError extends Exception
{
public ParseError(String msg)
{
- super(msg);
+ super(msg);
}
}
diff --git a/java/test/Freeze/complex/Parser.java b/java/test/Freeze/complex/Parser.java
index 2fed6eed723..99a1865574d 100644
--- a/java/test/Freeze/complex/Parser.java
+++ b/java/test/Freeze/complex/Parser.java
@@ -11,150 +11,150 @@ public class Parser
{
public Complex.Node
parse(String buf)
- throws ParseError
+ throws ParseError
{
- _buf = buf;
- _pos = 0;
- _token = null;
+ _buf = buf;
+ _pos = 0;
+ _token = null;
- return start();
+ return start();
}
private Complex.Node
start()
- throws ParseError
+ throws ParseError
{
- nextToken();
- Complex.Node node = expr();
- if(_token != null)
- {
- throw new ParseError("Extra garbage: " + _token);
- }
- return node;
+ nextToken();
+ Complex.Node node = expr();
+ if(_token != null)
+ {
+ throw new ParseError("Extra garbage: " + _token);
+ }
+ return node;
}
private Complex.Node
expr()
- throws ParseError
+ throws ParseError
{
- try
- {
- if(_token == null)
- {
- return null;
- }
+ try
+ {
+ if(_token == null)
+ {
+ return null;
+ }
- //
- // '(' expr ')'
- //
- if(_token.charAt(0) == '(')
- {
- nextToken();
+ //
+ // '(' expr ')'
+ //
+ if(_token.charAt(0) == '(')
+ {
+ nextToken();
- Complex.Node node = expr();
- if(_token.charAt(0) != ')')
- {
- throw new ParseError("Expected ')'");
- }
+ Complex.Node node = expr();
+ if(_token.charAt(0) != ')')
+ {
+ throw new ParseError("Expected ')'");
+ }
- nextToken();
- return node;
- }
+ nextToken();
+ return node;
+ }
- //
- // expr | expr '+' expr | expr '*' expr
- //
- if(!Character.isDigit(_token.charAt(0)))
- {
- throw new ParseError("Expected number");
- }
-
- Complex.NumberNode number = new Complex.NumberNodeI(Integer.parseInt(_token));
- Complex.Node result = number;
-
- //
- // expr?
- //
- nextToken();
- if(_token != null)
- {
- //
- // expr '+' expr
- //
- if(_token.charAt(0) == '+')
- {
- nextToken();
- Complex.Node right = expr();
- result = new Complex.AddNodeI(number, right);
- }
-
- //
- // expr '*' expr
- //
- else if(_token.charAt(0) == '*')
- {
- nextToken();
- Complex.Node right = expr();
- result = new Complex.MultiplyNodeI(number, right);
- }
- }
- return result;
- }
- catch(NumberFormatException e)
- {
- ParseError ex = new ParseError("Error parsing number");
- ex.initCause(e);
- throw ex;
- }
+ //
+ // expr | expr '+' expr | expr '*' expr
+ //
+ if(!Character.isDigit(_token.charAt(0)))
+ {
+ throw new ParseError("Expected number");
+ }
+
+ Complex.NumberNode number = new Complex.NumberNodeI(Integer.parseInt(_token));
+ Complex.Node result = number;
+
+ //
+ // expr?
+ //
+ nextToken();
+ if(_token != null)
+ {
+ //
+ // expr '+' expr
+ //
+ if(_token.charAt(0) == '+')
+ {
+ nextToken();
+ Complex.Node right = expr();
+ result = new Complex.AddNodeI(number, right);
+ }
+
+ //
+ // expr '*' expr
+ //
+ else if(_token.charAt(0) == '*')
+ {
+ nextToken();
+ Complex.Node right = expr();
+ result = new Complex.MultiplyNodeI(number, right);
+ }
+ }
+ return result;
+ }
+ catch(NumberFormatException e)
+ {
+ ParseError ex = new ParseError("Error parsing number");
+ ex.initCause(e);
+ throw ex;
+ }
}
private void
nextToken()
{
- //
- // Eat any whitespace.
- //
- while(_pos < _buf.length() && Character.isWhitespace(_buf.charAt(_pos)))
- {
- _pos++;
- }
+ //
+ // Eat any whitespace.
+ //
+ while(_pos < _buf.length() && Character.isWhitespace(_buf.charAt(_pos)))
+ {
+ _pos++;
+ }
- //
- // At the end-of-buffer?
- //
- if(_pos >= _buf.length())
- {
- _token = null;
- return;
- }
+ //
+ // At the end-of-buffer?
+ //
+ if(_pos >= _buf.length())
+ {
+ _token = null;
+ return;
+ }
- StringBuffer buf = new StringBuffer();
-
- //
- // Get the next character
- //
- char c = _buf.charAt(_pos);
-
- //
- // '(', ')', '+' and '*' are tokens.
- //
- if(c == '(' || c == ')' || c == '+' || c == '*')
- {
- buf.append(c);
- ++_pos;
- }
- else
- {
- //
- // Otherwise it's a number.
- //
- while(_pos < _buf.length() && Character.isDigit(_buf.charAt(_pos)))
- {
- buf.append(_buf.charAt(_pos++));
- }
- }
-
- _token = buf.toString();
+ StringBuffer buf = new StringBuffer();
+
+ //
+ // Get the next character
+ //
+ char c = _buf.charAt(_pos);
+
+ //
+ // '(', ')', '+' and '*' are tokens.
+ //
+ if(c == '(' || c == ')' || c == '+' || c == '*')
+ {
+ buf.append(c);
+ ++_pos;
+ }
+ else
+ {
+ //
+ // Otherwise it's a number.
+ //
+ while(_pos < _buf.length() && Character.isDigit(_buf.charAt(_pos)))
+ {
+ buf.append(_buf.charAt(_pos++));
+ }
+ }
+
+ _token = buf.toString();
}
private String _buf;
diff --git a/java/test/Freeze/dbmap/Client.java b/java/test/Freeze/dbmap/Client.java
index 9393d877b65..e68989b526c 100644
--- a/java/test/Freeze/dbmap/Client.java
+++ b/java/test/Freeze/dbmap/Client.java
@@ -18,62 +18,62 @@ public class Client
{
try
{
- for(int i = 0; i < 10; ++i)
- {
- for(;;)
- {
- java.util.Iterator p = null;
-
- try
- {
- java.util.Set entrySet = _map.entrySet();
- p = entrySet.iterator();
-
- while(p.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)p.next();
- byte v = ((Byte)e.getKey()).byteValue();
- test(e.getValue().equals(new Integer(v - (byte)'a')));
- }
- break;
- }
- catch(DeadlockException ex)
- {
- // System.err.print("r");
- //
- // Try again
- //
- }
- finally
- {
- if(p != null)
- {
- ((Freeze.Map.EntryIterator)p).close();
- }
- }
- }
- }
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- System.err.println(ex);
- }
- finally
- {
- ((Freeze.Map) _map).close();
- _connection.close();
- }
- }
-
- ReadThread(Ice.Communicator communicator, String envName, String dbName)
+ for(int i = 0; i < 10; ++i)
+ {
+ for(;;)
+ {
+ java.util.Iterator p = null;
+
+ try
+ {
+ java.util.Set entrySet = _map.entrySet();
+ p = entrySet.iterator();
+
+ while(p.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)p.next();
+ byte v = ((Byte)e.getKey()).byteValue();
+ test(e.getValue().equals(new Integer(v - (byte)'a')));
+ }
+ break;
+ }
+ catch(DeadlockException ex)
+ {
+ // System.err.print("r");
+ //
+ // Try again
+ //
+ }
+ finally
+ {
+ if(p != null)
+ {
+ ((Freeze.Map.EntryIterator)p).close();
+ }
+ }
+ }
+ }
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ System.err.println(ex);
+ }
+ finally
+ {
+ ((Freeze.Map) _map).close();
+ _connection.close();
+ }
+ }
+
+ ReadThread(Ice.Communicator communicator, String envName, String dbName)
{
- _connection = Freeze.Util.createConnection(communicator, envName);
- _map = new ByteIntMap(_connection, dbName, true);
- }
+ _connection = Freeze.Util.createConnection(communicator, envName);
+ _map = new ByteIntMap(_connection, dbName, true);
+ }
- private Freeze.Connection _connection;
- private java.util.Map _map;
+ private Freeze.Connection _connection;
+ private java.util.Map _map;
}
@@ -84,65 +84,65 @@ public class Client
{
try
{
- for(int i = 0; i < 4; ++i)
- {
- for(;;)
- {
- java.util.Iterator p = null;
-
- try
- {
- java.util.Set entrySet = _map.entrySet();
- p = entrySet.iterator();
-
- while(p.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)p.next();
- int v = ((Integer)e.getValue()).intValue() + 1;
- e.setValue(new Integer(v));
- p.remove();
- }
-
- break;
- }
- catch(DeadlockException ex)
- {
- // System.err.print("w");
- //
- // Try again
- //
- }
- finally
- {
- if(p != null)
- {
- ((Freeze.Map.EntryIterator)p).close();
- }
- }
- }
- populateDB(_connection, _map);
- }
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- System.err.println(ex);
- }
- finally
- {
- ((Freeze.Map)_map).close();
- _connection.close();
- }
- }
-
- WriteThread(Ice.Communicator communicator, String envName, String dbName)
+ for(int i = 0; i < 4; ++i)
+ {
+ for(;;)
+ {
+ java.util.Iterator p = null;
+
+ try
+ {
+ java.util.Set entrySet = _map.entrySet();
+ p = entrySet.iterator();
+
+ while(p.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)p.next();
+ int v = ((Integer)e.getValue()).intValue() + 1;
+ e.setValue(new Integer(v));
+ p.remove();
+ }
+
+ break;
+ }
+ catch(DeadlockException ex)
+ {
+ // System.err.print("w");
+ //
+ // Try again
+ //
+ }
+ finally
+ {
+ if(p != null)
+ {
+ ((Freeze.Map.EntryIterator)p).close();
+ }
+ }
+ }
+ populateDB(_connection, _map);
+ }
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ System.err.println(ex);
+ }
+ finally
+ {
+ ((Freeze.Map)_map).close();
+ _connection.close();
+ }
+ }
+
+ WriteThread(Ice.Communicator communicator, String envName, String dbName)
{
- _connection = Freeze.Util.createConnection(communicator, envName);
- _map = new ByteIntMap(_connection, dbName, true);
- }
+ _connection = Freeze.Util.createConnection(communicator, envName);
+ _map = new ByteIntMap(_connection, dbName, true);
+ }
- private Freeze.Connection _connection;
- private java.util.Map _map;
+ private Freeze.Connection _connection;
+ private java.util.Map _map;
}
@@ -159,218 +159,218 @@ public class Client
private static void
populateDB(Freeze.Connection connection, java.util.Map m)
- throws DatabaseException
+ throws DatabaseException
{
- int length = alphabet.length();
-
- for(;;)
- {
-
- try
- {
- Transaction tx = connection.beginTransaction();
- for(int j = 0; j < length; ++j)
- {
- m.put(new Byte((byte)alphabet.charAt(j)), new Integer(j));
- }
- tx.commit();
- break; // for(;;)
- }
- catch(Freeze.DeadlockException dx)
- {
- length = length / 2;
- // System.err.print("t");
- //
- // Try again
- //
- }
- finally
- {
- if(connection.currentTransaction() != null)
- {
- connection.currentTransaction().rollback();
- }
- }
- }
+ int length = alphabet.length();
+
+ for(;;)
+ {
+
+ try
+ {
+ Transaction tx = connection.beginTransaction();
+ for(int j = 0; j < length; ++j)
+ {
+ m.put(new Byte((byte)alphabet.charAt(j)), new Integer(j));
+ }
+ tx.commit();
+ break; // for(;;)
+ }
+ catch(Freeze.DeadlockException dx)
+ {
+ length = length / 2;
+ // System.err.print("t");
+ //
+ // Try again
+ //
+ }
+ finally
+ {
+ if(connection.currentTransaction() != null)
+ {
+ connection.currentTransaction().rollback();
+ }
+ }
+ }
}
private static int
run(String[] args, Ice.Communicator communicator, String envName, String dbName)
- throws DatabaseException
+ throws DatabaseException
{
- Freeze.Connection connection = Freeze.Util.createConnection(communicator, envName);
+ Freeze.Connection connection = Freeze.Util.createConnection(communicator, envName);
- java.util.Map m = new ByteIntMap(connection, dbName, true);
+ java.util.Map m = new ByteIntMap(connection, dbName, true);
- //
- // Populate the database with the alphabet.
- //
- populateDB(connection, m);
+ //
+ // Populate the database with the alphabet.
+ //
+ populateDB(connection, m);
- int j;
+ int j;
- System.out.print("testing populate... ");
+ System.out.print("testing populate... ");
System.out.flush();
- for(j = 0; j < alphabet.length(); ++j)
- {
- Object value = m.get(new Byte((byte)alphabet.charAt(j)));
- test(value != null);
- }
- test(m.get(new Byte((byte)'0')) == null);
- for(j = 0; j < alphabet.length(); ++j)
- {
- test(m.containsKey(new Byte((byte)alphabet.charAt(j))));
- }
- test(!m.containsKey(new Byte((byte)'0')));
- for(j = 0; j < alphabet.length(); ++j)
- {
- test(m.containsValue(new Integer(j)));
- }
- test(!m.containsValue(new Integer(-1)));
- test(m.size() == alphabet.length());
- test(!m.isEmpty());
- System.out.println("ok");
-
- System.out.print("testing erase... ");
+ for(j = 0; j < alphabet.length(); ++j)
+ {
+ Object value = m.get(new Byte((byte)alphabet.charAt(j)));
+ test(value != null);
+ }
+ test(m.get(new Byte((byte)'0')) == null);
+ for(j = 0; j < alphabet.length(); ++j)
+ {
+ test(m.containsKey(new Byte((byte)alphabet.charAt(j))));
+ }
+ test(!m.containsKey(new Byte((byte)'0')));
+ for(j = 0; j < alphabet.length(); ++j)
+ {
+ test(m.containsValue(new Integer(j)));
+ }
+ test(!m.containsValue(new Integer(-1)));
+ test(m.size() == alphabet.length());
+ test(!m.isEmpty());
+ System.out.println("ok");
+
+ System.out.print("testing erase... ");
System.out.flush();
- m.remove(new Byte((byte)'a'));
- m.remove(new Byte((byte)'b'));
- m.remove(new Byte((byte)'c'));
- for(j = 3; j < alphabet.length(); ++j)
- {
- Object value = m.get(new Byte((byte)alphabet.charAt(j)));
- test(value != null);
- }
- test(m.get(new Byte((byte)'a')) == null);
- test(m.get(new Byte((byte)'b')) == null);
- test(m.get(new Byte((byte)'c')) == null);
- System.out.println("ok");
-
- //
- // Re-populate.
- //
- populateDB(connection, m);
-
- {
- System.out.print("testing keySet... ");
- System.out.flush();
- java.util.Set keys = m.keySet();
- test(keys.size() == alphabet.length());
- test(!keys.isEmpty());
- java.util.Iterator p = keys.iterator();
- while(p.hasNext())
- {
- Object o = p.next();
- test(keys.contains(o));
-
- Byte b = (Byte)o;
- test(m.containsKey(b));
- }
- System.out.println("ok");
- }
-
- {
- System.out.print("testing values... ");
- System.out.flush();
- java.util.Collection values = m.values();
- test(values.size() == alphabet.length());
- test(!values.isEmpty());
- java.util.Iterator p = values.iterator();
- while(p.hasNext())
- {
- Object o = p.next();
- test(values.contains(o));
-
- Integer i = (Integer)o;
- test(m.containsValue(i));
- }
- System.out.println("ok");
- }
-
- {
- System.out.print("testing entrySet... ");
- System.out.flush();
- java.util.Set entrySet = m.entrySet();
- test(entrySet.size() == alphabet.length());
- test(!entrySet.isEmpty());
- java.util.Iterator p = entrySet.iterator();
- while(p.hasNext())
- {
- Object o = p.next();
- test(entrySet.contains(o));
-
- java.util.Map.Entry e = (java.util.Map.Entry)o;
- test(m.containsKey(e.getKey()));
- test(m.containsValue(e.getValue()));
- }
- System.out.println("ok");
- }
-
- {
- System.out.print("testing iterator.remove... ");
- System.out.flush();
-
- test(m.size() == 26);
- test(m.get(new Byte((byte)'b')) != null);
- test(m.get(new Byte((byte)'n')) != null);
- test(m.get(new Byte((byte)'z')) != null);
-
- ((Freeze.Map) m).closeAllIterators();
-
- java.util.Set entrySet = m.entrySet();
- java.util.Iterator p = entrySet.iterator();
-
- while(p.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)p.next();
- Byte b = (Byte)e.getKey();
- byte v = b.byteValue();
- if(v == (byte)'b' || v == (byte)'n' || v == (byte)'z')
- {
- p.remove();
- try
- {
- p.remove();
- }
- catch(IllegalStateException ex)
- {
- // Expected.
- }
- }
- }
- ((Freeze.Map) m).closeAllIterators();
-
- test(m.size() == 23);
- test(m.get(new Byte((byte)'b')) == null);
- test(m.get(new Byte((byte)'n')) == null);
- test(m.get(new Byte((byte)'z')) == null);
-
- //
- // Re-populate.
- //
- populateDB(connection, m);
-
- test(m.size() == 26);
-
- entrySet = m.entrySet();
- p = entrySet.iterator();
- while(p.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)p.next();
- byte v = ((Byte)e.getKey()).byteValue();
- if(v == (byte)'a' || v == (byte)'b' || v == (byte)'c')
- {
- p.remove();
- }
- }
- ((Freeze.Map) m).closeAllIterators();
-
- test(m.size() == 23);
- test(m.get(new Byte((byte)'a')) == null);
- test(m.get(new Byte((byte)'b')) == null);
- test(m.get(new Byte((byte)'c')) == null);
- System.out.println("ok");
- }
+ m.remove(new Byte((byte)'a'));
+ m.remove(new Byte((byte)'b'));
+ m.remove(new Byte((byte)'c'));
+ for(j = 3; j < alphabet.length(); ++j)
+ {
+ Object value = m.get(new Byte((byte)alphabet.charAt(j)));
+ test(value != null);
+ }
+ test(m.get(new Byte((byte)'a')) == null);
+ test(m.get(new Byte((byte)'b')) == null);
+ test(m.get(new Byte((byte)'c')) == null);
+ System.out.println("ok");
+
+ //
+ // Re-populate.
+ //
+ populateDB(connection, m);
+
+ {
+ System.out.print("testing keySet... ");
+ System.out.flush();
+ java.util.Set keys = m.keySet();
+ test(keys.size() == alphabet.length());
+ test(!keys.isEmpty());
+ java.util.Iterator p = keys.iterator();
+ while(p.hasNext())
+ {
+ Object o = p.next();
+ test(keys.contains(o));
+
+ Byte b = (Byte)o;
+ test(m.containsKey(b));
+ }
+ System.out.println("ok");
+ }
+
+ {
+ System.out.print("testing values... ");
+ System.out.flush();
+ java.util.Collection values = m.values();
+ test(values.size() == alphabet.length());
+ test(!values.isEmpty());
+ java.util.Iterator p = values.iterator();
+ while(p.hasNext())
+ {
+ Object o = p.next();
+ test(values.contains(o));
+
+ Integer i = (Integer)o;
+ test(m.containsValue(i));
+ }
+ System.out.println("ok");
+ }
+
+ {
+ System.out.print("testing entrySet... ");
+ System.out.flush();
+ java.util.Set entrySet = m.entrySet();
+ test(entrySet.size() == alphabet.length());
+ test(!entrySet.isEmpty());
+ java.util.Iterator p = entrySet.iterator();
+ while(p.hasNext())
+ {
+ Object o = p.next();
+ test(entrySet.contains(o));
+
+ java.util.Map.Entry e = (java.util.Map.Entry)o;
+ test(m.containsKey(e.getKey()));
+ test(m.containsValue(e.getValue()));
+ }
+ System.out.println("ok");
+ }
+
+ {
+ System.out.print("testing iterator.remove... ");
+ System.out.flush();
+
+ test(m.size() == 26);
+ test(m.get(new Byte((byte)'b')) != null);
+ test(m.get(new Byte((byte)'n')) != null);
+ test(m.get(new Byte((byte)'z')) != null);
+
+ ((Freeze.Map) m).closeAllIterators();
+
+ java.util.Set entrySet = m.entrySet();
+ java.util.Iterator p = entrySet.iterator();
+
+ while(p.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)p.next();
+ Byte b = (Byte)e.getKey();
+ byte v = b.byteValue();
+ if(v == (byte)'b' || v == (byte)'n' || v == (byte)'z')
+ {
+ p.remove();
+ try
+ {
+ p.remove();
+ }
+ catch(IllegalStateException ex)
+ {
+ // Expected.
+ }
+ }
+ }
+ ((Freeze.Map) m).closeAllIterators();
+
+ test(m.size() == 23);
+ test(m.get(new Byte((byte)'b')) == null);
+ test(m.get(new Byte((byte)'n')) == null);
+ test(m.get(new Byte((byte)'z')) == null);
+
+ //
+ // Re-populate.
+ //
+ populateDB(connection, m);
+
+ test(m.size() == 26);
+
+ entrySet = m.entrySet();
+ p = entrySet.iterator();
+ while(p.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)p.next();
+ byte v = ((Byte)e.getKey()).byteValue();
+ if(v == (byte)'a' || v == (byte)'b' || v == (byte)'c')
+ {
+ p.remove();
+ }
+ }
+ ((Freeze.Map) m).closeAllIterators();
+
+ test(m.size() == 23);
+ test(m.get(new Byte((byte)'a')) == null);
+ test(m.get(new Byte((byte)'b')) == null);
+ test(m.get(new Byte((byte)'c')) == null);
+ System.out.println("ok");
+ }
{
System.out.print("testing entry.setValue... ");
@@ -392,7 +392,7 @@ public class Client
e.setValue(new Integer(v + 100));
}
}
- ((Freeze.Map) m).closeAllIterators();
+ ((Freeze.Map) m).closeAllIterators();
test(m.size() == 26);
test(m.get(new Byte((byte)'b')) != null);
test(m.get(new Byte((byte)'n')) != null);
@@ -415,437 +415,437 @@ public class Client
System.out.println("ok");
}
- {
+ {
System.out.print("testing index... ");
System.out.flush();
- //
+ //
// Re-populate.
//
populateDB(connection, m);
- ByteIntMap typedM = (ByteIntMap)m;
-
- java.util.Map.Entry e;
- java.util.Iterator p;
-
- int length = alphabet.length();
-
- for(int k = 0; k < length; ++k)
- {
- p = typedM.findByValue(k);
- test(p.hasNext());
- e = (java.util.Map.Entry)p.next();
- test(((Byte)e.getKey()).byteValue() == (byte)alphabet.charAt(k));
- test(!p.hasNext());
- }
-
- //
- // Non-existent index value
- //
- p = typedM.findByValue(100);
- test(!p.hasNext());
-
- //
- // 2 items at 17
- //
- m.put(new Byte((byte)alphabet.charAt(21)), new Integer(17));
-
- p = typedM.findByValue(17);
-
- test(p.hasNext());
- e = (java.util.Map.Entry)p.next();
- byte v = ((Byte)e.getKey()).byteValue();
- test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
-
- test(p.hasNext());
- e = (java.util.Map.Entry)p.next();
- v = ((Byte)e.getKey()).byteValue();
- test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
-
- test(!p.hasNext());
- test(typedM.valueCount(17) == 2);
-
- p = typedM.findByValue(17);
- test(p.hasNext());
- p.next();
- p.remove();
- test(p.hasNext());
- e = (java.util.Map.Entry)p.next();
- v = ((Byte)e.getKey()).byteValue();
- test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
- test(!p.hasNext());
-
- //
- // We need to close this write iterator before further reads
- //
- typedM.closeAllIterators();
-
- test(typedM.valueCount(17) == 1);
-
- p = typedM.findByValue(17);
- test(p.hasNext());
- e = (java.util.Map.Entry)p.next();
-
- try
- {
- e.setValue(new Integer(18));
- test(false);
- }
- catch(UnsupportedOperationException ex)
- {
- // Expected
- }
-
- v = ((Byte)e.getKey()).byteValue();
- test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
- test(typedM.valueCount(17) == 1);
+ ByteIntMap typedM = (ByteIntMap)m;
+
+ java.util.Map.Entry e;
+ java.util.Iterator p;
+
+ int length = alphabet.length();
+
+ for(int k = 0; k < length; ++k)
+ {
+ p = typedM.findByValue(k);
+ test(p.hasNext());
+ e = (java.util.Map.Entry)p.next();
+ test(((Byte)e.getKey()).byteValue() == (byte)alphabet.charAt(k));
+ test(!p.hasNext());
+ }
+
+ //
+ // Non-existent index value
+ //
+ p = typedM.findByValue(100);
+ test(!p.hasNext());
+
+ //
+ // 2 items at 17
+ //
+ m.put(new Byte((byte)alphabet.charAt(21)), new Integer(17));
+
+ p = typedM.findByValue(17);
+
+ test(p.hasNext());
+ e = (java.util.Map.Entry)p.next();
+ byte v = ((Byte)e.getKey()).byteValue();
+ test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
+
+ test(p.hasNext());
+ e = (java.util.Map.Entry)p.next();
+ v = ((Byte)e.getKey()).byteValue();
+ test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
+
+ test(!p.hasNext());
+ test(typedM.valueCount(17) == 2);
+
+ p = typedM.findByValue(17);
+ test(p.hasNext());
+ p.next();
+ p.remove();
+ test(p.hasNext());
+ e = (java.util.Map.Entry)p.next();
+ v = ((Byte)e.getKey()).byteValue();
+ test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
+ test(!p.hasNext());
+
+ //
+ // We need to close this write iterator before further reads
+ //
+ typedM.closeAllIterators();
+
+ test(typedM.valueCount(17) == 1);
+
+ p = typedM.findByValue(17);
+ test(p.hasNext());
+ e = (java.util.Map.Entry)p.next();
+
+ try
+ {
+ e.setValue(new Integer(18));
+ test(false);
+ }
+ catch(UnsupportedOperationException ex)
+ {
+ // Expected
+ }
+
+ v = ((Byte)e.getKey()).byteValue();
+ test(v == (byte)alphabet.charAt(17) || v == (byte)alphabet.charAt(21));
+ test(typedM.valueCount(17) == 1);
+ System.out.println("ok");
+ }
+
+
+ ((Freeze.Map) m).closeAllIterators();
+
+ {
+ System.out.print("testing concurrent access... ");
+ System.out.flush();
+
+ m.clear();
+ populateDB(connection, m);
+
+
+ java.util.List l = new java.util.ArrayList();
+
+ //
+ // Create each thread.
+ //
+ for(int i = 0; i < 5; ++i)
+ {
+ l.add(new ReadThread(communicator, envName, dbName));
+ l.add(new WriteThread(communicator, envName, dbName));
+ }
+
+ //
+ // Start each thread.
+ //
+ java.util.Iterator p = l.iterator();
+ while(p.hasNext())
+ {
+ Thread thr = (Thread)p.next();
+ thr.start();
+ }
+
+ //
+ // Wait for each thread to terminate.
+ //
+ p = l.iterator();
+ while(p.hasNext())
+ {
+ Thread thr = (Thread)p.next();
+ while(thr.isAlive())
+ {
+ try
+ {
+ thr.join();
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+
System.out.println("ok");
}
+ System.out.print("testing index creation... ");
+ System.out.flush();
+
+ {
+ IntIdentityMap iim = new IntIdentityMap(connection, "intIdentity", true);
+
+ Ice.Identity odd = new Ice.Identity();
+ odd.name = "foo";
+ odd.category = "odd";
+
+ Ice.Identity even = new Ice.Identity();
+ even.name = "bar";
+ even.category = "even";
+
+ Transaction tx = connection.beginTransaction();
+ for(int i = 0; i < 1000; i++)
+ {
+ if(i % 2 == 0)
+ {
+ iim.fastPut(new Integer(i), even);
+ }
+ else
+ {
+ iim.fastPut(new Integer(i), odd);
+ }
+ }
+ tx.commit();
+ iim.close();
+ }
+
+ {
+ //
+ // Need true to create the index
+ //
+ IntIdentityMapWithIndex iim = new IntIdentityMapWithIndex(connection, "intIdentity", true);
+
+ test(iim.categoryCount("even") == 500);
+ test(iim.categoryCount("odd") == 500);
+
+ int count = 0;
+ java.util.Iterator p = iim.findByCategory("even");
+ while(p.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)p.next();
+ int k = ((Integer)e.getKey()).intValue();
+ test(k % 2 == 0);
+ ++count;
+ }
+ test(count == 500);
+
+ count = 0;
+ p = iim.findByCategory("odd");
+ while(p.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)p.next();
+ int k = ((Integer)e.getKey()).intValue();
+ test(k % 2 == 1);
+ ++count;
+ }
+ test(count == 500);
+
+ iim.closeAllIterators();
+ iim.clear();
+ }
+ System.out.println("ok");
+
+ System.out.print("testing sorting... ");
+ System.out.flush();
+
+
+ final java.util.Comparator less =
+ new java.util.Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ if(o1 == o2)
+ {
+ return 0;
+ }
+ else if(o1 == null)
+ {
+ return -((Comparable)o2).compareTo(o1);
+ }
+ else
+ {
+ return ((Comparable)o1).compareTo(o2);
+ }
+ }
+ };
+
+ java.util.Comparator greater =
+ new java.util.Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ return -less.compare(o1, o2);
+ }
+ };
+
+ java.util.Map indexComparators = new java.util.HashMap();
+ indexComparators.put("category", greater);
+ java.util.Random rand = new java.util.Random();
+
+ {
+ SortedMap sm = new SortedMap(connection, "sortedMap", true, less, indexComparators);
+
+ Transaction tx = connection.beginTransaction();
+ for(int i = 0; i < 500; i++)
+ {
+ int k = rand.nextInt(1000);
+
+ Ice.Identity id = new Ice.Identity("foo",
+ String.valueOf(alphabet.charAt(k % 26)));
+
+
+ sm.fastPut(new Integer(k), id);
+ }
+ tx.commit();
+ sm.close();
+ }
+
+ {
+ SortedMap sm = new SortedMap(connection, "sortedMap", true, less, indexComparators);
+
+ //
+ // Primary key
+ //
+ for(int i = 0; i < 100; i++)
+ {
+ int k = rand.nextInt(1000);
+
+ java.util.SortedMap subMap = sm.tailMap(new Integer(k));
+ try
+ {
+ Integer fk = (Integer)subMap.firstKey();
+ test(fk.intValue() >= k);
+ }
+ catch(NoSuchElementException e)
+ {
+ // Expected from time to time
+ }
+
+ subMap = sm.headMap(new Integer(k));
+ try
+ {
+ Integer lk = (Integer)subMap.lastKey();
+ test(lk.intValue() < k);
+ }
+ catch(NoSuchElementException e)
+ {
+ // Expected from time to time
+ }
+
+ //
+ // Now with an iterator
+ //
+ java.util.Iterator p = subMap.keySet().iterator();
+ while(p.hasNext())
+ {
+ Integer ck = (Integer)p.next();
+ test(ck.intValue() < k);
+ }
+ sm.closeAllIterators();
+ }
+
+ //
+ // Category index
+ //
+ for(int i = 0; i < 100; i++)
+ {
+ int k = rand.nextInt(1000);
+ String category = String.valueOf(alphabet.charAt(k % 26));
+
+ java.util.SortedMap subMap = sm.tailMapForIndex("category", category);
+ try
+ {
+ String fk = (String)subMap.firstKey();
+ test(greater.compare(fk, category) >= 0);
+ }
+ catch(NoSuchElementException e)
+ {
+ // Expected from time to time
+ }
+
+ subMap = sm.headMapForIndex("category", category);
+ try
+ {
+ String lk = (String)subMap.lastKey();
+ test(greater.compare(lk, category) < 0);
+ }
+ catch(NoSuchElementException e)
+ {
+ // Expected from time to time
+ }
+
+ //
+ // Now with an iterator
+ //
+ java.util.Iterator p = subMap.keySet().iterator();
+ while(p.hasNext())
+ {
+ String ck = (String)p.next();
+ test(greater.compare(ck, category) < 0);
+ }
+ sm.closeAllIterators();
+ }
+
+ java.util.SortedMap subMap = sm.mapForIndex("category");
+ java.util.Iterator p = subMap.entrySet().iterator();
+ String category = null;
+
+ while(p.hasNext())
+ {
+ java.util.Map.Entry entry = (java.util.Map.Entry)p.next();
+
+ if(category != null)
+ {
+ test(greater.compare(category, entry.getKey()) < 0);
+ }
+ category = (String)entry.getKey();
+ // System.out.println("*******Category == " + category);
- ((Freeze.Map) m).closeAllIterators();
-
- {
- System.out.print("testing concurrent access... ");
- System.out.flush();
-
- m.clear();
- populateDB(connection, m);
-
-
- java.util.List l = new java.util.ArrayList();
-
- //
- // Create each thread.
- //
- for(int i = 0; i < 5; ++i)
- {
- l.add(new ReadThread(communicator, envName, dbName));
- l.add(new WriteThread(communicator, envName, dbName));
- }
-
- //
- // Start each thread.
- //
- java.util.Iterator p = l.iterator();
- while(p.hasNext())
- {
- Thread thr = (Thread)p.next();
- thr.start();
- }
-
- //
- // Wait for each thread to terminate.
- //
- p = l.iterator();
- while(p.hasNext())
- {
- Thread thr = (Thread)p.next();
- while(thr.isAlive())
- {
- try
- {
- thr.join();
- }
- catch(InterruptedException e)
- {
- }
- }
- }
-
- System.out.println("ok");
- }
-
- System.out.print("testing index creation... ");
- System.out.flush();
-
- {
- IntIdentityMap iim = new IntIdentityMap(connection, "intIdentity", true);
-
- Ice.Identity odd = new Ice.Identity();
- odd.name = "foo";
- odd.category = "odd";
-
- Ice.Identity even = new Ice.Identity();
- even.name = "bar";
- even.category = "even";
-
- Transaction tx = connection.beginTransaction();
- for(int i = 0; i < 1000; i++)
- {
- if(i % 2 == 0)
- {
- iim.fastPut(new Integer(i), even);
- }
- else
- {
- iim.fastPut(new Integer(i), odd);
- }
- }
- tx.commit();
- iim.close();
- }
-
- {
- //
- // Need true to create the index
- //
- IntIdentityMapWithIndex iim = new IntIdentityMapWithIndex(connection, "intIdentity", true);
-
- test(iim.categoryCount("even") == 500);
- test(iim.categoryCount("odd") == 500);
-
- int count = 0;
- java.util.Iterator p = iim.findByCategory("even");
- while(p.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)p.next();
- int k = ((Integer)e.getKey()).intValue();
- test(k % 2 == 0);
- ++count;
- }
- test(count == 500);
-
- count = 0;
- p = iim.findByCategory("odd");
- while(p.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)p.next();
- int k = ((Integer)e.getKey()).intValue();
- test(k % 2 == 1);
- ++count;
- }
- test(count == 500);
-
- iim.closeAllIterators();
- iim.clear();
- }
- System.out.println("ok");
-
- System.out.print("testing sorting... ");
- System.out.flush();
-
-
- final java.util.Comparator less =
- new java.util.Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- if(o1 == o2)
- {
- return 0;
- }
- else if(o1 == null)
- {
- return -((Comparable)o2).compareTo(o1);
- }
- else
- {
- return ((Comparable)o1).compareTo(o2);
- }
- }
- };
-
- java.util.Comparator greater =
- new java.util.Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- return -less.compare(o1, o2);
- }
- };
-
- java.util.Map indexComparators = new java.util.HashMap();
- indexComparators.put("category", greater);
- java.util.Random rand = new java.util.Random();
-
- {
- SortedMap sm = new SortedMap(connection, "sortedMap", true, less, indexComparators);
-
- Transaction tx = connection.beginTransaction();
- for(int i = 0; i < 500; i++)
- {
- int k = rand.nextInt(1000);
-
- Ice.Identity id = new Ice.Identity("foo",
- String.valueOf(alphabet.charAt(k % 26)));
-
-
- sm.fastPut(new Integer(k), id);
- }
- tx.commit();
- sm.close();
- }
-
- {
- SortedMap sm = new SortedMap(connection, "sortedMap", true, less, indexComparators);
-
- //
- // Primary key
- //
- for(int i = 0; i < 100; i++)
- {
- int k = rand.nextInt(1000);
-
- java.util.SortedMap subMap = sm.tailMap(new Integer(k));
- try
- {
- Integer fk = (Integer)subMap.firstKey();
- test(fk.intValue() >= k);
- }
- catch(NoSuchElementException e)
- {
- // Expected from time to time
- }
-
- subMap = sm.headMap(new Integer(k));
- try
- {
- Integer lk = (Integer)subMap.lastKey();
- test(lk.intValue() < k);
- }
- catch(NoSuchElementException e)
- {
- // Expected from time to time
- }
-
- //
- // Now with an iterator
- //
- java.util.Iterator p = subMap.keySet().iterator();
- while(p.hasNext())
- {
- Integer ck = (Integer)p.next();
- test(ck.intValue() < k);
- }
- sm.closeAllIterators();
- }
-
- //
- // Category index
- //
- for(int i = 0; i < 100; i++)
- {
- int k = rand.nextInt(1000);
- String category = String.valueOf(alphabet.charAt(k % 26));
-
- java.util.SortedMap subMap = sm.tailMapForIndex("category", category);
- try
- {
- String fk = (String)subMap.firstKey();
- test(greater.compare(fk, category) >= 0);
- }
- catch(NoSuchElementException e)
- {
- // Expected from time to time
- }
-
- subMap = sm.headMapForIndex("category", category);
- try
- {
- String lk = (String)subMap.lastKey();
- test(greater.compare(lk, category) < 0);
- }
- catch(NoSuchElementException e)
- {
- // Expected from time to time
- }
-
- //
- // Now with an iterator
- //
- java.util.Iterator p = subMap.keySet().iterator();
- while(p.hasNext())
- {
- String ck = (String)p.next();
- test(greater.compare(ck, category) < 0);
- }
- sm.closeAllIterators();
- }
-
- java.util.SortedMap subMap = sm.mapForIndex("category");
- java.util.Iterator p = subMap.entrySet().iterator();
- String category = null;
-
- while(p.hasNext())
- {
- java.util.Map.Entry entry = (java.util.Map.Entry)p.next();
-
- if(category != null)
- {
- test(greater.compare(category, entry.getKey()) < 0);
- }
- category = (String)entry.getKey();
- // System.out.println("*******Category == " + category);
-
-
- java.util.Iterator q = ((java.util.Set)entry.getValue()).iterator();
- while(q.hasNext())
- {
- //
- // All my map entries
- //
- entry = (java.util.Map.Entry)q.next();
- Ice.Identity id = (Ice.Identity)entry.getValue();
- test(category.equals(id.category));
-
- // System.out.println("Key == " + entry.getKey().toString());
-
- }
- }
- sm.closeAllIterators();
- sm.clear();
- sm.close();
- }
- System.out.println("ok");
- connection.close();
-
- return 0;
+
+ java.util.Iterator q = ((java.util.Set)entry.getValue()).iterator();
+ while(q.hasNext())
+ {
+ //
+ // All my map entries
+ //
+ entry = (java.util.Map.Entry)q.next();
+ Ice.Identity id = (Ice.Identity)entry.getValue();
+ test(category.equals(id.category));
+
+ // System.out.println("Key == " + entry.getKey().toString());
+
+ }
+ }
+ sm.closeAllIterators();
+ sm.clear();
+ sm.close();
+ }
+ System.out.println("ok");
+ connection.close();
+
+ return 0;
}
static public void
main(String[] args)
{
- int status;
- Ice.Communicator communicator = null;
- String envName = "db";
+ int status;
+ Ice.Communicator communicator = null;
+ String envName = "db";
- try
- {
- Ice.StringSeqHolder holder = new Ice.StringSeqHolder();
- holder.value = args;
- communicator = Ice.Util.initialize(holder);
- args = holder.value;
- if(args.length > 0)
- {
- envName = args[0];
- envName += "/";
- envName += "db";
- }
-
- status = run(args, communicator, envName, "binary");
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- status = 1;
- }
-
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Exception ex)
- {
- System.err.println(ex);
- status = 1;
- }
- }
-
- System.gc();
- System.exit(status);
+ try
+ {
+ Ice.StringSeqHolder holder = new Ice.StringSeqHolder();
+ holder.value = args;
+ communicator = Ice.Util.initialize(holder);
+ args = holder.value;
+ if(args.length > 0)
+ {
+ envName = args[0];
+ envName += "/";
+ envName += "db";
+ }
+
+ status = run(args, communicator, envName, "binary");
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
+
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Exception ex)
+ {
+ System.err.println(ex);
+ status = 1;
+ }
+ }
+
+ System.gc();
+ System.exit(status);
}
}
diff --git a/java/test/Freeze/evictor/Client.java b/java/test/Freeze/evictor/Client.java
index 50927871c5c..befe0e0ff49 100644
--- a/java/test/Freeze/evictor/Client.java
+++ b/java/test/Freeze/evictor/Client.java
@@ -33,38 +33,38 @@ public class Client
static class ReadThread extends Thread
{
- ReadThread(Test.ServantPrx[] servants)
- {
- _servants = servants;
- }
-
- public void run()
- {
- int loops = 10;
- while(loops-- > 0)
- {
- try
- {
- _servants[0].getValue();
- test(false);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected
- }
- catch(Exception e)
- {
- test(false);
- }
-
- for(int i = 1; i < _servants.length; ++i)
- {
- test(_servants[i].getValue() == i);
- }
- }
- }
-
- private Test.ServantPrx[] _servants;
+ ReadThread(Test.ServantPrx[] servants)
+ {
+ _servants = servants;
+ }
+
+ public void run()
+ {
+ int loops = 10;
+ while(loops-- > 0)
+ {
+ try
+ {
+ _servants[0].getValue();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected
+ }
+ catch(Exception e)
+ {
+ test(false);
+ }
+
+ for(int i = 1; i < _servants.length; ++i)
+ {
+ test(_servants[i].getValue() == i);
+ }
+ }
+ }
+
+ private Test.ServantPrx[] _servants;
}
public static final int StateRunning = 0;
@@ -73,268 +73,268 @@ public class Client
static class ReadForeverThread extends Thread
{
- ReadForeverThread(Test.ServantPrx[] servants)
- {
- _servants = servants;
- }
-
- public void
- run()
- {
- for(;;)
- {
- try
- {
- for(int i = 0; i < _servants.length; ++i)
- {
- if(getEvictorState() == StateDeactivated)
- {
- _servants[i].slowGetValue();
- test(false);
- }
- else
- {
- test(_servants[i].slowGetValue() == i);
- }
- }
- }
- catch(Ice.SocketException e)
- {
- //
- // Expected
- //
- test(validEx());
- return;
- }
- catch(Ice.LocalException e)
- {
- System.err.println("Caught unexpected : " + e.toString());
- test(false);
- return;
- }
- catch(Exception e)
- {
- test(false);
- return;
- }
- }
- }
-
- synchronized int
- getEvictorState()
- {
- return _state;
- }
-
- synchronized boolean
- validEx()
- {
- return _state == StateDeactivating || _state == StateDeactivated;
- }
-
- synchronized void
- setEvictorState(int s)
- {
- _state = s;
- }
-
- private Test.ServantPrx[] _servants;
- private int _state = StateRunning;
+ ReadForeverThread(Test.ServantPrx[] servants)
+ {
+ _servants = servants;
+ }
+
+ public void
+ run()
+ {
+ for(;;)
+ {
+ try
+ {
+ for(int i = 0; i < _servants.length; ++i)
+ {
+ if(getEvictorState() == StateDeactivated)
+ {
+ _servants[i].slowGetValue();
+ test(false);
+ }
+ else
+ {
+ test(_servants[i].slowGetValue() == i);
+ }
+ }
+ }
+ catch(Ice.SocketException e)
+ {
+ //
+ // Expected
+ //
+ test(validEx());
+ return;
+ }
+ catch(Ice.LocalException e)
+ {
+ System.err.println("Caught unexpected : " + e.toString());
+ test(false);
+ return;
+ }
+ catch(Exception e)
+ {
+ test(false);
+ return;
+ }
+ }
+ }
+
+ synchronized int
+ getEvictorState()
+ {
+ return _state;
+ }
+
+ synchronized boolean
+ validEx()
+ {
+ return _state == StateDeactivating || _state == StateDeactivated;
+ }
+
+ synchronized void
+ setEvictorState(int s)
+ {
+ _state = s;
+ }
+
+ private Test.ServantPrx[] _servants;
+ private int _state = StateRunning;
}
static class AddForeverThread extends Thread
- {
- AddForeverThread(Test.RemoteEvictorPrx evictor, int prefix)
- {
- _evictor = evictor;
- _prefix = "" + prefix;
- }
-
- public void
- run()
- {
- int index = 0;
-
- for(;;)
- {
- try
- {
- String id = _prefix + "-" + index++;
- if(getEvictorState() == StateDeactivated)
- {
- _evictor.createServant(id, 0);
- test(false);
- }
- else
- {
- _evictor.createServant(id, 0);
- }
- }
- catch(Test.EvictorDeactivatedException e)
- {
- //
- // Expected
- //
- test(validEx());
- return;
- }
- catch(Ice.ObjectNotExistException e)
- {
- //
- // Expected
- //
- test(validEx());
- return;
- }
- catch(Test.AlreadyRegisteredException e)
- {
- System.err.println("Caught unexpected AlreadyRegistedException:" + e.toString());
- System.err.println("index is " + index);
- test(false);
- return;
- }
- catch(Ice.LocalException e)
- {
- System.err.println("Caught unexpected : " + e.toString());
- e.printStackTrace();
- test(false);
- return;
- }
- catch(Exception e)
- {
- e.printStackTrace();
- test(false);
- return;
- }
- }
- }
-
- synchronized int
- getEvictorState()
- {
- return _state;
- }
-
- synchronized boolean
- validEx()
- {
- return _state == StateDeactivating || _state == StateDeactivated;
- }
-
- synchronized void
- setEvictorState(int s)
- {
- _state = s;
- }
-
- private Test.RemoteEvictorPrx _evictor;
- private String _prefix;
- private int _state = StateRunning;
+ {
+ AddForeverThread(Test.RemoteEvictorPrx evictor, int prefix)
+ {
+ _evictor = evictor;
+ _prefix = "" + prefix;
+ }
+
+ public void
+ run()
+ {
+ int index = 0;
+
+ for(;;)
+ {
+ try
+ {
+ String id = _prefix + "-" + index++;
+ if(getEvictorState() == StateDeactivated)
+ {
+ _evictor.createServant(id, 0);
+ test(false);
+ }
+ else
+ {
+ _evictor.createServant(id, 0);
+ }
+ }
+ catch(Test.EvictorDeactivatedException e)
+ {
+ //
+ // Expected
+ //
+ test(validEx());
+ return;
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ //
+ // Expected
+ //
+ test(validEx());
+ return;
+ }
+ catch(Test.AlreadyRegisteredException e)
+ {
+ System.err.println("Caught unexpected AlreadyRegistedException:" + e.toString());
+ System.err.println("index is " + index);
+ test(false);
+ return;
+ }
+ catch(Ice.LocalException e)
+ {
+ System.err.println("Caught unexpected : " + e.toString());
+ e.printStackTrace();
+ test(false);
+ return;
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ test(false);
+ return;
+ }
+ }
+ }
+
+ synchronized int
+ getEvictorState()
+ {
+ return _state;
+ }
+
+ synchronized boolean
+ validEx()
+ {
+ return _state == StateDeactivating || _state == StateDeactivated;
+ }
+
+ synchronized void
+ setEvictorState(int s)
+ {
+ _state = s;
+ }
+
+ private Test.RemoteEvictorPrx _evictor;
+ private String _prefix;
+ private int _state = StateRunning;
}
static class CreateDestroyThread extends Thread
{
- CreateDestroyThread(Test.RemoteEvictorPrx evictor, int id, int size)
- {
- _evictor = evictor;
- _id = "" + id;
- _size = size;
- }
-
- public void
- run()
- {
- try
- {
- int loops = 50;
- while(loops-- > 0)
- {
- for(int i = 0; i < _size; i++)
- {
- String id = "" + i;
- if(id.equals(_id))
- {
- //
- // Create when odd, destroy when even.
- //
-
- if(loops % 2 == 0)
- {
- Test.ServantPrx servant = _evictor.getServant(id);
- servant.destroy();
-
- //
- // Twice
- //
- try
- {
- servant.destroy();
- test(false);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected
- }
- }
- else
- {
- Test.ServantPrx servant = _evictor.createServant(id, i);
-
- //
- // Twice
- //
- try
- {
- servant = _evictor.createServant(id, 0);
- test(false);
- }
- catch(Test.AlreadyRegisteredException e)
- {
- // Expected
- }
- }
- }
- else
- {
- //
- // Just read/write the value
- //
- Test.ServantPrx servant = _evictor.getServant(id);
- try
- {
- int val = servant.getValue();
- test(val == i || val == -i);
- servant.setValue(-val);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected from time to time
- }
- }
- }
- }
- }
- catch(Exception e)
- {
- //
- // Unexpected!
- //
- test(false);
- }
- }
-
- private Test.RemoteEvictorPrx _evictor;
- private String _id;
- private int _size;
+ CreateDestroyThread(Test.RemoteEvictorPrx evictor, int id, int size)
+ {
+ _evictor = evictor;
+ _id = "" + id;
+ _size = size;
+ }
+
+ public void
+ run()
+ {
+ try
+ {
+ int loops = 50;
+ while(loops-- > 0)
+ {
+ for(int i = 0; i < _size; i++)
+ {
+ String id = "" + i;
+ if(id.equals(_id))
+ {
+ //
+ // Create when odd, destroy when even.
+ //
+
+ if(loops % 2 == 0)
+ {
+ Test.ServantPrx servant = _evictor.getServant(id);
+ servant.destroy();
+
+ //
+ // Twice
+ //
+ try
+ {
+ servant.destroy();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected
+ }
+ }
+ else
+ {
+ Test.ServantPrx servant = _evictor.createServant(id, i);
+
+ //
+ // Twice
+ //
+ try
+ {
+ servant = _evictor.createServant(id, 0);
+ test(false);
+ }
+ catch(Test.AlreadyRegisteredException e)
+ {
+ // Expected
+ }
+ }
+ }
+ else
+ {
+ //
+ // Just read/write the value
+ //
+ Test.ServantPrx servant = _evictor.getServant(id);
+ try
+ {
+ int val = servant.getValue();
+ test(val == i || val == -i);
+ servant.setValue(-val);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected from time to time
+ }
+ }
+ }
+ }
+ }
+ catch(Exception e)
+ {
+ //
+ // Unexpected!
+ //
+ test(false);
+ }
+ }
+
+ private Test.RemoteEvictorPrx _evictor;
+ private String _id;
+ private int _size;
}
private static int
run(String[] args, Ice.Communicator communicator)
- throws Test.AlreadyRegisteredException, Test.NotRegisteredException, Test.EvictorDeactivatedException
+ throws Test.AlreadyRegisteredException, Test.NotRegisteredException, Test.EvictorDeactivatedException
{
String ref = "factory:default -p 12010 -t 30000";
Ice.ObjectPrx base = communicator.stringToProxy(ref);
@@ -342,524 +342,524 @@ public class Client
Test.RemoteEvictorFactoryPrx factory = Test.RemoteEvictorFactoryPrxHelper.checkedCast(base);
- System.out.print("testing Freeze Evictor... ");
- System.out.flush();
-
- final int size = 5;
-
- Test.RemoteEvictorPrx evictor = factory.createEvictor("Test");
- evictor.setSize(size);
-
- //
- // Create some servants
- //
- Test.ServantPrx[] servants = new Test.ServantPrx[size];
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.createServant(id, i);
- servants[i].ice_ping();
-
- Test.FacetPrx facet1 = Test.FacetPrxHelper.uncheckedCast(servants[i], "facet1");
- try
- {
- facet1.ice_ping();
- test(false);
- }
- catch(Ice.FacetNotExistException e)
- {
- //
- // Expected
- //
- }
- servants[i].addFacet("facet1", "data");
- facet1.ice_ping();
- facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- facet1.setValue(10 * i);
- facet1.addFacet("facet2", "moreData");
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- facet2.setValue(100 * i);
- }
-
- //
- // Evict and verify values.
- //
- evictor.setSize(0);
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- servants[i].ice_ping();
- test(servants[i].getValue() == i);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- test(facet1.getValue() == 10 * i);
- test(facet1.getData().equals("data"));
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- test(facet2.getData().equals("moreData"));
- }
-
- //
- // Mutate servants.
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].setValue(i + 100);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- facet1.setValue(10 * i + 100);
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- facet2.setValue(100 * i + 100);
- }
-
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getValue() == i + 100);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- test(facet1.getValue() == 10 * i + 100);
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- test(facet2.getValue() == 100 * i + 100);
- }
-
- //
- // Evict and verify values.
- //
- evictor.setSize(0);
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getValue() == i + 100);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- test(facet1.getValue() == 10 * i + 100);
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- test(facet2.getValue() == 100 * i + 100);
- }
-
- //
- // Test saving while busy
- //
-
- AMI_Servant_setValueAsyncI setCB = new AMI_Servant_setValueAsyncI();
- for(int i = 0; i < size; i++)
- {
- //
- // Start a mutating operation so that the object is not idle.
- //
- servants[i].setValueAsync_async(setCB, i + 300);
-
- test(servants[i].getValue() == i + 100);
- //
- // This operation modifies the object state but is not saved
- // because the setValueAsync operation is still pending.
- //
- servants[i].setValue(i + 200);
- test(servants[i].getValue() == i + 200);
-
- //
- // Force the response to setValueAsync
- //
- servants[i].releaseAsync();
- test(servants[i].getValue() == i + 300);
- }
-
-
- //
- // Add duplicate facet and catch corresponding exception
- //
- for(int i = 0; i < size; i++)
- {
- try
- {
- servants[i].addFacet("facet1", "foobar");
- test(false);
- }
- catch(Test.AlreadyRegisteredException ex)
- {
- }
- }
-
- //
- // Remove a facet that does not exist
- //
- try
- {
- servants[0].removeFacet("facet3");
- test(false);
- }
- catch(Test.NotRegisteredException ex)
- {
- }
-
- //
- // Remove all facets
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].removeFacet("facet1");
- servants[i].removeFacet("facet2");
- }
-
- evictor.setSize(0);
- evictor.setSize(size);
-
- //
- // Destroy servants and verify ObjectNotExistException.
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].destroy();
- try
- {
- servants[i].getValue();
- test(false);
- }
- catch(Ice.ObjectNotExistException ex)
- {
- // Expected
- }
-
- try
- {
- servants[i].ice_ping();
- test(false);
- }
- catch(Ice.ObjectNotExistException ex)
- {
- // Expected
- }
-
- }
-
- //
- // Allocate space for size servants.
- //
- servants = new Test.ServantPrx[size];
-
- //
- // Recreate servants, set transient value
- //
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.createServant(id, i);
- servants[i].setTransientValue(i);
- }
-
- //
- // Evict
- //
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
-
- //
- // Check the transient value
- //
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == -1);
- }
+ System.out.print("testing Freeze Evictor... ");
+ System.out.flush();
+
+ final int size = 5;
+
+ Test.RemoteEvictorPrx evictor = factory.createEvictor("Test");
+ evictor.setSize(size);
+
+ //
+ // Create some servants
+ //
+ Test.ServantPrx[] servants = new Test.ServantPrx[size];
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.createServant(id, i);
+ servants[i].ice_ping();
+
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.uncheckedCast(servants[i], "facet1");
+ try
+ {
+ facet1.ice_ping();
+ test(false);
+ }
+ catch(Ice.FacetNotExistException e)
+ {
+ //
+ // Expected
+ //
+ }
+ servants[i].addFacet("facet1", "data");
+ facet1.ice_ping();
+ facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ facet1.setValue(10 * i);
+ facet1.addFacet("facet2", "moreData");
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ facet2.setValue(100 * i);
+ }
+
+ //
+ // Evict and verify values.
+ //
+ evictor.setSize(0);
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].ice_ping();
+ test(servants[i].getValue() == i);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ test(facet1.getValue() == 10 * i);
+ test(facet1.getData().equals("data"));
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ test(facet2.getData().equals("moreData"));
+ }
+
+ //
+ // Mutate servants.
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].setValue(i + 100);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ facet1.setValue(10 * i + 100);
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ facet2.setValue(100 * i + 100);
+ }
+
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getValue() == i + 100);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ test(facet1.getValue() == 10 * i + 100);
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ test(facet2.getValue() == 100 * i + 100);
+ }
+
+ //
+ // Evict and verify values.
+ //
+ evictor.setSize(0);
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getValue() == i + 100);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ test(facet1.getValue() == 10 * i + 100);
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ test(facet2.getValue() == 100 * i + 100);
+ }
+
+ //
+ // Test saving while busy
+ //
+
+ AMI_Servant_setValueAsyncI setCB = new AMI_Servant_setValueAsyncI();
+ for(int i = 0; i < size; i++)
+ {
+ //
+ // Start a mutating operation so that the object is not idle.
+ //
+ servants[i].setValueAsync_async(setCB, i + 300);
+
+ test(servants[i].getValue() == i + 100);
+ //
+ // This operation modifies the object state but is not saved
+ // because the setValueAsync operation is still pending.
+ //
+ servants[i].setValue(i + 200);
+ test(servants[i].getValue() == i + 200);
+
+ //
+ // Force the response to setValueAsync
+ //
+ servants[i].releaseAsync();
+ test(servants[i].getValue() == i + 300);
+ }
+
+
+ //
+ // Add duplicate facet and catch corresponding exception
+ //
+ for(int i = 0; i < size; i++)
+ {
+ try
+ {
+ servants[i].addFacet("facet1", "foobar");
+ test(false);
+ }
+ catch(Test.AlreadyRegisteredException ex)
+ {
+ }
+ }
+
+ //
+ // Remove a facet that does not exist
+ //
+ try
+ {
+ servants[0].removeFacet("facet3");
+ test(false);
+ }
+ catch(Test.NotRegisteredException ex)
+ {
+ }
+
+ //
+ // Remove all facets
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].removeFacet("facet1");
+ servants[i].removeFacet("facet2");
+ }
+
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ //
+ // Destroy servants and verify ObjectNotExistException.
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].destroy();
+ try
+ {
+ servants[i].getValue();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ // Expected
+ }
+
+ try
+ {
+ servants[i].ice_ping();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ // Expected
+ }
+
+ }
+
+ //
+ // Allocate space for size servants.
+ //
+ servants = new Test.ServantPrx[size];
+
+ //
+ // Recreate servants, set transient value
+ //
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.createServant(id, i);
+ servants[i].setTransientValue(i);
+ }
+
+ //
+ // Evict
+ //
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ //
+ // Check the transient value
+ //
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == -1);
+ }
- //
- // Now with keep
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].keepInCache();
- servants[i].keepInCache();
- servants[i].setTransientValue(i);
- }
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
-
- //
- // Check the transient value
- //
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == i);
- }
-
- //
- // Again, after one release
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].release();
- }
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == i);
- }
-
- //
- // Again, after a second release
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].release();
- }
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
-
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == -1);
- }
-
- //
- // Release one more time
- //
- for(int i = 0; i < size; i++)
- {
- try
- {
- servants[i].release();
- test(false);
- }
- catch(Test.NotRegisteredException e)
- {
- // Expected
- }
- }
-
- //
- // Deactivate and recreate evictor, to ensure that servants
- // are restored properly after database close and reopen.
- //
- evictor.deactivate();
- evictor = factory.createEvictor("Test");
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.getServant(id);
- test(servants[i].getValue() == i);
- }
-
-
- //
- // Test concurrent lookups with a smaller evictor
- // size and one missing servant
- //
- evictor.setSize(size / 2);
- servants[0].destroy();
-
- {
- int threadCount = size * 2;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new ReadThread(servants);
- threads[i].start();
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
- }
-
- //
- // Clean up.
- //
- evictor.destroyAllServants("");
- evictor.destroyAllServants("facet1");
- evictor.destroyAllServants("facet2");
-
- //
- // CreateDestroy threads
- //
- {
- int threadCount = size;;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new CreateDestroyThread(evictor, i, size);
- threads[i].start();
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
-
- //
- // Verify all destroyed
- //
- for(int i = 0; i < size; i++)
- {
- try
- {
- servants[i].getValue();
- test(false);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected
- }
- }
- }
-
- //
- // Recreate servants.
- //
- servants = new Test.ServantPrx[size];
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.createServant(id, i);
- }
-
- //
- // Deactivate in the middle of remote AMD operations
- // (really testing Ice here)
- //
- {
- int threadCount = size;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new ReadForeverThread(servants);
- threads[i].start();
- }
-
- try
- {
- Thread.currentThread().sleep(500);
- }
- catch(InterruptedException e)
- {
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- ReadForeverThread t = (ReadForeverThread)threads[i];
- t.setEvictorState(StateDeactivating);
- }
- evictor.deactivate();
- for(int i = 0; i < threadCount; i++)
- {
- ReadForeverThread t = (ReadForeverThread)threads[i];
- t.setEvictorState(StateDeactivated);
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
- }
-
- //
- // Resurrect
- //
- evictor = factory.createEvictor("Test");
- evictor.destroyAllServants("");
-
- //
- // Deactivate in the middle of adds
- //
- {
- int threadCount = size;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new AddForeverThread(evictor, i);
- threads[i].start();
- }
-
- try
- {
- Thread.currentThread().sleep(500);
- }
- catch(InterruptedException e)
- {
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- AddForeverThread t = (AddForeverThread)threads[i];
- t.setEvictorState(StateDeactivating);
- }
- evictor.deactivate();
- for(int i = 0; i < threadCount; i++)
- {
- AddForeverThread t = (AddForeverThread)threads[i];
- t.setEvictorState(StateDeactivated);
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
- }
-
-
- //
- // Clean up.
- //
- evictor = factory.createEvictor("Test");
- evictor.destroyAllServants("");
- evictor.deactivate();
-
-
- System.out.println("ok");
+ //
+ // Now with keep
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].keepInCache();
+ servants[i].keepInCache();
+ servants[i].setTransientValue(i);
+ }
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ //
+ // Check the transient value
+ //
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == i);
+ }
+
+ //
+ // Again, after one release
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].release();
+ }
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == i);
+ }
+
+ //
+ // Again, after a second release
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].release();
+ }
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == -1);
+ }
+
+ //
+ // Release one more time
+ //
+ for(int i = 0; i < size; i++)
+ {
+ try
+ {
+ servants[i].release();
+ test(false);
+ }
+ catch(Test.NotRegisteredException e)
+ {
+ // Expected
+ }
+ }
+
+ //
+ // Deactivate and recreate evictor, to ensure that servants
+ // are restored properly after database close and reopen.
+ //
+ evictor.deactivate();
+ evictor = factory.createEvictor("Test");
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.getServant(id);
+ test(servants[i].getValue() == i);
+ }
+
+
+ //
+ // Test concurrent lookups with a smaller evictor
+ // size and one missing servant
+ //
+ evictor.setSize(size / 2);
+ servants[0].destroy();
+
+ {
+ int threadCount = size * 2;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new ReadThread(servants);
+ threads[i].start();
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+ }
+
+ //
+ // Clean up.
+ //
+ evictor.destroyAllServants("");
+ evictor.destroyAllServants("facet1");
+ evictor.destroyAllServants("facet2");
+
+ //
+ // CreateDestroy threads
+ //
+ {
+ int threadCount = size;;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new CreateDestroyThread(evictor, i, size);
+ threads[i].start();
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+
+ //
+ // Verify all destroyed
+ //
+ for(int i = 0; i < size; i++)
+ {
+ try
+ {
+ servants[i].getValue();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected
+ }
+ }
+ }
+
+ //
+ // Recreate servants.
+ //
+ servants = new Test.ServantPrx[size];
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.createServant(id, i);
+ }
+
+ //
+ // Deactivate in the middle of remote AMD operations
+ // (really testing Ice here)
+ //
+ {
+ int threadCount = size;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new ReadForeverThread(servants);
+ threads[i].start();
+ }
+
+ try
+ {
+ Thread.currentThread().sleep(500);
+ }
+ catch(InterruptedException e)
+ {
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ ReadForeverThread t = (ReadForeverThread)threads[i];
+ t.setEvictorState(StateDeactivating);
+ }
+ evictor.deactivate();
+ for(int i = 0; i < threadCount; i++)
+ {
+ ReadForeverThread t = (ReadForeverThread)threads[i];
+ t.setEvictorState(StateDeactivated);
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+ }
+
+ //
+ // Resurrect
+ //
+ evictor = factory.createEvictor("Test");
+ evictor.destroyAllServants("");
+
+ //
+ // Deactivate in the middle of adds
+ //
+ {
+ int threadCount = size;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new AddForeverThread(evictor, i);
+ threads[i].start();
+ }
+
+ try
+ {
+ Thread.currentThread().sleep(500);
+ }
+ catch(InterruptedException e)
+ {
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ AddForeverThread t = (AddForeverThread)threads[i];
+ t.setEvictorState(StateDeactivating);
+ }
+ evictor.deactivate();
+ for(int i = 0; i < threadCount; i++)
+ {
+ AddForeverThread t = (AddForeverThread)threads[i];
+ t.setEvictorState(StateDeactivated);
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+ }
+
+
+ //
+ // Clean up.
+ //
+ evictor = factory.createEvictor("Test");
+ evictor.destroyAllServants("");
+ evictor.deactivate();
+
+
+ System.out.println("ok");
factory.shutdown();
@@ -882,21 +882,21 @@ public class Client
ex.printStackTrace();
status = 1;
}
- catch(Test.AlreadyRegisteredException ex)
- {
- ex.printStackTrace();
+ catch(Test.AlreadyRegisteredException ex)
+ {
+ ex.printStackTrace();
status = 1;
- }
- catch(Test.NotRegisteredException ex)
- {
- ex.printStackTrace();
+ }
+ catch(Test.NotRegisteredException ex)
+ {
+ ex.printStackTrace();
status = 1;
- }
- catch(Test.EvictorDeactivatedException ex)
- {
- ex.printStackTrace();
+ }
+ catch(Test.EvictorDeactivatedException ex)
+ {
+ ex.printStackTrace();
status = 1;
- }
+ }
if(communicator != null)
{
@@ -911,7 +911,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Freeze/evictor/FacetI.java b/java/test/Freeze/evictor/FacetI.java
index 093a85eacf3..fe63af89be7 100644
--- a/java/test/Freeze/evictor/FacetI.java
+++ b/java/test/Freeze/evictor/FacetI.java
@@ -11,30 +11,30 @@ public class FacetI extends ServantI implements Test._FacetOperations
{
FacetI(Test.Facet tie)
{
- super(tie);
+ super(tie);
}
FacetI(Test.Servant tie, RemoteEvictorI remoteEvictor, Freeze.Evictor evictor, int value, String data)
{
- super(tie, remoteEvictor, evictor, value);
- ((Test.Facet)_tie).data = data;
+ super(tie, remoteEvictor, evictor, value);
+ ((Test.Facet)_tie).data = data;
}
public String
getData(Ice.Current current)
{
- synchronized(_tie)
- {
- return ((Test.Facet)_tie).data;
- }
+ synchronized(_tie)
+ {
+ return ((Test.Facet)_tie).data;
+ }
}
public void
setData(String data, Ice.Current current)
{
- synchronized(_tie)
- {
- ((Test.Facet)_tie).data = data;
- }
+ synchronized(_tie)
+ {
+ ((Test.Facet)_tie).data = data;
+ }
}
}
diff --git a/java/test/Freeze/evictor/RemoteEvictorFactoryI.java b/java/test/Freeze/evictor/RemoteEvictorFactoryI.java
index a33cc90a0b8..5ec691bdb86 100644
--- a/java/test/Freeze/evictor/RemoteEvictorFactoryI.java
+++ b/java/test/Freeze/evictor/RemoteEvictorFactoryI.java
@@ -12,16 +12,16 @@ public final class RemoteEvictorFactoryI extends Test._RemoteEvictorFactoryDisp
RemoteEvictorFactoryI(Ice.ObjectAdapter adapter, String envName)
{
_adapter = adapter;
- _envName = envName;
+ _envName = envName;
}
public Test.RemoteEvictorPrx
createEvictor(String name, Ice.Current current)
{
- RemoteEvictorI remoteEvictor = new RemoteEvictorI(_adapter, _envName, name);
- return Test.RemoteEvictorPrxHelper.
- uncheckedCast(_adapter.add(remoteEvictor, _adapter.getCommunicator().stringToIdentity(name)));
+ RemoteEvictorI remoteEvictor = new RemoteEvictorI(_adapter, _envName, name);
+ return Test.RemoteEvictorPrxHelper.
+ uncheckedCast(_adapter.add(remoteEvictor, _adapter.getCommunicator().stringToIdentity(name)));
}
public void
diff --git a/java/test/Freeze/evictor/RemoteEvictorI.java b/java/test/Freeze/evictor/RemoteEvictorI.java
index f17cf467b0c..1aece86c862 100644
--- a/java/test/Freeze/evictor/RemoteEvictorI.java
+++ b/java/test/Freeze/evictor/RemoteEvictorI.java
@@ -14,16 +14,16 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public void
initialize(Ice.ObjectAdapter adapter, Ice.Identity ident, String facet, Ice.Object servant)
{
- if(facet.length() == 0)
- {
- ServantI servantImpl = (ServantI) ((Test._ServantTie) servant).ice_delegate();
- servantImpl.init(_remoteEvictor, _evictor);
- }
- else
- {
- ServantI servantImpl = (ServantI) ((Test._FacetTie) servant).ice_delegate();
- servantImpl.init(_remoteEvictor, _evictor);
- }
+ if(facet.length() == 0)
+ {
+ ServantI servantImpl = (ServantI) ((Test._ServantTie) servant).ice_delegate();
+ servantImpl.init(_remoteEvictor, _evictor);
+ }
+ else
+ {
+ ServantI servantImpl = (ServantI) ((Test._FacetTie) servant).ice_delegate();
+ servantImpl.init(_remoteEvictor, _evictor);
+ }
}
void init(RemoteEvictorI remoteEvictor, Freeze.Evictor evictor)
@@ -39,19 +39,19 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
RemoteEvictorI(Ice.ObjectAdapter adapter, String envName, String category)
{
- _adapter = adapter;
+ _adapter = adapter;
_category = category;
- //
- // NOTE: COMPILERBUG: The timeout here is required for MacOS X.
- //
- _evictorAdapter = _adapter.getCommunicator().
- createObjectAdapterWithEndpoints(Ice.Util.generateUUID(), "default -t 30000");
+ //
+ // NOTE: COMPILERBUG: The timeout here is required for MacOS X.
+ //
+ _evictorAdapter = _adapter.getCommunicator().
+ createObjectAdapterWithEndpoints(Ice.Util.generateUUID(), "default -t 30000");
- Initializer initializer = new Initializer();
+ Initializer initializer = new Initializer();
- _evictor = Freeze.Util.createEvictor(_evictorAdapter, envName, category, initializer, null, true);
- initializer.init(this, _evictor);
+ _evictor = Freeze.Util.createEvictor(_evictorAdapter, envName, category, initializer, null, true);
+ initializer.init(this, _evictor);
_evictorAdapter.addServantLocator(_evictor, category);
_evictorAdapter.activate();
@@ -65,34 +65,34 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public Test.ServantPrx
createServant(String id, int value, Ice.Current current)
- throws Test.AlreadyRegisteredException, Test.EvictorDeactivatedException
+ throws Test.AlreadyRegisteredException, Test.EvictorDeactivatedException
{
Ice.Identity ident = new Ice.Identity();
ident.category = _category;
ident.name = id;
- Test._ServantTie tie = new Test._ServantTie();
- tie.ice_delegate(new ServantI(tie, this, _evictor, value));
- try
- {
- return Test.ServantPrxHelper.uncheckedCast(_evictor.add(tie, ident));
- }
- catch(Ice.AlreadyRegisteredException e)
- {
- throw new Test.AlreadyRegisteredException();
- }
- catch(Ice.ObjectAdapterDeactivatedException e)
- {
- throw new Test.EvictorDeactivatedException();
- }
- catch(Freeze.EvictorDeactivatedException e)
- {
- throw new Test.EvictorDeactivatedException();
- }
- catch(Ice.LocalException e)
- {
- System.out.println("Throwing " + e.toString());
- throw e;
- }
+ Test._ServantTie tie = new Test._ServantTie();
+ tie.ice_delegate(new ServantI(tie, this, _evictor, value));
+ try
+ {
+ return Test.ServantPrxHelper.uncheckedCast(_evictor.add(tie, ident));
+ }
+ catch(Ice.AlreadyRegisteredException e)
+ {
+ throw new Test.AlreadyRegisteredException();
+ }
+ catch(Ice.ObjectAdapterDeactivatedException e)
+ {
+ throw new Test.EvictorDeactivatedException();
+ }
+ catch(Freeze.EvictorDeactivatedException e)
+ {
+ throw new Test.EvictorDeactivatedException();
+ }
+ catch(Ice.LocalException e)
+ {
+ System.out.println("Throwing " + e.toString());
+ throw e;
+ }
}
public Test.ServantPrx
@@ -107,7 +107,7 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public void
saveNow(Ice.Current current)
{
- _evictor.getIterator("", 1);
+ _evictor.getIterator("", 1);
}
public void
@@ -120,17 +120,17 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public void
destroyAllServants(String facet, Ice.Current current)
{
- //
- // Only for test purpose: don't use such a small value in
- // a real application!
- //
- int batchSize = 2;
+ //
+ // Only for test purpose: don't use such a small value in
+ // a real application!
+ //
+ int batchSize = 2;
- Freeze.EvictorIterator p = _evictor.getIterator(facet, batchSize);
- while(p.hasNext())
- {
- _evictor.remove((Ice.Identity) p.next());
- }
+ Freeze.EvictorIterator p = _evictor.getIterator(facet, batchSize);
+ while(p.hasNext())
+ {
+ _evictor.remove((Ice.Identity) p.next());
+ }
}
private Ice.ObjectAdapter _adapter;
diff --git a/java/test/Freeze/evictor/ServantI.java b/java/test/Freeze/evictor/ServantI.java
index db7a7b4423d..3a50bd01054 100644
--- a/java/test/Freeze/evictor/ServantI.java
+++ b/java/test/Freeze/evictor/ServantI.java
@@ -10,40 +10,40 @@
public class ServantI implements Test._ServantOperations
{
static class DelayedResponse extends Thread
- {
- DelayedResponse(Test.AMD_Servant_slowGetValue cb, int val)
- {
- _cb = cb;
- _val = val;
- }
-
- public void
+ {
+ DelayedResponse(Test.AMD_Servant_slowGetValue cb, int val)
+ {
+ _cb = cb;
+ _val = val;
+ }
+
+ public void
run()
{
- try
- {
- sleep(500);
- }
- catch(InterruptedException e)
- {
- // Ignored
- }
- _cb.ice_response(_val);
- }
+ try
+ {
+ sleep(500);
+ }
+ catch(InterruptedException e)
+ {
+ // Ignored
+ }
+ _cb.ice_response(_val);
+ }
- private Test.AMD_Servant_slowGetValue _cb;
- private int _val;
+ private Test.AMD_Servant_slowGetValue _cb;
+ private int _val;
}
ServantI(Test.Servant tie)
{
- _tie = tie;
+ _tie = tie;
}
ServantI(Test.Servant tie, RemoteEvictorI remoteEvictor, Freeze.Evictor evictor, int value)
{
- _tie = tie;
+ _tie = tie;
_remoteEvictor = remoteEvictor;
_evictor = evictor;
_tie.value = value;
@@ -51,7 +51,7 @@ public class ServantI implements Test._ServantOperations
void
init(RemoteEvictorI remoteEvictor, Freeze.Evictor evictor)
- {
+ {
_remoteEvictor = remoteEvictor;
_evictor = evictor;
}
@@ -65,48 +65,48 @@ public class ServantI implements Test._ServantOperations
public int
getValue(Ice.Current current)
{
- synchronized(_tie)
- {
- return _tie.value;
- }
+ synchronized(_tie)
+ {
+ return _tie.value;
+ }
}
public void
slowGetValue_async(Test.AMD_Servant_slowGetValue cb, Ice.Current current)
{
- synchronized(_tie)
- {
- Thread t = new DelayedResponse(cb, _tie.value);
- t.setDaemon(true);
- t.start();
- }
+ synchronized(_tie)
+ {
+ Thread t = new DelayedResponse(cb, _tie.value);
+ t.setDaemon(true);
+ t.start();
+ }
}
public void
setValue(int value, Ice.Current current)
{
- synchronized(_tie)
- {
- _tie.value = value;
- }
+ synchronized(_tie)
+ {
+ _tie.value = value;
+ }
}
public void
setValueAsync_async(Test.AMD_Servant_setValueAsync __cb, int value, Ice.Current current)
{
- synchronized(_tie)
- {
- _setValueAsyncCB = __cb;
- _setValueAsyncValue = value;
+ synchronized(_tie)
+ {
+ _setValueAsyncCB = __cb;
+ _setValueAsyncValue = value;
_tie.notify();
- }
+ }
}
public void
releaseAsync(Ice.Current current)
{
- synchronized(_tie)
- {
+ synchronized(_tie)
+ {
while(_setValueAsyncCB == null)
{
try
@@ -127,66 +127,66 @@ public class ServantI implements Test._ServantOperations
public void
addFacet(String name, String data, Ice.Current current)
- throws Test.AlreadyRegisteredException
+ throws Test.AlreadyRegisteredException
{
- Test._FacetTie tie = new Test._FacetTie();
- tie.ice_delegate(new FacetI(tie, _remoteEvictor, _evictor, 0, data));
+ Test._FacetTie tie = new Test._FacetTie();
+ tie.ice_delegate(new FacetI(tie, _remoteEvictor, _evictor, 0, data));
- try
- {
- _evictor.addFacet(tie, current.id, name);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- throw new Test.AlreadyRegisteredException();
- }
+ try
+ {
+ _evictor.addFacet(tie, current.id, name);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ throw new Test.AlreadyRegisteredException();
+ }
}
public void
removeFacet(String name, Ice.Current current)
- throws Test.NotRegisteredException
+ throws Test.NotRegisteredException
{
- try
- {
- _evictor.removeFacet(current.id, name);
- }
- catch(Ice.NotRegisteredException ex)
- {
- throw new Test.NotRegisteredException();
- }
+ try
+ {
+ _evictor.removeFacet(current.id, name);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ throw new Test.NotRegisteredException();
+ }
}
public synchronized int
getTransientValue(Ice.Current current)
{
- return _transientValue;
+ return _transientValue;
}
public synchronized void
setTransientValue(int val, Ice.Current current)
{
- _transientValue = val;
+ _transientValue = val;
}
public void
keepInCache(Ice.Current current)
{
- _evictor.keep(current.id);
+ _evictor.keep(current.id);
}
public void
release(Ice.Current current)
- throws Test.NotRegisteredException
+ throws Test.NotRegisteredException
{
- try
- {
- _evictor.release(current.id);
- }
- catch(Ice.NotRegisteredException e)
- {
- throw new Test.NotRegisteredException();
- }
+ try
+ {
+ _evictor.release(current.id);
+ }
+ catch(Ice.NotRegisteredException e)
+ {
+ throw new Test.NotRegisteredException();
+ }
}
protected RemoteEvictorI _remoteEvictor;
diff --git a/java/test/Freeze/evictor/Server.java b/java/test/Freeze/evictor/Server.java
index 59533f1da32..a55456ed540 100644
--- a/java/test/Freeze/evictor/Server.java
+++ b/java/test/Freeze/evictor/Server.java
@@ -15,9 +15,9 @@ public class Server
create(String type)
{
assert(type.equals("::Test::Servant"));
- Test._ServantTie tie = new Test._ServantTie();
- tie.ice_delegate(new ServantI(tie));
- return tie;
+ Test._ServantTie tie = new Test._ServantTie();
+ tie.ice_delegate(new ServantI(tie));
+ return tie;
}
public void
@@ -32,9 +32,9 @@ public class Server
create(String type)
{
assert(type.equals("::Test::Facet"));
- Test._FacetTie tie = new Test._FacetTie();
- tie.ice_delegate(new FacetI(tie));
- return tie;
+ Test._FacetTie tie = new Test._FacetTie();
+ tie.ice_delegate(new FacetI(tie));
+ return tie;
}
public void
@@ -55,7 +55,7 @@ public class Server
Ice.ObjectFactory servantFactory = new ServantFactory();
communicator.addObjectFactory(servantFactory, "::Test::Servant");
- Ice.ObjectFactory facetFactory = new FacetFactory();
+ Ice.ObjectFactory facetFactory = new FacetFactory();
communicator.addObjectFactory(facetFactory, "::Test::Facet");
adapter.activate();
@@ -99,7 +99,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Freeze/evictor/Test.ice b/java/test/Freeze/evictor/Test.ice
index 4ab855c984c..e51e4b39a18 100644
--- a/java/test/Freeze/evictor/Test.ice
+++ b/java/test/Freeze/evictor/Test.ice
@@ -61,7 +61,7 @@ interface RemoteEvictor
idempotent void setSize(int size);
Servant* createServant(string id, int value)
- throws AlreadyRegisteredException, EvictorDeactivatedException;
+ throws AlreadyRegisteredException, EvictorDeactivatedException;
idempotent Servant* getServant(string id);
diff --git a/java/test/Freeze/oldevictor/Client.java b/java/test/Freeze/oldevictor/Client.java
index 50927871c5c..befe0e0ff49 100644
--- a/java/test/Freeze/oldevictor/Client.java
+++ b/java/test/Freeze/oldevictor/Client.java
@@ -33,38 +33,38 @@ public class Client
static class ReadThread extends Thread
{
- ReadThread(Test.ServantPrx[] servants)
- {
- _servants = servants;
- }
-
- public void run()
- {
- int loops = 10;
- while(loops-- > 0)
- {
- try
- {
- _servants[0].getValue();
- test(false);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected
- }
- catch(Exception e)
- {
- test(false);
- }
-
- for(int i = 1; i < _servants.length; ++i)
- {
- test(_servants[i].getValue() == i);
- }
- }
- }
-
- private Test.ServantPrx[] _servants;
+ ReadThread(Test.ServantPrx[] servants)
+ {
+ _servants = servants;
+ }
+
+ public void run()
+ {
+ int loops = 10;
+ while(loops-- > 0)
+ {
+ try
+ {
+ _servants[0].getValue();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected
+ }
+ catch(Exception e)
+ {
+ test(false);
+ }
+
+ for(int i = 1; i < _servants.length; ++i)
+ {
+ test(_servants[i].getValue() == i);
+ }
+ }
+ }
+
+ private Test.ServantPrx[] _servants;
}
public static final int StateRunning = 0;
@@ -73,268 +73,268 @@ public class Client
static class ReadForeverThread extends Thread
{
- ReadForeverThread(Test.ServantPrx[] servants)
- {
- _servants = servants;
- }
-
- public void
- run()
- {
- for(;;)
- {
- try
- {
- for(int i = 0; i < _servants.length; ++i)
- {
- if(getEvictorState() == StateDeactivated)
- {
- _servants[i].slowGetValue();
- test(false);
- }
- else
- {
- test(_servants[i].slowGetValue() == i);
- }
- }
- }
- catch(Ice.SocketException e)
- {
- //
- // Expected
- //
- test(validEx());
- return;
- }
- catch(Ice.LocalException e)
- {
- System.err.println("Caught unexpected : " + e.toString());
- test(false);
- return;
- }
- catch(Exception e)
- {
- test(false);
- return;
- }
- }
- }
-
- synchronized int
- getEvictorState()
- {
- return _state;
- }
-
- synchronized boolean
- validEx()
- {
- return _state == StateDeactivating || _state == StateDeactivated;
- }
-
- synchronized void
- setEvictorState(int s)
- {
- _state = s;
- }
-
- private Test.ServantPrx[] _servants;
- private int _state = StateRunning;
+ ReadForeverThread(Test.ServantPrx[] servants)
+ {
+ _servants = servants;
+ }
+
+ public void
+ run()
+ {
+ for(;;)
+ {
+ try
+ {
+ for(int i = 0; i < _servants.length; ++i)
+ {
+ if(getEvictorState() == StateDeactivated)
+ {
+ _servants[i].slowGetValue();
+ test(false);
+ }
+ else
+ {
+ test(_servants[i].slowGetValue() == i);
+ }
+ }
+ }
+ catch(Ice.SocketException e)
+ {
+ //
+ // Expected
+ //
+ test(validEx());
+ return;
+ }
+ catch(Ice.LocalException e)
+ {
+ System.err.println("Caught unexpected : " + e.toString());
+ test(false);
+ return;
+ }
+ catch(Exception e)
+ {
+ test(false);
+ return;
+ }
+ }
+ }
+
+ synchronized int
+ getEvictorState()
+ {
+ return _state;
+ }
+
+ synchronized boolean
+ validEx()
+ {
+ return _state == StateDeactivating || _state == StateDeactivated;
+ }
+
+ synchronized void
+ setEvictorState(int s)
+ {
+ _state = s;
+ }
+
+ private Test.ServantPrx[] _servants;
+ private int _state = StateRunning;
}
static class AddForeverThread extends Thread
- {
- AddForeverThread(Test.RemoteEvictorPrx evictor, int prefix)
- {
- _evictor = evictor;
- _prefix = "" + prefix;
- }
-
- public void
- run()
- {
- int index = 0;
-
- for(;;)
- {
- try
- {
- String id = _prefix + "-" + index++;
- if(getEvictorState() == StateDeactivated)
- {
- _evictor.createServant(id, 0);
- test(false);
- }
- else
- {
- _evictor.createServant(id, 0);
- }
- }
- catch(Test.EvictorDeactivatedException e)
- {
- //
- // Expected
- //
- test(validEx());
- return;
- }
- catch(Ice.ObjectNotExistException e)
- {
- //
- // Expected
- //
- test(validEx());
- return;
- }
- catch(Test.AlreadyRegisteredException e)
- {
- System.err.println("Caught unexpected AlreadyRegistedException:" + e.toString());
- System.err.println("index is " + index);
- test(false);
- return;
- }
- catch(Ice.LocalException e)
- {
- System.err.println("Caught unexpected : " + e.toString());
- e.printStackTrace();
- test(false);
- return;
- }
- catch(Exception e)
- {
- e.printStackTrace();
- test(false);
- return;
- }
- }
- }
-
- synchronized int
- getEvictorState()
- {
- return _state;
- }
-
- synchronized boolean
- validEx()
- {
- return _state == StateDeactivating || _state == StateDeactivated;
- }
-
- synchronized void
- setEvictorState(int s)
- {
- _state = s;
- }
-
- private Test.RemoteEvictorPrx _evictor;
- private String _prefix;
- private int _state = StateRunning;
+ {
+ AddForeverThread(Test.RemoteEvictorPrx evictor, int prefix)
+ {
+ _evictor = evictor;
+ _prefix = "" + prefix;
+ }
+
+ public void
+ run()
+ {
+ int index = 0;
+
+ for(;;)
+ {
+ try
+ {
+ String id = _prefix + "-" + index++;
+ if(getEvictorState() == StateDeactivated)
+ {
+ _evictor.createServant(id, 0);
+ test(false);
+ }
+ else
+ {
+ _evictor.createServant(id, 0);
+ }
+ }
+ catch(Test.EvictorDeactivatedException e)
+ {
+ //
+ // Expected
+ //
+ test(validEx());
+ return;
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ //
+ // Expected
+ //
+ test(validEx());
+ return;
+ }
+ catch(Test.AlreadyRegisteredException e)
+ {
+ System.err.println("Caught unexpected AlreadyRegistedException:" + e.toString());
+ System.err.println("index is " + index);
+ test(false);
+ return;
+ }
+ catch(Ice.LocalException e)
+ {
+ System.err.println("Caught unexpected : " + e.toString());
+ e.printStackTrace();
+ test(false);
+ return;
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ test(false);
+ return;
+ }
+ }
+ }
+
+ synchronized int
+ getEvictorState()
+ {
+ return _state;
+ }
+
+ synchronized boolean
+ validEx()
+ {
+ return _state == StateDeactivating || _state == StateDeactivated;
+ }
+
+ synchronized void
+ setEvictorState(int s)
+ {
+ _state = s;
+ }
+
+ private Test.RemoteEvictorPrx _evictor;
+ private String _prefix;
+ private int _state = StateRunning;
}
static class CreateDestroyThread extends Thread
{
- CreateDestroyThread(Test.RemoteEvictorPrx evictor, int id, int size)
- {
- _evictor = evictor;
- _id = "" + id;
- _size = size;
- }
-
- public void
- run()
- {
- try
- {
- int loops = 50;
- while(loops-- > 0)
- {
- for(int i = 0; i < _size; i++)
- {
- String id = "" + i;
- if(id.equals(_id))
- {
- //
- // Create when odd, destroy when even.
- //
-
- if(loops % 2 == 0)
- {
- Test.ServantPrx servant = _evictor.getServant(id);
- servant.destroy();
-
- //
- // Twice
- //
- try
- {
- servant.destroy();
- test(false);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected
- }
- }
- else
- {
- Test.ServantPrx servant = _evictor.createServant(id, i);
-
- //
- // Twice
- //
- try
- {
- servant = _evictor.createServant(id, 0);
- test(false);
- }
- catch(Test.AlreadyRegisteredException e)
- {
- // Expected
- }
- }
- }
- else
- {
- //
- // Just read/write the value
- //
- Test.ServantPrx servant = _evictor.getServant(id);
- try
- {
- int val = servant.getValue();
- test(val == i || val == -i);
- servant.setValue(-val);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected from time to time
- }
- }
- }
- }
- }
- catch(Exception e)
- {
- //
- // Unexpected!
- //
- test(false);
- }
- }
-
- private Test.RemoteEvictorPrx _evictor;
- private String _id;
- private int _size;
+ CreateDestroyThread(Test.RemoteEvictorPrx evictor, int id, int size)
+ {
+ _evictor = evictor;
+ _id = "" + id;
+ _size = size;
+ }
+
+ public void
+ run()
+ {
+ try
+ {
+ int loops = 50;
+ while(loops-- > 0)
+ {
+ for(int i = 0; i < _size; i++)
+ {
+ String id = "" + i;
+ if(id.equals(_id))
+ {
+ //
+ // Create when odd, destroy when even.
+ //
+
+ if(loops % 2 == 0)
+ {
+ Test.ServantPrx servant = _evictor.getServant(id);
+ servant.destroy();
+
+ //
+ // Twice
+ //
+ try
+ {
+ servant.destroy();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected
+ }
+ }
+ else
+ {
+ Test.ServantPrx servant = _evictor.createServant(id, i);
+
+ //
+ // Twice
+ //
+ try
+ {
+ servant = _evictor.createServant(id, 0);
+ test(false);
+ }
+ catch(Test.AlreadyRegisteredException e)
+ {
+ // Expected
+ }
+ }
+ }
+ else
+ {
+ //
+ // Just read/write the value
+ //
+ Test.ServantPrx servant = _evictor.getServant(id);
+ try
+ {
+ int val = servant.getValue();
+ test(val == i || val == -i);
+ servant.setValue(-val);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected from time to time
+ }
+ }
+ }
+ }
+ }
+ catch(Exception e)
+ {
+ //
+ // Unexpected!
+ //
+ test(false);
+ }
+ }
+
+ private Test.RemoteEvictorPrx _evictor;
+ private String _id;
+ private int _size;
}
private static int
run(String[] args, Ice.Communicator communicator)
- throws Test.AlreadyRegisteredException, Test.NotRegisteredException, Test.EvictorDeactivatedException
+ throws Test.AlreadyRegisteredException, Test.NotRegisteredException, Test.EvictorDeactivatedException
{
String ref = "factory:default -p 12010 -t 30000";
Ice.ObjectPrx base = communicator.stringToProxy(ref);
@@ -342,524 +342,524 @@ public class Client
Test.RemoteEvictorFactoryPrx factory = Test.RemoteEvictorFactoryPrxHelper.checkedCast(base);
- System.out.print("testing Freeze Evictor... ");
- System.out.flush();
-
- final int size = 5;
-
- Test.RemoteEvictorPrx evictor = factory.createEvictor("Test");
- evictor.setSize(size);
-
- //
- // Create some servants
- //
- Test.ServantPrx[] servants = new Test.ServantPrx[size];
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.createServant(id, i);
- servants[i].ice_ping();
-
- Test.FacetPrx facet1 = Test.FacetPrxHelper.uncheckedCast(servants[i], "facet1");
- try
- {
- facet1.ice_ping();
- test(false);
- }
- catch(Ice.FacetNotExistException e)
- {
- //
- // Expected
- //
- }
- servants[i].addFacet("facet1", "data");
- facet1.ice_ping();
- facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- facet1.setValue(10 * i);
- facet1.addFacet("facet2", "moreData");
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- facet2.setValue(100 * i);
- }
-
- //
- // Evict and verify values.
- //
- evictor.setSize(0);
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- servants[i].ice_ping();
- test(servants[i].getValue() == i);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- test(facet1.getValue() == 10 * i);
- test(facet1.getData().equals("data"));
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- test(facet2.getData().equals("moreData"));
- }
-
- //
- // Mutate servants.
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].setValue(i + 100);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- facet1.setValue(10 * i + 100);
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- facet2.setValue(100 * i + 100);
- }
-
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getValue() == i + 100);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- test(facet1.getValue() == 10 * i + 100);
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- test(facet2.getValue() == 100 * i + 100);
- }
-
- //
- // Evict and verify values.
- //
- evictor.setSize(0);
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getValue() == i + 100);
- Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
- test(facet1 != null);
- test(facet1.getValue() == 10 * i + 100);
- Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
- test(facet2 != null);
- test(facet2.getValue() == 100 * i + 100);
- }
-
- //
- // Test saving while busy
- //
-
- AMI_Servant_setValueAsyncI setCB = new AMI_Servant_setValueAsyncI();
- for(int i = 0; i < size; i++)
- {
- //
- // Start a mutating operation so that the object is not idle.
- //
- servants[i].setValueAsync_async(setCB, i + 300);
-
- test(servants[i].getValue() == i + 100);
- //
- // This operation modifies the object state but is not saved
- // because the setValueAsync operation is still pending.
- //
- servants[i].setValue(i + 200);
- test(servants[i].getValue() == i + 200);
-
- //
- // Force the response to setValueAsync
- //
- servants[i].releaseAsync();
- test(servants[i].getValue() == i + 300);
- }
-
-
- //
- // Add duplicate facet and catch corresponding exception
- //
- for(int i = 0; i < size; i++)
- {
- try
- {
- servants[i].addFacet("facet1", "foobar");
- test(false);
- }
- catch(Test.AlreadyRegisteredException ex)
- {
- }
- }
-
- //
- // Remove a facet that does not exist
- //
- try
- {
- servants[0].removeFacet("facet3");
- test(false);
- }
- catch(Test.NotRegisteredException ex)
- {
- }
-
- //
- // Remove all facets
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].removeFacet("facet1");
- servants[i].removeFacet("facet2");
- }
-
- evictor.setSize(0);
- evictor.setSize(size);
-
- //
- // Destroy servants and verify ObjectNotExistException.
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].destroy();
- try
- {
- servants[i].getValue();
- test(false);
- }
- catch(Ice.ObjectNotExistException ex)
- {
- // Expected
- }
-
- try
- {
- servants[i].ice_ping();
- test(false);
- }
- catch(Ice.ObjectNotExistException ex)
- {
- // Expected
- }
-
- }
-
- //
- // Allocate space for size servants.
- //
- servants = new Test.ServantPrx[size];
-
- //
- // Recreate servants, set transient value
- //
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.createServant(id, i);
- servants[i].setTransientValue(i);
- }
-
- //
- // Evict
- //
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
-
- //
- // Check the transient value
- //
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == -1);
- }
+ System.out.print("testing Freeze Evictor... ");
+ System.out.flush();
+
+ final int size = 5;
+
+ Test.RemoteEvictorPrx evictor = factory.createEvictor("Test");
+ evictor.setSize(size);
+
+ //
+ // Create some servants
+ //
+ Test.ServantPrx[] servants = new Test.ServantPrx[size];
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.createServant(id, i);
+ servants[i].ice_ping();
+
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.uncheckedCast(servants[i], "facet1");
+ try
+ {
+ facet1.ice_ping();
+ test(false);
+ }
+ catch(Ice.FacetNotExistException e)
+ {
+ //
+ // Expected
+ //
+ }
+ servants[i].addFacet("facet1", "data");
+ facet1.ice_ping();
+ facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ facet1.setValue(10 * i);
+ facet1.addFacet("facet2", "moreData");
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ facet2.setValue(100 * i);
+ }
+
+ //
+ // Evict and verify values.
+ //
+ evictor.setSize(0);
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].ice_ping();
+ test(servants[i].getValue() == i);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ test(facet1.getValue() == 10 * i);
+ test(facet1.getData().equals("data"));
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ test(facet2.getData().equals("moreData"));
+ }
+
+ //
+ // Mutate servants.
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].setValue(i + 100);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ facet1.setValue(10 * i + 100);
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ facet2.setValue(100 * i + 100);
+ }
+
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getValue() == i + 100);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ test(facet1.getValue() == 10 * i + 100);
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ test(facet2.getValue() == 100 * i + 100);
+ }
+
+ //
+ // Evict and verify values.
+ //
+ evictor.setSize(0);
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getValue() == i + 100);
+ Test.FacetPrx facet1 = Test.FacetPrxHelper.checkedCast(servants[i], "facet1");
+ test(facet1 != null);
+ test(facet1.getValue() == 10 * i + 100);
+ Test.FacetPrx facet2 = Test.FacetPrxHelper.checkedCast(facet1, "facet2");
+ test(facet2 != null);
+ test(facet2.getValue() == 100 * i + 100);
+ }
+
+ //
+ // Test saving while busy
+ //
+
+ AMI_Servant_setValueAsyncI setCB = new AMI_Servant_setValueAsyncI();
+ for(int i = 0; i < size; i++)
+ {
+ //
+ // Start a mutating operation so that the object is not idle.
+ //
+ servants[i].setValueAsync_async(setCB, i + 300);
+
+ test(servants[i].getValue() == i + 100);
+ //
+ // This operation modifies the object state but is not saved
+ // because the setValueAsync operation is still pending.
+ //
+ servants[i].setValue(i + 200);
+ test(servants[i].getValue() == i + 200);
+
+ //
+ // Force the response to setValueAsync
+ //
+ servants[i].releaseAsync();
+ test(servants[i].getValue() == i + 300);
+ }
+
+
+ //
+ // Add duplicate facet and catch corresponding exception
+ //
+ for(int i = 0; i < size; i++)
+ {
+ try
+ {
+ servants[i].addFacet("facet1", "foobar");
+ test(false);
+ }
+ catch(Test.AlreadyRegisteredException ex)
+ {
+ }
+ }
+
+ //
+ // Remove a facet that does not exist
+ //
+ try
+ {
+ servants[0].removeFacet("facet3");
+ test(false);
+ }
+ catch(Test.NotRegisteredException ex)
+ {
+ }
+
+ //
+ // Remove all facets
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].removeFacet("facet1");
+ servants[i].removeFacet("facet2");
+ }
+
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ //
+ // Destroy servants and verify ObjectNotExistException.
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].destroy();
+ try
+ {
+ servants[i].getValue();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ // Expected
+ }
+
+ try
+ {
+ servants[i].ice_ping();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ // Expected
+ }
+
+ }
+
+ //
+ // Allocate space for size servants.
+ //
+ servants = new Test.ServantPrx[size];
+
+ //
+ // Recreate servants, set transient value
+ //
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.createServant(id, i);
+ servants[i].setTransientValue(i);
+ }
+
+ //
+ // Evict
+ //
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ //
+ // Check the transient value
+ //
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == -1);
+ }
- //
- // Now with keep
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].keepInCache();
- servants[i].keepInCache();
- servants[i].setTransientValue(i);
- }
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
-
- //
- // Check the transient value
- //
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == i);
- }
-
- //
- // Again, after one release
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].release();
- }
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == i);
- }
-
- //
- // Again, after a second release
- //
- for(int i = 0; i < size; i++)
- {
- servants[i].release();
- }
- evictor.saveNow();
- evictor.setSize(0);
- evictor.setSize(size);
-
- for(int i = 0; i < size; i++)
- {
- test(servants[i].getTransientValue() == -1);
- }
-
- //
- // Release one more time
- //
- for(int i = 0; i < size; i++)
- {
- try
- {
- servants[i].release();
- test(false);
- }
- catch(Test.NotRegisteredException e)
- {
- // Expected
- }
- }
-
- //
- // Deactivate and recreate evictor, to ensure that servants
- // are restored properly after database close and reopen.
- //
- evictor.deactivate();
- evictor = factory.createEvictor("Test");
- evictor.setSize(size);
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.getServant(id);
- test(servants[i].getValue() == i);
- }
-
-
- //
- // Test concurrent lookups with a smaller evictor
- // size and one missing servant
- //
- evictor.setSize(size / 2);
- servants[0].destroy();
-
- {
- int threadCount = size * 2;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new ReadThread(servants);
- threads[i].start();
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
- }
-
- //
- // Clean up.
- //
- evictor.destroyAllServants("");
- evictor.destroyAllServants("facet1");
- evictor.destroyAllServants("facet2");
-
- //
- // CreateDestroy threads
- //
- {
- int threadCount = size;;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new CreateDestroyThread(evictor, i, size);
- threads[i].start();
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
-
- //
- // Verify all destroyed
- //
- for(int i = 0; i < size; i++)
- {
- try
- {
- servants[i].getValue();
- test(false);
- }
- catch(Ice.ObjectNotExistException e)
- {
- // Expected
- }
- }
- }
-
- //
- // Recreate servants.
- //
- servants = new Test.ServantPrx[size];
- for(int i = 0; i < size; i++)
- {
- String id = "" + i;
- servants[i] = evictor.createServant(id, i);
- }
-
- //
- // Deactivate in the middle of remote AMD operations
- // (really testing Ice here)
- //
- {
- int threadCount = size;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new ReadForeverThread(servants);
- threads[i].start();
- }
-
- try
- {
- Thread.currentThread().sleep(500);
- }
- catch(InterruptedException e)
- {
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- ReadForeverThread t = (ReadForeverThread)threads[i];
- t.setEvictorState(StateDeactivating);
- }
- evictor.deactivate();
- for(int i = 0; i < threadCount; i++)
- {
- ReadForeverThread t = (ReadForeverThread)threads[i];
- t.setEvictorState(StateDeactivated);
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
- }
-
- //
- // Resurrect
- //
- evictor = factory.createEvictor("Test");
- evictor.destroyAllServants("");
-
- //
- // Deactivate in the middle of adds
- //
- {
- int threadCount = size;
-
- Thread[] threads = new Thread[threadCount];
- for(int i = 0; i < threadCount; i++)
- {
- threads[i] = new AddForeverThread(evictor, i);
- threads[i].start();
- }
-
- try
- {
- Thread.currentThread().sleep(500);
- }
- catch(InterruptedException e)
- {
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- AddForeverThread t = (AddForeverThread)threads[i];
- t.setEvictorState(StateDeactivating);
- }
- evictor.deactivate();
- for(int i = 0; i < threadCount; i++)
- {
- AddForeverThread t = (AddForeverThread)threads[i];
- t.setEvictorState(StateDeactivated);
- }
-
- for(int i = 0; i < threadCount; i++)
- {
- for(;;)
- {
- try
- {
- threads[i].join(0);
- break;
- }
- catch(InterruptedException e)
- {
- }
- }
- }
- }
-
-
- //
- // Clean up.
- //
- evictor = factory.createEvictor("Test");
- evictor.destroyAllServants("");
- evictor.deactivate();
-
-
- System.out.println("ok");
+ //
+ // Now with keep
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].keepInCache();
+ servants[i].keepInCache();
+ servants[i].setTransientValue(i);
+ }
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ //
+ // Check the transient value
+ //
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == i);
+ }
+
+ //
+ // Again, after one release
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].release();
+ }
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == i);
+ }
+
+ //
+ // Again, after a second release
+ //
+ for(int i = 0; i < size; i++)
+ {
+ servants[i].release();
+ }
+ evictor.saveNow();
+ evictor.setSize(0);
+ evictor.setSize(size);
+
+ for(int i = 0; i < size; i++)
+ {
+ test(servants[i].getTransientValue() == -1);
+ }
+
+ //
+ // Release one more time
+ //
+ for(int i = 0; i < size; i++)
+ {
+ try
+ {
+ servants[i].release();
+ test(false);
+ }
+ catch(Test.NotRegisteredException e)
+ {
+ // Expected
+ }
+ }
+
+ //
+ // Deactivate and recreate evictor, to ensure that servants
+ // are restored properly after database close and reopen.
+ //
+ evictor.deactivate();
+ evictor = factory.createEvictor("Test");
+ evictor.setSize(size);
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.getServant(id);
+ test(servants[i].getValue() == i);
+ }
+
+
+ //
+ // Test concurrent lookups with a smaller evictor
+ // size and one missing servant
+ //
+ evictor.setSize(size / 2);
+ servants[0].destroy();
+
+ {
+ int threadCount = size * 2;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new ReadThread(servants);
+ threads[i].start();
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+ }
+
+ //
+ // Clean up.
+ //
+ evictor.destroyAllServants("");
+ evictor.destroyAllServants("facet1");
+ evictor.destroyAllServants("facet2");
+
+ //
+ // CreateDestroy threads
+ //
+ {
+ int threadCount = size;;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new CreateDestroyThread(evictor, i, size);
+ threads[i].start();
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+
+ //
+ // Verify all destroyed
+ //
+ for(int i = 0; i < size; i++)
+ {
+ try
+ {
+ servants[i].getValue();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException e)
+ {
+ // Expected
+ }
+ }
+ }
+
+ //
+ // Recreate servants.
+ //
+ servants = new Test.ServantPrx[size];
+ for(int i = 0; i < size; i++)
+ {
+ String id = "" + i;
+ servants[i] = evictor.createServant(id, i);
+ }
+
+ //
+ // Deactivate in the middle of remote AMD operations
+ // (really testing Ice here)
+ //
+ {
+ int threadCount = size;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new ReadForeverThread(servants);
+ threads[i].start();
+ }
+
+ try
+ {
+ Thread.currentThread().sleep(500);
+ }
+ catch(InterruptedException e)
+ {
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ ReadForeverThread t = (ReadForeverThread)threads[i];
+ t.setEvictorState(StateDeactivating);
+ }
+ evictor.deactivate();
+ for(int i = 0; i < threadCount; i++)
+ {
+ ReadForeverThread t = (ReadForeverThread)threads[i];
+ t.setEvictorState(StateDeactivated);
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+ }
+
+ //
+ // Resurrect
+ //
+ evictor = factory.createEvictor("Test");
+ evictor.destroyAllServants("");
+
+ //
+ // Deactivate in the middle of adds
+ //
+ {
+ int threadCount = size;
+
+ Thread[] threads = new Thread[threadCount];
+ for(int i = 0; i < threadCount; i++)
+ {
+ threads[i] = new AddForeverThread(evictor, i);
+ threads[i].start();
+ }
+
+ try
+ {
+ Thread.currentThread().sleep(500);
+ }
+ catch(InterruptedException e)
+ {
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ AddForeverThread t = (AddForeverThread)threads[i];
+ t.setEvictorState(StateDeactivating);
+ }
+ evictor.deactivate();
+ for(int i = 0; i < threadCount; i++)
+ {
+ AddForeverThread t = (AddForeverThread)threads[i];
+ t.setEvictorState(StateDeactivated);
+ }
+
+ for(int i = 0; i < threadCount; i++)
+ {
+ for(;;)
+ {
+ try
+ {
+ threads[i].join(0);
+ break;
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+ }
+ }
+
+
+ //
+ // Clean up.
+ //
+ evictor = factory.createEvictor("Test");
+ evictor.destroyAllServants("");
+ evictor.deactivate();
+
+
+ System.out.println("ok");
factory.shutdown();
@@ -882,21 +882,21 @@ public class Client
ex.printStackTrace();
status = 1;
}
- catch(Test.AlreadyRegisteredException ex)
- {
- ex.printStackTrace();
+ catch(Test.AlreadyRegisteredException ex)
+ {
+ ex.printStackTrace();
status = 1;
- }
- catch(Test.NotRegisteredException ex)
- {
- ex.printStackTrace();
+ }
+ catch(Test.NotRegisteredException ex)
+ {
+ ex.printStackTrace();
status = 1;
- }
- catch(Test.EvictorDeactivatedException ex)
- {
- ex.printStackTrace();
+ }
+ catch(Test.EvictorDeactivatedException ex)
+ {
+ ex.printStackTrace();
status = 1;
- }
+ }
if(communicator != null)
{
@@ -911,7 +911,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Freeze/oldevictor/FacetI.java b/java/test/Freeze/oldevictor/FacetI.java
index 093a85eacf3..fe63af89be7 100644
--- a/java/test/Freeze/oldevictor/FacetI.java
+++ b/java/test/Freeze/oldevictor/FacetI.java
@@ -11,30 +11,30 @@ public class FacetI extends ServantI implements Test._FacetOperations
{
FacetI(Test.Facet tie)
{
- super(tie);
+ super(tie);
}
FacetI(Test.Servant tie, RemoteEvictorI remoteEvictor, Freeze.Evictor evictor, int value, String data)
{
- super(tie, remoteEvictor, evictor, value);
- ((Test.Facet)_tie).data = data;
+ super(tie, remoteEvictor, evictor, value);
+ ((Test.Facet)_tie).data = data;
}
public String
getData(Ice.Current current)
{
- synchronized(_tie)
- {
- return ((Test.Facet)_tie).data;
- }
+ synchronized(_tie)
+ {
+ return ((Test.Facet)_tie).data;
+ }
}
public void
setData(String data, Ice.Current current)
{
- synchronized(_tie)
- {
- ((Test.Facet)_tie).data = data;
- }
+ synchronized(_tie)
+ {
+ ((Test.Facet)_tie).data = data;
+ }
}
}
diff --git a/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java b/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java
index a33cc90a0b8..5ec691bdb86 100644
--- a/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java
+++ b/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java
@@ -12,16 +12,16 @@ public final class RemoteEvictorFactoryI extends Test._RemoteEvictorFactoryDisp
RemoteEvictorFactoryI(Ice.ObjectAdapter adapter, String envName)
{
_adapter = adapter;
- _envName = envName;
+ _envName = envName;
}
public Test.RemoteEvictorPrx
createEvictor(String name, Ice.Current current)
{
- RemoteEvictorI remoteEvictor = new RemoteEvictorI(_adapter, _envName, name);
- return Test.RemoteEvictorPrxHelper.
- uncheckedCast(_adapter.add(remoteEvictor, _adapter.getCommunicator().stringToIdentity(name)));
+ RemoteEvictorI remoteEvictor = new RemoteEvictorI(_adapter, _envName, name);
+ return Test.RemoteEvictorPrxHelper.
+ uncheckedCast(_adapter.add(remoteEvictor, _adapter.getCommunicator().stringToIdentity(name)));
}
public void
diff --git a/java/test/Freeze/oldevictor/RemoteEvictorI.java b/java/test/Freeze/oldevictor/RemoteEvictorI.java
index f17cf467b0c..1aece86c862 100644
--- a/java/test/Freeze/oldevictor/RemoteEvictorI.java
+++ b/java/test/Freeze/oldevictor/RemoteEvictorI.java
@@ -14,16 +14,16 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public void
initialize(Ice.ObjectAdapter adapter, Ice.Identity ident, String facet, Ice.Object servant)
{
- if(facet.length() == 0)
- {
- ServantI servantImpl = (ServantI) ((Test._ServantTie) servant).ice_delegate();
- servantImpl.init(_remoteEvictor, _evictor);
- }
- else
- {
- ServantI servantImpl = (ServantI) ((Test._FacetTie) servant).ice_delegate();
- servantImpl.init(_remoteEvictor, _evictor);
- }
+ if(facet.length() == 0)
+ {
+ ServantI servantImpl = (ServantI) ((Test._ServantTie) servant).ice_delegate();
+ servantImpl.init(_remoteEvictor, _evictor);
+ }
+ else
+ {
+ ServantI servantImpl = (ServantI) ((Test._FacetTie) servant).ice_delegate();
+ servantImpl.init(_remoteEvictor, _evictor);
+ }
}
void init(RemoteEvictorI remoteEvictor, Freeze.Evictor evictor)
@@ -39,19 +39,19 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
RemoteEvictorI(Ice.ObjectAdapter adapter, String envName, String category)
{
- _adapter = adapter;
+ _adapter = adapter;
_category = category;
- //
- // NOTE: COMPILERBUG: The timeout here is required for MacOS X.
- //
- _evictorAdapter = _adapter.getCommunicator().
- createObjectAdapterWithEndpoints(Ice.Util.generateUUID(), "default -t 30000");
+ //
+ // NOTE: COMPILERBUG: The timeout here is required for MacOS X.
+ //
+ _evictorAdapter = _adapter.getCommunicator().
+ createObjectAdapterWithEndpoints(Ice.Util.generateUUID(), "default -t 30000");
- Initializer initializer = new Initializer();
+ Initializer initializer = new Initializer();
- _evictor = Freeze.Util.createEvictor(_evictorAdapter, envName, category, initializer, null, true);
- initializer.init(this, _evictor);
+ _evictor = Freeze.Util.createEvictor(_evictorAdapter, envName, category, initializer, null, true);
+ initializer.init(this, _evictor);
_evictorAdapter.addServantLocator(_evictor, category);
_evictorAdapter.activate();
@@ -65,34 +65,34 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public Test.ServantPrx
createServant(String id, int value, Ice.Current current)
- throws Test.AlreadyRegisteredException, Test.EvictorDeactivatedException
+ throws Test.AlreadyRegisteredException, Test.EvictorDeactivatedException
{
Ice.Identity ident = new Ice.Identity();
ident.category = _category;
ident.name = id;
- Test._ServantTie tie = new Test._ServantTie();
- tie.ice_delegate(new ServantI(tie, this, _evictor, value));
- try
- {
- return Test.ServantPrxHelper.uncheckedCast(_evictor.add(tie, ident));
- }
- catch(Ice.AlreadyRegisteredException e)
- {
- throw new Test.AlreadyRegisteredException();
- }
- catch(Ice.ObjectAdapterDeactivatedException e)
- {
- throw new Test.EvictorDeactivatedException();
- }
- catch(Freeze.EvictorDeactivatedException e)
- {
- throw new Test.EvictorDeactivatedException();
- }
- catch(Ice.LocalException e)
- {
- System.out.println("Throwing " + e.toString());
- throw e;
- }
+ Test._ServantTie tie = new Test._ServantTie();
+ tie.ice_delegate(new ServantI(tie, this, _evictor, value));
+ try
+ {
+ return Test.ServantPrxHelper.uncheckedCast(_evictor.add(tie, ident));
+ }
+ catch(Ice.AlreadyRegisteredException e)
+ {
+ throw new Test.AlreadyRegisteredException();
+ }
+ catch(Ice.ObjectAdapterDeactivatedException e)
+ {
+ throw new Test.EvictorDeactivatedException();
+ }
+ catch(Freeze.EvictorDeactivatedException e)
+ {
+ throw new Test.EvictorDeactivatedException();
+ }
+ catch(Ice.LocalException e)
+ {
+ System.out.println("Throwing " + e.toString());
+ throw e;
+ }
}
public Test.ServantPrx
@@ -107,7 +107,7 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public void
saveNow(Ice.Current current)
{
- _evictor.getIterator("", 1);
+ _evictor.getIterator("", 1);
}
public void
@@ -120,17 +120,17 @@ public final class RemoteEvictorI extends Test._RemoteEvictorDisp
public void
destroyAllServants(String facet, Ice.Current current)
{
- //
- // Only for test purpose: don't use such a small value in
- // a real application!
- //
- int batchSize = 2;
+ //
+ // Only for test purpose: don't use such a small value in
+ // a real application!
+ //
+ int batchSize = 2;
- Freeze.EvictorIterator p = _evictor.getIterator(facet, batchSize);
- while(p.hasNext())
- {
- _evictor.remove((Ice.Identity) p.next());
- }
+ Freeze.EvictorIterator p = _evictor.getIterator(facet, batchSize);
+ while(p.hasNext())
+ {
+ _evictor.remove((Ice.Identity) p.next());
+ }
}
private Ice.ObjectAdapter _adapter;
diff --git a/java/test/Freeze/oldevictor/ServantI.java b/java/test/Freeze/oldevictor/ServantI.java
index db7a7b4423d..3a50bd01054 100644
--- a/java/test/Freeze/oldevictor/ServantI.java
+++ b/java/test/Freeze/oldevictor/ServantI.java
@@ -10,40 +10,40 @@
public class ServantI implements Test._ServantOperations
{
static class DelayedResponse extends Thread
- {
- DelayedResponse(Test.AMD_Servant_slowGetValue cb, int val)
- {
- _cb = cb;
- _val = val;
- }
-
- public void
+ {
+ DelayedResponse(Test.AMD_Servant_slowGetValue cb, int val)
+ {
+ _cb = cb;
+ _val = val;
+ }
+
+ public void
run()
{
- try
- {
- sleep(500);
- }
- catch(InterruptedException e)
- {
- // Ignored
- }
- _cb.ice_response(_val);
- }
+ try
+ {
+ sleep(500);
+ }
+ catch(InterruptedException e)
+ {
+ // Ignored
+ }
+ _cb.ice_response(_val);
+ }
- private Test.AMD_Servant_slowGetValue _cb;
- private int _val;
+ private Test.AMD_Servant_slowGetValue _cb;
+ private int _val;
}
ServantI(Test.Servant tie)
{
- _tie = tie;
+ _tie = tie;
}
ServantI(Test.Servant tie, RemoteEvictorI remoteEvictor, Freeze.Evictor evictor, int value)
{
- _tie = tie;
+ _tie = tie;
_remoteEvictor = remoteEvictor;
_evictor = evictor;
_tie.value = value;
@@ -51,7 +51,7 @@ public class ServantI implements Test._ServantOperations
void
init(RemoteEvictorI remoteEvictor, Freeze.Evictor evictor)
- {
+ {
_remoteEvictor = remoteEvictor;
_evictor = evictor;
}
@@ -65,48 +65,48 @@ public class ServantI implements Test._ServantOperations
public int
getValue(Ice.Current current)
{
- synchronized(_tie)
- {
- return _tie.value;
- }
+ synchronized(_tie)
+ {
+ return _tie.value;
+ }
}
public void
slowGetValue_async(Test.AMD_Servant_slowGetValue cb, Ice.Current current)
{
- synchronized(_tie)
- {
- Thread t = new DelayedResponse(cb, _tie.value);
- t.setDaemon(true);
- t.start();
- }
+ synchronized(_tie)
+ {
+ Thread t = new DelayedResponse(cb, _tie.value);
+ t.setDaemon(true);
+ t.start();
+ }
}
public void
setValue(int value, Ice.Current current)
{
- synchronized(_tie)
- {
- _tie.value = value;
- }
+ synchronized(_tie)
+ {
+ _tie.value = value;
+ }
}
public void
setValueAsync_async(Test.AMD_Servant_setValueAsync __cb, int value, Ice.Current current)
{
- synchronized(_tie)
- {
- _setValueAsyncCB = __cb;
- _setValueAsyncValue = value;
+ synchronized(_tie)
+ {
+ _setValueAsyncCB = __cb;
+ _setValueAsyncValue = value;
_tie.notify();
- }
+ }
}
public void
releaseAsync(Ice.Current current)
{
- synchronized(_tie)
- {
+ synchronized(_tie)
+ {
while(_setValueAsyncCB == null)
{
try
@@ -127,66 +127,66 @@ public class ServantI implements Test._ServantOperations
public void
addFacet(String name, String data, Ice.Current current)
- throws Test.AlreadyRegisteredException
+ throws Test.AlreadyRegisteredException
{
- Test._FacetTie tie = new Test._FacetTie();
- tie.ice_delegate(new FacetI(tie, _remoteEvictor, _evictor, 0, data));
+ Test._FacetTie tie = new Test._FacetTie();
+ tie.ice_delegate(new FacetI(tie, _remoteEvictor, _evictor, 0, data));
- try
- {
- _evictor.addFacet(tie, current.id, name);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- throw new Test.AlreadyRegisteredException();
- }
+ try
+ {
+ _evictor.addFacet(tie, current.id, name);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ throw new Test.AlreadyRegisteredException();
+ }
}
public void
removeFacet(String name, Ice.Current current)
- throws Test.NotRegisteredException
+ throws Test.NotRegisteredException
{
- try
- {
- _evictor.removeFacet(current.id, name);
- }
- catch(Ice.NotRegisteredException ex)
- {
- throw new Test.NotRegisteredException();
- }
+ try
+ {
+ _evictor.removeFacet(current.id, name);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ throw new Test.NotRegisteredException();
+ }
}
public synchronized int
getTransientValue(Ice.Current current)
{
- return _transientValue;
+ return _transientValue;
}
public synchronized void
setTransientValue(int val, Ice.Current current)
{
- _transientValue = val;
+ _transientValue = val;
}
public void
keepInCache(Ice.Current current)
{
- _evictor.keep(current.id);
+ _evictor.keep(current.id);
}
public void
release(Ice.Current current)
- throws Test.NotRegisteredException
+ throws Test.NotRegisteredException
{
- try
- {
- _evictor.release(current.id);
- }
- catch(Ice.NotRegisteredException e)
- {
- throw new Test.NotRegisteredException();
- }
+ try
+ {
+ _evictor.release(current.id);
+ }
+ catch(Ice.NotRegisteredException e)
+ {
+ throw new Test.NotRegisteredException();
+ }
}
protected RemoteEvictorI _remoteEvictor;
diff --git a/java/test/Freeze/oldevictor/Server.java b/java/test/Freeze/oldevictor/Server.java
index 59533f1da32..a55456ed540 100644
--- a/java/test/Freeze/oldevictor/Server.java
+++ b/java/test/Freeze/oldevictor/Server.java
@@ -15,9 +15,9 @@ public class Server
create(String type)
{
assert(type.equals("::Test::Servant"));
- Test._ServantTie tie = new Test._ServantTie();
- tie.ice_delegate(new ServantI(tie));
- return tie;
+ Test._ServantTie tie = new Test._ServantTie();
+ tie.ice_delegate(new ServantI(tie));
+ return tie;
}
public void
@@ -32,9 +32,9 @@ public class Server
create(String type)
{
assert(type.equals("::Test::Facet"));
- Test._FacetTie tie = new Test._FacetTie();
- tie.ice_delegate(new FacetI(tie));
- return tie;
+ Test._FacetTie tie = new Test._FacetTie();
+ tie.ice_delegate(new FacetI(tie));
+ return tie;
}
public void
@@ -55,7 +55,7 @@ public class Server
Ice.ObjectFactory servantFactory = new ServantFactory();
communicator.addObjectFactory(servantFactory, "::Test::Servant");
- Ice.ObjectFactory facetFactory = new FacetFactory();
+ Ice.ObjectFactory facetFactory = new FacetFactory();
communicator.addObjectFactory(facetFactory, "::Test::Facet");
adapter.activate();
@@ -99,7 +99,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Freeze/oldevictor/Test.ice b/java/test/Freeze/oldevictor/Test.ice
index f1ee08793eb..61610763814 100644
--- a/java/test/Freeze/oldevictor/Test.ice
+++ b/java/test/Freeze/oldevictor/Test.ice
@@ -61,7 +61,7 @@ interface RemoteEvictor
void setSize(int size);
Servant* createServant(string id, int value)
- throws AlreadyRegisteredException, EvictorDeactivatedException;
+ throws AlreadyRegisteredException, EvictorDeactivatedException;
Servant* getServant(string id);
diff --git a/java/test/Glacier2/attack/AttackClient.java b/java/test/Glacier2/attack/AttackClient.java
index 16881c6b1ea..48208139d13 100644
--- a/java/test/Glacier2/attack/AttackClient.java
+++ b/java/test/Glacier2/attack/AttackClient.java
@@ -15,113 +15,113 @@ class AttackClient extends Ice.Application
run(String[] args)
{
System.out.print("getting router... ");
- System.out.flush();
- Ice.ObjectPrx routerBase = communicator().stringToProxy("Glacier2/router:default -p 12347 -t 10000");
- Glacier2.RouterPrx router = Glacier2.RouterPrxHelper.checkedCast(routerBase);
- test(router != null);
- System.out.println("ok");
+ System.out.flush();
+ Ice.ObjectPrx routerBase = communicator().stringToProxy("Glacier2/router:default -p 12347 -t 10000");
+ Glacier2.RouterPrx router = Glacier2.RouterPrxHelper.checkedCast(routerBase);
+ test(router != null);
+ System.out.println("ok");
System.out.print("creating session... ");
- System.out.flush();
- try
- {
- Glacier2.SessionPrx session = router.createSession("userid", "abc123");
- }
- catch(Glacier2.PermissionDeniedException ex)
- {
- assert(false);
- }
- catch(Glacier2.CannotCreateSessionException ex)
- {
- assert(false);
- }
- communicator().setDefaultRouter(router);
- System.out.println("ok");
+ System.out.flush();
+ try
+ {
+ Glacier2.SessionPrx session = router.createSession("userid", "abc123");
+ }
+ catch(Glacier2.PermissionDeniedException ex)
+ {
+ assert(false);
+ }
+ catch(Glacier2.CannotCreateSessionException ex)
+ {
+ assert(false);
+ }
+ communicator().setDefaultRouter(router);
+ System.out.println("ok");
System.out.print("making thousands of invocations on proxies... ");
- System.out.flush();
- Ice.ObjectPrx backendBase = communicator().stringToProxy("dummy:tcp -p 12010 -t 10000");
- BackendPrx backend = BackendPrxHelper.uncheckedCast(backendBase);
- backend.ice_ping();
-
- java.util.HashMap backends = new java.util.HashMap();
- java.util.Random rand = new java.util.Random();
-
- String msg = "";
- for(int i = 1; i <= 10000; ++i)
- {
- if(i % 100 == 0)
- {
- for(int j = 0; j < msg.length(); ++j)
- {
- System.out.print('\b');
- }
-
- msg = "" + i;
- System.out.print(i);
- System.out.flush();
- }
-
- Ice.Identity ident = new Ice.Identity();
-
- StringBuffer name = new StringBuffer();
- name.append((char)('A' + rand.nextInt(26)));
- ident.name = name.toString();
-
- StringBuffer category = new StringBuffer();
- int len = rand.nextInt(2);
- for(int j = 0; j < len; ++j)
- {
- category.append((char)('a' + rand.nextInt(26)));
- }
- ident.category = category.toString();
-
- BackendPrx newBackend = BackendPrxHelper.uncheckedCast(backendBase.ice_identity(ident));
-
- if(!backends.containsKey(newBackend))
- {
- backends.put(newBackend, newBackend);
- backend = newBackend;
- }
- else
- {
- backend = (BackendPrx)backends.get(newBackend);
- }
-
- backend.ice_ping();
- }
-
- for(int j = 0; j < msg.length(); ++j)
- {
- System.out.print('\b');
- }
- for(int j = 0; j < msg.length(); ++j)
- {
- System.out.print(' ');
- }
- for(int j = 0; j < msg.length(); ++j)
- {
- System.out.print('\b');
- }
- System.out.println("ok");
-
- System.out.print("testing server and router shutdown... ");
- System.out.flush();
- backend.shutdown();
- communicator().setDefaultRouter(null);
- Ice.ObjectPrx adminBase = communicator().stringToProxy("Glacier2/admin:tcp -h 127.0.0.1 -p 12348 -t 10000");
- Glacier2.AdminPrx admin = Glacier2.AdminPrxHelper.checkedCast(adminBase);
- test(admin != null);
- admin.shutdown();
- try
- {
- admin.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- System.out.println("ok");
- }
+ System.out.flush();
+ Ice.ObjectPrx backendBase = communicator().stringToProxy("dummy:tcp -p 12010 -t 10000");
+ BackendPrx backend = BackendPrxHelper.uncheckedCast(backendBase);
+ backend.ice_ping();
+
+ java.util.HashMap backends = new java.util.HashMap();
+ java.util.Random rand = new java.util.Random();
+
+ String msg = "";
+ for(int i = 1; i <= 10000; ++i)
+ {
+ if(i % 100 == 0)
+ {
+ for(int j = 0; j < msg.length(); ++j)
+ {
+ System.out.print('\b');
+ }
+
+ msg = "" + i;
+ System.out.print(i);
+ System.out.flush();
+ }
+
+ Ice.Identity ident = new Ice.Identity();
+
+ StringBuffer name = new StringBuffer();
+ name.append((char)('A' + rand.nextInt(26)));
+ ident.name = name.toString();
+
+ StringBuffer category = new StringBuffer();
+ int len = rand.nextInt(2);
+ for(int j = 0; j < len; ++j)
+ {
+ category.append((char)('a' + rand.nextInt(26)));
+ }
+ ident.category = category.toString();
+
+ BackendPrx newBackend = BackendPrxHelper.uncheckedCast(backendBase.ice_identity(ident));
+
+ if(!backends.containsKey(newBackend))
+ {
+ backends.put(newBackend, newBackend);
+ backend = newBackend;
+ }
+ else
+ {
+ backend = (BackendPrx)backends.get(newBackend);
+ }
+
+ backend.ice_ping();
+ }
+
+ for(int j = 0; j < msg.length(); ++j)
+ {
+ System.out.print('\b');
+ }
+ for(int j = 0; j < msg.length(); ++j)
+ {
+ System.out.print(' ');
+ }
+ for(int j = 0; j < msg.length(); ++j)
+ {
+ System.out.print('\b');
+ }
+ System.out.println("ok");
+
+ System.out.print("testing server and router shutdown... ");
+ System.out.flush();
+ backend.shutdown();
+ communicator().setDefaultRouter(null);
+ Ice.ObjectPrx adminBase = communicator().stringToProxy("Glacier2/admin:tcp -h 127.0.0.1 -p 12348 -t 10000");
+ Glacier2.AdminPrx admin = Glacier2.AdminPrxHelper.checkedCast(adminBase);
+ test(admin != null);
+ admin.shutdown();
+ try
+ {
+ admin.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ System.out.println("ok");
+ }
return 0;
}
diff --git a/java/test/Glacier2/attack/BackendServer.java b/java/test/Glacier2/attack/BackendServer.java
index f09b8dafcbc..2b610575325 100644
--- a/java/test/Glacier2/attack/BackendServer.java
+++ b/java/test/Glacier2/attack/BackendServer.java
@@ -14,9 +14,9 @@ class BackendServer extends Ice.Application
public int
run(String[] args)
{
- communicator().getProperties().setProperty("Ice.OA.BackendAdapter.Endpoints", "tcp -p 12010 -t 10000");
+ communicator().getProperties().setProperty("Ice.OA.BackendAdapter.Endpoints", "tcp -p 12010 -t 10000");
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("BackendAdapter");
- adapter.addServantLocator(new ServantLocatorI(), "");
+ adapter.addServantLocator(new ServantLocatorI(), "");
adapter.activate();
communicator().waitForShutdown();
return 0;
diff --git a/java/test/Glacier2/attack/Client.java b/java/test/Glacier2/attack/Client.java
index d7674481956..96670c6e680 100644
--- a/java/test/Glacier2/attack/Client.java
+++ b/java/test/Glacier2/attack/Client.java
@@ -12,18 +12,18 @@ public class Client
public static void
main(String[] args)
{
- //
- // We want to check whether the client retries for evicted
- // proxies, even with regular retries disabled.
- //
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.RetryIntervals", "-1");
+ //
+ // We want to check whether the client retries for evicted
+ // proxies, even with regular retries disabled.
+ //
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.RetryIntervals", "-1");
AttackClient app = new AttackClient();
int status = app.main("Client", argsH.value, initData);
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Glacier2/attack/Server.java b/java/test/Glacier2/attack/Server.java
index bf66c6f2b7c..8e95eb364f5 100644
--- a/java/test/Glacier2/attack/Server.java
+++ b/java/test/Glacier2/attack/Server.java
@@ -14,7 +14,7 @@ public class Server
{
BackendServer app = new BackendServer();
int status = app.main("Server", args);
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Glacier2/attack/run.py b/java/test/Glacier2/attack/run.py
index 4ab6ee25feb..69ffb614581 100755
--- a/java/test/Glacier2/attack/run.py
+++ b/java/test/Glacier2/attack/run.py
@@ -29,7 +29,7 @@ ice_home = os.environ['ICE_HOME']
router = os.path.join(ice_home, "bin", "glacier2router")
command = router + TestUtil.cppClientServerOptions + \
- r' --Ice.PrintProcessId' \
+ r' --Ice.PrintProcessId' \
r' --Glacier2.RoutingTable.MaxSize=10' + \
r' --Ice.OA.Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \
r' --Ice.OA.Glacier2.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \
diff --git a/java/test/Glacier2/router/Callback.ice b/java/test/Glacier2/router/Callback.ice
index 48504d83c1b..038602852b5 100644
--- a/java/test/Glacier2/router/Callback.ice
+++ b/java/test/Glacier2/router/Callback.ice
@@ -24,7 +24,7 @@ interface CallbackReceiver
void callback();
void callbackEx()
- throws CallbackException;
+ throws CallbackException;
};
interface Callback
@@ -32,7 +32,7 @@ interface Callback
void initiateCallback(CallbackReceiver* proxy);
void initiateCallbackEx(CallbackReceiver* proxy)
- throws CallbackException;
+ throws CallbackException;
void shutdown();
};
diff --git a/java/test/Glacier2/router/CallbackClient.java b/java/test/Glacier2/router/CallbackClient.java
index ebf4dc7a058..c6ab1ca364f 100644
--- a/java/test/Glacier2/router/CallbackClient.java
+++ b/java/test/Glacier2/router/CallbackClient.java
@@ -40,13 +40,13 @@ class CallbackClient extends Ice.Application
System.out.println("ok");
}
- {
- System.out.print("getting the session timeout... ");
+ {
+ System.out.print("getting the session timeout... ");
System.out.flush();
- long timeout = router.getSessionTimeout();
- test(timeout == 30);
+ long timeout = router.getSessionTimeout();
+ test(timeout == 30);
System.out.println("ok");
- }
+ }
Ice.ObjectPrx base;
@@ -71,19 +71,19 @@ class CallbackClient extends Ice.Application
}
catch(Ice.SocketException ex)
{
- //
- // The JSSE implementation in the AIX JDK appears to have a
- // bug that causes a "bad certificate" exception to be raised
- // when the connection is forcefully dropped and a retry occurs.
- //
- if(System.getProperty("os.name").equals("AIX"))
- {
- System.out.println("ok");
- }
- else
- {
- test(false);
- }
+ //
+ // The JSSE implementation in the AIX JDK appears to have a
+ // bug that causes a "bad certificate" exception to be raised
+ // when the connection is forcefully dropped and a retry occurs.
+ //
+ if(System.getProperty("os.name").equals("AIX"))
+ {
+ System.out.println("ok");
+ }
+ else
+ {
+ test(false);
+ }
}
}
@@ -179,7 +179,7 @@ class CallbackClient extends Ice.Application
{
System.out.print("creating and activating callback receiver adapter... ");
System.out.flush();
- communicator().getProperties().setProperty("Ice.PrintAdapterReady", "0");
+ communicator().getProperties().setProperty("Ice.PrintAdapterReady", "0");
adapter = communicator().createObjectAdapterWithRouter("CallbackReceiverAdapter", router);
adapter.activate();
System.out.println("ok");
@@ -273,48 +273,48 @@ class CallbackClient extends Ice.Application
}
}
- {
- System.out.print("testing whether other allowed category is accepted... ");
+ {
+ System.out.print("testing whether other allowed category is accepted... ");
System.out.flush();
java.util.Map context = new java.util.HashMap();
context.put("_fwd", "t");
- CallbackPrx otherCategoryTwoway = CallbackPrxHelper.uncheckedCast(
- twoway.ice_identity(communicator().stringToIdentity("c2/callback")));
- otherCategoryTwoway.initiateCallback(twowayR, context);
- test(callbackReceiverImpl.callbackOK());
- System.out.println("ok");
- }
-
- {
- System.out.print("testing whether disallowed category gets rejected... ");
+ CallbackPrx otherCategoryTwoway = CallbackPrxHelper.uncheckedCast(
+ twoway.ice_identity(communicator().stringToIdentity("c2/callback")));
+ otherCategoryTwoway.initiateCallback(twowayR, context);
+ test(callbackReceiverImpl.callbackOK());
+ System.out.println("ok");
+ }
+
+ {
+ System.out.print("testing whether disallowed category gets rejected... ");
System.out.flush();
java.util.Map context = new java.util.HashMap();
context.put("_fwd", "t");
- try
- {
- CallbackPrx otherCategoryTwoway = CallbackPrxHelper.uncheckedCast(
- twoway.ice_identity(communicator().stringToIdentity("c3/callback")));
- otherCategoryTwoway.initiateCallback(twowayR, context);
- test(false);
- }
- catch(Ice.ObjectNotExistException ex)
- {
- System.out.println("ok");
- }
- }
-
- {
- System.out.print("testing whether user-id as category is accepted... ");
+ try
+ {
+ CallbackPrx otherCategoryTwoway = CallbackPrxHelper.uncheckedCast(
+ twoway.ice_identity(communicator().stringToIdentity("c3/callback")));
+ otherCategoryTwoway.initiateCallback(twowayR, context);
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ System.out.println("ok");
+ }
+ }
+
+ {
+ System.out.print("testing whether user-id as category is accepted... ");
System.out.flush();
java.util.Map context = new java.util.HashMap();
context.put("_fwd", "t");
- CallbackPrx otherCategoryTwoway = CallbackPrxHelper.uncheckedCast(
- twoway.ice_identity(communicator().stringToIdentity("_userid/callback")));
- otherCategoryTwoway.initiateCallback(twowayR, context);
- test(callbackReceiverImpl.callbackOK());
- System.out.println("ok");
- }
-
+ CallbackPrx otherCategoryTwoway = CallbackPrxHelper.uncheckedCast(
+ twoway.ice_identity(communicator().stringToIdentity("_userid/callback")));
+ otherCategoryTwoway.initiateCallback(twowayR, context);
+ test(callbackReceiverImpl.callbackOK());
+ System.out.println("ok");
+ }
+
{
System.out.print("testing server shutdown... ");
System.out.flush();
@@ -349,13 +349,13 @@ class CallbackClient extends Ice.Application
{
test(false);
}
- catch(Ice.ConnectionLostException ex)
- {
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
+ catch(Ice.ConnectionLostException ex)
+ {
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
System.out.println("ok");
}
@@ -373,69 +373,69 @@ class CallbackClient extends Ice.Application
}
catch(Ice.SocketException ex)
{
- //
- // The JSSE implementation in the AIX JDK appears to have a
- // bug that causes a "bad certificate" exception to be raised
- // when the connection is forcefully dropped and a retry occurs.
- //
- if(System.getProperty("os.name").equals("AIX"))
- {
- System.out.println("ok");
- }
- else
- {
- test(false);
- }
+ //
+ // The JSSE implementation in the AIX JDK appears to have a
+ // bug that causes a "bad certificate" exception to be raised
+ // when the connection is forcefully dropped and a retry occurs.
+ //
+ if(System.getProperty("os.name").equals("AIX"))
+ {
+ System.out.println("ok");
+ }
+ else
+ {
+ test(false);
+ }
}
}
-
- if(args.length >= 1 && args[0].equals("--shutdown"))
- {
- {
- System.out.print("uninstalling router with communicator... ");
- System.out.flush();
- communicator().setDefaultRouter(null);
- System.out.println("ok");
- }
-
- Ice.ObjectPrx adminBase;
-
- {
- System.out.print("testing stringToProxy for admin object... ");
- adminBase = communicator().stringToProxy("Glacier2/admin:tcp -h 127.0.0.1 -p 12348 -t 10000");
- System.out.println("ok");
- }
-
+
+ if(args.length >= 1 && args[0].equals("--shutdown"))
+ {
+ {
+ System.out.print("uninstalling router with communicator... ");
+ System.out.flush();
+ communicator().setDefaultRouter(null);
+ System.out.println("ok");
+ }
+
+ Ice.ObjectPrx adminBase;
+
+ {
+ System.out.print("testing stringToProxy for admin object... ");
+ adminBase = communicator().stringToProxy("Glacier2/admin:tcp -h 127.0.0.1 -p 12348 -t 10000");
+ System.out.println("ok");
+ }
+
/*
- {
- System.out.print("uninstalling router with admin object... ");
- adminBase.ice_router(null);
- System.out.println("ok");
- }
+ {
+ System.out.print("uninstalling router with admin object... ");
+ adminBase.ice_router(null);
+ System.out.println("ok");
+ }
*/
-
- Glacier2.AdminPrx admin;
-
- {
- System.out.print("testing checked cast for admin object... ");
- admin = Glacier2.AdminPrxHelper.checkedCast(adminBase);
- test(admin != null);
- System.out.println("ok");
- }
-
- System.out.print("testing Glacier2 shutdown... ");
- admin.shutdown();
- try
- {
- admin.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- System.out.println("ok");
- }
- }
-
+
+ Glacier2.AdminPrx admin;
+
+ {
+ System.out.print("testing checked cast for admin object... ");
+ admin = Glacier2.AdminPrxHelper.checkedCast(adminBase);
+ test(admin != null);
+ System.out.println("ok");
+ }
+
+ System.out.print("testing Glacier2 shutdown... ");
+ admin.shutdown();
+ try
+ {
+ admin.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ System.out.println("ok");
+ }
+ }
+
return 0;
}
diff --git a/java/test/Glacier2/router/CallbackI.java b/java/test/Glacier2/router/CallbackI.java
index a19347b8caa..7bed4c70a1c 100644
--- a/java/test/Glacier2/router/CallbackI.java
+++ b/java/test/Glacier2/router/CallbackI.java
@@ -18,12 +18,12 @@ final class CallbackI extends _CallbackDisp
public void
initiateCallback(CallbackReceiverPrx proxy, Ice.Current current)
{
- proxy.callback(current.ctx);
+ proxy.callback(current.ctx);
}
public void
initiateCallbackEx(CallbackReceiverPrx proxy, Ice.Current current)
- throws CallbackException
+ throws CallbackException
{
proxy.callbackEx(current.ctx);
}
diff --git a/java/test/Glacier2/router/CallbackServer.java b/java/test/Glacier2/router/CallbackServer.java
index 2aea782e229..7f5c141bc9f 100644
--- a/java/test/Glacier2/router/CallbackServer.java
+++ b/java/test/Glacier2/router/CallbackServer.java
@@ -14,16 +14,16 @@ class CallbackServer extends Ice.Application
public int
run(String[] args)
{
- communicator().getProperties().setProperty("Ice.OA.CallbackAdapter.Endpoints", "tcp -p 12010 -t 10000");
+ communicator().getProperties().setProperty("Ice.OA.CallbackAdapter.Endpoints", "tcp -p 12010 -t 10000");
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("CallbackAdapter");
- adapter.add(new CallbackI(),
- communicator().stringToIdentity("c1/callback")); // The test allows "c1" as category.
- adapter.add(new CallbackI(),
- communicator().stringToIdentity("c2/callback")); // The test allows "c2" as category.
- adapter.add(new CallbackI(),
- communicator().stringToIdentity("c3/callback")); // The test rejects "c3" as category.
- adapter.add(new CallbackI(),
- communicator().stringToIdentity("_userid/callback")); // The test allows the prefixed userid.
+ adapter.add(new CallbackI(),
+ communicator().stringToIdentity("c1/callback")); // The test allows "c1" as category.
+ adapter.add(new CallbackI(),
+ communicator().stringToIdentity("c2/callback")); // The test allows "c2" as category.
+ adapter.add(new CallbackI(),
+ communicator().stringToIdentity("c3/callback")); // The test rejects "c3" as category.
+ adapter.add(new CallbackI(),
+ communicator().stringToIdentity("_userid/callback")); // The test allows the prefixed userid.
adapter.activate();
communicator().waitForShutdown();
return 0;
diff --git a/java/test/Glacier2/router/Client.java b/java/test/Glacier2/router/Client.java
index 56564fcf51a..6ca01b2eb41 100644
--- a/java/test/Glacier2/router/Client.java
+++ b/java/test/Glacier2/router/Client.java
@@ -12,20 +12,20 @@ public class Client
public static void
main(String[] args)
{
- //
- // We must disable connection warnings, because we attempt to
- // ping the router before session establishment, as well as
- // after session destruction. Both will cause a
- // ConnectionLostException.
- //
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.Warn.Connections", "0");
+ //
+ // We must disable connection warnings, because we attempt to
+ // ping the router before session establishment, as well as
+ // after session destruction. Both will cause a
+ // ConnectionLostException.
+ //
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
CallbackClient app = new CallbackClient();
int status = app.main("Client", argsH.value, initData);
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Glacier2/router/Server.java b/java/test/Glacier2/router/Server.java
index 53966ec356d..db7cd4f0da5 100644
--- a/java/test/Glacier2/router/Server.java
+++ b/java/test/Glacier2/router/Server.java
@@ -14,7 +14,7 @@ public class Server
{
CallbackServer app = new CallbackServer();
int status = app.main("Server", args);
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/adapterDeactivation/AllTests.java b/java/test/Ice/adapterDeactivation/AllTests.java
index 0fde580d033..50db73e1b3f 100644
--- a/java/test/Ice/adapterDeactivation/AllTests.java
+++ b/java/test/Ice/adapterDeactivation/AllTests.java
@@ -37,27 +37,27 @@ public class AllTests
test(obj.equals(base));
System.out.println("ok");
- {
+ {
System.out.print("creating/destroying/recreating object adapter... ");
System.out.flush();
- Ice.ObjectAdapter adapter =
- communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999");
- try
- {
- communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998");
- test(false);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- }
- adapter.destroy();
- //
- // Use a different port than the first adapter to avoid an "address already in use" error.
- //
- adapter = communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998");
- adapter.destroy();
+ Ice.ObjectAdapter adapter =
+ communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999");
+ try
+ {
+ communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998");
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ }
+ adapter.destroy();
+ //
+ // Use a different port than the first adapter to avoid an "address already in use" error.
+ //
+ adapter = communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998");
+ adapter.destroy();
System.out.println("ok");
- }
+ }
System.out.print("creating/activating/deactivating object adapter in one operation... ");
System.out.flush();
diff --git a/java/test/Ice/adapterDeactivation/ServantLocatorI.java b/java/test/Ice/adapterDeactivation/ServantLocatorI.java
index 639a493f149..80e2241a214 100644
--- a/java/test/Ice/adapterDeactivation/ServantLocatorI.java
+++ b/java/test/Ice/adapterDeactivation/ServantLocatorI.java
@@ -37,9 +37,9 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
locate(Ice.Current current, Ice.LocalObjectHolder cookie)
{
synchronized(this)
- {
- test(!_deactivated);
- }
+ {
+ test(!_deactivated);
+ }
test(current.id.category.length() == 0);
test(current.id.name.equals("test"));
@@ -52,10 +52,10 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public void
finished(Ice.Current current, Ice.Object servant, Ice.LocalObject cookie)
{
- synchronized(this)
- {
- test(!_deactivated);
- }
+ synchronized(this)
+ {
+ test(!_deactivated);
+ }
Cookie co = (Cookie)cookie;
test(co.message().equals("blahblah"));
@@ -64,12 +64,12 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public synchronized void
deactivate(String category)
{
- synchronized(this)
- {
- test(!_deactivated);
+ synchronized(this)
+ {
+ test(!_deactivated);
- _deactivated = true;
- }
+ _deactivated = true;
+ }
}
private boolean _deactivated;
diff --git a/java/test/Ice/adapterDeactivation/Server.java b/java/test/Ice/adapterDeactivation/Server.java
index e46e369c98a..5055ded0cb1 100644
--- a/java/test/Ice/adapterDeactivation/Server.java
+++ b/java/test/Ice/adapterDeactivation/Server.java
@@ -30,7 +30,7 @@ public class Server
{
TestServer app = new TestServer();
int result = app.main("Server", args);
- System.gc();
+ System.gc();
System.exit(result);
}
}
diff --git a/java/test/Ice/binding/AllTests.java b/java/test/Ice/binding/AllTests.java
index 3feb1c2eb9c..c1422f1f2ba 100644
--- a/java/test/Ice/binding/AllTests.java
+++ b/java/test/Ice/binding/AllTests.java
@@ -22,700 +22,700 @@ public class AllTests
static class GetAdapterNameCB extends AMI_TestIntf_getAdapterName
{
- synchronized public void
- ice_response(String adapterName)
- {
- _name = adapterName;
- notify();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
+ synchronized public void
+ ice_response(String adapterName)
{
- test(false);
- }
+ _name = adapterName;
+ notify();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
- public void
- ice_exception(Ice.UserException ex)
+ public void
+ ice_exception(Ice.UserException ex)
{
- test(false);
- }
+ test(false);
+ }
- synchronized public String
- getResult()
+ synchronized public String
+ getResult()
{
- while(_name == null)
- {
- try
- {
- wait();
- }
- catch(java.lang.InterruptedException ex)
- {
- }
- }
- return _name;
- }
-
- private String _name = null;
+ while(_name == null)
+ {
+ try
+ {
+ wait();
+ }
+ catch(java.lang.InterruptedException ex)
+ {
+ }
+ }
+ return _name;
+ }
+
+ private String _name = null;
};
private static String
getAdapterNameWithAMI(TestIntfPrx test)
{
- GetAdapterNameCB cb = new GetAdapterNameCB();
- test.getAdapterName_async(cb);
- return cb.getResult();
+ GetAdapterNameCB cb = new GetAdapterNameCB();
+ test.getAdapterName_async(cb);
+ return cb.getResult();
}
private static TestIntfPrx
createTestIntfPrx(java.util.List adapters)
{
- java.util.List endpoints = new java.util.ArrayList();
- TestIntfPrx test = null;
- java.util.Iterator p = adapters.iterator();
- while(p.hasNext())
- {
- test = ((RemoteObjectAdapterPrx)p.next()).getTestIntf();
- Ice.Endpoint[] edpts = test.ice_getEndpoints();
- endpoints.addAll(java.util.Arrays.asList(edpts));
- }
- return TestIntfPrxHelper.uncheckedCast(
- test.ice_endpoints((Ice.Endpoint[])endpoints.toArray(new Ice.Endpoint[endpoints.size()])));
+ java.util.List endpoints = new java.util.ArrayList();
+ TestIntfPrx test = null;
+ java.util.Iterator p = adapters.iterator();
+ while(p.hasNext())
+ {
+ test = ((RemoteObjectAdapterPrx)p.next()).getTestIntf();
+ Ice.Endpoint[] edpts = test.ice_getEndpoints();
+ endpoints.addAll(java.util.Arrays.asList(edpts));
+ }
+ return TestIntfPrxHelper.uncheckedCast(
+ test.ice_endpoints((Ice.Endpoint[])endpoints.toArray(new Ice.Endpoint[endpoints.size()])));
}
private static void
deactivate(RemoteCommunicatorPrx communicator, java.util.List adapters)
{
- java.util.Iterator p = adapters.iterator();
- while(p.hasNext())
- {
- communicator.deactivateObjectAdapter((RemoteObjectAdapterPrx)p.next());
- }
+ java.util.Iterator p = adapters.iterator();
+ while(p.hasNext())
+ {
+ communicator.deactivateObjectAdapter((RemoteObjectAdapterPrx)p.next());
+ }
}
public static void
allTests(Ice.Communicator communicator)
{
- String ref = "communicator:default -p 12010 -t 10000";
- RemoteCommunicatorPrx com = RemoteCommunicatorPrxHelper.uncheckedCast(communicator.stringToProxy(ref));
-
- System.out.print("testing binding with single endpoint... ");
- System.out.flush();
- {
- RemoteObjectAdapterPrx adapter = com.createObjectAdapter("Adapter", "default");
-
- TestIntfPrx test1 = adapter.getTestIntf();
- TestIntfPrx test2 = adapter.getTestIntf();
- test(test1.ice_getConnection() == test2.ice_getConnection());
-
- test1.ice_ping();
- test2.ice_ping();
-
- com.deactivateObjectAdapter(adapter);
-
- TestIntfPrx test3 = TestIntfPrxHelper.uncheckedCast(test1);
- test(test3.ice_getConnection() == test1.ice_getConnection());
- test(test3.ice_getConnection() == test2.ice_getConnection());
-
- try
- {
- test3.ice_ping();
- test(false);
- }
- catch(Ice.ConnectionRefusedException ex)
- {
- }
- }
- System.out.println("ok");
-
- System.out.print("testing binding with multiple endpoints... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("Adapter11", "default"));
- adapters.add(com.createObjectAdapter("Adapter12", "default"));
- adapters.add(com.createObjectAdapter("Adapter13", "default"));
-
- //
- // Ensure that when a connection is opened it's reused for new
- // proxies and that all endpoints are eventually tried.
- //
- java.util.Set names = new java.util.HashSet();
- names.add("Adapter11");
- names.add("Adapter12");
- names.add("Adapter13");
- while(!names.isEmpty())
- {
- java.util.List adpts = new java.util.ArrayList(adapters);
-
- TestIntfPrx test1 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test2 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test3 = createTestIntfPrx(adpts);
-
- test(test1.ice_getConnection() == test2.ice_getConnection());
- test(test2.ice_getConnection() == test3.ice_getConnection());
-
- names.remove(test1.getAdapterName());
- test1.ice_getConnection().close(false);
- }
-
- //
- // Ensure that the proxy correctly caches the connection (we
- // always send the request over the same connection.)
- //
- {
- java.util.Iterator p = adapters.iterator();
- while(p.hasNext())
- {
- ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_ping();
- }
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- String name = test.getAdapterName();
- final int nRetry = 10;
- int i;
- for(i = 0; i < nRetry && test.getAdapterName().equals(name); i++);
- test(i == nRetry);
-
- p = adapters.iterator();
- while(p.hasNext())
- {
- ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_getConnection().close(false);
- }
- }
-
- //
- // Deactivate an adapter and ensure that we can still
- // establish the connection to the remaining adapters.
- //
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
- names.add("Adapter12");
- names.add("Adapter13");
- while(!names.isEmpty())
- {
- java.util.List adpts = new java.util.ArrayList(adapters);
-
- TestIntfPrx test1 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test2 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test3 = createTestIntfPrx(adpts);
-
- test(test1.ice_getConnection() == test2.ice_getConnection());
- test(test2.ice_getConnection() == test3.ice_getConnection());
-
- names.remove(test1.getAdapterName());
- test1.ice_getConnection().close(false);
- }
-
- //
- // Deactivate an adapter and ensure that we can still
- // establish the connection to the remaining adapter.
- //
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
- TestIntfPrx test = createTestIntfPrx(adapters);
- test(test.getAdapterName().equals("Adapter12"));
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing binding with multiple endpoints and AMI... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("AdapterAMI11", "default"));
- adapters.add(com.createObjectAdapter("AdapterAMI12", "default"));
- adapters.add(com.createObjectAdapter("AdapterAMI13", "default"));
-
- //
- // Ensure that when a connection is opened it's reused for new
- // proxies and that all endpoints are eventually tried.
- //
- java.util.Set names = new java.util.HashSet();
- names.add("AdapterAMI11");
- names.add("AdapterAMI12");
- names.add("AdapterAMI13");
- while(!names.isEmpty())
- {
- java.util.List adpts = new java.util.ArrayList(adapters);
-
- TestIntfPrx test1 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test2 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test3 = createTestIntfPrx(adpts);
-
- test(test1.ice_getConnection() == test2.ice_getConnection());
- test(test2.ice_getConnection() == test3.ice_getConnection());
-
- names.remove(getAdapterNameWithAMI(test1));
- test1.ice_getConnection().close(false);
- }
-
- //
- // Ensure that the proxy correctly caches the connection (we
- // always send the request over the same connection.)
- //
- {
- java.util.Iterator p = adapters.iterator();
- while(p.hasNext())
- {
- ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_ping();
- }
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- String name = getAdapterNameWithAMI(test);
- final int nRetry = 10;
- int i;
- for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals(name); i++);
- test(i == nRetry);
-
- p = adapters.iterator();
- while(p.hasNext())
- {
- ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_getConnection().close(false);
- }
- }
-
- //
- // Deactivate an adapter and ensure that we can still
- // establish the connection to the remaining adapters.
- //
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
- names.add("AdapterAMI12");
- names.add("AdapterAMI13");
- while(!names.isEmpty())
- {
- java.util.List adpts = new java.util.ArrayList(adapters);
-
- TestIntfPrx test1 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test2 = createTestIntfPrx(adpts);
- java.util.Collections.shuffle(adpts);
- TestIntfPrx test3 = createTestIntfPrx(adpts);
-
- test(test1.ice_getConnection() == test2.ice_getConnection());
- test(test2.ice_getConnection() == test3.ice_getConnection());
-
- names.remove(getAdapterNameWithAMI(test1));
- test1.ice_getConnection().close(false);
- }
-
- //
- // Deactivate an adapter and ensure that we can still
- // establish the connection to the remaining adapter.
- //
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
- TestIntfPrx test = createTestIntfPrx(adapters);
- test(getAdapterNameWithAMI(test).equals("AdapterAMI12"));
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing random endpoint selection... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("Adapter21", "default"));
- adapters.add(com.createObjectAdapter("Adapter22", "default"));
- adapters.add(com.createObjectAdapter("Adapter23", "default"));
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Random);
-
- java.util.Set names = new java.util.HashSet();
- names.add("Adapter21");
- names.add("Adapter22");
- names.add("Adapter23");
- while(!names.isEmpty())
- {
- names.remove(test.getAdapterName());
- test.ice_getConnection().close(false);
- }
-
- test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Random));
- test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Random);
-
- names.add("Adapter21");
- names.add("Adapter22");
- names.add("Adapter23");
- while(!names.isEmpty())
- {
- names.remove(test.getAdapterName());
- test.ice_getConnection().close(false);
- }
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing ordered endpoint selection... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("Adapter31", "default"));
- adapters.add(com.createObjectAdapter("Adapter32", "default"));
- adapters.add(com.createObjectAdapter("Adapter33", "default"));
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Ordered));
- test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Ordered);
- int nRetry = 5;
- int i;
-
- //
- // Ensure that endpoints are tried in order by deactiving the adapters
- // one after the other.
- //
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter31"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter32"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter33"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
-
- try
- {
- test.getAdapterName();
- }
- catch(Ice.ConnectionRefusedException ex)
- {
- }
-
- Ice.Endpoint[] endpoints = test.ice_getEndpoints();
-
- adapters.clear();
-
- //
- // Now, re-activate the adapters with the same endpoints in the opposite
- // order.
- //
- adapters.add(com.createObjectAdapter("Adapter36", endpoints[2].toString()));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter36"); i++);
- test(i == nRetry);
- test.ice_getConnection().close(false);
- adapters.add(com.createObjectAdapter("Adapter35", endpoints[1].toString()));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter35"); i++);
- test(i == nRetry);
- test.ice_getConnection().close(false);
- adapters.add(com.createObjectAdapter("Adapter34", endpoints[0].toString()));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter34"); i++);
- test(i == nRetry);
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing per request binding with single endpoint... ");
- System.out.flush();
- {
- RemoteObjectAdapterPrx adapter = com.createObjectAdapter("Adapter41", "default");
-
- TestIntfPrx test1 = TestIntfPrxHelper.uncheckedCast(adapter.getTestIntf().ice_connectionCached(false));
- TestIntfPrx test2 = TestIntfPrxHelper.uncheckedCast(adapter.getTestIntf().ice_connectionCached(false));
- test(!test1.ice_isConnectionCached());
- test(!test2.ice_isConnectionCached());
- test(test1.ice_getConnection() == test2.ice_getConnection());
-
- test1.ice_ping();
-
- com.deactivateObjectAdapter(adapter);
-
- TestIntfPrx test3 = TestIntfPrxHelper.uncheckedCast(test1);
- try
- {
- test(test3.ice_getConnection() == test1.ice_getConnection());
- test(false);
- }
- catch(Ice.ConnectionRefusedException ex)
- {
- }
- }
- System.out.println("ok");
-
- System.out.print("testing per request binding with multiple endpoints... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("Adapter51", "default"));
- adapters.add(com.createObjectAdapter("Adapter52", "default"));
- adapters.add(com.createObjectAdapter("Adapter53", "default"));
-
- TestIntfPrx test = TestIntfPrxHelper.uncheckedCast(createTestIntfPrx(adapters).ice_connectionCached(false));
- test(!test.ice_isConnectionCached());
-
- java.util.Set names = new java.util.HashSet();
- names.add("Adapter51");
- names.add("Adapter52");
- names.add("Adapter53");
- while(!names.isEmpty())
- {
- names.remove(test.getAdapterName());
- }
-
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
-
- names.add("Adapter52");
- names.add("Adapter53");
- while(!names.isEmpty())
- {
- names.remove(test.getAdapterName());
- }
-
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
-
-
- test(test.getAdapterName().equals("Adapter52"));
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing per request binding with multiple endpoints and AMI... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("AdapterAMI51", "default"));
- adapters.add(com.createObjectAdapter("AdapterAMI52", "default"));
- adapters.add(com.createObjectAdapter("AdapterAMI53", "default"));
-
- TestIntfPrx test = TestIntfPrxHelper.uncheckedCast(createTestIntfPrx(adapters).ice_connectionCached(false));
- test(!test.ice_isConnectionCached());
-
- java.util.Set names = new java.util.HashSet();
- names.add("AdapterAMI51");
- names.add("AdapterAMI52");
- names.add("AdapterAMI53");
- while(!names.isEmpty())
- {
- names.remove(getAdapterNameWithAMI(test));
- }
-
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
-
- names.add("AdapterAMI52");
- names.add("AdapterAMI53");
- while(!names.isEmpty())
- {
- names.remove(getAdapterNameWithAMI(test));
- }
-
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
-
-
- test(getAdapterNameWithAMI(test).equals("AdapterAMI52"));
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing per request binding and ordered endpoint selection... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("Adapter61", "default"));
- adapters.add(com.createObjectAdapter("Adapter62", "default"));
- adapters.add(com.createObjectAdapter("Adapter63", "default"));
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Ordered));
- test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Ordered);
- test = TestIntfPrxHelper.uncheckedCast(test.ice_connectionCached(false));
- test(!test.ice_isConnectionCached());
- int nRetry = 5;
- int i;
-
- //
- // Ensure that endpoints are tried in order by deactiving the adapters
- // one after the other.
- //
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter61"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter62"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter63"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
-
- try
- {
- test.getAdapterName();
- }
- catch(Ice.ConnectionRefusedException ex)
- {
- }
-
- Ice.Endpoint[] endpoints = test.ice_getEndpoints();
-
- adapters.clear();
-
- //
- // Now, re-activate the adapters with the same endpoints in the opposite
- // order.
- //
- adapters.add(com.createObjectAdapter("Adapter66", endpoints[2].toString()));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter66"); i++);
- test(i == nRetry);
- adapters.add(com.createObjectAdapter("Adapter65", endpoints[1].toString()));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter65"); i++);
- test(i == nRetry);
- adapters.add(com.createObjectAdapter("Adapter64", endpoints[0].toString()));
- for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter64"); i++);
- test(i == nRetry);
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing per request binding and ordered endpoint selection and AMI... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("AdapterAMI61", "default"));
- adapters.add(com.createObjectAdapter("AdapterAMI62", "default"));
- adapters.add(com.createObjectAdapter("AdapterAMI63", "default"));
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Ordered));
- test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Ordered);
- test = TestIntfPrxHelper.uncheckedCast(test.ice_connectionCached(false));
- test(!test.ice_isConnectionCached());
- int nRetry = 5;
- int i;
-
- //
- // Ensure that endpoints are tried in order by deactiving the adapters
- // one after the other.
- //
- for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI61"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
- for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI62"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
- for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI63"); i++);
- test(i == nRetry);
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
-
- try
- {
- test.getAdapterName();
- }
- catch(Ice.ConnectionRefusedException ex)
- {
- }
-
- Ice.Endpoint[] endpoints = test.ice_getEndpoints();
-
- adapters.clear();
-
- //
- // Now, re-activate the adapters with the same endpoints in the opposite
- // order.
- //
- adapters.add(com.createObjectAdapter("AdapterAMI66", endpoints[2].toString()));
- for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI66"); i++);
- test(i == nRetry);
- adapters.add(com.createObjectAdapter("AdapterAMI65", endpoints[1].toString()));
- for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI65"); i++);
- test(i == nRetry);
- adapters.add(com.createObjectAdapter("AdapterAMI64", endpoints[0].toString()));
- for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI64"); i++);
- test(i == nRetry);
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
-
- System.out.print("testing endpoint mode filtering... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("Adapter71", "default"));
- adapters.add(com.createObjectAdapter("Adapter72", "udp"));
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- test(test.getAdapterName().equals("Adapter71"));
-
- TestIntfPrx testUDP = TestIntfPrxHelper.uncheckedCast(test.ice_datagram());
- test(test.ice_getConnection() != testUDP.ice_getConnection());
- try
- {
- testUDP.getAdapterName();
- }
- catch(Ice.TwowayOnlyException ex)
- {
- }
- }
- System.out.println("ok");
-
- if(communicator.getProperties().getProperty("Ice.Plugin.IceSSL").length() > 0)
- {
- System.out.print("testing unsecure vs. secure endpoints... ");
- System.out.flush();
- {
- java.util.List adapters = new java.util.ArrayList();
- adapters.add(com.createObjectAdapter("Adapter81", "ssl"));
- adapters.add(com.createObjectAdapter("Adapter82", "tcp"));
-
- TestIntfPrx test = createTestIntfPrx(adapters);
- int i;
- for(i = 0; i < 5; i++)
- {
- test(test.getAdapterName().equals("Adapter82"));
- test.ice_getConnection().close(false);
- }
-
- TestIntfPrx testSecure = TestIntfPrxHelper.uncheckedCast(test.ice_secure(true));
- test(testSecure.ice_isSecure());
- testSecure = TestIntfPrxHelper.uncheckedCast(test.ice_secure(false));
- test(!testSecure.ice_isSecure());
- testSecure = TestIntfPrxHelper.uncheckedCast(test.ice_secure(true));
- test(testSecure.ice_isSecure());
- test(test.ice_getConnection() != testSecure.ice_getConnection());
-
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
-
- for(i = 0; i < 5; i++)
- {
- test(test.getAdapterName().equals("Adapter81"));
- test.ice_getConnection().close(false);
- }
-
- com.createObjectAdapter("Adapter83", (test.ice_getEndpoints()[1]).toString()); // Reactive tcp OA.
-
- for(i = 0; i < 5; i++)
- {
- test(test.getAdapterName().equals("Adapter83"));
- test.ice_getConnection().close(false);
- }
-
- com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
- try
- {
- testSecure.ice_ping();
- test(false);
- }
- catch(Ice.ConnectionRefusedException ex)
- {
- }
-
- deactivate(com, adapters);
- }
- System.out.println("ok");
- }
-
- com.shutdown();
-
+ String ref = "communicator:default -p 12010 -t 10000";
+ RemoteCommunicatorPrx com = RemoteCommunicatorPrxHelper.uncheckedCast(communicator.stringToProxy(ref));
+
+ System.out.print("testing binding with single endpoint... ");
+ System.out.flush();
+ {
+ RemoteObjectAdapterPrx adapter = com.createObjectAdapter("Adapter", "default");
+
+ TestIntfPrx test1 = adapter.getTestIntf();
+ TestIntfPrx test2 = adapter.getTestIntf();
+ test(test1.ice_getConnection() == test2.ice_getConnection());
+
+ test1.ice_ping();
+ test2.ice_ping();
+
+ com.deactivateObjectAdapter(adapter);
+
+ TestIntfPrx test3 = TestIntfPrxHelper.uncheckedCast(test1);
+ test(test3.ice_getConnection() == test1.ice_getConnection());
+ test(test3.ice_getConnection() == test2.ice_getConnection());
+
+ try
+ {
+ test3.ice_ping();
+ test(false);
+ }
+ catch(Ice.ConnectionRefusedException ex)
+ {
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("testing binding with multiple endpoints... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("Adapter11", "default"));
+ adapters.add(com.createObjectAdapter("Adapter12", "default"));
+ adapters.add(com.createObjectAdapter("Adapter13", "default"));
+
+ //
+ // Ensure that when a connection is opened it's reused for new
+ // proxies and that all endpoints are eventually tried.
+ //
+ java.util.Set names = new java.util.HashSet();
+ names.add("Adapter11");
+ names.add("Adapter12");
+ names.add("Adapter13");
+ while(!names.isEmpty())
+ {
+ java.util.List adpts = new java.util.ArrayList(adapters);
+
+ TestIntfPrx test1 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test2 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test3 = createTestIntfPrx(adpts);
+
+ test(test1.ice_getConnection() == test2.ice_getConnection());
+ test(test2.ice_getConnection() == test3.ice_getConnection());
+
+ names.remove(test1.getAdapterName());
+ test1.ice_getConnection().close(false);
+ }
+
+ //
+ // Ensure that the proxy correctly caches the connection (we
+ // always send the request over the same connection.)
+ //
+ {
+ java.util.Iterator p = adapters.iterator();
+ while(p.hasNext())
+ {
+ ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_ping();
+ }
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ String name = test.getAdapterName();
+ final int nRetry = 10;
+ int i;
+ for(i = 0; i < nRetry && test.getAdapterName().equals(name); i++);
+ test(i == nRetry);
+
+ p = adapters.iterator();
+ while(p.hasNext())
+ {
+ ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_getConnection().close(false);
+ }
+ }
+
+ //
+ // Deactivate an adapter and ensure that we can still
+ // establish the connection to the remaining adapters.
+ //
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+ names.add("Adapter12");
+ names.add("Adapter13");
+ while(!names.isEmpty())
+ {
+ java.util.List adpts = new java.util.ArrayList(adapters);
+
+ TestIntfPrx test1 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test2 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test3 = createTestIntfPrx(adpts);
+
+ test(test1.ice_getConnection() == test2.ice_getConnection());
+ test(test2.ice_getConnection() == test3.ice_getConnection());
+
+ names.remove(test1.getAdapterName());
+ test1.ice_getConnection().close(false);
+ }
+
+ //
+ // Deactivate an adapter and ensure that we can still
+ // establish the connection to the remaining adapter.
+ //
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ test(test.getAdapterName().equals("Adapter12"));
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing binding with multiple endpoints and AMI... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("AdapterAMI11", "default"));
+ adapters.add(com.createObjectAdapter("AdapterAMI12", "default"));
+ adapters.add(com.createObjectAdapter("AdapterAMI13", "default"));
+
+ //
+ // Ensure that when a connection is opened it's reused for new
+ // proxies and that all endpoints are eventually tried.
+ //
+ java.util.Set names = new java.util.HashSet();
+ names.add("AdapterAMI11");
+ names.add("AdapterAMI12");
+ names.add("AdapterAMI13");
+ while(!names.isEmpty())
+ {
+ java.util.List adpts = new java.util.ArrayList(adapters);
+
+ TestIntfPrx test1 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test2 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test3 = createTestIntfPrx(adpts);
+
+ test(test1.ice_getConnection() == test2.ice_getConnection());
+ test(test2.ice_getConnection() == test3.ice_getConnection());
+
+ names.remove(getAdapterNameWithAMI(test1));
+ test1.ice_getConnection().close(false);
+ }
+
+ //
+ // Ensure that the proxy correctly caches the connection (we
+ // always send the request over the same connection.)
+ //
+ {
+ java.util.Iterator p = adapters.iterator();
+ while(p.hasNext())
+ {
+ ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_ping();
+ }
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ String name = getAdapterNameWithAMI(test);
+ final int nRetry = 10;
+ int i;
+ for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals(name); i++);
+ test(i == nRetry);
+
+ p = adapters.iterator();
+ while(p.hasNext())
+ {
+ ((RemoteObjectAdapterPrx)p.next()).getTestIntf().ice_getConnection().close(false);
+ }
+ }
+
+ //
+ // Deactivate an adapter and ensure that we can still
+ // establish the connection to the remaining adapters.
+ //
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+ names.add("AdapterAMI12");
+ names.add("AdapterAMI13");
+ while(!names.isEmpty())
+ {
+ java.util.List adpts = new java.util.ArrayList(adapters);
+
+ TestIntfPrx test1 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test2 = createTestIntfPrx(adpts);
+ java.util.Collections.shuffle(adpts);
+ TestIntfPrx test3 = createTestIntfPrx(adpts);
+
+ test(test1.ice_getConnection() == test2.ice_getConnection());
+ test(test2.ice_getConnection() == test3.ice_getConnection());
+
+ names.remove(getAdapterNameWithAMI(test1));
+ test1.ice_getConnection().close(false);
+ }
+
+ //
+ // Deactivate an adapter and ensure that we can still
+ // establish the connection to the remaining adapter.
+ //
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ test(getAdapterNameWithAMI(test).equals("AdapterAMI12"));
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing random endpoint selection... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("Adapter21", "default"));
+ adapters.add(com.createObjectAdapter("Adapter22", "default"));
+ adapters.add(com.createObjectAdapter("Adapter23", "default"));
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Random);
+
+ java.util.Set names = new java.util.HashSet();
+ names.add("Adapter21");
+ names.add("Adapter22");
+ names.add("Adapter23");
+ while(!names.isEmpty())
+ {
+ names.remove(test.getAdapterName());
+ test.ice_getConnection().close(false);
+ }
+
+ test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Random));
+ test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Random);
+
+ names.add("Adapter21");
+ names.add("Adapter22");
+ names.add("Adapter23");
+ while(!names.isEmpty())
+ {
+ names.remove(test.getAdapterName());
+ test.ice_getConnection().close(false);
+ }
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing ordered endpoint selection... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("Adapter31", "default"));
+ adapters.add(com.createObjectAdapter("Adapter32", "default"));
+ adapters.add(com.createObjectAdapter("Adapter33", "default"));
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Ordered));
+ test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Ordered);
+ int nRetry = 5;
+ int i;
+
+ //
+ // Ensure that endpoints are tried in order by deactiving the adapters
+ // one after the other.
+ //
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter31"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter32"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter33"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
+
+ try
+ {
+ test.getAdapterName();
+ }
+ catch(Ice.ConnectionRefusedException ex)
+ {
+ }
+
+ Ice.Endpoint[] endpoints = test.ice_getEndpoints();
+
+ adapters.clear();
+
+ //
+ // Now, re-activate the adapters with the same endpoints in the opposite
+ // order.
+ //
+ adapters.add(com.createObjectAdapter("Adapter36", endpoints[2].toString()));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter36"); i++);
+ test(i == nRetry);
+ test.ice_getConnection().close(false);
+ adapters.add(com.createObjectAdapter("Adapter35", endpoints[1].toString()));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter35"); i++);
+ test(i == nRetry);
+ test.ice_getConnection().close(false);
+ adapters.add(com.createObjectAdapter("Adapter34", endpoints[0].toString()));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter34"); i++);
+ test(i == nRetry);
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing per request binding with single endpoint... ");
+ System.out.flush();
+ {
+ RemoteObjectAdapterPrx adapter = com.createObjectAdapter("Adapter41", "default");
+
+ TestIntfPrx test1 = TestIntfPrxHelper.uncheckedCast(adapter.getTestIntf().ice_connectionCached(false));
+ TestIntfPrx test2 = TestIntfPrxHelper.uncheckedCast(adapter.getTestIntf().ice_connectionCached(false));
+ test(!test1.ice_isConnectionCached());
+ test(!test2.ice_isConnectionCached());
+ test(test1.ice_getConnection() == test2.ice_getConnection());
+
+ test1.ice_ping();
+
+ com.deactivateObjectAdapter(adapter);
+
+ TestIntfPrx test3 = TestIntfPrxHelper.uncheckedCast(test1);
+ try
+ {
+ test(test3.ice_getConnection() == test1.ice_getConnection());
+ test(false);
+ }
+ catch(Ice.ConnectionRefusedException ex)
+ {
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("testing per request binding with multiple endpoints... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("Adapter51", "default"));
+ adapters.add(com.createObjectAdapter("Adapter52", "default"));
+ adapters.add(com.createObjectAdapter("Adapter53", "default"));
+
+ TestIntfPrx test = TestIntfPrxHelper.uncheckedCast(createTestIntfPrx(adapters).ice_connectionCached(false));
+ test(!test.ice_isConnectionCached());
+
+ java.util.Set names = new java.util.HashSet();
+ names.add("Adapter51");
+ names.add("Adapter52");
+ names.add("Adapter53");
+ while(!names.isEmpty())
+ {
+ names.remove(test.getAdapterName());
+ }
+
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+
+ names.add("Adapter52");
+ names.add("Adapter53");
+ while(!names.isEmpty())
+ {
+ names.remove(test.getAdapterName());
+ }
+
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
+
+
+ test(test.getAdapterName().equals("Adapter52"));
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing per request binding with multiple endpoints and AMI... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("AdapterAMI51", "default"));
+ adapters.add(com.createObjectAdapter("AdapterAMI52", "default"));
+ adapters.add(com.createObjectAdapter("AdapterAMI53", "default"));
+
+ TestIntfPrx test = TestIntfPrxHelper.uncheckedCast(createTestIntfPrx(adapters).ice_connectionCached(false));
+ test(!test.ice_isConnectionCached());
+
+ java.util.Set names = new java.util.HashSet();
+ names.add("AdapterAMI51");
+ names.add("AdapterAMI52");
+ names.add("AdapterAMI53");
+ while(!names.isEmpty())
+ {
+ names.remove(getAdapterNameWithAMI(test));
+ }
+
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+
+ names.add("AdapterAMI52");
+ names.add("AdapterAMI53");
+ while(!names.isEmpty())
+ {
+ names.remove(getAdapterNameWithAMI(test));
+ }
+
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
+
+
+ test(getAdapterNameWithAMI(test).equals("AdapterAMI52"));
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing per request binding and ordered endpoint selection... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("Adapter61", "default"));
+ adapters.add(com.createObjectAdapter("Adapter62", "default"));
+ adapters.add(com.createObjectAdapter("Adapter63", "default"));
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Ordered));
+ test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Ordered);
+ test = TestIntfPrxHelper.uncheckedCast(test.ice_connectionCached(false));
+ test(!test.ice_isConnectionCached());
+ int nRetry = 5;
+ int i;
+
+ //
+ // Ensure that endpoints are tried in order by deactiving the adapters
+ // one after the other.
+ //
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter61"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter62"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter63"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
+
+ try
+ {
+ test.getAdapterName();
+ }
+ catch(Ice.ConnectionRefusedException ex)
+ {
+ }
+
+ Ice.Endpoint[] endpoints = test.ice_getEndpoints();
+
+ adapters.clear();
+
+ //
+ // Now, re-activate the adapters with the same endpoints in the opposite
+ // order.
+ //
+ adapters.add(com.createObjectAdapter("Adapter66", endpoints[2].toString()));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter66"); i++);
+ test(i == nRetry);
+ adapters.add(com.createObjectAdapter("Adapter65", endpoints[1].toString()));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter65"); i++);
+ test(i == nRetry);
+ adapters.add(com.createObjectAdapter("Adapter64", endpoints[0].toString()));
+ for(i = 0; i < nRetry && test.getAdapterName().equals("Adapter64"); i++);
+ test(i == nRetry);
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing per request binding and ordered endpoint selection and AMI... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("AdapterAMI61", "default"));
+ adapters.add(com.createObjectAdapter("AdapterAMI62", "default"));
+ adapters.add(com.createObjectAdapter("AdapterAMI63", "default"));
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ test = TestIntfPrxHelper.uncheckedCast(test.ice_endpointSelection(Ice.EndpointSelectionType.Ordered));
+ test(test.ice_getEndpointSelection() == Ice.EndpointSelectionType.Ordered);
+ test = TestIntfPrxHelper.uncheckedCast(test.ice_connectionCached(false));
+ test(!test.ice_isConnectionCached());
+ int nRetry = 5;
+ int i;
+
+ //
+ // Ensure that endpoints are tried in order by deactiving the adapters
+ // one after the other.
+ //
+ for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI61"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+ for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI62"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
+ for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI63"); i++);
+ test(i == nRetry);
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(2));
+
+ try
+ {
+ test.getAdapterName();
+ }
+ catch(Ice.ConnectionRefusedException ex)
+ {
+ }
+
+ Ice.Endpoint[] endpoints = test.ice_getEndpoints();
+
+ adapters.clear();
+
+ //
+ // Now, re-activate the adapters with the same endpoints in the opposite
+ // order.
+ //
+ adapters.add(com.createObjectAdapter("AdapterAMI66", endpoints[2].toString()));
+ for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI66"); i++);
+ test(i == nRetry);
+ adapters.add(com.createObjectAdapter("AdapterAMI65", endpoints[1].toString()));
+ for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI65"); i++);
+ test(i == nRetry);
+ adapters.add(com.createObjectAdapter("AdapterAMI64", endpoints[0].toString()));
+ for(i = 0; i < nRetry && getAdapterNameWithAMI(test).equals("AdapterAMI64"); i++);
+ test(i == nRetry);
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+
+ System.out.print("testing endpoint mode filtering... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("Adapter71", "default"));
+ adapters.add(com.createObjectAdapter("Adapter72", "udp"));
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ test(test.getAdapterName().equals("Adapter71"));
+
+ TestIntfPrx testUDP = TestIntfPrxHelper.uncheckedCast(test.ice_datagram());
+ test(test.ice_getConnection() != testUDP.ice_getConnection());
+ try
+ {
+ testUDP.getAdapterName();
+ }
+ catch(Ice.TwowayOnlyException ex)
+ {
+ }
+ }
+ System.out.println("ok");
+
+ if(communicator.getProperties().getProperty("Ice.Plugin.IceSSL").length() > 0)
+ {
+ System.out.print("testing unsecure vs. secure endpoints... ");
+ System.out.flush();
+ {
+ java.util.List adapters = new java.util.ArrayList();
+ adapters.add(com.createObjectAdapter("Adapter81", "ssl"));
+ adapters.add(com.createObjectAdapter("Adapter82", "tcp"));
+
+ TestIntfPrx test = createTestIntfPrx(adapters);
+ int i;
+ for(i = 0; i < 5; i++)
+ {
+ test(test.getAdapterName().equals("Adapter82"));
+ test.ice_getConnection().close(false);
+ }
+
+ TestIntfPrx testSecure = TestIntfPrxHelper.uncheckedCast(test.ice_secure(true));
+ test(testSecure.ice_isSecure());
+ testSecure = TestIntfPrxHelper.uncheckedCast(test.ice_secure(false));
+ test(!testSecure.ice_isSecure());
+ testSecure = TestIntfPrxHelper.uncheckedCast(test.ice_secure(true));
+ test(testSecure.ice_isSecure());
+ test(test.ice_getConnection() != testSecure.ice_getConnection());
+
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(1));
+
+ for(i = 0; i < 5; i++)
+ {
+ test(test.getAdapterName().equals("Adapter81"));
+ test.ice_getConnection().close(false);
+ }
+
+ com.createObjectAdapter("Adapter83", (test.ice_getEndpoints()[1]).toString()); // Reactive tcp OA.
+
+ for(i = 0; i < 5; i++)
+ {
+ test(test.getAdapterName().equals("Adapter83"));
+ test.ice_getConnection().close(false);
+ }
+
+ com.deactivateObjectAdapter((RemoteObjectAdapterPrx)adapters.get(0));
+ try
+ {
+ testSecure.ice_ping();
+ test(false);
+ }
+ catch(Ice.ConnectionRefusedException ex)
+ {
+ }
+
+ deactivate(com, adapters);
+ }
+ System.out.println("ok");
+ }
+
+ com.shutdown();
+
}
}
diff --git a/java/test/Ice/binding/Client.java b/java/test/Ice/binding/Client.java
index 4399d5ae044..aa5e5100f06 100644
--- a/java/test/Ice/binding/Client.java
+++ b/java/test/Ice/binding/Client.java
@@ -12,7 +12,7 @@ public class Client
private static int
run(String[] args, Ice.Communicator communicator)
{
- AllTests.allTests(communicator);
+ AllTests.allTests(communicator);
return 0;
}
@@ -46,7 +46,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/binding/RemoteCommunicatorI.java b/java/test/Ice/binding/RemoteCommunicatorI.java
index ada63c2abb2..a2143ff920f 100644
--- a/java/test/Ice/binding/RemoteCommunicatorI.java
+++ b/java/test/Ice/binding/RemoteCommunicatorI.java
@@ -14,25 +14,25 @@ public class RemoteCommunicatorI extends _RemoteCommunicatorDisp
public RemoteObjectAdapterPrx
createObjectAdapter(String name, String endpoints, Ice.Current current)
{
- Ice.Communicator com = current.adapter.getCommunicator();
+ Ice.Communicator com = current.adapter.getCommunicator();
if(com.getProperties().getPropertyAsIntWithDefault("Ice.ThreadPerConnection", 0) == 0)
{
com.getProperties().setProperty("Ice.OA." + name + ".ThreadPool.Size", "1");
}
- Ice.ObjectAdapter adapter = com.createObjectAdapterWithEndpoints(name, endpoints);
- return RemoteObjectAdapterPrxHelper.uncheckedCast(
- current.adapter.addWithUUID(new RemoteObjectAdapterI(adapter)));
+ Ice.ObjectAdapter adapter = com.createObjectAdapterWithEndpoints(name, endpoints);
+ return RemoteObjectAdapterPrxHelper.uncheckedCast(
+ current.adapter.addWithUUID(new RemoteObjectAdapterI(adapter)));
}
public void
deactivateObjectAdapter(RemoteObjectAdapterPrx adapter, Ice.Current current)
{
- adapter.deactivate(); // Collocated call.
+ adapter.deactivate(); // Collocated call.
}
public void
shutdown(Ice.Current current)
{
- current.adapter.getCommunicator().shutdown();
+ current.adapter.getCommunicator().shutdown();
}
}
diff --git a/java/test/Ice/binding/RemoteObjectAdapterI.java b/java/test/Ice/binding/RemoteObjectAdapterI.java
index 15e79b18295..65f067278aa 100644
--- a/java/test/Ice/binding/RemoteObjectAdapterI.java
+++ b/java/test/Ice/binding/RemoteObjectAdapterI.java
@@ -14,28 +14,28 @@ public class RemoteObjectAdapterI extends _RemoteObjectAdapterDisp
public
RemoteObjectAdapterI(Ice.ObjectAdapter adapter)
{
- _adapter = adapter;
- _testIntf = TestIntfPrxHelper.uncheckedCast(_adapter.add(new TestI(),
- _adapter.getCommunicator().stringToIdentity("test")));
- _adapter.activate();
+ _adapter = adapter;
+ _testIntf = TestIntfPrxHelper.uncheckedCast(_adapter.add(new TestI(),
+ _adapter.getCommunicator().stringToIdentity("test")));
+ _adapter.activate();
}
public TestIntfPrx
getTestIntf(Ice.Current current)
{
- return _testIntf;
+ return _testIntf;
}
public void
deactivate(Ice.Current current)
{
- try
- {
- _adapter.destroy();
- }
- catch(Ice.ObjectAdapterDeactivatedException ex)
- {
- }
+ try
+ {
+ _adapter.destroy();
+ }
+ catch(Ice.ObjectAdapterDeactivatedException ex)
+ {
+ }
}
final Ice.ObjectAdapter _adapter;
diff --git a/java/test/Ice/binding/TestI.java b/java/test/Ice/binding/TestI.java
index 65074e61fa5..51b0e7b60f0 100644
--- a/java/test/Ice/binding/TestI.java
+++ b/java/test/Ice/binding/TestI.java
@@ -18,6 +18,6 @@ public class TestI extends _TestIntfDisp
public String
getAdapterName(Ice.Current current)
{
- return current.adapter.getName();
+ return current.adapter.getName();
}
}
diff --git a/java/test/Ice/checksum/client/Client.java b/java/test/Ice/checksum/client/Client.java
index a4bd153e20e..1ebcec8f727 100644
--- a/java/test/Ice/checksum/client/Client.java
+++ b/java/test/Ice/checksum/client/Client.java
@@ -47,7 +47,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/checksum/server/Server.java b/java/test/Ice/checksum/server/Server.java
index a14c6b4d5be..00c1ca2ae14 100644
--- a/java/test/Ice/checksum/server/Server.java
+++ b/java/test/Ice/checksum/server/Server.java
@@ -51,7 +51,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/custom/Client.java b/java/test/Ice/custom/Client.java
index 1a3a806249c..cc6d8fe4fe1 100644
--- a/java/test/Ice/custom/Client.java
+++ b/java/test/Ice/custom/Client.java
@@ -49,7 +49,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/custom/Server.java b/java/test/Ice/custom/Server.java
index 0d069a21d57..56145be745c 100644
--- a/java/test/Ice/custom/Server.java
+++ b/java/test/Ice/custom/Server.java
@@ -53,7 +53,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/custom/jdk1.5/AllTests.java b/java/test/Ice/custom/jdk1.5/AllTests.java
index f8913ecac73..e726c376ac0 100644
--- a/java/test/Ice/custom/jdk1.5/AllTests.java
+++ b/java/test/Ice/custom/jdk1.5/AllTests.java
@@ -15,210 +15,210 @@ public class AllTests
private static void
test(boolean b)
{
- if(!b)
- {
- throw new RuntimeException();
- }
+ if(!b)
+ {
+ throw new RuntimeException();
+ }
}
public static TestIntfPrx
allTests(Ice.Communicator communicator)
{
- System.out.print("testing stringToProxy... ");
- System.out.flush();
- String ref = "test:default -p 12010 -t 10000";
- Ice.ObjectPrx obj = communicator.stringToProxy(ref);
- test(obj != null);
- System.out.println("ok");
-
- System.out.print("testing checked cast... ");
- System.out.flush();
- TestIntfPrx t = TestIntfPrxHelper.checkedCast(obj);
- test(t != null);
- test(t.equals(obj));
- System.out.println("ok");
-
- System.out.print("testing custom sequences... ");
- System.out.flush();
-
- {
- //
- // Create a sequence of C instances, where elements 1..n simply point to element 0.
- //
- C[] seq = new C[5];
- seq[0] = new C();
- for(int i = 1; i < seq.length; i++)
- {
- seq[i] = seq[0];
- }
-
- //
- // Invoke each operation and verify that the returned sequences have the same
- // structure as the original.
- //
- CSeqHolder seqH = new CSeqHolder();
- C[] seqR = t.opCSeq(seq, seqH);
- test(seqR.length == seq.length);
- test(seqH.value.length == seq.length);
- for(int i = 1; i < seq.length; i++)
- {
- test(seqR[i] != null);
- test(seqR[i] == seqR[0]);
- test(seqR[i] == seqH.value[i]);
- }
-
- ArrayList<C> arr = new ArrayList<C>(Arrays.asList(seq));
- CArrayHolder arrH = new CArrayHolder();
- List<C> arrR = t.opCArray(arr, arrH);
- test(arrR.size() == arr.size());
- test(arrH.value.size() == arr.size());
- for(int i = 1; i < arr.size(); i++)
- {
- test(arrR.get(i) != null);
- test(arrR.get(i) == arrR.get(0));
- test(arrR.get(i) == arrH.value.get(i));
- }
-
- LinkedList<C> list = new LinkedList<C>(Arrays.asList(seq));
- CListHolder listH = new CListHolder();
- List<C> listR = t.opCList(list, listH);
- test(listR.size() == list.size());
- test(listH.value.size() == list.size());
- for(int i = 1; i < list.size(); i++)
- {
- test(listR.get(i) != null);
- test(listR.get(i) == listR.get(0));
- test(listR.get(i) == listH.value.get(i));
- }
- }
-
- {
- final Boolean[] seq = { Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE };
- ArrayList<Boolean> list = new ArrayList<Boolean>(Arrays.asList(seq));
- BoolSeqHolder listH = new BoolSeqHolder();
- List<Boolean> listR = t.opBoolSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final Byte[] seq = { new Byte((byte)0), new Byte((byte)1), new Byte((byte)2), new Byte((byte)3) };
- ArrayList<Byte> list = new ArrayList<Byte>(Arrays.asList(seq));
- ByteSeqHolder listH = new ByteSeqHolder();
- List<Byte> listR = t.opByteSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final Short[] seq = { new Short((short)0), new Short((short)1), new Short((short)2), new Short((short)3) };
- ArrayList<Short> list = new ArrayList<Short>(Arrays.asList(seq));
- ShortSeqHolder listH = new ShortSeqHolder();
- List<Short> listR = t.opShortSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final Integer[] seq = { new Integer(0), new Integer(1), new Integer(2), new Integer(3) };
- ArrayList<Integer> list = new ArrayList<Integer>(Arrays.asList(seq));
- IntSeqHolder listH = new IntSeqHolder();
- List<Integer> listR = t.opIntSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final Long[] seq = { new Long(0), new Long(1), new Long(2), new Long(3) };
- ArrayList<Long> list = new ArrayList<Long>(Arrays.asList(seq));
- LongSeqHolder listH = new LongSeqHolder();
- List<Long> listR = t.opLongSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final Float[] seq = { new Float(0), new Float(1), new Float(2), new Float(3) };
- ArrayList<Float> list = new ArrayList<Float>(Arrays.asList(seq));
- FloatSeqHolder listH = new FloatSeqHolder();
- List<Float> listR = t.opFloatSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final Double[] seq = { new Double(0), new Double(1), new Double(2), new Double(3) };
- ArrayList<Double> list = new ArrayList<Double>(Arrays.asList(seq));
- DoubleSeqHolder listH = new DoubleSeqHolder();
- List<Double> listR = t.opDoubleSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final String[] seq = { "0", "1", "2", "3", "4" };
- ArrayList<String> list = new ArrayList<String>(Arrays.asList(seq));
- StringSeqHolder listH = new StringSeqHolder();
- List<String> listR = t.opStringSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- final E[] seq = { E.E1, E.E2, E.E3 };
- ArrayList<E> list = new ArrayList<E>(Arrays.asList(seq));
- ESeqHolder listH = new ESeqHolder();
- List<E> listR = t.opESeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- S[] seq = new S[5];
- for(int i = 0; i < seq.length; i++)
- {
- seq[i] = new S();
- seq[i].en = E.convert(i % 3);
- }
- ArrayList<S> list = new ArrayList<S>(Arrays.asList(seq));
- SSeqHolder listH = new SSeqHolder();
- List<S> listR = t.opSSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- ArrayList<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>();
- for(int i = 0; i < 5; i++)
- {
- Map<Integer, String> m = new HashMap<Integer, String>();
- for(int j = 0; j < 4; j++)
- {
- m.put(j, "" + j);
- }
- list.add(m);
- }
- DSeqHolder listH = new DSeqHolder();
- List<Map<Integer, String>> listR = t.opDSeq(list, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(list));
- }
-
- {
- List<List<String>> seq = new LinkedList<List<String>>();
- for(int i = 0; i < 5; i++)
- {
- final String[] arr = { "0", "1", "2", "3", "4" };
- seq.add(new ArrayList<String>(Arrays.asList(arr)));
- }
- StringSeqSeqHolder listH = new StringSeqSeqHolder();
- List<List<String>> listR = t.opStringSeqSeq(seq, listH);
- test(listH.value.equals(listR));
- test(listH.value.equals(seq));
- }
-
- System.out.println("ok");
-
- return t;
+ System.out.print("testing stringToProxy... ");
+ System.out.flush();
+ String ref = "test:default -p 12010 -t 10000";
+ Ice.ObjectPrx obj = communicator.stringToProxy(ref);
+ test(obj != null);
+ System.out.println("ok");
+
+ System.out.print("testing checked cast... ");
+ System.out.flush();
+ TestIntfPrx t = TestIntfPrxHelper.checkedCast(obj);
+ test(t != null);
+ test(t.equals(obj));
+ System.out.println("ok");
+
+ System.out.print("testing custom sequences... ");
+ System.out.flush();
+
+ {
+ //
+ // Create a sequence of C instances, where elements 1..n simply point to element 0.
+ //
+ C[] seq = new C[5];
+ seq[0] = new C();
+ for(int i = 1; i < seq.length; i++)
+ {
+ seq[i] = seq[0];
+ }
+
+ //
+ // Invoke each operation and verify that the returned sequences have the same
+ // structure as the original.
+ //
+ CSeqHolder seqH = new CSeqHolder();
+ C[] seqR = t.opCSeq(seq, seqH);
+ test(seqR.length == seq.length);
+ test(seqH.value.length == seq.length);
+ for(int i = 1; i < seq.length; i++)
+ {
+ test(seqR[i] != null);
+ test(seqR[i] == seqR[0]);
+ test(seqR[i] == seqH.value[i]);
+ }
+
+ ArrayList<C> arr = new ArrayList<C>(Arrays.asList(seq));
+ CArrayHolder arrH = new CArrayHolder();
+ List<C> arrR = t.opCArray(arr, arrH);
+ test(arrR.size() == arr.size());
+ test(arrH.value.size() == arr.size());
+ for(int i = 1; i < arr.size(); i++)
+ {
+ test(arrR.get(i) != null);
+ test(arrR.get(i) == arrR.get(0));
+ test(arrR.get(i) == arrH.value.get(i));
+ }
+
+ LinkedList<C> list = new LinkedList<C>(Arrays.asList(seq));
+ CListHolder listH = new CListHolder();
+ List<C> listR = t.opCList(list, listH);
+ test(listR.size() == list.size());
+ test(listH.value.size() == list.size());
+ for(int i = 1; i < list.size(); i++)
+ {
+ test(listR.get(i) != null);
+ test(listR.get(i) == listR.get(0));
+ test(listR.get(i) == listH.value.get(i));
+ }
+ }
+
+ {
+ final Boolean[] seq = { Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE };
+ ArrayList<Boolean> list = new ArrayList<Boolean>(Arrays.asList(seq));
+ BoolSeqHolder listH = new BoolSeqHolder();
+ List<Boolean> listR = t.opBoolSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final Byte[] seq = { new Byte((byte)0), new Byte((byte)1), new Byte((byte)2), new Byte((byte)3) };
+ ArrayList<Byte> list = new ArrayList<Byte>(Arrays.asList(seq));
+ ByteSeqHolder listH = new ByteSeqHolder();
+ List<Byte> listR = t.opByteSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final Short[] seq = { new Short((short)0), new Short((short)1), new Short((short)2), new Short((short)3) };
+ ArrayList<Short> list = new ArrayList<Short>(Arrays.asList(seq));
+ ShortSeqHolder listH = new ShortSeqHolder();
+ List<Short> listR = t.opShortSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final Integer[] seq = { new Integer(0), new Integer(1), new Integer(2), new Integer(3) };
+ ArrayList<Integer> list = new ArrayList<Integer>(Arrays.asList(seq));
+ IntSeqHolder listH = new IntSeqHolder();
+ List<Integer> listR = t.opIntSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final Long[] seq = { new Long(0), new Long(1), new Long(2), new Long(3) };
+ ArrayList<Long> list = new ArrayList<Long>(Arrays.asList(seq));
+ LongSeqHolder listH = new LongSeqHolder();
+ List<Long> listR = t.opLongSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final Float[] seq = { new Float(0), new Float(1), new Float(2), new Float(3) };
+ ArrayList<Float> list = new ArrayList<Float>(Arrays.asList(seq));
+ FloatSeqHolder listH = new FloatSeqHolder();
+ List<Float> listR = t.opFloatSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final Double[] seq = { new Double(0), new Double(1), new Double(2), new Double(3) };
+ ArrayList<Double> list = new ArrayList<Double>(Arrays.asList(seq));
+ DoubleSeqHolder listH = new DoubleSeqHolder();
+ List<Double> listR = t.opDoubleSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final String[] seq = { "0", "1", "2", "3", "4" };
+ ArrayList<String> list = new ArrayList<String>(Arrays.asList(seq));
+ StringSeqHolder listH = new StringSeqHolder();
+ List<String> listR = t.opStringSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ final E[] seq = { E.E1, E.E2, E.E3 };
+ ArrayList<E> list = new ArrayList<E>(Arrays.asList(seq));
+ ESeqHolder listH = new ESeqHolder();
+ List<E> listR = t.opESeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ S[] seq = new S[5];
+ for(int i = 0; i < seq.length; i++)
+ {
+ seq[i] = new S();
+ seq[i].en = E.convert(i % 3);
+ }
+ ArrayList<S> list = new ArrayList<S>(Arrays.asList(seq));
+ SSeqHolder listH = new SSeqHolder();
+ List<S> listR = t.opSSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ ArrayList<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>();
+ for(int i = 0; i < 5; i++)
+ {
+ Map<Integer, String> m = new HashMap<Integer, String>();
+ for(int j = 0; j < 4; j++)
+ {
+ m.put(j, "" + j);
+ }
+ list.add(m);
+ }
+ DSeqHolder listH = new DSeqHolder();
+ List<Map<Integer, String>> listR = t.opDSeq(list, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(list));
+ }
+
+ {
+ List<List<String>> seq = new LinkedList<List<String>>();
+ for(int i = 0; i < 5; i++)
+ {
+ final String[] arr = { "0", "1", "2", "3", "4" };
+ seq.add(new ArrayList<String>(Arrays.asList(arr)));
+ }
+ StringSeqSeqHolder listH = new StringSeqSeqHolder();
+ List<List<String>> listR = t.opStringSeqSeq(seq, listH);
+ test(listH.value.equals(listR));
+ test(listH.value.equals(seq));
+ }
+
+ System.out.println("ok");
+
+ return t;
}
}
diff --git a/java/test/Ice/exceptions/AllTests.java b/java/test/Ice/exceptions/AllTests.java
index b463836d80a..60a2e2a8652 100644
--- a/java/test/Ice/exceptions/AllTests.java
+++ b/java/test/Ice/exceptions/AllTests.java
@@ -22,801 +22,801 @@ 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;
+ 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_Thrower_throwAasAI extends AMI_Thrower_throwAasA
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- throw exc;
- }
- catch(A ex)
- {
- test(ex.aMem == 1);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(A ex)
+ {
+ test(ex.aMem == 1);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwAasAObjectNotExistI extends AMI_Thrower_throwAasA
{
AMI_Thrower_throwAasAObjectNotExistI(Ice.Communicator communicator)
- {
- _communicator = communicator;
- }
-
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.ObjectNotExistException ex)
- {
- Ice.Identity id = _communicator.stringToIdentity("does not exist");
- test(ex.id.equals(id));
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
- private Ice.Communicator _communicator;
+ {
+ _communicator = communicator;
+ }
+
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ Ice.Identity id = _communicator.stringToIdentity("does not exist");
+ test(ex.id.equals(id));
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
+ private Ice.Communicator _communicator;
}
private static class AMI_Thrower_throwAasAFacetNotExistI extends AMI_Thrower_throwAasA
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.FacetNotExistException ex)
- {
- test(ex.facet.equals("no such facet"));
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.FacetNotExistException ex)
+ {
+ test(ex.facet.equals("no such facet"));
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwAorDasAorDI extends AMI_Thrower_throwAorDasAorD
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- throw exc;
- }
- catch(A ex)
- {
- test(ex.aMem == 1);
- }
- catch(D ex)
- {
- test(ex.dMem == -1);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(A ex)
+ {
+ test(ex.aMem == 1);
+ }
+ catch(D ex)
+ {
+ test(ex.dMem == -1);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwBasAI extends AMI_Thrower_throwBasA
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- throw exc;
- }
- catch(B ex)
- {
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(B ex)
+ {
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwCasAI extends AMI_Thrower_throwCasA
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- throw exc;
- }
- catch(C ex)
- {
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- test(ex.cMem == 3);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(C ex)
+ {
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwBasBI extends AMI_Thrower_throwBasB
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- throw exc;
- }
- catch(B ex)
- {
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(B ex)
+ {
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwCasBI extends AMI_Thrower_throwCasB
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- throw exc;
- }
- catch(C ex)
- {
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- test(ex.cMem == 3);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(C ex)
+ {
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwCasCI extends AMI_Thrower_throwCasC
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- exc.printStackTrace();
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- throw exc;
- }
- catch(C ex)
- {
- test(ex.aMem == 1);
- test(ex.bMem == 2);
- test(ex.cMem == 3);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ exc.printStackTrace();
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(C ex)
+ {
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwUndeclaredAI extends AMI_Thrower_throwUndeclaredA
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.UnknownUserException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.UnknownUserException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwUndeclaredBI extends AMI_Thrower_throwUndeclaredB
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.UnknownUserException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.UnknownUserException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwUndeclaredCI extends AMI_Thrower_throwUndeclaredC
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.UnknownUserException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.UnknownUserException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwLocalExceptionI extends AMI_Thrower_throwLocalException
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.UnknownLocalException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.UnknownLocalException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwNonIceExceptionI extends AMI_Thrower_throwNonIceException
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.UnknownException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.UnknownException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Thrower_throwAssertExceptionI extends AMI_Thrower_throwAssertException
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.ConnectionLostException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_WrongOperation_noSuchOperationI extends AMI_WrongOperation_noSuchOperation
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- try
- {
- throw exc;
- }
- catch(Ice.OperationNotExistException ex)
- {
- test(ex.operation.equals("noSuchOperation"));
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ try
+ {
+ throw exc;
+ }
+ catch(Ice.OperationNotExistException ex)
+ {
+ test(ex.operation.equals("noSuchOperation"));
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
public static ThrowerPrx
allTests(Ice.Communicator communicator, boolean collocated)
{
- {
- System.out.print("testing object adapter registration exceptions... ");
- Ice.ObjectAdapter first;
- try
- {
- first = communicator.createObjectAdapter("TestAdapter0");
- }
- catch(Ice.InitializationException ex)
- {
- // Expected
- }
-
- communicator.getProperties().setProperty("Ice.OA.TestAdapter0.Endpoints", "default");
- first = communicator.createObjectAdapter("TestAdapter0");
- try
- {
- Ice.ObjectAdapter second = communicator.createObjectAdapter("TestAdapter0");
- test(false);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- // Expected
- }
-
- try
- {
- Ice.ObjectAdapter second =
- communicator.createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12011 -t 10000");
- test(false);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- // Expected
- }
- test(communicator.getProperties().getProperty("Ice.OA.TestAdapter0.Endpoints").equals("default"));
- first.deactivate();
- System.out.println("ok");
- }
-
- {
- System.out.print("testing servant registration exceptions... ");
- communicator.getProperties().setProperty("Ice.OA.TestAdapter1.Endpoints", "default");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter1");
- Ice.Object obj = new EmptyI();
- adapter.add(obj, communicator.stringToIdentity("x"));
- try
- {
- adapter.add(obj, communicator.stringToIdentity("x"));
- test(false);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- }
-
- adapter.remove(communicator.stringToIdentity("x"));
- try
- {
- adapter.remove(communicator.stringToIdentity("x"));
- test(false);
- }
- catch(Ice.NotRegisteredException ex)
- {
- }
- adapter.deactivate();
- System.out.println("ok");
- }
-
- {
- System.out.print("testing servant locator registration exceptions... ");
- communicator.getProperties().setProperty("Ice.OA.TestAdapter2.Endpoints", "default");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter2");
- Ice.ServantLocator loc = new ServantLocatorI();
- adapter.addServantLocator(loc, "x");
- try
- {
- adapter.addServantLocator(loc, "x");
- test(false);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- }
-
- adapter.deactivate();
- System.out.println("ok");
- }
-
- {
- System.out.print("testing object factory registration exception... ");
- Ice.ObjectFactory of = new ObjectFactoryI();
- communicator.addObjectFactory(of, "::x");
- try
- {
- communicator.addObjectFactory(of, "::x");
- test(false);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- }
- System.out.println("ok");
- }
+ {
+ System.out.print("testing object adapter registration exceptions... ");
+ Ice.ObjectAdapter first;
+ try
+ {
+ first = communicator.createObjectAdapter("TestAdapter0");
+ }
+ catch(Ice.InitializationException ex)
+ {
+ // Expected
+ }
+
+ communicator.getProperties().setProperty("Ice.OA.TestAdapter0.Endpoints", "default");
+ first = communicator.createObjectAdapter("TestAdapter0");
+ try
+ {
+ Ice.ObjectAdapter second = communicator.createObjectAdapter("TestAdapter0");
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ // Expected
+ }
+
+ try
+ {
+ Ice.ObjectAdapter second =
+ communicator.createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12011 -t 10000");
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ // Expected
+ }
+ test(communicator.getProperties().getProperty("Ice.OA.TestAdapter0.Endpoints").equals("default"));
+ first.deactivate();
+ System.out.println("ok");
+ }
+
+ {
+ System.out.print("testing servant registration exceptions... ");
+ communicator.getProperties().setProperty("Ice.OA.TestAdapter1.Endpoints", "default");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter1");
+ Ice.Object obj = new EmptyI();
+ adapter.add(obj, communicator.stringToIdentity("x"));
+ try
+ {
+ adapter.add(obj, communicator.stringToIdentity("x"));
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ }
+
+ adapter.remove(communicator.stringToIdentity("x"));
+ try
+ {
+ adapter.remove(communicator.stringToIdentity("x"));
+ test(false);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ }
+ adapter.deactivate();
+ System.out.println("ok");
+ }
+
+ {
+ System.out.print("testing servant locator registration exceptions... ");
+ communicator.getProperties().setProperty("Ice.OA.TestAdapter2.Endpoints", "default");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter2");
+ Ice.ServantLocator loc = new ServantLocatorI();
+ adapter.addServantLocator(loc, "x");
+ try
+ {
+ adapter.addServantLocator(loc, "x");
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ }
+
+ adapter.deactivate();
+ System.out.println("ok");
+ }
+
+ {
+ System.out.print("testing object factory registration exception... ");
+ Ice.ObjectFactory of = new ObjectFactoryI();
+ communicator.addObjectFactory(of, "::x");
+ try
+ {
+ communicator.addObjectFactory(of, "::x");
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ }
+ System.out.println("ok");
+ }
System.out.print("testing stringToProxy... ");
System.out.flush();
@@ -846,7 +846,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -861,7 +861,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -876,7 +876,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -892,7 +892,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -909,7 +909,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -929,7 +929,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -945,14 +945,14 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
System.out.println("ok");
- System.out.print("catching derived types... ");
- System.out.flush();
+ System.out.print("catching derived types... ");
+ System.out.flush();
try
{
@@ -966,7 +966,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -983,7 +983,7 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -1000,134 +1000,134 @@ public class AllTests
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
System.out.println("ok");
- if(thrower.supportsUndeclaredExceptions())
- {
- test(!collocated);
-
- System.out.print("catching unknown user exception... ");
- System.out.flush();
-
- try
- {
- thrower.throwUndeclaredA(1);
- test(false);
- }
- catch(Ice.UnknownUserException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
-
- try
- {
- thrower.throwUndeclaredB(1, 2);
- test(false);
- }
- catch(Ice.UnknownUserException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
-
- try
- {
- thrower.throwUndeclaredC(1, 2, 3);
- test(false);
- }
- catch(Ice.UnknownUserException ex)
- {
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
-
- System.out.println("ok");
- }
-
- if(thrower.supportsAssertException())
- {
- System.out.print("testing assert in the server... ");
- System.out.flush();
-
- try
- {
- thrower.throwAssertException();
- test(false);
- }
- catch(java.lang.AssertionError ex)
- {
- assert(collocated);
- }
- catch(Ice.ConnectionLostException ex)
- {
- assert(!collocated);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
-
- System.out.println("ok");
- }
-
- System.out.print("catching object not exist exception... ");
- System.out.flush();
-
- {
- Ice.Identity id = communicator.stringToIdentity("does not exist");
- try
- {
- ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower.ice_identity(id));
- thrower2.ice_ping();
- test(false);
- }
- catch(Ice.ObjectNotExistException ex)
- {
- test(ex.id.equals(id));
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
- }
+ if(thrower.supportsUndeclaredExceptions())
+ {
+ test(!collocated);
+
+ System.out.print("catching unknown user exception... ");
+ System.out.flush();
+
+ try
+ {
+ thrower.throwUndeclaredA(1);
+ test(false);
+ }
+ catch(Ice.UnknownUserException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+
+ try
+ {
+ thrower.throwUndeclaredB(1, 2);
+ test(false);
+ }
+ catch(Ice.UnknownUserException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+
+ try
+ {
+ thrower.throwUndeclaredC(1, 2, 3);
+ test(false);
+ }
+ catch(Ice.UnknownUserException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+
+ System.out.println("ok");
+ }
+
+ if(thrower.supportsAssertException())
+ {
+ System.out.print("testing assert in the server... ");
+ System.out.flush();
+
+ try
+ {
+ thrower.throwAssertException();
+ test(false);
+ }
+ catch(java.lang.AssertionError ex)
+ {
+ assert(collocated);
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ assert(!collocated);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+
+ System.out.println("ok");
+ }
+
+ System.out.print("catching object not exist exception... ");
+ System.out.flush();
+
+ {
+ Ice.Identity id = communicator.stringToIdentity("does not exist");
+ try
+ {
+ ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower.ice_identity(id));
+ thrower2.ice_ping();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ test(ex.id.equals(id));
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+ }
System.out.println("ok");
System.out.print("catching facet not exist exception... ");
System.out.flush();
- try
- {
- ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower, "no such facet");
- try
- {
- thrower2.ice_ping();
- test(false);
- }
- catch(Ice.FacetNotExistException ex)
- {
- test(ex.facet.equals("no such facet"));
- }
- }
+ try
+ {
+ ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower, "no such facet");
+ try
+ {
+ thrower2.ice_ping();
+ test(false);
+ }
+ catch(Ice.FacetNotExistException ex)
+ {
+ test(ex.facet.equals("no such facet"));
+ }
+ }
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -1138,17 +1138,17 @@ public class AllTests
try
{
- WrongOperationPrx thrower2 = WrongOperationPrxHelper.uncheckedCast(thrower);
- thrower2.noSuchOperation();
- test(false);
+ WrongOperationPrx thrower2 = WrongOperationPrxHelper.uncheckedCast(thrower);
+ thrower2.noSuchOperation();
+ test(false);
}
catch(Ice.OperationNotExistException ex)
{
- test(ex.operation.equals("noSuchOperation"));
+ test(ex.operation.equals("noSuchOperation"));
}
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -1164,23 +1164,23 @@ public class AllTests
}
catch(Ice.TimeoutException ex)
{
- //
- // We get the original exception with collocation
- // optimization.
- //
- test(collocated);
- }
+ //
+ // We get the original exception with collocation
+ // optimization.
+ //
+ test(collocated);
+ }
catch(Ice.UnknownLocalException ex)
{
- //
- // We get an unknown local exception without collocation
- // optimization.
- //
- test(!collocated);
- }
+ //
+ // We get an unknown local exception without collocation
+ // optimization.
+ //
+ test(!collocated);
+ }
catch(Exception ex)
{
- ex.printStackTrace();
+ ex.printStackTrace();
test(false);
}
@@ -1196,192 +1196,192 @@ public class AllTests
}
catch(Ice.UnknownException ex)
{
- //
- // We get the an unknown exception without collocation
- // optimization.
- //
- test(!collocated);
+ //
+ // We get the an unknown exception without collocation
+ // optimization.
+ //
+ test(!collocated);
}
catch(RuntimeException ex)
{
- //
- // We get the original exception with collocation
- // optimization.
- //
- test(collocated);
+ //
+ // We get the original exception with collocation
+ // optimization.
+ //
+ test(collocated);
}
System.out.println("ok");
- if(!collocated)
- {
- System.out.print("catching exact types with AMI... ");
- System.out.flush();
-
- {
- AMI_Thrower_throwAasAI cb = new AMI_Thrower_throwAasAI();
- thrower.throwAasA_async(cb, 1);
- test(cb.check());
- // Let's check if we can reuse the same callback object for another call.
- thrower.throwAasA_async(cb, 1);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwAorDasAorDI cb = new AMI_Thrower_throwAorDasAorDI();
- thrower.throwAorDasAorD_async(cb, 1);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwAorDasAorDI cb = new AMI_Thrower_throwAorDasAorDI();
- thrower.throwAorDasAorD_async(cb, -1);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwBasBI cb = new AMI_Thrower_throwBasBI();
- thrower.throwBasB_async(cb, 1, 2);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwCasCI cb = new AMI_Thrower_throwCasCI();
- thrower.throwCasC_async(cb, 1, 2, 3);
- test(cb.check());
- // Let's check if we can reuse the same callback object for another call.
- thrower.throwCasC_async(cb, 1, 2, 3);
- test(cb.check());
- }
-
- System.out.println("ok");
-
+ if(!collocated)
+ {
+ System.out.print("catching exact types with AMI... ");
+ System.out.flush();
+
+ {
+ AMI_Thrower_throwAasAI cb = new AMI_Thrower_throwAasAI();
+ thrower.throwAasA_async(cb, 1);
+ test(cb.check());
+ // Let's check if we can reuse the same callback object for another call.
+ thrower.throwAasA_async(cb, 1);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwAorDasAorDI cb = new AMI_Thrower_throwAorDasAorDI();
+ thrower.throwAorDasAorD_async(cb, 1);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwAorDasAorDI cb = new AMI_Thrower_throwAorDasAorDI();
+ thrower.throwAorDasAorD_async(cb, -1);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwBasBI cb = new AMI_Thrower_throwBasBI();
+ thrower.throwBasB_async(cb, 1, 2);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwCasCI cb = new AMI_Thrower_throwCasCI();
+ thrower.throwCasC_async(cb, 1, 2, 3);
+ test(cb.check());
+ // Let's check if we can reuse the same callback object for another call.
+ thrower.throwCasC_async(cb, 1, 2, 3);
+ test(cb.check());
+ }
+
+ System.out.println("ok");
+
System.out.print("catching derived types with AMI... ");
System.out.flush();
-
- {
- AMI_Thrower_throwBasAI cb = new AMI_Thrower_throwBasAI();
- thrower.throwBasA_async(cb, 1, 2);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwCasAI cb = new AMI_Thrower_throwCasAI();
- thrower.throwCasA_async(cb, 1, 2, 3);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwCasBI cb = new AMI_Thrower_throwCasBI();
- thrower.throwCasB_async(cb, 1, 2, 3);
- test(cb.check());
- }
-
- System.out.println("ok");
-
- if(thrower.supportsUndeclaredExceptions())
- {
- System.out.print("catching unknown user exception with AMI... ");
- System.out.flush();
-
- {
- AMI_Thrower_throwUndeclaredAI cb = new AMI_Thrower_throwUndeclaredAI();
- thrower.throwUndeclaredA_async(cb, 1);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwUndeclaredBI cb = new AMI_Thrower_throwUndeclaredBI();
- thrower.throwUndeclaredB_async(cb, 1, 2);
- test(cb.check());
- }
-
- {
- AMI_Thrower_throwUndeclaredCI cb = new AMI_Thrower_throwUndeclaredCI();
- thrower.throwUndeclaredC_async(cb, 1, 2, 3);
- test(cb.check());
- }
-
- System.out.println("ok");
- }
-
- if(thrower.supportsAssertException())
- {
- System.out.print("testing assert in the server with AMI... ");
- System.out.flush();
-
- AMI_Thrower_throwAssertExceptionI cb = new AMI_Thrower_throwAssertExceptionI();
- thrower.throwAssertException_async(cb);
- test(cb.check());
-
- System.out.println("ok");
- }
-
- System.out.print("catching object not exist exception with AMI... ");
- System.out.flush();
-
- {
- Ice.Identity id = communicator.stringToIdentity("does not exist");
- ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower.ice_identity(id));
- AMI_Thrower_throwAasAObjectNotExistI cb = new AMI_Thrower_throwAasAObjectNotExistI(communicator);
- thrower2.throwAasA_async(cb, 1);
- test(cb.check());
- }
-
- System.out.println("ok");
-
- System.out.print("catching facet not exist exception with AMI... ");
- System.out.flush();
-
- try
- {
- ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower, "no such facet");
- {
- AMI_Thrower_throwAasAFacetNotExistI cb = new AMI_Thrower_throwAasAFacetNotExistI();
- thrower2.throwAasA_async(cb, 1);
- test(cb.check());
- }
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- test(false);
- }
-
- System.out.println("ok");
-
- System.out.print("catching operation not exist exception with AMI... ");
- System.out.flush();
-
- {
- AMI_WrongOperation_noSuchOperationI cb = new AMI_WrongOperation_noSuchOperationI();
- WrongOperationPrx thrower2 = WrongOperationPrxHelper.uncheckedCast(thrower);
- thrower2.noSuchOperation_async(cb);
- test(cb.check());
- }
-
- System.out.println("ok");
+
+ {
+ AMI_Thrower_throwBasAI cb = new AMI_Thrower_throwBasAI();
+ thrower.throwBasA_async(cb, 1, 2);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwCasAI cb = new AMI_Thrower_throwCasAI();
+ thrower.throwCasA_async(cb, 1, 2, 3);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwCasBI cb = new AMI_Thrower_throwCasBI();
+ thrower.throwCasB_async(cb, 1, 2, 3);
+ test(cb.check());
+ }
+
+ System.out.println("ok");
+
+ if(thrower.supportsUndeclaredExceptions())
+ {
+ System.out.print("catching unknown user exception with AMI... ");
+ System.out.flush();
+
+ {
+ AMI_Thrower_throwUndeclaredAI cb = new AMI_Thrower_throwUndeclaredAI();
+ thrower.throwUndeclaredA_async(cb, 1);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwUndeclaredBI cb = new AMI_Thrower_throwUndeclaredBI();
+ thrower.throwUndeclaredB_async(cb, 1, 2);
+ test(cb.check());
+ }
+
+ {
+ AMI_Thrower_throwUndeclaredCI cb = new AMI_Thrower_throwUndeclaredCI();
+ thrower.throwUndeclaredC_async(cb, 1, 2, 3);
+ test(cb.check());
+ }
+
+ System.out.println("ok");
+ }
+
+ if(thrower.supportsAssertException())
+ {
+ System.out.print("testing assert in the server with AMI... ");
+ System.out.flush();
+
+ AMI_Thrower_throwAssertExceptionI cb = new AMI_Thrower_throwAssertExceptionI();
+ thrower.throwAssertException_async(cb);
+ test(cb.check());
+
+ System.out.println("ok");
+ }
+
+ System.out.print("catching object not exist exception with AMI... ");
+ System.out.flush();
+
+ {
+ Ice.Identity id = communicator.stringToIdentity("does not exist");
+ ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower.ice_identity(id));
+ AMI_Thrower_throwAasAObjectNotExistI cb = new AMI_Thrower_throwAasAObjectNotExistI(communicator);
+ thrower2.throwAasA_async(cb, 1);
+ test(cb.check());
+ }
+
+ System.out.println("ok");
+
+ System.out.print("catching facet not exist exception with AMI... ");
+ System.out.flush();
+
+ try
+ {
+ ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower, "no such facet");
+ {
+ AMI_Thrower_throwAasAFacetNotExistI cb = new AMI_Thrower_throwAasAFacetNotExistI();
+ thrower2.throwAasA_async(cb, 1);
+ test(cb.check());
+ }
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ test(false);
+ }
+
+ System.out.println("ok");
+
+ System.out.print("catching operation not exist exception with AMI... ");
+ System.out.flush();
+
+ {
+ AMI_WrongOperation_noSuchOperationI cb = new AMI_WrongOperation_noSuchOperationI();
+ WrongOperationPrx thrower2 = WrongOperationPrxHelper.uncheckedCast(thrower);
+ thrower2.noSuchOperation_async(cb);
+ test(cb.check());
+ }
+
+ System.out.println("ok");
- System.out.print("catching unknown local exception with AMI... ");
- System.out.flush();
-
- {
- AMI_Thrower_throwLocalExceptionI cb = new AMI_Thrower_throwLocalExceptionI();
- thrower.throwLocalException_async(cb);
- test(cb.check());
- }
-
- System.out.println("ok");
-
- System.out.print("catching unknown non-Ice exception with AMI... ");
- System.out.flush();
-
- AMI_Thrower_throwNonIceExceptionI cb = new AMI_Thrower_throwNonIceExceptionI();
- thrower.throwNonIceException_async(cb);
- test(cb.check());
-
- System.out.println("ok");
- }
+ System.out.print("catching unknown local exception with AMI... ");
+ System.out.flush();
+
+ {
+ AMI_Thrower_throwLocalExceptionI cb = new AMI_Thrower_throwLocalExceptionI();
+ thrower.throwLocalException_async(cb);
+ test(cb.check());
+ }
+
+ System.out.println("ok");
+
+ System.out.print("catching unknown non-Ice exception with AMI... ");
+ System.out.flush();
+
+ AMI_Thrower_throwNonIceExceptionI cb = new AMI_Thrower_throwNonIceExceptionI();
+ thrower.throwNonIceException_async(cb);
+ test(cb.check());
+
+ System.out.println("ok");
+ }
return thrower;
}
diff --git a/java/test/Ice/exceptions/Client.java b/java/test/Ice/exceptions/Client.java
index 323b6652c40..8f97b2e19c1 100644
--- a/java/test/Ice/exceptions/Client.java
+++ b/java/test/Ice/exceptions/Client.java
@@ -27,10 +27,10 @@ public class Client
try
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.Warn.Connections", "0");
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
communicator = Ice.Util.initialize(argsH, initData);
status = run(args, communicator);
@@ -54,7 +54,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/exceptions/Server.java b/java/test/Ice/exceptions/Server.java
index 9035ff41b9f..4c97c5e6582 100644
--- a/java/test/Ice/exceptions/Server.java
+++ b/java/test/Ice/exceptions/Server.java
@@ -13,7 +13,7 @@ public class Server
run(String[] args, Ice.Communicator communicator)
{
Ice.Properties properties = communicator.getProperties();
- // We don't need to disable warnings, because we have a dummy logger.
+ // We don't need to disable warnings, because we have a dummy logger.
//properties.setProperty("Ice.Warn.Dispatch", "0");
properties.setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000:udp");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
@@ -32,12 +32,12 @@ public class Server
try
{
- //
- // For this test, we need a dummy logger, otherwise the
- // assertion test will print an error message.
- //
+ //
+ // For this test, we need a dummy logger, otherwise the
+ // assertion test will print an error message.
+ //
Ice.InitializationData initData = new Ice.InitializationData();
- initData.logger = new DummyLogger();
+ initData.logger = new DummyLogger();
communicator = Ice.Util.initialize(args, initData);
status = run(args, communicator);
diff --git a/java/test/Ice/exceptionsAMD/Server.java b/java/test/Ice/exceptionsAMD/Server.java
index 9aec3e28a6a..4c97c5e6582 100644
--- a/java/test/Ice/exceptionsAMD/Server.java
+++ b/java/test/Ice/exceptionsAMD/Server.java
@@ -13,7 +13,7 @@ public class Server
run(String[] args, Ice.Communicator communicator)
{
Ice.Properties properties = communicator.getProperties();
- // We don't need to disable warnings, because we have a dummy logger.
+ // We don't need to disable warnings, because we have a dummy logger.
//properties.setProperty("Ice.Warn.Dispatch", "0");
properties.setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000:udp");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
@@ -32,12 +32,12 @@ public class Server
try
{
- //
- // For this test, we need a dummy logger, otherwise the
- // assertion test will print an error message.
- //
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.logger = new DummyLogger();
+ //
+ // For this test, we need a dummy logger, otherwise the
+ // assertion test will print an error message.
+ //
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.logger = new DummyLogger();
communicator = Ice.Util.initialize(args, initData);
status = run(args, communicator);
diff --git a/java/test/Ice/exceptionsAMD/ThrowerI.java b/java/test/Ice/exceptionsAMD/ThrowerI.java
index 5c3bc854824..37d305179b0 100644
--- a/java/test/Ice/exceptionsAMD/ThrowerI.java
+++ b/java/test/Ice/exceptionsAMD/ThrowerI.java
@@ -21,7 +21,7 @@ public final class ThrowerI extends _ThrowerDisp
shutdown_async(AMD_Thrower_shutdown cb, Ice.Current current)
{
_adapter.getCommunicator().shutdown();
- cb.ice_response();
+ cb.ice_response();
}
public void
@@ -54,13 +54,13 @@ public final class ThrowerI extends _ThrowerDisp
{
A ex = new A();
ex.aMem = a;
- cb.ice_exception(ex);
+ cb.ice_exception(ex);
}
else
{
D ex = new D();
ex.dMem = a;
- cb.ice_exception(ex);
+ cb.ice_exception(ex);
}
}
@@ -68,11 +68,11 @@ public final class ThrowerI extends _ThrowerDisp
throwBasA_async(AMD_Thrower_throwBasA cb, int a, int b, Ice.Current current)
throws A
{
- B ex = new B();
- ex.aMem = a;
- ex.bMem = b;
- throw ex;
- //cb.ice_exception(ex);
+ B ex = new B();
+ ex.aMem = a;
+ ex.bMem = b;
+ throw ex;
+ //cb.ice_exception(ex);
}
public void
@@ -83,29 +83,29 @@ public final class ThrowerI extends _ThrowerDisp
ex.aMem = a;
ex.bMem = b;
throw ex;
- //cb.ice_exception(ex);
+ //cb.ice_exception(ex);
}
public void
throwCasA_async(AMD_Thrower_throwCasA cb, int a, int b, int c, Ice.Current current)
throws A
{
- C ex = new C();
- ex.aMem = a;
- ex.bMem = b;
- ex.cMem = c;
- cb.ice_exception(ex);
+ C ex = new C();
+ ex.aMem = a;
+ ex.bMem = b;
+ ex.cMem = c;
+ cb.ice_exception(ex);
}
public void
throwCasB_async(AMD_Thrower_throwCasB cb, int a, int b, int c, Ice.Current current)
throws B
{
- C ex = new C();
- ex.aMem = a;
- ex.bMem = b;
- ex.cMem = c;
- cb.ice_exception(ex);
+ C ex = new C();
+ ex.aMem = a;
+ ex.bMem = b;
+ ex.cMem = c;
+ cb.ice_exception(ex);
}
public void
@@ -116,7 +116,7 @@ public final class ThrowerI extends _ThrowerDisp
ex.aMem = a;
ex.bMem = b;
ex.cMem = c;
- cb.ice_exception(ex);
+ cb.ice_exception(ex);
}
public void
@@ -130,10 +130,10 @@ public final class ThrowerI extends _ThrowerDisp
public void
throwUndeclaredB_async(AMD_Thrower_throwUndeclaredB cb, int a, int b, Ice.Current current)
{
- B ex = new B();
- ex.aMem = a;
- ex.bMem = b;
- cb.ice_exception(ex);
+ B ex = new B();
+ ex.aMem = a;
+ ex.bMem = b;
+ cb.ice_exception(ex);
}
public void
diff --git a/java/test/Ice/facets/AllTests.java b/java/test/Ice/facets/AllTests.java
index 4b6dda90a5c..9dc5167f89d 100644
--- a/java/test/Ice/facets/AllTests.java
+++ b/java/test/Ice/facets/AllTests.java
@@ -24,56 +24,56 @@ public class AllTests
allTests(Ice.Communicator communicator)
{
System.out.print("testing facet registration exceptions... ");
- communicator.getProperties().setProperty("Ice.OA.FacetExceptionTestAdapter.Endpoints", "default");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("FacetExceptionTestAdapter");
- Ice.Object obj = new EmptyI();
+ communicator.getProperties().setProperty("Ice.OA.FacetExceptionTestAdapter.Endpoints", "default");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("FacetExceptionTestAdapter");
+ Ice.Object obj = new EmptyI();
adapter.add(obj, communicator.stringToIdentity("d"));
- adapter.addFacet(obj, communicator.stringToIdentity("d"), "facetABCD");
- try
- {
+ adapter.addFacet(obj, communicator.stringToIdentity("d"), "facetABCD");
+ try
+ {
adapter.addFacet(obj, communicator.stringToIdentity("d"), "facetABCD");
- test(false);
- }
- catch(Ice.AlreadyRegisteredException ex)
- {
- }
- adapter.removeFacet(communicator.stringToIdentity("d"), "facetABCD");
- try
- {
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException ex)
+ {
+ }
+ adapter.removeFacet(communicator.stringToIdentity("d"), "facetABCD");
+ try
+ {
adapter.removeFacet(communicator.stringToIdentity("d"), "facetABCD");
- test(false);
- }
- catch(Ice.NotRegisteredException ex)
- {
- }
+ test(false);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ }
System.out.println("ok");
System.out.print("testing removeAllFacets... ");
- Ice.Object obj1 = new EmptyI();
- Ice.Object obj2 = new EmptyI();
- adapter.addFacet(obj1, communicator.stringToIdentity("id1"), "f1");
- adapter.addFacet(obj2, communicator.stringToIdentity("id1"), "f2");
- Ice.Object obj3 = new EmptyI();
- adapter.addFacet(obj1, communicator.stringToIdentity("id2"), "f1");
- adapter.addFacet(obj2, communicator.stringToIdentity("id2"), "f2");
- adapter.addFacet(obj3, communicator.stringToIdentity("id2"), "");
- java.util.Map fm = adapter.removeAllFacets(communicator.stringToIdentity("id1"));
- test(fm.size() == 2);
- test(fm.get("f1") == obj1);
- test(fm.get("f2") == obj2);
- try
- {
+ Ice.Object obj1 = new EmptyI();
+ Ice.Object obj2 = new EmptyI();
+ adapter.addFacet(obj1, communicator.stringToIdentity("id1"), "f1");
+ adapter.addFacet(obj2, communicator.stringToIdentity("id1"), "f2");
+ Ice.Object obj3 = new EmptyI();
+ adapter.addFacet(obj1, communicator.stringToIdentity("id2"), "f1");
+ adapter.addFacet(obj2, communicator.stringToIdentity("id2"), "f2");
+ adapter.addFacet(obj3, communicator.stringToIdentity("id2"), "");
+ java.util.Map fm = adapter.removeAllFacets(communicator.stringToIdentity("id1"));
+ test(fm.size() == 2);
+ test(fm.get("f1") == obj1);
+ test(fm.get("f2") == obj2);
+ try
+ {
adapter.removeAllFacets(communicator.stringToIdentity("id1"));
- test(false);
- }
- catch(Ice.NotRegisteredException ex)
- {
- }
- fm = adapter.removeAllFacets(communicator.stringToIdentity("id2"));
- test(fm.size() == 3);
- test(fm.get("f1") == obj1);
- test(fm.get("f2") == obj2);
- test(fm.get("") == obj3);
+ test(false);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ }
+ fm = adapter.removeAllFacets(communicator.stringToIdentity("id2"));
+ test(fm.size() == 3);
+ test(fm.get("f1") == obj1);
+ test(fm.get("f2") == obj2);
+ test(fm.get("") == obj3);
System.out.println("ok");
adapter.deactivate();
diff --git a/java/test/Ice/facets/Client.java b/java/test/Ice/facets/Client.java
index cfce4f44101..15260b9f6b3 100644
--- a/java/test/Ice/facets/Client.java
+++ b/java/test/Ice/facets/Client.java
@@ -49,7 +49,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/facets/Collocated.java b/java/test/Ice/facets/Collocated.java
index 6167eb6e412..6f5d19733b2 100644
--- a/java/test/Ice/facets/Collocated.java
+++ b/java/test/Ice/facets/Collocated.java
@@ -17,9 +17,9 @@ public class Collocated
Ice.Object d = new DI();
adapter.add(d, communicator.stringToIdentity("d"));
adapter.addFacet(d, communicator.stringToIdentity("d"), "facetABCD");
- Ice.Object f = new FI();
+ Ice.Object f = new FI();
adapter.addFacet(f, communicator.stringToIdentity("d"), "facetEF");
- Ice.Object h = new HI(communicator);
+ Ice.Object h = new HI(communicator);
adapter.addFacet(h, communicator.stringToIdentity("d"), "facetGH");
AllTests.allTests(communicator);
diff --git a/java/test/Ice/facets/Server.java b/java/test/Ice/facets/Server.java
index 417b196ef02..059eafcff94 100644
--- a/java/test/Ice/facets/Server.java
+++ b/java/test/Ice/facets/Server.java
@@ -17,9 +17,9 @@ public class Server
Ice.Object d = new DI();
adapter.add(d, communicator.stringToIdentity("d"));
adapter.addFacet(d, communicator.stringToIdentity("d"), "facetABCD");
- Ice.Object f = new FI();
+ Ice.Object f = new FI();
adapter.addFacet(f, communicator.stringToIdentity("d"), "facetEF");
- Ice.Object h = new HI(communicator);
+ Ice.Object h = new HI(communicator);
adapter.addFacet(h, communicator.stringToIdentity("d"), "facetGH");
adapter.activate();
@@ -58,7 +58,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/faultTolerance/AllTests.java b/java/test/Ice/faultTolerance/AllTests.java
index 4f3eb09b2ea..937fb4aa99e 100644
--- a/java/test/Ice/faultTolerance/AllTests.java
+++ b/java/test/Ice/faultTolerance/AllTests.java
@@ -22,186 +22,186 @@ public class AllTests
private static class Callback
{
- Callback()
- {
- _called = false;
- }
+ Callback()
+ {
+ _called = false;
+ }
- public synchronized boolean
- check()
- {
- while(!_called)
- {
- try
- {
- wait(30000);
- }
- catch(InterruptedException ex)
- {
- continue;
- }
+ public synchronized boolean
+ check()
+ {
+ while(!_called)
+ {
+ try
+ {
+ wait(30000);
+ }
+ catch(InterruptedException ex)
+ {
+ continue;
+ }
- if(!_called)
- {
- return false; // Must be timeout.
- }
- }
-
- _called = false;
- return true;
- }
-
- public synchronized void
- called()
- {
- assert(!_called);
- _called = true;
- notify();
- }
+ if(!_called)
+ {
+ return false; // Must be timeout.
+ }
+ }
+
+ _called = false;
+ return true;
+ }
+
+ public synchronized void
+ called()
+ {
+ assert(!_called);
+ _called = true;
+ notify();
+ }
- private boolean _called;
+ private boolean _called;
}
private static class AMI_Test_pidI extends AMI_TestIntf_pid
{
- public void
- ice_response(int pid)
- {
- _pid = pid;
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException ex)
- {
- test(false);
- }
-
- public int
- pid()
- {
- return _pid;
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
+ public void
+ ice_response(int pid)
+ {
+ _pid = pid;
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException ex)
+ {
+ test(false);
+ }
+
+ public int
+ pid()
+ {
+ return _pid;
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
- private int _pid;
-
- private Callback callback = new Callback();
+ private int _pid;
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_shutdownI extends AMI_TestIntf_shutdown
{
- public void
- ice_response()
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
+ public void
+ ice_response()
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
- private Callback callback = new Callback();
+ private Callback callback = new Callback();
}
private static class AMI_Test_abortI extends AMI_TestIntf_abort
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- try
- {
- throw ex;
- }
- catch(Ice.ConnectionLostException exc)
- {
- }
- catch(Ice.ConnectFailedException exc)
- {
- }
- catch(Ice.SocketException exc)
- {
- }
- catch(Exception exc)
- {
- test(false);
- }
- callback.called();
- }
-
- public void
- ice_exception(Ice.UserException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ try
+ {
+ throw ex;
+ }
+ catch(Ice.ConnectionLostException exc)
+ {
+ }
+ catch(Ice.ConnectFailedException exc)
+ {
+ }
+ catch(Ice.SocketException exc)
+ {
+ }
+ catch(Exception exc)
+ {
+ test(false);
+ }
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.UserException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
- private Callback callback = new Callback();
+ private Callback callback = new Callback();
}
private static class AMI_Test_idempotentAbortI extends AMI_TestIntf_idempotentAbort
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- delegate.ice_exception(ex);
- }
-
- public void
- ice_exception(Ice.UserException ex)
- {
- delegate.ice_exception(ex);
- }
-
- public boolean
- check()
- {
- return delegate.check();
- }
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ delegate.ice_exception(ex);
+ }
+
+ public void
+ ice_exception(Ice.UserException ex)
+ {
+ delegate.ice_exception(ex);
+ }
+
+ public boolean
+ check()
+ {
+ return delegate.check();
+ }
- private AMI_Test_abortI delegate = new AMI_Test_abortI();
+ private AMI_Test_abortI delegate = new AMI_Test_abortI();
}
public static void
@@ -226,123 +226,123 @@ public class AllTests
System.out.println("ok");
int oldPid = 0;
- boolean ami = false;
+ boolean ami = false;
for(int i = 1, j = 0; i <= ports.length; ++i, ++j)
{
- if(j > 3)
- {
- j = 0;
- ami = !ami;
- }
+ if(j > 3)
+ {
+ j = 0;
+ ami = !ami;
+ }
- if(!ami)
- {
- System.out.print("testing server #" + i + "... ");
- System.out.flush();
- int pid = obj.pid();
- test(pid != oldPid);
- System.out.println("ok");
- oldPid = pid;
- }
- else
- {
- System.out.print("testing server #" + i + " with AMI... ");
- System.out.flush();
- AMI_Test_pidI cb = new AMI_Test_pidI();
- obj.pid_async(cb);
- test(cb.check());
- int pid = cb.pid();
- test(pid != oldPid);
- System.out.println("ok");
- oldPid = pid;
- }
+ if(!ami)
+ {
+ System.out.print("testing server #" + i + "... ");
+ System.out.flush();
+ int pid = obj.pid();
+ test(pid != oldPid);
+ System.out.println("ok");
+ oldPid = pid;
+ }
+ else
+ {
+ System.out.print("testing server #" + i + " with AMI... ");
+ System.out.flush();
+ AMI_Test_pidI cb = new AMI_Test_pidI();
+ obj.pid_async(cb);
+ test(cb.check());
+ int pid = cb.pid();
+ test(pid != oldPid);
+ System.out.println("ok");
+ oldPid = pid;
+ }
if(j == 0)
{
- if(!ami)
- {
- System.out.print("shutting down server #" + i + "... ");
- System.out.flush();
- obj.shutdown();
- System.out.println("ok");
- }
- else
- {
- System.out.print("shutting down server #" + i + " with AMI... ");
- System.out.flush();
- AMI_Test_shutdownI cb = new AMI_Test_shutdownI();
- obj.shutdown_async(cb);
- test(cb.check());
- System.out.println("ok");
- }
+ if(!ami)
+ {
+ System.out.print("shutting down server #" + i + "... ");
+ System.out.flush();
+ obj.shutdown();
+ System.out.println("ok");
+ }
+ else
+ {
+ System.out.print("shutting down server #" + i + " with AMI... ");
+ System.out.flush();
+ AMI_Test_shutdownI cb = new AMI_Test_shutdownI();
+ obj.shutdown_async(cb);
+ test(cb.check());
+ System.out.println("ok");
+ }
}
else if(j == 1 || i + 1 > ports.length)
{
- if(!ami)
- {
- System.out.print("aborting server #" + i + "... ");
- System.out.flush();
- try
- {
- obj.abort();
- test(false);
- }
- catch(Ice.ConnectionLostException ex)
- {
- System.out.println("ok");
- }
- catch(Ice.ConnectFailedException exc)
- {
- System.out.println("ok");
- }
- catch(Ice.SocketException ex)
- {
- System.out.println("ok");
- }
- }
- else
- {
- System.out.print("aborting server #" + i + " with AMI... ");
- System.out.flush();
- AMI_Test_abortI cb = new AMI_Test_abortI();
- obj.abort_async(cb);
- test(cb.check());
- System.out.println("ok");
- }
+ if(!ami)
+ {
+ System.out.print("aborting server #" + i + "... ");
+ System.out.flush();
+ try
+ {
+ obj.abort();
+ test(false);
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ System.out.println("ok");
+ }
+ catch(Ice.ConnectFailedException exc)
+ {
+ System.out.println("ok");
+ }
+ catch(Ice.SocketException ex)
+ {
+ System.out.println("ok");
+ }
+ }
+ else
+ {
+ System.out.print("aborting server #" + i + " with AMI... ");
+ System.out.flush();
+ AMI_Test_abortI cb = new AMI_Test_abortI();
+ obj.abort_async(cb);
+ test(cb.check());
+ System.out.println("ok");
+ }
}
else if(j == 2 || j == 3)
{
- if(!ami)
- {
- System.out.print("aborting server #" + i + " and #" + (i + 1) + " with idempotent call... ");
- System.out.flush();
- try
- {
- obj.idempotentAbort();
- test(false);
- }
- catch(Ice.ConnectionLostException ex)
- {
- System.out.println("ok");
- }
- catch(Ice.ConnectFailedException exc)
- {
- System.out.println("ok");
- }
- catch(Ice.SocketException ex)
- {
- System.out.println("ok");
- }
- }
- else
- {
- System.out.print("aborting server #" + i + " and #" + (i + 1) + " with idempotent AMI call... ");
- System.out.flush();
- AMI_Test_idempotentAbortI cb = new AMI_Test_idempotentAbortI();
- obj.idempotentAbort_async(cb);
- test(cb.check());
- System.out.println("ok");
- }
+ if(!ami)
+ {
+ System.out.print("aborting server #" + i + " and #" + (i + 1) + " with idempotent call... ");
+ System.out.flush();
+ try
+ {
+ obj.idempotentAbort();
+ test(false);
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ System.out.println("ok");
+ }
+ catch(Ice.ConnectFailedException exc)
+ {
+ System.out.println("ok");
+ }
+ catch(Ice.SocketException ex)
+ {
+ System.out.println("ok");
+ }
+ }
+ else
+ {
+ System.out.print("aborting server #" + i + " and #" + (i + 1) + " with idempotent AMI call... ");
+ System.out.flush();
+ AMI_Test_idempotentAbortI cb = new AMI_Test_idempotentAbortI();
+ obj.idempotentAbort_async(cb);
+ test(cb.check());
+ System.out.println("ok");
+ }
++i;
}
diff --git a/java/test/Ice/faultTolerance/Client.java b/java/test/Ice/faultTolerance/Client.java
index 2274a560e74..f56f3b83c40 100644
--- a/java/test/Ice/faultTolerance/Client.java
+++ b/java/test/Ice/faultTolerance/Client.java
@@ -59,15 +59,15 @@ public class Client
arr[i] = ((Integer)ports.get(i)).intValue();
}
- try
- {
- AllTests.allTests(communicator, arr);
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- AllTests.test(false);
- }
+ try
+ {
+ AllTests.allTests(communicator, arr);
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ AllTests.test(false);
+ }
return 0;
}
@@ -80,16 +80,16 @@ public class Client
try
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
- //
- // This test aborts servers, so we don't want warnings.
- //
- initData. properties.setProperty("Ice.Warn.Connections", "0");
+ //
+ // This test aborts servers, so we don't want warnings.
+ //
+ initData. properties.setProperty("Ice.Warn.Connections", "0");
- communicator = Ice.Util.initialize(argsH, initData);
+ communicator = Ice.Util.initialize(argsH, initData);
status = run(argsH.value, communicator);
}
catch(Ice.LocalException ex)
@@ -111,7 +111,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/faultTolerance/Server.java b/java/test/Ice/faultTolerance/Server.java
index 0d56bfef120..f8a8841d8ec 100644
--- a/java/test/Ice/faultTolerance/Server.java
+++ b/java/test/Ice/faultTolerance/Server.java
@@ -71,16 +71,16 @@ public class Server
try
{
- //
- // In this test, we need a longer server idle time,
- // otherwise our test servers may time out before they are
- // used in the test.
- //
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
+ //
+ // In this test, we need a longer server idle time,
+ // otherwise our test servers may time out before they are
+ // used in the test.
+ //
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.ServerIdleTime", "120"); // Two minutes.
+ initData.properties.setProperty("Ice.ServerIdleTime", "120"); // Two minutes.
communicator = Ice.Util.initialize(argsH, initData);
status = run(argsH.value, communicator);
diff --git a/java/test/Ice/faultTolerance/TestI.java b/java/test/Ice/faultTolerance/TestI.java
index d740d39b509..cc5dc9d20b4 100644
--- a/java/test/Ice/faultTolerance/TestI.java
+++ b/java/test/Ice/faultTolerance/TestI.java
@@ -15,7 +15,7 @@ public final class TestI extends _TestIntfDisp
TestI(Ice.ObjectAdapter adapter, int port)
{
_adapter = adapter;
- _pseudoPid = port; // We use the port number instead of the process ID in Java.
+ _pseudoPid = port; // We use the port number instead of the process ID in Java.
}
public void
@@ -27,13 +27,13 @@ public final class TestI extends _TestIntfDisp
public void
abort(Ice.Current current)
{
- Runtime.getRuntime().halt(0);
+ Runtime.getRuntime().halt(0);
}
public void
idempotentAbort(Ice.Current current)
{
- Runtime.getRuntime().halt(0);
+ Runtime.getRuntime().halt(0);
}
public int
diff --git a/java/test/Ice/hold/AllTests.java b/java/test/Ice/hold/AllTests.java
index 7c3220296e7..38917d23efc 100644
--- a/java/test/Ice/hold/AllTests.java
+++ b/java/test/Ice/hold/AllTests.java
@@ -23,32 +23,32 @@ public class AllTests
public static void
allTests(Ice.Communicator communicator)
{
- System.out.print("testing stringToProxy... ");
- System.out.flush();
- String ref = "hold:default -p 12010 -t 10000";
- Ice.ObjectPrx base = communicator.stringToProxy(ref);
- test(base != null);
- System.out.println("ok");
-
- System.out.print("testing checked cast... ");
- System.out.flush();
- HoldPrx hold = HoldPrxHelper.checkedCast(base);
- test(hold != null);
- test(hold.equals(base));
- System.out.println("ok");
-
- System.out.print("changing state between active and hold rapidly... ");
- System.out.flush();
- for(int i = 0; i < 100; ++i)
- {
- hold.putOnHold(0);
- }
- System.out.println("ok");
-
- System.out.print("changing state to hold and shutting down server... ");
- System.out.flush();
- hold.shutdown();
- System.out.println("ok");
+ System.out.print("testing stringToProxy... ");
+ System.out.flush();
+ String ref = "hold:default -p 12010 -t 10000";
+ Ice.ObjectPrx base = communicator.stringToProxy(ref);
+ test(base != null);
+ System.out.println("ok");
+
+ System.out.print("testing checked cast... ");
+ System.out.flush();
+ HoldPrx hold = HoldPrxHelper.checkedCast(base);
+ test(hold != null);
+ test(hold.equals(base));
+ System.out.println("ok");
+
+ System.out.print("changing state between active and hold rapidly... ");
+ System.out.flush();
+ for(int i = 0; i < 100; ++i)
+ {
+ hold.putOnHold(0);
+ }
+ System.out.println("ok");
+
+ System.out.print("changing state to hold and shutting down server... ");
+ System.out.flush();
+ hold.shutdown();
+ System.out.println("ok");
}
}
- \ No newline at end of file
+ \ No newline at end of file
diff --git a/java/test/Ice/hold/Client.java b/java/test/Ice/hold/Client.java
index 05351c33027..a74fab2127a 100644
--- a/java/test/Ice/hold/Client.java
+++ b/java/test/Ice/hold/Client.java
@@ -46,7 +46,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/hold/HoldI.java b/java/test/Ice/hold/HoldI.java
index a4cacba084e..bcdb0b70f86 100644
--- a/java/test/Ice/hold/HoldI.java
+++ b/java/test/Ice/hold/HoldI.java
@@ -14,21 +14,21 @@ public final class HoldI extends _HoldDisp
public void
putOnHold(int seconds, Ice.Current current)
{
- if(seconds <= 0)
- {
- current.adapter.hold();
- current.adapter.activate();
- }
- else
- {
- assert(false); // TODO
- }
+ if(seconds <= 0)
+ {
+ current.adapter.hold();
+ current.adapter.activate();
+ }
+ else
+ {
+ assert(false); // TODO
+ }
}
public void
shutdown(Ice.Current current)
{
- current.adapter.hold();
- current.adapter.getCommunicator().shutdown();
+ current.adapter.hold();
+ current.adapter.getCommunicator().shutdown();
}
}
diff --git a/java/test/Ice/hold/Server.java b/java/test/Ice/hold/Server.java
index ffca24d34d8..cde9df23169 100644
--- a/java/test/Ice/hold/Server.java
+++ b/java/test/Ice/hold/Server.java
@@ -50,7 +50,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/inheritance/Client.java b/java/test/Ice/inheritance/Client.java
index 6ce04625d84..92492c38d98 100644
--- a/java/test/Ice/inheritance/Client.java
+++ b/java/test/Ice/inheritance/Client.java
@@ -49,7 +49,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/inheritance/Server.java b/java/test/Ice/inheritance/Server.java
index c6929930217..417a854c79f 100644
--- a/java/test/Ice/inheritance/Server.java
+++ b/java/test/Ice/inheritance/Server.java
@@ -51,7 +51,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/location/AllTests.java b/java/test/Ice/location/AllTests.java
index a73a8a6a2e2..9918e8e11cd 100644
--- a/java/test/Ice/location/AllTests.java
+++ b/java/test/Ice/location/AllTests.java
@@ -23,335 +23,335 @@ public class AllTests
public static void
allTests(Ice.Communicator communicator)
{
- ServerManagerPrx manager = ServerManagerPrxHelper.checkedCast(
- communicator.stringToProxy("ServerManager :default -t 10000 -p 12010"));
- test(manager != null);
- TestLocatorPrx locator = TestLocatorPrxHelper.uncheckedCast(communicator.getDefaultLocator());
- test(locator != null);
+ ServerManagerPrx manager = ServerManagerPrxHelper.checkedCast(
+ communicator.stringToProxy("ServerManager :default -t 10000 -p 12010"));
+ test(manager != null);
+ TestLocatorPrx locator = TestLocatorPrxHelper.uncheckedCast(communicator.getDefaultLocator());
+ test(locator != null);
- System.out.print("testing stringToProxy... ");
+ System.out.print("testing stringToProxy... ");
System.out.flush();
- Ice.ObjectPrx base = communicator.stringToProxy("test @ TestAdapter");
- Ice.ObjectPrx base2 = communicator.stringToProxy("test @ TestAdapter");
- Ice.ObjectPrx base3 = communicator.stringToProxy("test");
- Ice.ObjectPrx base4 = communicator.stringToProxy("ServerManager");
- Ice.ObjectPrx base5 = communicator.stringToProxy("test2");
- Ice.ObjectPrx base6 = communicator.stringToProxy("test @ ReplicatedAdapter");
- System.out.println("ok");
+ Ice.ObjectPrx base = communicator.stringToProxy("test @ TestAdapter");
+ Ice.ObjectPrx base2 = communicator.stringToProxy("test @ TestAdapter");
+ Ice.ObjectPrx base3 = communicator.stringToProxy("test");
+ Ice.ObjectPrx base4 = communicator.stringToProxy("ServerManager");
+ Ice.ObjectPrx base5 = communicator.stringToProxy("test2");
+ Ice.ObjectPrx base6 = communicator.stringToProxy("test @ ReplicatedAdapter");
+ System.out.println("ok");
- System.out.print("testing ice_locator and ice_getLocator... ");
- test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), communicator.getDefaultLocator()) == 0);
- Ice.LocatorPrx anotherLocator =
- Ice.LocatorPrxHelper.uncheckedCast(communicator.stringToProxy("anotherLocator"));
- base = base.ice_locator(anotherLocator);
- test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), anotherLocator) == 0);
- communicator.setDefaultLocator(null);
- base = communicator.stringToProxy("test @ TestAdapter");
- test(base.ice_getLocator() == null);
- base = base.ice_locator(anotherLocator);
- test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), anotherLocator) == 0);
- communicator.setDefaultLocator(locator);
- base = communicator.stringToProxy("test @ TestAdapter");
- test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), communicator.getDefaultLocator()) == 0);
-
- //
- // We also test ice_router/ice_getRouter (perhaps we should add a
- // test/Ice/router test?)
- //
- test(base.ice_getRouter() == null);
- Ice.RouterPrx anotherRouter = Ice.RouterPrxHelper.uncheckedCast(communicator.stringToProxy("anotherRouter"));
- base = base.ice_router(anotherRouter);
- test(Ice.Util.proxyIdentityCompare(base.ice_getRouter(), anotherRouter) == 0);
- Ice.RouterPrx router = Ice.RouterPrxHelper.uncheckedCast(communicator.stringToProxy("dummyrouter"));
- communicator.setDefaultRouter(router);
- base = communicator.stringToProxy("test @ TestAdapter");
- test(Ice.Util.proxyIdentityCompare(base.ice_getRouter(), communicator.getDefaultRouter()) == 0);
- communicator.setDefaultRouter(null);
- base = communicator.stringToProxy("test @ TestAdapter");
- test(base.ice_getRouter() == null);
- System.out.println("ok");
+ System.out.print("testing ice_locator and ice_getLocator... ");
+ test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), communicator.getDefaultLocator()) == 0);
+ Ice.LocatorPrx anotherLocator =
+ Ice.LocatorPrxHelper.uncheckedCast(communicator.stringToProxy("anotherLocator"));
+ base = base.ice_locator(anotherLocator);
+ test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), anotherLocator) == 0);
+ communicator.setDefaultLocator(null);
+ base = communicator.stringToProxy("test @ TestAdapter");
+ test(base.ice_getLocator() == null);
+ base = base.ice_locator(anotherLocator);
+ test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), anotherLocator) == 0);
+ communicator.setDefaultLocator(locator);
+ base = communicator.stringToProxy("test @ TestAdapter");
+ test(Ice.Util.proxyIdentityCompare(base.ice_getLocator(), communicator.getDefaultLocator()) == 0);
+
+ //
+ // We also test ice_router/ice_getRouter (perhaps we should add a
+ // test/Ice/router test?)
+ //
+ test(base.ice_getRouter() == null);
+ Ice.RouterPrx anotherRouter = Ice.RouterPrxHelper.uncheckedCast(communicator.stringToProxy("anotherRouter"));
+ base = base.ice_router(anotherRouter);
+ test(Ice.Util.proxyIdentityCompare(base.ice_getRouter(), anotherRouter) == 0);
+ Ice.RouterPrx router = Ice.RouterPrxHelper.uncheckedCast(communicator.stringToProxy("dummyrouter"));
+ communicator.setDefaultRouter(router);
+ base = communicator.stringToProxy("test @ TestAdapter");
+ test(Ice.Util.proxyIdentityCompare(base.ice_getRouter(), communicator.getDefaultRouter()) == 0);
+ communicator.setDefaultRouter(null);
+ base = communicator.stringToProxy("test @ TestAdapter");
+ test(base.ice_getRouter() == null);
+ System.out.println("ok");
- //
- // Start a server, get the port of the adapter it's listening on,
- // and add it to the configuration so that the client can locate
- // the TestAdapter adapter.
- //
- System.out.print("starting server... ");
+ //
+ // Start a server, get the port of the adapter it's listening on,
+ // and add it to the configuration so that the client can locate
+ // the TestAdapter adapter.
+ //
+ System.out.print("starting server... ");
System.out.flush();
- manager.startServer();
- System.out.println("ok");
+ manager.startServer();
+ System.out.println("ok");
- System.out.print("testing checked cast... ");
+ System.out.print("testing checked cast... ");
System.out.flush();
- TestIntfPrx obj = TestIntfPrxHelper.checkedCast(base);
- test(obj != null);
- TestIntfPrx obj2 = TestIntfPrxHelper.checkedCast(base2);
- test(obj2 != null);
- TestIntfPrx obj3 = TestIntfPrxHelper.checkedCast(base3);
- test(obj3 != null);
- ServerManagerPrx obj4 = ServerManagerPrxHelper.checkedCast(base4);
- test(obj4 != null);
- TestIntfPrx obj5 = TestIntfPrxHelper.checkedCast(base5);
- test(obj5 != null);
- TestIntfPrx obj6 = TestIntfPrxHelper.checkedCast(base6);
- test(obj6 != null);
- System.out.println("ok");
+ TestIntfPrx obj = TestIntfPrxHelper.checkedCast(base);
+ test(obj != null);
+ TestIntfPrx obj2 = TestIntfPrxHelper.checkedCast(base2);
+ test(obj2 != null);
+ TestIntfPrx obj3 = TestIntfPrxHelper.checkedCast(base3);
+ test(obj3 != null);
+ ServerManagerPrx obj4 = ServerManagerPrxHelper.checkedCast(base4);
+ test(obj4 != null);
+ TestIntfPrx obj5 = TestIntfPrxHelper.checkedCast(base5);
+ test(obj5 != null);
+ TestIntfPrx obj6 = TestIntfPrxHelper.checkedCast(base6);
+ test(obj6 != null);
+ System.out.println("ok");
- System.out.print("testing id@AdapterId indirect proxy... ");
+ System.out.print("testing id@AdapterId indirect proxy... ");
System.out.flush();
- obj.shutdown();
- manager.startServer();
- try
- {
- obj2.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- System.out.println("ok");
+ obj.shutdown();
+ manager.startServer();
+ try
+ {
+ obj2.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ System.out.println("ok");
- System.out.print("testing id@ReplicaGroupId indirect proxy... ");
+ System.out.print("testing id@ReplicaGroupId indirect proxy... ");
System.out.flush();
- obj.shutdown();
- manager.startServer();
- try
- {
- obj6 = TestIntfPrxHelper.checkedCast(base6);
- obj6.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- System.out.println("ok");
+ obj.shutdown();
+ manager.startServer();
+ try
+ {
+ obj6 = TestIntfPrxHelper.checkedCast(base6);
+ obj6.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ System.out.println("ok");
- System.out.print("testing identity indirect proxy... ");
+ System.out.print("testing identity indirect proxy... ");
System.out.flush();
- obj.shutdown();
- manager.startServer();
- try
- {
- obj3 = TestIntfPrxHelper.checkedCast(base3);
- obj3.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- try
- {
- obj2 = TestIntfPrxHelper.checkedCast(base2);
- obj2.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- obj.shutdown();
- manager.startServer();
- try
- {
- obj2 = TestIntfPrxHelper.checkedCast(base2);
- obj2.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- try
- {
- obj3 = TestIntfPrxHelper.checkedCast(base3);
- obj3.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- obj.shutdown();
- manager.startServer();
- try
- {
- obj2 = TestIntfPrxHelper.checkedCast(base2);
- obj2.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- obj.shutdown();
- manager.startServer();
- try
- {
- obj3 = TestIntfPrxHelper.checkedCast(base2);
- obj3.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- obj.shutdown();
- manager.startServer();
- try
- {
- obj5 = TestIntfPrxHelper.checkedCast(base5);
- obj5.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
+ obj.shutdown();
+ manager.startServer();
+ try
+ {
+ obj3 = TestIntfPrxHelper.checkedCast(base3);
+ obj3.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ try
+ {
+ obj2 = TestIntfPrxHelper.checkedCast(base2);
+ obj2.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ obj.shutdown();
+ manager.startServer();
+ try
+ {
+ obj2 = TestIntfPrxHelper.checkedCast(base2);
+ obj2.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ try
+ {
+ obj3 = TestIntfPrxHelper.checkedCast(base3);
+ obj3.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ obj.shutdown();
+ manager.startServer();
+ try
+ {
+ obj2 = TestIntfPrxHelper.checkedCast(base2);
+ obj2.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ obj.shutdown();
+ manager.startServer();
+ try
+ {
+ obj3 = TestIntfPrxHelper.checkedCast(base2);
+ obj3.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ obj.shutdown();
+ manager.startServer();
+ try
+ {
+ obj5 = TestIntfPrxHelper.checkedCast(base5);
+ obj5.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
- System.out.println("ok");
+ System.out.println("ok");
- System.out.print("testing proxy with unknown identity... ");
- System.out.flush();
- try
- {
- base = communicator.stringToProxy("unknown/unknown");
- base.ice_ping();
- test(false);
- }
- catch(Ice.NotRegisteredException ex)
- {
- test(ex.kindOfObject.equals("object"));
- test(ex.id.equals("unknown/unknown"));
- }
- System.out.println("ok");
+ System.out.print("testing proxy with unknown identity... ");
+ System.out.flush();
+ try
+ {
+ base = communicator.stringToProxy("unknown/unknown");
+ base.ice_ping();
+ test(false);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ test(ex.kindOfObject.equals("object"));
+ test(ex.id.equals("unknown/unknown"));
+ }
+ System.out.println("ok");
- System.out.print("testing proxy with unknown adapter... ");
- System.out.flush();
- try
- {
- base = communicator.stringToProxy("test @ TestAdapterUnknown");
- base.ice_ping();
- test(false);
- }
- catch(Ice.NotRegisteredException ex)
- {
- test(ex.kindOfObject.equals("object adapter"));
- test(ex.id.equals("TestAdapterUnknown"));
- }
- System.out.println("ok");
+ System.out.print("testing proxy with unknown adapter... ");
+ System.out.flush();
+ try
+ {
+ base = communicator.stringToProxy("test @ TestAdapterUnknown");
+ base.ice_ping();
+ test(false);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ test(ex.kindOfObject.equals("object adapter"));
+ test(ex.id.equals("TestAdapterUnknown"));
+ }
+ System.out.println("ok");
- System.out.print("testing locator cache timeout... ");
- System.out.flush();
-
- int count = locator.getRequestCount();
- communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache.
- test(++count == locator.getRequestCount());
- communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache.
- test(++count == locator.getRequestCount());
- communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout.
- test(count == locator.getRequestCount());
- try
- {
- Thread.sleep(1200);
+ System.out.print("testing locator cache timeout... ");
+ System.out.flush();
+
+ int count = locator.getRequestCount();
+ communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache.
+ test(++count == locator.getRequestCount());
+ communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache.
+ test(++count == locator.getRequestCount());
+ communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout.
+ test(count == locator.getRequestCount());
+ try
+ {
+ Thread.sleep(1200);
}
catch(InterruptedException ex)
{
}
- communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout.
- test(++count == locator.getRequestCount());
-
- communicator.stringToProxy("test").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache.
- count += 2;
- test(count == locator.getRequestCount());
- communicator.stringToProxy("test").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout
- test(count == locator.getRequestCount());
- try
- {
- Thread.sleep(1200);
+ communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout.
+ test(++count == locator.getRequestCount());
+
+ communicator.stringToProxy("test").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache.
+ count += 2;
+ test(count == locator.getRequestCount());
+ communicator.stringToProxy("test").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout
+ test(count == locator.getRequestCount());
+ try
+ {
+ Thread.sleep(1200);
}
catch(InterruptedException ex)
{
}
- communicator.stringToProxy("test").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout
- count += 2;
- test(count == locator.getRequestCount());
-
- communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(-1).ice_ping();
- test(count == locator.getRequestCount());
- communicator.stringToProxy("test").ice_locatorCacheTimeout(-1).ice_ping();
- test(count == locator.getRequestCount());
- communicator.stringToProxy("test@TestAdapter").ice_ping();
- test(count == locator.getRequestCount());
- communicator.stringToProxy("test").ice_ping();
- test(count == locator.getRequestCount());
+ communicator.stringToProxy("test").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout
+ count += 2;
+ test(count == locator.getRequestCount());
+
+ communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(-1).ice_ping();
+ test(count == locator.getRequestCount());
+ communicator.stringToProxy("test").ice_locatorCacheTimeout(-1).ice_ping();
+ test(count == locator.getRequestCount());
+ communicator.stringToProxy("test@TestAdapter").ice_ping();
+ test(count == locator.getRequestCount());
+ communicator.stringToProxy("test").ice_ping();
+ test(count == locator.getRequestCount());
- test(communicator.stringToProxy("test").ice_locatorCacheTimeout(99).ice_getLocatorCacheTimeout() == 99);
-
- System.out.println("ok");
+ test(communicator.stringToProxy("test").ice_locatorCacheTimeout(99).ice_getLocatorCacheTimeout() == 99);
+
+ System.out.println("ok");
- System.out.print("testing proxy from server... ");
+ System.out.print("testing proxy from server... ");
System.out.flush();
- HelloPrx hello = obj.getHello();
- test(hello.ice_getAdapterId().equals("TestAdapter"));
- hello = obj.getReplicatedHello();
- test(hello.ice_getAdapterId().equals("ReplicatedAdapter"));
- hello.sayHello();
- System.out.println("ok");
+ HelloPrx hello = obj.getHello();
+ test(hello.ice_getAdapterId().equals("TestAdapter"));
+ hello = obj.getReplicatedHello();
+ test(hello.ice_getAdapterId().equals("ReplicatedAdapter"));
+ hello.sayHello();
+ System.out.println("ok");
- System.out.print("testing proxy from server after shutdown... ");
+ System.out.print("testing proxy from server after shutdown... ");
System.out.flush();
- obj.shutdown();
- manager.startServer();
- hello.sayHello();
- System.out.println("ok");
+ obj.shutdown();
+ manager.startServer();
+ hello.sayHello();
+ System.out.println("ok");
- System.out.print("testing object migration...");
- System.out.flush();
- hello = HelloPrxHelper.checkedCast(communicator.stringToProxy("hello"));
- obj.migrateHello();
- hello.sayHello();
- obj.migrateHello();
- hello.sayHello();
- obj.migrateHello();
- hello.sayHello();
- System.out.println("ok");
+ System.out.print("testing object migration...");
+ System.out.flush();
+ hello = HelloPrxHelper.checkedCast(communicator.stringToProxy("hello"));
+ obj.migrateHello();
+ hello.sayHello();
+ obj.migrateHello();
+ hello.sayHello();
+ obj.migrateHello();
+ hello.sayHello();
+ System.out.println("ok");
- System.out.print("testing whether server is gone... ");
+ System.out.print("testing whether server is gone... ");
System.out.flush();
- obj.shutdown();
- try
- {
- obj2.ice_ping();
- test(false);
- }
+ obj.shutdown();
+ try
+ {
+ obj2.ice_ping();
+ test(false);
+ }
catch(Ice.LocalException ex)
{
System.out.println("ok");
}
- System.out.print("testing indirect proxies to collocated objects... ");
- Ice.Properties properties = communicator.getProperties();
- properties.setProperty("Ice.PrintAdapterReady", "0");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("Hello", "default");
- adapter.setLocator(locator);
- TestLocatorRegistryPrx registry = TestLocatorRegistryPrxHelper.checkedCast(locator.getRegistry());
- test(registry != null);
+ System.out.print("testing indirect proxies to collocated objects... ");
+ Ice.Properties properties = communicator.getProperties();
+ properties.setProperty("Ice.PrintAdapterReady", "0");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("Hello", "default");
+ adapter.setLocator(locator);
+ TestLocatorRegistryPrx registry = TestLocatorRegistryPrxHelper.checkedCast(locator.getRegistry());
+ test(registry != null);
- Ice.Identity id = new Ice.Identity();
- id.name = Ice.Util.generateUUID();
- registry.addObject(adapter.add(new HelloI(), id));
- adapter.activate();
+ Ice.Identity id = new Ice.Identity();
+ id.name = Ice.Util.generateUUID();
+ registry.addObject(adapter.add(new HelloI(), id));
+ adapter.activate();
- try
- {
- HelloPrx helloPrx = HelloPrxHelper.checkedCast(
- communicator.stringToProxy("\"" + communicator.identityToString(id) + "\""));
- Ice.Connection connection = helloPrx.ice_getConnection();
- test(false);
- }
- catch(Ice.CollocationOptimizationException ex)
- {
- System.out.println("ok");
- }
- adapter.deactivate();
+ try
+ {
+ HelloPrx helloPrx = HelloPrxHelper.checkedCast(
+ communicator.stringToProxy("\"" + communicator.identityToString(id) + "\""));
+ Ice.Connection connection = helloPrx.ice_getConnection();
+ test(false);
+ }
+ catch(Ice.CollocationOptimizationException ex)
+ {
+ System.out.println("ok");
+ }
+ adapter.deactivate();
- System.out.print("shutdown server manager... ");
+ System.out.print("shutdown server manager... ");
System.out.flush();
- manager.shutdown();
- System.out.println("ok");
+ manager.shutdown();
+ System.out.println("ok");
}
}
diff --git a/java/test/Ice/location/Client.java b/java/test/Ice/location/Client.java
index 423d20c9c10..956ba1c726f 100644
--- a/java/test/Ice/location/Client.java
+++ b/java/test/Ice/location/Client.java
@@ -12,7 +12,7 @@ public class Client
private static int
run(String[] args, Ice.Communicator communicator)
{
- AllTests.allTests(communicator);
+ AllTests.allTests(communicator);
return 0;
}
@@ -24,9 +24,9 @@ public class Client
try
{
- Ice.InitializationData initData = new Ice.InitializationData();
+ Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(args);
- initData.properties.setProperty("Ice.Default.Locator", "locator:default -p 12010");
+ initData.properties.setProperty("Ice.Default.Locator", "locator:default -p 12010");
communicator = Ice.Util.initialize(args, initData);
status = run(args, communicator);
}
@@ -49,7 +49,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/location/Server.java b/java/test/Ice/location/Server.java
index d7ae98ced7b..394d838c9aa 100644
--- a/java/test/Ice/location/Server.java
+++ b/java/test/Ice/location/Server.java
@@ -12,37 +12,37 @@ public class Server
private static int
run(String[] args, Ice.Communicator communicator, Ice.InitializationData initData)
{
- //
- // Register the server manager. The server manager creates a new
- // 'server' (a server isn't a different process, it's just a new
- // communicator and object adapter).
- //
- Ice.Properties properties = communicator.getProperties();
- properties.setProperty("Ice.ThreadPool.Server.Size", "2");
- properties.setProperty("Ice.OA.ServerManagerAdapter.Endpoints", "default -p 12010 -t 30000:udp");
+ //
+ // Register the server manager. The server manager creates a new
+ // 'server' (a server isn't a different process, it's just a new
+ // communicator and object adapter).
+ //
+ Ice.Properties properties = communicator.getProperties();
+ properties.setProperty("Ice.ThreadPool.Server.Size", "2");
+ properties.setProperty("Ice.OA.ServerManagerAdapter.Endpoints", "default -p 12010 -t 30000:udp");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ServerManagerAdapter");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ServerManagerAdapter");
- //
- // We also register a sample server locator which implements the
- // locator interface, this locator is used by the clients and the
- // 'servers' created with the server manager interface.
- //
- ServerLocatorRegistry registry = new ServerLocatorRegistry();
- registry.addObject(adapter.createProxy(communicator.stringToIdentity("ServerManager")));
- Ice.Object object = new ServerManagerI(adapter, registry, initData);
- adapter.add(object, communicator.stringToIdentity("ServerManager"));
+ //
+ // We also register a sample server locator which implements the
+ // locator interface, this locator is used by the clients and the
+ // 'servers' created with the server manager interface.
+ //
+ ServerLocatorRegistry registry = new ServerLocatorRegistry();
+ registry.addObject(adapter.createProxy(communicator.stringToIdentity("ServerManager")));
+ Ice.Object object = new ServerManagerI(adapter, registry, initData);
+ adapter.add(object, communicator.stringToIdentity("ServerManager"));
- Ice.LocatorRegistryPrx registryPrx =
- Ice.LocatorRegistryPrxHelper.uncheckedCast(adapter.add(registry, communicator.stringToIdentity("registry")));
-
- ServerLocator locator = new ServerLocator(registry, registryPrx);
- adapter.add(locator, communicator.stringToIdentity("locator"));
-
- adapter.activate();
- communicator.waitForShutdown();
-
- return 0;
+ Ice.LocatorRegistryPrx registryPrx =
+ Ice.LocatorRegistryPrxHelper.uncheckedCast(adapter.add(registry, communicator.stringToIdentity("registry")));
+
+ ServerLocator locator = new ServerLocator(registry, registryPrx);
+ adapter.add(locator, communicator.stringToIdentity("locator"));
+
+ adapter.activate();
+ communicator.waitForShutdown();
+
+ return 0;
}
public static void
@@ -53,9 +53,9 @@ public class Server
try
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
communicator = Ice.Util.initialize(argsH, initData);
status = run(argsH.value, communicator, initData);
}
diff --git a/java/test/Ice/location/ServerLocator.java b/java/test/Ice/location/ServerLocator.java
index c8b84b77306..51a3434f54c 100644
--- a/java/test/Ice/location/ServerLocator.java
+++ b/java/test/Ice/location/ServerLocator.java
@@ -12,37 +12,37 @@ public class ServerLocator extends Test._TestLocatorDisp
public
ServerLocator(ServerLocatorRegistry registry, Ice.LocatorRegistryPrx registryPrx)
{
- _registry = registry;
- _registryPrx = registryPrx;
- _requestCount = 0;
+ _registry = registry;
+ _registryPrx = registryPrx;
+ _requestCount = 0;
}
public void
findAdapterById_async(Ice.AMD_Locator_findAdapterById response, String adapter, Ice.Current current)
- throws Ice.AdapterNotFoundException
+ throws Ice.AdapterNotFoundException
{
- ++_requestCount;
- response.ice_response(_registry.getAdapter(adapter));
+ ++_requestCount;
+ response.ice_response(_registry.getAdapter(adapter));
}
public void
findObjectById_async(Ice.AMD_Locator_findObjectById response, Ice.Identity id, Ice.Current current)
- throws Ice.ObjectNotFoundException
+ throws Ice.ObjectNotFoundException
{
- ++_requestCount;
- response.ice_response(_registry.getObject(id));
+ ++_requestCount;
+ response.ice_response(_registry.getObject(id));
}
public Ice.LocatorRegistryPrx
getRegistry(Ice.Current current)
{
- return _registryPrx;
+ return _registryPrx;
}
public int
getRequestCount(Ice.Current current)
{
- return _requestCount;
+ return _requestCount;
}
private ServerLocatorRegistry _registry;
diff --git a/java/test/Ice/location/ServerLocatorRegistry.java b/java/test/Ice/location/ServerLocatorRegistry.java
index 24218875480..4a28cdaada5 100644
--- a/java/test/Ice/location/ServerLocatorRegistry.java
+++ b/java/test/Ice/location/ServerLocatorRegistry.java
@@ -11,55 +11,55 @@ public class ServerLocatorRegistry extends Test._TestLocatorRegistryDisp
{
public void
setAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setAdapterDirectProxy cb, String adapter,
- Ice.ObjectPrx object, Ice.Current current)
+ Ice.ObjectPrx object, Ice.Current current)
{
- _adapters.put(adapter, object);
- cb.ice_response();
+ _adapters.put(adapter, object);
+ cb.ice_response();
}
public void
setReplicatedAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setReplicatedAdapterDirectProxy cb, String adapter,
- String replica, Ice.ObjectPrx object, Ice.Current current)
+ String replica, Ice.ObjectPrx object, Ice.Current current)
{
- _adapters.put(adapter, object);
- _adapters.put(replica, object);
- cb.ice_response();
+ _adapters.put(adapter, object);
+ _adapters.put(replica, object);
+ cb.ice_response();
}
public void
setServerProcessProxy_async(Ice.AMD_LocatorRegistry_setServerProcessProxy cb, String id, Ice.ProcessPrx proxy,
- Ice.Current current)
+ Ice.Current current)
{
}
public void
addObject(Ice.ObjectPrx object, Ice.Current current)
{
- _objects.put(object.ice_getIdentity(), object);
+ _objects.put(object.ice_getIdentity(), object);
}
public Ice.ObjectPrx
getAdapter(String adapter)
- throws Ice.AdapterNotFoundException
+ throws Ice.AdapterNotFoundException
{
- Ice.ObjectPrx obj = (Ice.ObjectPrx)_adapters.get(adapter);
- if(obj == null)
- {
- throw new Ice.AdapterNotFoundException();
- }
- return obj;
+ Ice.ObjectPrx obj = (Ice.ObjectPrx)_adapters.get(adapter);
+ if(obj == null)
+ {
+ throw new Ice.AdapterNotFoundException();
+ }
+ return obj;
}
public Ice.ObjectPrx
getObject(Ice.Identity id)
- throws Ice.ObjectNotFoundException
+ throws Ice.ObjectNotFoundException
{
- Ice.ObjectPrx obj = (Ice.ObjectPrx)_objects.get(id);
- if(obj == null)
- {
- throw new Ice.ObjectNotFoundException();
- }
- return obj;
+ Ice.ObjectPrx obj = (Ice.ObjectPrx)_objects.get(id);
+ if(obj == null)
+ {
+ throw new Ice.ObjectNotFoundException();
+ }
+ return obj;
}
private java.util.HashMap _adapters = new java.util.HashMap();
diff --git a/java/test/Ice/location/ServerManagerI.java b/java/test/Ice/location/ServerManagerI.java
index eed1a9a244b..a62e6445f89 100644
--- a/java/test/Ice/location/ServerManagerI.java
+++ b/java/test/Ice/location/ServerManagerI.java
@@ -13,66 +13,66 @@ public class ServerManagerI extends _ServerManagerDisp
{
ServerManagerI(Ice.ObjectAdapter adapter, ServerLocatorRegistry registry, Ice.InitializationData initData)
{
- _adapter = adapter;
- _registry = registry;
- _communicators = new java.util.ArrayList();
- _initData = initData;
+ _adapter = adapter;
+ _registry = registry;
+ _communicators = new java.util.ArrayList();
+ _initData = initData;
- _initData.properties.setProperty("Ice.OA.TestAdapter.Endpoints", "default");
- _initData.properties.setProperty("Ice.OA.TestAdapter.AdapterId", "TestAdapter");
- _initData.properties.setProperty("Ice.OA.TestAdapter.ReplicaGroupId", "ReplicatedAdapter");
- _initData.properties.setProperty("Ice.OA.TestAdapter2.Endpoints", "default");
- _initData.properties.setProperty("Ice.OA.TestAdapter2.AdapterId", "TestAdapter2");
+ _initData.properties.setProperty("Ice.OA.TestAdapter.Endpoints", "default");
+ _initData.properties.setProperty("Ice.OA.TestAdapter.AdapterId", "TestAdapter");
+ _initData.properties.setProperty("Ice.OA.TestAdapter.ReplicaGroupId", "ReplicatedAdapter");
+ _initData.properties.setProperty("Ice.OA.TestAdapter2.Endpoints", "default");
+ _initData.properties.setProperty("Ice.OA.TestAdapter2.AdapterId", "TestAdapter2");
}
public void
startServer(Ice.Current current)
{
java.util.Iterator i = _communicators.iterator();
- while(i.hasNext())
- {
- Ice.Communicator c = (Ice.Communicator)i.next();
- c.waitForShutdown();
- c.destroy();
- }
- _communicators.clear();
+ while(i.hasNext())
+ {
+ Ice.Communicator c = (Ice.Communicator)i.next();
+ c.waitForShutdown();
+ c.destroy();
+ }
+ _communicators.clear();
- //
- // Simulate a server: create a new communicator and object
- // adapter. The object adapter is started on a system allocated
- // port. The configuration used here contains the Ice.Locator
- // configuration variable. The new object adapter will register
- // its endpoints with the locator and create references containing
- // the adapter id instead of the endpoints.
- //
- Ice.Communicator serverCommunicator = Ice.Util.initialize(_initData);
- _communicators.add(serverCommunicator);
+ //
+ // Simulate a server: create a new communicator and object
+ // adapter. The object adapter is started on a system allocated
+ // port. The configuration used here contains the Ice.Locator
+ // configuration variable. The new object adapter will register
+ // its endpoints with the locator and create references containing
+ // the adapter id instead of the endpoints.
+ //
+ Ice.Communicator serverCommunicator = Ice.Util.initialize(_initData);
+ _communicators.add(serverCommunicator);
- Ice.ObjectAdapter adapter = serverCommunicator.createObjectAdapter("TestAdapter");
+ Ice.ObjectAdapter adapter = serverCommunicator.createObjectAdapter("TestAdapter");
- Ice.ObjectAdapter adapter2 = serverCommunicator.createObjectAdapter("TestAdapter2");
+ Ice.ObjectAdapter adapter2 = serverCommunicator.createObjectAdapter("TestAdapter2");
- Ice.ObjectPrx locator = serverCommunicator.stringToProxy("locator:default -p 12010 -t 30000");
- adapter.setLocator(Ice.LocatorPrxHelper.uncheckedCast(locator));
- adapter2.setLocator(Ice.LocatorPrxHelper.uncheckedCast(locator));
+ Ice.ObjectPrx locator = serverCommunicator.stringToProxy("locator:default -p 12010 -t 30000");
+ adapter.setLocator(Ice.LocatorPrxHelper.uncheckedCast(locator));
+ adapter2.setLocator(Ice.LocatorPrxHelper.uncheckedCast(locator));
- Ice.Object object = new TestI(adapter, adapter2, _registry);
- _registry.addObject(adapter.add(object, serverCommunicator.stringToIdentity("test")));
- _registry.addObject(adapter.add(object, serverCommunicator.stringToIdentity("test2")));
+ Ice.Object object = new TestI(adapter, adapter2, _registry);
+ _registry.addObject(adapter.add(object, serverCommunicator.stringToIdentity("test")));
+ _registry.addObject(adapter.add(object, serverCommunicator.stringToIdentity("test2")));
- adapter.activate();
- adapter2.activate();
+ adapter.activate();
+ adapter2.activate();
}
public void
shutdown(Ice.Current current)
{
java.util.Iterator i = _communicators.iterator();
- while(i.hasNext())
- {
- ((Ice.Communicator)i.next()).destroy();
- }
- _adapter.getCommunicator().shutdown();
+ while(i.hasNext())
+ {
+ ((Ice.Communicator)i.next()).destroy();
+ }
+ _adapter.getCommunicator().shutdown();
}
private Ice.ObjectAdapter _adapter;
diff --git a/java/test/Ice/location/TestI.java b/java/test/Ice/location/TestI.java
index 18209f8fd36..3a65aeca617 100644
--- a/java/test/Ice/location/TestI.java
+++ b/java/test/Ice/location/TestI.java
@@ -13,44 +13,44 @@ public class TestI extends _TestIntfDisp
{
TestI(Ice.ObjectAdapter adapter1, Ice.ObjectAdapter adapter2, ServerLocatorRegistry registry)
{
- _adapter1 = adapter1;
- _adapter2 = adapter2;
- _registry = registry;
+ _adapter1 = adapter1;
+ _adapter2 = adapter2;
+ _registry = registry;
- _registry.addObject(_adapter1.add(new HelloI(), _adapter1.getCommunicator().stringToIdentity("hello")));
+ _registry.addObject(_adapter1.add(new HelloI(), _adapter1.getCommunicator().stringToIdentity("hello")));
}
public void
shutdown(Ice.Current current)
{
- _adapter1.getCommunicator().shutdown();
+ _adapter1.getCommunicator().shutdown();
}
public HelloPrx
getHello(Ice.Current current)
{
- return HelloPrxHelper.uncheckedCast(_adapter1.createIndirectProxy(
- _adapter1.getCommunicator().stringToIdentity("hello")));
+ return HelloPrxHelper.uncheckedCast(_adapter1.createIndirectProxy(
+ _adapter1.getCommunicator().stringToIdentity("hello")));
}
public HelloPrx
getReplicatedHello(Ice.Current current)
{
- return HelloPrxHelper.uncheckedCast(_adapter1.createProxy(_adapter1.getCommunicator().stringToIdentity("hello")));
+ return HelloPrxHelper.uncheckedCast(_adapter1.createProxy(_adapter1.getCommunicator().stringToIdentity("hello")));
}
public void
migrateHello(Ice.Current current)
{
- final Ice.Identity id = _adapter1.getCommunicator().stringToIdentity("hello");
- try
- {
- _registry.addObject(_adapter2.add(_adapter1.remove(id), id));
- }
- catch(Ice.NotRegisteredException ex)
- {
- _registry.addObject(_adapter1.add(_adapter2.remove(id), id));
- }
+ final Ice.Identity id = _adapter1.getCommunicator().stringToIdentity("hello");
+ try
+ {
+ _registry.addObject(_adapter2.add(_adapter1.remove(id), id));
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ _registry.addObject(_adapter1.add(_adapter2.remove(id), id));
+ }
}
private ServerLocatorRegistry _registry;
diff --git a/java/test/Ice/objects/AllTests.java b/java/test/Ice/objects/AllTests.java
index 7a7ddb771b5..db4d956fef5 100644
--- a/java/test/Ice/objects/AllTests.java
+++ b/java/test/Ice/objects/AllTests.java
@@ -139,32 +139,32 @@ public class AllTests
}
System.out.println("ok");
- if(!collocated)
- {
- System.out.print("testing UnexpectedObjectException...");
- System.out.flush();
- ref = "uoet:default -p 12010 -t 10000";
- base = communicator.stringToProxy(ref);
- test(base != null);
- UnexpectedObjectExceptionTestPrx uoet = UnexpectedObjectExceptionTestPrxHelper.uncheckedCast(base);
- test(uoet != null);
- try
- {
- uoet.op();
- test(false);
- }
- catch(Ice.UnexpectedObjectException ex)
- {
- test(ex.type.equals("::Test::AlsoEmpty"));
- test(ex.expectedType.equals("::Test::Empty"));
- }
- catch(java.lang.Exception ex)
- {
- System.out.println(ex);
- test(false);
- }
- System.out.println("ok");
- }
+ if(!collocated)
+ {
+ System.out.print("testing UnexpectedObjectException...");
+ System.out.flush();
+ ref = "uoet:default -p 12010 -t 10000";
+ base = communicator.stringToProxy(ref);
+ test(base != null);
+ UnexpectedObjectExceptionTestPrx uoet = UnexpectedObjectExceptionTestPrxHelper.uncheckedCast(base);
+ test(uoet != null);
+ try
+ {
+ uoet.op();
+ test(false);
+ }
+ catch(Ice.UnexpectedObjectException ex)
+ {
+ test(ex.type.equals("::Test::AlsoEmpty"));
+ test(ex.expectedType.equals("::Test::Empty"));
+ }
+ catch(java.lang.Exception ex)
+ {
+ System.out.println(ex);
+ test(false);
+ }
+ System.out.println("ok");
+ }
return initial;
}
diff --git a/java/test/Ice/objects/Client.java b/java/test/Ice/objects/Client.java
index d4b4653869e..7d88222e906 100644
--- a/java/test/Ice/objects/Client.java
+++ b/java/test/Ice/objects/Client.java
@@ -82,7 +82,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/objects/Server.java b/java/test/Ice/objects/Server.java
index 5b73aac39a6..b341452febb 100644
--- a/java/test/Ice/objects/Server.java
+++ b/java/test/Ice/objects/Server.java
@@ -53,7 +53,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java b/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java
index a3c1565a873..77d48b973d6 100644
--- a/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java
+++ b/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java
@@ -14,12 +14,12 @@ public final class UnexpectedObjectExceptionTestI extends Ice.Blobject
public boolean
ice_invoke(byte[] inParams, Ice.ByteSeqHolder outParams, Ice.Current current)
{
- Ice.Communicator communicator = current.adapter.getCommunicator();
- Ice.OutputStream out = Ice.Util.createOutputStream(communicator);
- AlsoEmpty ae = new AlsoEmpty();
- Test.AlsoEmptyHelper.write(out, ae);
- out.writePendingObjects();
- outParams.value = out.finished();
- return true;
+ Ice.Communicator communicator = current.adapter.getCommunicator();
+ Ice.OutputStream out = Ice.Util.createOutputStream(communicator);
+ AlsoEmpty ae = new AlsoEmpty();
+ Test.AlsoEmptyHelper.write(out, ae);
+ out.writePendingObjects();
+ outParams.value = out.finished();
+ return true;
}
}
diff --git a/java/test/Ice/operations/AllTests.java b/java/test/Ice/operations/AllTests.java
index 0744aa12711..0bb47cda1b1 100644
--- a/java/test/Ice/operations/AllTests.java
+++ b/java/test/Ice/operations/AllTests.java
@@ -28,84 +28,84 @@ public class AllTests
test(base != null);
System.out.println("ok");
- System.out.print("testing ice_getCommunicator... ");
- System.out.flush();
- test(base.ice_getCommunicator() == communicator);
- System.out.println("ok");
+ System.out.print("testing ice_getCommunicator... ");
+ System.out.flush();
+ test(base.ice_getCommunicator() == communicator);
+ System.out.println("ok");
- System.out.print("testing proxy methods... ");
- System.out.flush();
- test(communicator.identityToString(
- base.ice_identity(communicator.stringToIdentity("other")).ice_getIdentity()).equals("other"));
- test(base.ice_facet("facet").ice_getFacet().equals("facet"));
- test(base.ice_adapterId("id").ice_getAdapterId().equals("id"));
- test(base.ice_twoway().ice_isTwoway());
- test(base.ice_oneway().ice_isOneway());
- test(base.ice_batchOneway().ice_isBatchOneway());
- test(base.ice_datagram().ice_isDatagram());
- test(base.ice_batchDatagram().ice_isBatchDatagram());
- test(base.ice_secure(true).ice_isSecure());
- test(!base.ice_secure(false).ice_isSecure());
- test(base.ice_collocationOptimized(true).ice_isCollocationOptimized());
- test(!base.ice_collocationOptimized(false).ice_isCollocationOptimized());
- System.out.println("ok");
+ System.out.print("testing proxy methods... ");
+ System.out.flush();
+ test(communicator.identityToString(
+ base.ice_identity(communicator.stringToIdentity("other")).ice_getIdentity()).equals("other"));
+ test(base.ice_facet("facet").ice_getFacet().equals("facet"));
+ test(base.ice_adapterId("id").ice_getAdapterId().equals("id"));
+ test(base.ice_twoway().ice_isTwoway());
+ test(base.ice_oneway().ice_isOneway());
+ test(base.ice_batchOneway().ice_isBatchOneway());
+ test(base.ice_datagram().ice_isDatagram());
+ test(base.ice_batchDatagram().ice_isBatchDatagram());
+ test(base.ice_secure(true).ice_isSecure());
+ test(!base.ice_secure(false).ice_isSecure());
+ test(base.ice_collocationOptimized(true).ice_isCollocationOptimized());
+ test(!base.ice_collocationOptimized(false).ice_isCollocationOptimized());
+ System.out.println("ok");
- System.out.print("testing proxy comparison... ");
- System.out.flush();
+ System.out.print("testing proxy comparison... ");
+ System.out.flush();
- test(communicator.stringToProxy("foo").equals(communicator.stringToProxy("foo")));
- test(!communicator.stringToProxy("foo").equals(communicator.stringToProxy("foo2")));
+ test(communicator.stringToProxy("foo").equals(communicator.stringToProxy("foo")));
+ test(!communicator.stringToProxy("foo").equals(communicator.stringToProxy("foo2")));
- Ice.ObjectPrx compObj = communicator.stringToProxy("foo");
+ Ice.ObjectPrx compObj = communicator.stringToProxy("foo");
- test(compObj.ice_facet("facet").equals(compObj.ice_facet("facet")));
- test(!compObj.ice_facet("facet").equals(compObj.ice_facet("facet1")));
+ test(compObj.ice_facet("facet").equals(compObj.ice_facet("facet")));
+ test(!compObj.ice_facet("facet").equals(compObj.ice_facet("facet1")));
- test(compObj.ice_oneway().equals(compObj.ice_oneway()));
- test(!compObj.ice_oneway().equals(compObj.ice_twoway()));
+ test(compObj.ice_oneway().equals(compObj.ice_oneway()));
+ test(!compObj.ice_oneway().equals(compObj.ice_twoway()));
- test(compObj.ice_secure(true).equals(compObj.ice_secure(true)));
- test(!compObj.ice_secure(false).equals(compObj.ice_secure(true)));
+ test(compObj.ice_secure(true).equals(compObj.ice_secure(true)));
+ test(!compObj.ice_secure(false).equals(compObj.ice_secure(true)));
- test(compObj.ice_collocationOptimized(true).equals(compObj.ice_collocationOptimized(true)));
- test(!compObj.ice_collocationOptimized(false).equals(compObj.ice_collocationOptimized(true)));
+ test(compObj.ice_collocationOptimized(true).equals(compObj.ice_collocationOptimized(true)));
+ test(!compObj.ice_collocationOptimized(false).equals(compObj.ice_collocationOptimized(true)));
- test(compObj.ice_connectionCached(true).equals(compObj.ice_connectionCached(true)));
- test(!compObj.ice_connectionCached(false).equals(compObj.ice_connectionCached(true)));
+ test(compObj.ice_connectionCached(true).equals(compObj.ice_connectionCached(true)));
+ test(!compObj.ice_connectionCached(false).equals(compObj.ice_connectionCached(true)));
- test(compObj.ice_endpointSelection(Ice.EndpointSelectionType.Random).equals(
- compObj.ice_endpointSelection(Ice.EndpointSelectionType.Random)));
- test(!compObj.ice_endpointSelection(Ice.EndpointSelectionType.Random).equals(
- compObj.ice_endpointSelection(Ice.EndpointSelectionType.Ordered)));
+ test(compObj.ice_endpointSelection(Ice.EndpointSelectionType.Random).equals(
+ compObj.ice_endpointSelection(Ice.EndpointSelectionType.Random)));
+ test(!compObj.ice_endpointSelection(Ice.EndpointSelectionType.Random).equals(
+ compObj.ice_endpointSelection(Ice.EndpointSelectionType.Ordered)));
- test(compObj.ice_connectionId("id2").equals(compObj.ice_connectionId("id2")));
- test(!compObj.ice_connectionId("id1").equals(compObj.ice_connectionId("id2")));
+ test(compObj.ice_connectionId("id2").equals(compObj.ice_connectionId("id2")));
+ test(!compObj.ice_connectionId("id1").equals(compObj.ice_connectionId("id2")));
- test(compObj.ice_compress(true).equals(compObj.ice_compress(true)));
- test(!compObj.ice_compress(false).equals(compObj.ice_compress(true)));
+ test(compObj.ice_compress(true).equals(compObj.ice_compress(true)));
+ test(!compObj.ice_compress(false).equals(compObj.ice_compress(true)));
- test(compObj.ice_timeout(20).equals(compObj.ice_timeout(20)));
- test(!compObj.ice_timeout(10).equals(compObj.ice_timeout(20)));
+ test(compObj.ice_timeout(20).equals(compObj.ice_timeout(20)));
+ test(!compObj.ice_timeout(10).equals(compObj.ice_timeout(20)));
- Ice.ObjectPrx compObj1 = communicator.stringToProxy("foo:tcp -h 127.0.0.1 -p 10000");
- Ice.ObjectPrx compObj2 = communicator.stringToProxy("foo:tcp -h 127.0.0.1 -p 10001");
- test(!compObj1.equals(compObj2));
+ Ice.ObjectPrx compObj1 = communicator.stringToProxy("foo:tcp -h 127.0.0.1 -p 10000");
+ Ice.ObjectPrx compObj2 = communicator.stringToProxy("foo:tcp -h 127.0.0.1 -p 10001");
+ test(!compObj1.equals(compObj2));
- compObj1 = communicator.stringToProxy("foo@MyAdapter1");
- compObj2 = communicator.stringToProxy("foo@MyAdapter2");
- test(!compObj1.equals(compObj2));
+ compObj1 = communicator.stringToProxy("foo@MyAdapter1");
+ compObj2 = communicator.stringToProxy("foo@MyAdapter2");
+ test(!compObj1.equals(compObj2));
- test(compObj1.ice_locatorCacheTimeout(20).equals(compObj1.ice_locatorCacheTimeout(20)));
- test(!compObj1.ice_locatorCacheTimeout(10).equals(compObj1.ice_locatorCacheTimeout(20)));
+ test(compObj1.ice_locatorCacheTimeout(20).equals(compObj1.ice_locatorCacheTimeout(20)));
+ test(!compObj1.ice_locatorCacheTimeout(10).equals(compObj1.ice_locatorCacheTimeout(20)));
- compObj1 = communicator.stringToProxy("foo:tcp -h 127.0.0.1 -p 1000");
- compObj2 = communicator.stringToProxy("foo@MyAdapter1");
- test(!compObj1.equals(compObj2));
+ compObj1 = communicator.stringToProxy("foo:tcp -h 127.0.0.1 -p 1000");
+ compObj2 = communicator.stringToProxy("foo@MyAdapter1");
+ test(!compObj1.equals(compObj2));
- //
- // TODO: Ideally we should also test comparison of fixed proxies.
- //
- System.out.println("ok");
+ //
+ // TODO: Ideally we should also test comparison of fixed proxies.
+ //
+ System.out.println("ok");
System.out.print("testing checked cast... ");
System.out.flush();
@@ -118,39 +118,39 @@ public class AllTests
test(cl.equals(derived));
System.out.println("ok");
- System.out.print("testing checked cast with context... ");
- System.out.flush();
- String cref = "context:default -p 12010 -t 10000";
- Ice.ObjectPrx cbase = communicator.stringToProxy(cref);
- test(cbase != null);
-
- Test.TestCheckedCastPrx tccp = Test.TestCheckedCastPrxHelper.checkedCast(cbase);
- java.util.Map c = tccp.getContext();
- test(c == null || c.size() == 0);
-
- c = new java.util.HashMap();
- c.put("one", "hello");
- c.put("two", "world");
- tccp = Test.TestCheckedCastPrxHelper.checkedCast(cbase, c);
- java.util.Map c2 = tccp.getContext();
- test(c.equals(c2));
- System.out.println("ok");
-
- if(!collocated)
- {
- System.out.print("testing timeout... ");
- System.out.flush();
- try
- {
- Test.MyClassPrx clTimeout = Test.MyClassPrxHelper.uncheckedCast(cl.ice_timeout(500));
- clTimeout.opSleep(1000);
- test(false);
- }
- catch(Ice.TimeoutException ex)
- {
- }
- System.out.println("ok");
- }
+ System.out.print("testing checked cast with context... ");
+ System.out.flush();
+ String cref = "context:default -p 12010 -t 10000";
+ Ice.ObjectPrx cbase = communicator.stringToProxy(cref);
+ test(cbase != null);
+
+ Test.TestCheckedCastPrx tccp = Test.TestCheckedCastPrxHelper.checkedCast(cbase);
+ java.util.Map c = tccp.getContext();
+ test(c == null || c.size() == 0);
+
+ c = new java.util.HashMap();
+ c.put("one", "hello");
+ c.put("two", "world");
+ tccp = Test.TestCheckedCastPrxHelper.checkedCast(cbase, c);
+ java.util.Map c2 = tccp.getContext();
+ test(c.equals(c2));
+ System.out.println("ok");
+
+ if(!collocated)
+ {
+ System.out.print("testing timeout... ");
+ System.out.flush();
+ try
+ {
+ Test.MyClassPrx clTimeout = Test.MyClassPrxHelper.uncheckedCast(cl.ice_timeout(500));
+ clTimeout.opSleep(1000);
+ test(false);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ }
+ System.out.println("ok");
+ }
System.out.print("testing twoway operations... ");
System.out.flush();
@@ -159,20 +159,20 @@ public class AllTests
derived.opDerived();
System.out.println("ok");
- if(!collocated)
- {
- System.out.print("testing twoway operations with AMI... ");
- System.out.flush();
- TwowaysAMI.twowaysAMI(communicator, cl);
- TwowaysAMI.twowaysAMI(communicator, derived);
- System.out.println("ok");
-
- System.out.print("testing batch oneway operations... ");
- System.out.flush();
- BatchOneways.batchOneways(cl);
- BatchOneways.batchOneways(derived);
- System.out.println("ok");
- }
+ if(!collocated)
+ {
+ System.out.print("testing twoway operations with AMI... ");
+ System.out.flush();
+ TwowaysAMI.twowaysAMI(communicator, cl);
+ TwowaysAMI.twowaysAMI(communicator, derived);
+ System.out.println("ok");
+
+ System.out.print("testing batch oneway operations... ");
+ System.out.flush();
+ BatchOneways.batchOneways(cl);
+ BatchOneways.batchOneways(derived);
+ System.out.println("ok");
+ }
return cl;
}
diff --git a/java/test/Ice/operations/BatchOneways.java b/java/test/Ice/operations/BatchOneways.java
index 2ce6418d423..86944c0b9c9 100644
--- a/java/test/Ice/operations/BatchOneways.java
+++ b/java/test/Ice/operations/BatchOneways.java
@@ -21,55 +21,55 @@ class BatchOneways
static void
batchOneways(Test.MyClassPrx p)
{
- final byte[] bs1 = new byte[10 * 1024];
- final byte[] bs2 = new byte[99 * 1024];
- final byte[] bs3 = new byte[100 * 1024];
+ final byte[] bs1 = new byte[10 * 1024];
+ final byte[] bs2 = new byte[99 * 1024];
+ final byte[] bs3 = new byte[100 * 1024];
- try
+ try
{
p.opByteSOneway(bs1);
- test(true);
+ test(true);
+ }
+ catch(Ice.MemoryLimitException ex)
+ {
+ test(false);
}
- catch(Ice.MemoryLimitException ex)
- {
- test(false);
- }
- try
+ try
{
p.opByteSOneway(bs2);
- test(true);
+ test(true);
+ }
+ catch(Ice.MemoryLimitException ex)
+ {
+ test(false);
}
- catch(Ice.MemoryLimitException ex)
- {
- test(false);
- }
- try
+ try
{
p.opByteSOneway(bs3);
- test(false);
+ test(false);
+ }
+ catch(Ice.MemoryLimitException ex)
+ {
+ test(true);
}
- catch(Ice.MemoryLimitException ex)
- {
- test(true);
- }
- Test.MyClassPrx batch = Test.MyClassPrxHelper.uncheckedCast(p.ice_batchOneway());
+ Test.MyClassPrx batch = Test.MyClassPrxHelper.uncheckedCast(p.ice_batchOneway());
- for(int i = 0 ; i < 30 ; ++i)
- {
- try
- {
- batch.opByteSOneway(bs1);
- test(true);
- }
- catch(Ice.MemoryLimitException ex)
- {
- test(false);
- }
- }
+ for(int i = 0 ; i < 30 ; ++i)
+ {
+ try
+ {
+ batch.opByteSOneway(bs1);
+ test(true);
+ }
+ catch(Ice.MemoryLimitException ex)
+ {
+ test(false);
+ }
+ }
- batch.ice_getConnection().flushBatchRequests();
+ batch.ice_getConnection().flushBatchRequests();
}
}
diff --git a/java/test/Ice/operations/Client.java b/java/test/Ice/operations/Client.java
index 598d33ed526..280d6791d65 100644
--- a/java/test/Ice/operations/Client.java
+++ b/java/test/Ice/operations/Client.java
@@ -38,28 +38,28 @@ public class Client
try
{
- //
- // In this test, we need at least two threads in the
- // client side thread pool for nested AMI.
- //
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2");
- initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
+ //
+ // In this test, we need at least two threads in the
+ // client side thread pool for nested AMI.
+ //
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2");
+ initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
- //
- // We must set MessageSizeMax to an explicit values,
- // because we run tests to check whether
- // Ice.MemoryLimitException is raised as expected.
- //
- initData.properties.setProperty("Ice.MessageSizeMax", "100");
+ //
+ // We must set MessageSizeMax to an explicit values,
+ // because we run tests to check whether
+ // Ice.MemoryLimitException is raised as expected.
+ //
+ initData.properties.setProperty("Ice.MessageSizeMax", "100");
- //
- // We don't want connection warnings because of the timeout test.
- //
- initData.properties.setProperty("Ice.Warn.Connections", "0");
-
+ //
+ // We don't want connection warnings because of the timeout test.
+ //
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
+
communicator = Ice.Util.initialize(argsH, initData);
status = run(argsH.value, communicator);
}
@@ -82,7 +82,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/operations/Collocated.java b/java/test/Ice/operations/Collocated.java
index 6aa4c99b0ba..de1cb34739c 100644
--- a/java/test/Ice/operations/Collocated.java
+++ b/java/test/Ice/operations/Collocated.java
@@ -17,7 +17,7 @@ public class Collocated
Ice.Identity id = communicator.stringToIdentity("test");
adapter.add(new MyDerivedClassI(adapter, id), id);
adapter.add(new TestCheckedCastI(), communicator.stringToIdentity("context"));
- adapter.activate();
+ adapter.activate();
AllTests.allTests(communicator, true);
@@ -32,9 +32,9 @@ public class Collocated
try
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
communicator = Ice.Util.initialize(argsH, initData);
status = run(args, communicator);
}
diff --git a/java/test/Ice/operations/MyDerivedClassI.java b/java/test/Ice/operations/MyDerivedClassI.java
index e92b7f04536..7e44f5be060 100644
--- a/java/test/Ice/operations/MyDerivedClassI.java
+++ b/java/test/Ice/operations/MyDerivedClassI.java
@@ -39,23 +39,23 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opSleep(int duration, Ice.Current current)
{
- while(true)
- {
- try
- {
- Thread.currentThread().sleep(duration);
- break;
- }
- catch(java.lang.InterruptedException ex)
- {
- }
- }
+ while(true)
+ {
+ try
+ {
+ Thread.currentThread().sleep(duration);
+ break;
+ }
+ catch(java.lang.InterruptedException ex)
+ {
+ }
+ }
}
public boolean
opBool(boolean p1, boolean p2,
- Ice.BooleanHolder p3,
- Ice.Current current)
+ Ice.BooleanHolder p3,
+ Ice.Current current)
{
p3.value = p1;
return p2;
@@ -63,7 +63,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public boolean[]
opBoolS(boolean[] p1, boolean[] p2,
- Test.BoolSHolder p3,
+ Test.BoolSHolder p3,
Ice.Current current)
{
p3.value = new boolean[p1.length + p2.length];
@@ -80,7 +80,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public boolean[][]
opBoolSS(boolean[][] p1, boolean[][] p2,
- Test.BoolSSHolder p3,
+ Test.BoolSSHolder p3,
Ice.Current current)
{
p3.value = new boolean[p1.length + p2.length][];
@@ -97,8 +97,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public byte
opByte(byte p1, byte p2,
- Ice.ByteHolder p3,
- Ice.Current current)
+ Ice.ByteHolder p3,
+ Ice.Current current)
{
p3.value = (byte)(p1 ^ p2);
return p1;
@@ -106,7 +106,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public java.util.Map
opByteBoolD(java.util.Map p1, java.util.Map p2,
- Test.ByteBoolDHolder p3,
+ Test.ByteBoolDHolder p3,
Ice.Current current)
{
p3.value = p1;
@@ -118,8 +118,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public byte[]
opByteS(byte[] p1, byte[] p2,
- Test.ByteSHolder p3,
- Ice.Current current)
+ Test.ByteSHolder p3,
+ Ice.Current current)
{
p3.value = new byte[p1.length];
for(int i = 0; i < p1.length; i++)
@@ -135,7 +135,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public byte[][]
opByteSS(byte[][] p1, byte[][] p2,
- Test.ByteSSHolder p3,
+ Test.ByteSSHolder p3,
Ice.Current current)
{
p3.value = new byte[p1.length][];
@@ -152,8 +152,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public double
opFloatDouble(float p1, double p2,
- Ice.FloatHolder p3, Ice.DoubleHolder p4,
- Ice.Current current)
+ Ice.FloatHolder p3, Ice.DoubleHolder p4,
+ Ice.Current current)
{
p3.value = p1;
p4.value = p2;
@@ -162,8 +162,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public double[]
opFloatDoubleS(float[] p1, double[] p2,
- Test.FloatSHolder p3, Test.DoubleSHolder p4,
- Ice.Current current)
+ Test.FloatSHolder p3, Test.DoubleSHolder p4,
+ Ice.Current current)
{
p3.value = p1;
p4.value = new double[p2.length];
@@ -182,8 +182,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public double[][]
opFloatDoubleSS(float[][] p1, double[][] p2,
- Test.FloatSSHolder p3, Test.DoubleSSHolder p4,
- Ice.Current current)
+ Test.FloatSSHolder p3, Test.DoubleSSHolder p4,
+ Ice.Current current)
{
p3.value = p1;
p4.value = new double[p2.length][];
@@ -199,7 +199,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public java.util.Map
opLongFloatD(java.util.Map p1, java.util.Map p2,
- Test.LongFloatDHolder p3,
+ Test.LongFloatDHolder p3,
Ice.Current current)
{
p3.value = p1;
@@ -211,19 +211,19 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public Test.MyClassPrx
opMyClass(Test.MyClassPrx p1,
- Test.MyClassPrxHolder p2, Test.MyClassPrxHolder p3,
- Ice.Current current)
+ Test.MyClassPrxHolder p2, Test.MyClassPrxHolder p3,
+ Ice.Current current)
{
p2.value = p1;
p3.value = Test.MyClassPrxHelper.uncheckedCast(
- _adapter.createProxy(_adapter.getCommunicator().stringToIdentity("noSuchIdentity")));
+ _adapter.createProxy(_adapter.getCommunicator().stringToIdentity("noSuchIdentity")));
return Test.MyClassPrxHelper.uncheckedCast(_adapter.createProxy(_identity));
}
public Test.MyEnum
opMyEnum(Test.MyEnum p1,
- Test.MyEnumHolder p2,
- Ice.Current current)
+ Test.MyEnumHolder p2,
+ Ice.Current current)
{
p2.value = p1;
return Test.MyEnum.enum3;
@@ -231,7 +231,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public java.util.Map
opShortIntD(java.util.Map p1, java.util.Map p2,
- Test.ShortIntDHolder p3,
+ Test.ShortIntDHolder p3,
Ice.Current current)
{
p3.value = p1;
@@ -243,8 +243,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public long
opShortIntLong(short p1, int p2, long p3,
- Ice.ShortHolder p4, Ice.IntHolder p5, Ice.LongHolder p6,
- Ice.Current current)
+ Ice.ShortHolder p4, Ice.IntHolder p5, Ice.LongHolder p6,
+ Ice.Current current)
{
p4.value = p1;
p5.value = p2;
@@ -254,7 +254,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public long[]
opShortIntLongS(short[] p1, int[] p2, long[] p3,
- Test.ShortSHolder p4, Test.IntSHolder p5, Test.LongSHolder p6,
+ Test.ShortSHolder p4, Test.IntSHolder p5, Test.LongSHolder p6,
Ice.Current current)
{
p4.value = p1;
@@ -272,7 +272,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public long[][]
opShortIntLongSS(short[][] p1, int[][] p2, long[][] p3,
Test.ShortSSHolder p4, Test.IntSSHolder p5, Test.LongSSHolder p6,
- Ice.Current current)
+ Ice.Current current)
{
p4.value = p1;
p5.value = new int[p2.length][];
@@ -288,8 +288,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public String
opString(String p1, String p2,
- Ice.StringHolder p3,
- Ice.Current current)
+ Ice.StringHolder p3,
+ Ice.Current current)
{
p3.value = p2 + " " + p1;
return p1 + " " + p2;
@@ -298,7 +298,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public java.util.Map
opStringMyEnumD(java.util.Map p1, java.util.Map p2,
Test.StringMyEnumDHolder p3,
- Ice.Current current)
+ Ice.Current current)
{
p3.value = p1;
java.util.Map r = new java.util.HashMap();
@@ -310,11 +310,11 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public int[]
opIntS(int[] s, Ice.Current current)
{
- int[] r = new int[s.length];
- for(int i = 0; i < r.length; ++i)
- {
- r[i] = -s[i];
- }
+ int[] r = new int[s.length];
+ for(int i = 0; i < r.length; ++i)
+ {
+ r[i] = -s[i];
+ }
return r;
}
@@ -326,23 +326,23 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public java.util.Map
opContext(Ice.Current current)
{
- return current.ctx;
+ return current.ctx;
}
public void
opDoubleMarshaling(double p1, double[] p2, Ice.Current current)
{
- double d = 1278312346.0 / 13.0;
- test(p1 == d);
- for(int i = 0; i < p2.length; ++i)
- {
- test(p2[i] == d);
- }
+ double d = 1278312346.0 / 13.0;
+ test(p1 == d);
+ for(int i = 0; i < p2.length; ++i)
+ {
+ test(p2[i] == d);
+ }
}
public String[]
opStringS(String[] p1, String[] p2,
- Test.StringSHolder p3,
+ Test.StringSHolder p3,
Ice.Current current)
{
p3.value = new String[p1.length + p2.length];
@@ -359,7 +359,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public String[][]
opStringSS(String[][] p1, String[][] p2,
- Test.StringSSHolder p3,
+ Test.StringSSHolder p3,
Ice.Current current)
{
p3.value = new String[p1.length + p2.length][];
@@ -376,7 +376,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public String[][][]
opStringSSS(String[][][] p1, String[][][] p2,
- Test.StringSSSHolder p3,
+ Test.StringSSSHolder p3,
Ice.Current current)
{
p3.value = new String[p1.length + p2.length][][];
@@ -394,7 +394,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public java.util.Map
opStringStringD(java.util.Map p1, java.util.Map p2,
Test.StringStringDHolder p3,
- Ice.Current current)
+ Ice.Current current)
{
p3.value = p1;
java.util.Map r = new java.util.HashMap();
@@ -405,7 +405,7 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public Test.Structure
opStruct(Test.Structure p1, Test.Structure p2,
- Test.StructureHolder p3,
+ Test.StructureHolder p3,
Ice.Current current)
{
p3.value = p1;
diff --git a/java/test/Ice/operations/Server.java b/java/test/Ice/operations/Server.java
index 41de47c5418..02a84b8100c 100644
--- a/java/test/Ice/operations/Server.java
+++ b/java/test/Ice/operations/Server.java
@@ -31,10 +31,10 @@ public class Server
try
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.Warn.Connections", "0");
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
communicator = Ice.Util.initialize(argsH, initData);
status = run(argsH.value, communicator);
@@ -58,7 +58,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/operations/Test.ice b/java/test/Ice/operations/Test.ice
index d6637fef4cf..aaaa2975345 100644
--- a/java/test/Ice/operations/Test.ice
+++ b/java/test/Ice/operations/Test.ice
@@ -75,75 +75,75 @@ dictionary<string, MyEnum> StringMyEnumD;
void opSleep(int duration);
byte opByte(byte p1, byte p2,
- out byte p3);
+ out byte p3);
bool opBool(bool p1, bool p2,
- out bool p3);
+ out bool p3);
long opShortIntLong(short p1, int p2, long p3,
- out short p4, out int p5, out long p6);
+ out short p4, out int p5, out long p6);
double opFloatDouble(float p1, double p2,
- out float p3, out double p4);
+ out float p3, out double p4);
string opString(string p1, string p2,
- out string p3);
+ out string p3);
MyEnum opMyEnum(MyEnum p1, out MyEnum p2);
MyClass* opMyClass(MyClass* p1, out MyClass* p2, out MyClass* p3);
Structure opStruct(Structure p1, Structure p2,
- out Structure p3);
+ out Structure p3);
ByteS opByteS(ByteS p1, ByteS p2,
- out ByteS p3);
+ out ByteS p3);
BoolS opBoolS(BoolS p1, BoolS p2,
- out BoolS p3);
+ out BoolS p3);
LongS opShortIntLongS(Test::ShortS p1, IntS p2, LongS p3,
- out ::Test::ShortS p4, out IntS p5, out LongS p6);
+ out ::Test::ShortS p4, out IntS p5, out LongS p6);
DoubleS opFloatDoubleS(FloatS p1, DoubleS p2,
- out FloatS p3, out DoubleS p4);
+ out FloatS p3, out DoubleS p4);
StringS opStringS(StringS p1, StringS p2,
- out StringS p3);
+ out StringS p3);
ByteSS opByteSS(ByteSS p1, ByteSS p2,
- out ByteSS p3);
+ out ByteSS p3);
BoolSS opBoolSS(BoolSS p1, BoolSS p2,
- out BoolSS p3);
+ out BoolSS p3);
LongSS opShortIntLongSS(ShortSS p1, IntSS p2, LongSS p3,
- out ShortSS p4, out IntSS p5, out LongSS p6);
+ out ShortSS p4, out IntSS p5, out LongSS p6);
DoubleSS opFloatDoubleSS(FloatSS p1, DoubleSS p2,
- out FloatSS p3, out DoubleSS p4);
+ out FloatSS p3, out DoubleSS p4);
StringSS opStringSS(StringSS p1, StringSS p2,
- out StringSS p3);
+ out StringSS p3);
StringSSS opStringSSS(StringSSS p1, StringSSS p2,
- out StringSSS p3);
+ out StringSSS p3);
ByteBoolD opByteBoolD(ByteBoolD p1, ByteBoolD p2,
- out ByteBoolD p3);
+ out ByteBoolD p3);
ShortIntD opShortIntD(ShortIntD p1, ShortIntD p2,
- out ShortIntD p3);
+ out ShortIntD p3);
LongFloatD opLongFloatD(LongFloatD p1, LongFloatD p2,
- out LongFloatD p3);
+ out LongFloatD p3);
StringStringD opStringStringD(StringStringD p1, StringStringD p2,
- out StringStringD p3);
+ out StringStringD p3);
StringMyEnumD opStringMyEnumD(StringMyEnumD p1, StringMyEnumD p2,
- out StringMyEnumD p3);
+ out StringMyEnumD p3);
IntS opIntS(IntS s);
diff --git a/java/test/Ice/operations/Twoways.java b/java/test/Ice/operations/Twoways.java
index c8f49ebb81a..328b3ae4013 100644
--- a/java/test/Ice/operations/Twoways.java
+++ b/java/test/Ice/operations/Twoways.java
@@ -403,80 +403,80 @@ class Twoways
test(rso[2].length == 0);
}
- {
- final String[][][] sssi1 =
- {
- {
- {
- "abc", "de"
- },
- {
- "xyz"
- }
- },
- {
- {
- "hello"
- }
- }
- };
-
- final String[][][] sssi2 =
- {
- {
- {
- "", ""
- },
- {
- "abcd"
- }
- },
- {
- {
- ""
- }
- },
- {
- }
- };
-
- Test.StringSSSHolder ssso = new Test.StringSSSHolder();
- String rsso[][][];
-
- rsso = p.opStringSSS(sssi1, sssi2, ssso);
- test(ssso.value.length == 5);
- test(ssso.value[0].length == 2);
- test(ssso.value[0][0].length == 2);
- test(ssso.value[0][1].length == 1);
- test(ssso.value[1].length == 1);
- test(ssso.value[1][0].length == 1);
- test(ssso.value[2].length == 2);
- test(ssso.value[2][0].length == 2);
- test(ssso.value[2][1].length == 1);
- test(ssso.value[3].length == 1);
- test(ssso.value[3][0].length == 1);
- test(ssso.value[4].length == 0);
- test(ssso.value[0][0][0].equals("abc"));
- test(ssso.value[0][0][1].equals("de"));
- test(ssso.value[0][1][0].equals("xyz"));
- test(ssso.value[1][0][0].equals("hello"));
- test(ssso.value[2][0][0].equals(""));
- test(ssso.value[2][0][1].equals(""));
- test(ssso.value[2][1][0].equals("abcd"));
- test(ssso.value[3][0][0].equals(""));
-
- test(rsso.length == 3);
- test(rsso[0].length == 0);
- test(rsso[1].length == 1);
- test(rsso[1][0].length == 1);
- test(rsso[2].length == 2);
- test(rsso[2][0].length == 2);
- test(rsso[2][1].length == 1);
- test(rsso[1][0][0].equals(""));
- test(rsso[2][0][0].equals(""));
- test(rsso[2][0][1].equals(""));
- test(rsso[2][1][0].equals("abcd"));
- }
+ {
+ final String[][][] sssi1 =
+ {
+ {
+ {
+ "abc", "de"
+ },
+ {
+ "xyz"
+ }
+ },
+ {
+ {
+ "hello"
+ }
+ }
+ };
+
+ final String[][][] sssi2 =
+ {
+ {
+ {
+ "", ""
+ },
+ {
+ "abcd"
+ }
+ },
+ {
+ {
+ ""
+ }
+ },
+ {
+ }
+ };
+
+ Test.StringSSSHolder ssso = new Test.StringSSSHolder();
+ String rsso[][][];
+
+ rsso = p.opStringSSS(sssi1, sssi2, ssso);
+ test(ssso.value.length == 5);
+ test(ssso.value[0].length == 2);
+ test(ssso.value[0][0].length == 2);
+ test(ssso.value[0][1].length == 1);
+ test(ssso.value[1].length == 1);
+ test(ssso.value[1][0].length == 1);
+ test(ssso.value[2].length == 2);
+ test(ssso.value[2][0].length == 2);
+ test(ssso.value[2][1].length == 1);
+ test(ssso.value[3].length == 1);
+ test(ssso.value[3][0].length == 1);
+ test(ssso.value[4].length == 0);
+ test(ssso.value[0][0][0].equals("abc"));
+ test(ssso.value[0][0][1].equals("de"));
+ test(ssso.value[0][1][0].equals("xyz"));
+ test(ssso.value[1][0][0].equals("hello"));
+ test(ssso.value[2][0][0].equals(""));
+ test(ssso.value[2][0][1].equals(""));
+ test(ssso.value[2][1][0].equals("abcd"));
+ test(ssso.value[3][0][0].equals(""));
+
+ test(rsso.length == 3);
+ test(rsso[0].length == 0);
+ test(rsso[1].length == 1);
+ test(rsso[1][0].length == 1);
+ test(rsso[2].length == 2);
+ test(rsso[2][0].length == 2);
+ test(rsso[2][1].length == 1);
+ test(rsso[1][0][0].equals(""));
+ test(rsso[2][0][0].equals(""));
+ test(rsso[2][0][1].equals(""));
+ test(rsso[2][1][0].equals("abcd"));
+ }
{
java.util.Map di1 = new java.util.HashMap();
@@ -579,153 +579,153 @@ class Twoways
}
{
- int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
-
- for(int l = 0; l < lengths.length; ++l)
- {
- int[] s = new int[lengths[l]];
- for(int i = 0; i < lengths[l]; ++i)
- {
- s[i] = i;
- }
- int[] r = p.opIntS(s);
- test(r.length == lengths[l]);
- for(int j = 0; j < r.length; ++j)
- {
- test(r[j] == -j);
- }
- }
+ int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
+
+ for(int l = 0; l < lengths.length; ++l)
+ {
+ int[] s = new int[lengths[l]];
+ for(int i = 0; i < lengths[l]; ++i)
+ {
+ s[i] = i;
+ }
+ int[] r = p.opIntS(s);
+ test(r.length == lengths[l]);
+ for(int j = 0; j < r.length; ++j)
+ {
+ test(r[j] == -j);
+ }
+ }
}
- {
- java.util.HashMap ctx = new java.util.HashMap();
- ctx.put("one", "ONE");
- ctx.put("two", "TWO");
- ctx.put("three", "THREE");
- {
- test(p.ice_getContext().isEmpty());
- java.util.Map r = p.opContext();
- test(!r.equals(ctx));
- }
- {
- java.util.Map r = p.opContext(ctx);
- test(p.ice_getContext().isEmpty());
- test(r.equals(ctx));
- }
- {
- Test.MyClassPrx p2 = Test.MyClassPrxHelper.checkedCast(p.ice_context(ctx));
- test(p2.ice_getContext().equals(ctx));
- java.util.Map r = p2.opContext();
- test(r.equals(ctx));
- r = p2.opContext(ctx);
- test(r.equals(ctx));
- }
- {
- //
- // Test that default context is obtained correctly from communicator.
- //
+ {
+ java.util.HashMap ctx = new java.util.HashMap();
+ ctx.put("one", "ONE");
+ ctx.put("two", "TWO");
+ ctx.put("three", "THREE");
+ {
+ test(p.ice_getContext().isEmpty());
+ java.util.Map r = p.opContext();
+ test(!r.equals(ctx));
+ }
+ {
+ java.util.Map r = p.opContext(ctx);
+ test(p.ice_getContext().isEmpty());
+ test(r.equals(ctx));
+ }
+ {
+ Test.MyClassPrx p2 = Test.MyClassPrxHelper.checkedCast(p.ice_context(ctx));
+ test(p2.ice_getContext().equals(ctx));
+ java.util.Map r = p2.opContext();
+ test(r.equals(ctx));
+ r = p2.opContext(ctx);
+ test(r.equals(ctx));
+ }
+ {
+ //
+ // Test that default context is obtained correctly from communicator.
+ //
/* DEPRECATED
- java.util.HashMap dflt = new java.util.HashMap();
- dflt.put("a", "b");
- communicator.setDefaultContext(dflt);
- test(!p.opContext().equals(dflt));
+ java.util.HashMap dflt = new java.util.HashMap();
+ dflt.put("a", "b");
+ communicator.setDefaultContext(dflt);
+ test(!p.opContext().equals(dflt));
- Test.MyClassPrx p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_context(new java.util.HashMap()));
- test(p2.opContext().isEmpty());
+ Test.MyClassPrx p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_context(new java.util.HashMap()));
+ test(p2.opContext().isEmpty());
- p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_defaultContext());
- test(p2.opContext().equals(dflt));
+ p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_defaultContext());
+ test(p2.opContext().equals(dflt));
- communicator.setDefaultContext(new java.util.HashMap());
- test(!p2.opContext().isEmpty());
+ communicator.setDefaultContext(new java.util.HashMap());
+ test(!p2.opContext().isEmpty());
- communicator.setDefaultContext(dflt);
- Test.MyClassPrx c = Test.MyClassPrxHelper.checkedCast(
- communicator.stringToProxy("test:default -p 12010 -t 10000"));
- test(c.opContext().equals(dflt));
+ communicator.setDefaultContext(dflt);
+ Test.MyClassPrx c = Test.MyClassPrxHelper.checkedCast(
+ communicator.stringToProxy("test:default -p 12010 -t 10000"));
+ test(c.opContext().equals(dflt));
- dflt.put("a", "c");
- Test.MyClassPrx c2 = Test.MyClassPrxHelper.uncheckedCast(c.ice_context(dflt));
- test(c2.opContext().get("a").equals("c"));
+ dflt.put("a", "c");
+ Test.MyClassPrx c2 = Test.MyClassPrxHelper.uncheckedCast(c.ice_context(dflt));
+ test(c2.opContext().get("a").equals("c"));
- dflt.clear();
- Test.MyClassPrx c3 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_context(dflt));
- test(c3.opContext().get("a") == null);
+ dflt.clear();
+ Test.MyClassPrx c3 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_context(dflt));
+ test(c3.opContext().get("a") == null);
- Test.MyClassPrx c4 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
- test(c4.opContext().get("a").equals("b"));
+ Test.MyClassPrx c4 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
+ test(c4.opContext().get("a").equals("b"));
- dflt.put("a", "d");
- communicator.setDefaultContext(dflt);
+ dflt.put("a", "d");
+ communicator.setDefaultContext(dflt);
- Test.MyClassPrx c5 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
- test(c5.opContext().get("a").equals("d"));
+ Test.MyClassPrx c5 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
+ test(c5.opContext().get("a").equals("d"));
- communicator.setDefaultContext(new java.util.HashMap());
+ communicator.setDefaultContext(new java.util.HashMap());
*/
- }
- }
- {
- //
- // Test implicit context propagation
- //
-
- String[] impls = {"Shared", "SharedWithoutLocking", "PerThread"};
- for(int i = 0; i < 3; i++)
- {
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = communicator.getProperties()._clone();
- initData.properties.setProperty("Ice.ImplicitContext", impls[i]);
-
- Ice.Communicator ic = Ice.Util.initialize(initData);
-
- java.util.Map ctx = new java.util.HashMap();
- ctx.put("one", "ONE");
- ctx.put("two", "TWO");
- ctx.put("three", "THREE");
-
- Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(
- ic.stringToProxy("test:default -p 12010 -t 10000"));
-
- ic.getImplicitContext().setContext(ctx);
- test(ic.getImplicitContext().getContext().equals(ctx));
- test(p3.opContext().equals(ctx));
-
- ic.getImplicitContext().set("zero", "ZERO");
- test(ic.getImplicitContext().get("zero").equals("ZERO"));
- test(ic.getImplicitContext().getWithDefault("foobar", "foo").equals("foo"));
-
- ctx = ic.getImplicitContext().getContext();
- test(p3.opContext().equals(ctx));
-
- java.util.Map prxContext = new java.util.HashMap();
- prxContext.put("one", "UN");
- prxContext.put("four", "QUATRE");
-
- java.util.Map combined = new java.util.HashMap(ctx);
- combined.putAll(prxContext);
- test(combined.get("one").equals("UN"));
-
- p3 = Test.MyClassPrxHelper.uncheckedCast(p3.ice_context(prxContext));
-
- ic.getImplicitContext().setContext(null);
- test(p3.opContext().equals(prxContext));
-
- ic.getImplicitContext().setContext(ctx);
- test(p3.opContext().equals(combined));
-
- ic.destroy();
- }
- }
-
- {
- double d = 1278312346.0 / 13.0;
- double[] ds = new double[5];
- for(int i = 0; i < 5; i++)
- {
- ds[i] = d;
- }
- p.opDoubleMarshaling(d, ds);
- }
+ }
+ }
+ {
+ //
+ // Test implicit context propagation
+ //
+
+ String[] impls = {"Shared", "SharedWithoutLocking", "PerThread"};
+ for(int i = 0; i < 3; i++)
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = communicator.getProperties()._clone();
+ initData.properties.setProperty("Ice.ImplicitContext", impls[i]);
+
+ Ice.Communicator ic = Ice.Util.initialize(initData);
+
+ java.util.Map ctx = new java.util.HashMap();
+ ctx.put("one", "ONE");
+ ctx.put("two", "TWO");
+ ctx.put("three", "THREE");
+
+ Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(
+ ic.stringToProxy("test:default -p 12010 -t 10000"));
+
+ ic.getImplicitContext().setContext(ctx);
+ test(ic.getImplicitContext().getContext().equals(ctx));
+ test(p3.opContext().equals(ctx));
+
+ ic.getImplicitContext().set("zero", "ZERO");
+ test(ic.getImplicitContext().get("zero").equals("ZERO"));
+ test(ic.getImplicitContext().getWithDefault("foobar", "foo").equals("foo"));
+
+ ctx = ic.getImplicitContext().getContext();
+ test(p3.opContext().equals(ctx));
+
+ java.util.Map prxContext = new java.util.HashMap();
+ prxContext.put("one", "UN");
+ prxContext.put("four", "QUATRE");
+
+ java.util.Map combined = new java.util.HashMap(ctx);
+ combined.putAll(prxContext);
+ test(combined.get("one").equals("UN"));
+
+ p3 = Test.MyClassPrxHelper.uncheckedCast(p3.ice_context(prxContext));
+
+ ic.getImplicitContext().setContext(null);
+ test(p3.opContext().equals(prxContext));
+
+ ic.getImplicitContext().setContext(ctx);
+ test(p3.opContext().equals(combined));
+
+ ic.destroy();
+ }
+ }
+
+ {
+ double d = 1278312346.0 / 13.0;
+ double[] ds = new double[5];
+ for(int i = 0; i < 5; i++)
+ {
+ ds[i] = d;
+ }
+ p.opDoubleMarshaling(d, ds);
+ }
}
}
diff --git a/java/test/Ice/operations/TwowaysAMI.java b/java/test/Ice/operations/TwowaysAMI.java
index 1d59123bec9..83b78ff912d 100644
--- a/java/test/Ice/operations/TwowaysAMI.java
+++ b/java/test/Ice/operations/TwowaysAMI.java
@@ -20,473 +20,473 @@ class TwowaysAMI
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;
+ 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_MyClass_opVoidI extends Test.AMI_MyClass_opVoid
{
- public void
- ice_response()
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opVoidExI extends Test.AMI_MyClass_opVoid
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(ex instanceof Ice.TwowayOnlyException);
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(ex instanceof Ice.TwowayOnlyException);
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opByteI extends Test.AMI_MyClass_opByte
{
- public void
- ice_response(byte r, byte b)
- {
- test(b == (byte)0xf0);
- test(r == (byte)0xff);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(byte r, byte b)
+ {
+ test(b == (byte)0xf0);
+ test(r == (byte)0xff);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opByteExI extends Test.AMI_MyClass_opByte
{
- public void
- ice_response(byte r, byte b)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(ex instanceof Ice.TwowayOnlyException);
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(byte r, byte b)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(ex instanceof Ice.TwowayOnlyException);
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opBoolI extends Test.AMI_MyClass_opBool
{
- public void
- ice_response(boolean r, boolean b)
- {
- test(b);
- test(!r);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(boolean r, boolean b)
+ {
+ test(b);
+ test(!r);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opShortIntLongI extends Test.AMI_MyClass_opShortIntLong
{
- public void
- ice_response(long r, short s, int i, long l)
- {
- test(s == 10);
- test(i == 11);
- test(l == 12);
- test(r == 12);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(long r, short s, int i, long l)
+ {
+ test(s == 10);
+ test(i == 11);
+ test(l == 12);
+ test(r == 12);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opFloatDoubleI extends Test.AMI_MyClass_opFloatDouble
{
- public void
- ice_response(double r, float f, double d)
- {
- test(f == 3.14f);
- test(d == 1.1E10);
- test(r == 1.1E10);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(double r, float f, double d)
+ {
+ test(f == 3.14f);
+ test(d == 1.1E10);
+ test(r == 1.1E10);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opStringI extends Test.AMI_MyClass_opString
{
- public void
- ice_response(String r, String s)
- {
- test(s.equals("world hello"));
- test(r.equals("hello world"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(String r, String s)
+ {
+ test(s.equals("world hello"));
+ test(r.equals("hello world"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opMyEnumI extends Test.AMI_MyClass_opMyEnum
{
- public void
- ice_response(Test.MyEnum r, Test.MyEnum e)
- {
+ public void
+ ice_response(Test.MyEnum r, Test.MyEnum e)
+ {
test(e == Test.MyEnum.enum2);
test(r == Test.MyEnum.enum3);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opMyClassI extends Test.AMI_MyClass_opMyClass
{
AMI_MyClass_opMyClassI(Ice.Communicator communicator)
- {
- _communicator = communicator;
- }
+ {
+ _communicator = communicator;
+ }
- public void
- ice_response(Test.MyClassPrx r, Test.MyClassPrx c1, Test.MyClassPrx c2)
- {
+ public void
+ ice_response(Test.MyClassPrx r, Test.MyClassPrx c1, Test.MyClassPrx c2)
+ {
test(c1.ice_getIdentity().equals(_communicator.stringToIdentity("test")));
test(c2.ice_getIdentity().equals(_communicator.stringToIdentity("noSuchIdentity")));
test(r.ice_getIdentity().equals(_communicator.stringToIdentity("test")));
- // We can't do the callbacks below in thread per connection mode.
- if(_communicator.getProperties().getPropertyAsInt("Ice.ThreadPerConnection") == 0)
- {
- r.opVoid();
- c1.opVoid();
- try
- {
- c2.opVoid();
- test(false);
- }
- catch(Ice.ObjectNotExistException ex)
- {
- }
- }
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
- private Ice.Communicator _communicator;
+ // We can't do the callbacks below in thread per connection mode.
+ if(_communicator.getProperties().getPropertyAsInt("Ice.ThreadPerConnection") == 0)
+ {
+ r.opVoid();
+ c1.opVoid();
+ try
+ {
+ c2.opVoid();
+ test(false);
+ }
+ catch(Ice.ObjectNotExistException ex)
+ {
+ }
+ }
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
+ private Ice.Communicator _communicator;
}
private static class AMI_MyClass_opStructI extends Test.AMI_MyClass_opStruct
{
- AMI_MyClass_opStructI(Ice.Communicator communicator)
- {
- _communicator = communicator;
- }
-
- public void
- ice_response(Test.Structure rso, Test.Structure so)
- {
+ AMI_MyClass_opStructI(Ice.Communicator communicator)
+ {
+ _communicator = communicator;
+ }
+
+ public void
+ ice_response(Test.Structure rso, Test.Structure so)
+ {
test(rso.p == null);
test(rso.e == Test.MyEnum.enum2);
test(rso.s.s.equals("def"));
test(so.e == Test.MyEnum.enum3);
test(so.s.s.equals("a new string"));
- // We can't do the callbacks below in thread per connection mode.
- if(_communicator.getProperties().getPropertyAsInt("Ice.ThreadPerConnection") == 0)
- {
- so.p.opVoid();
- }
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
- private Ice.Communicator _communicator;
+ // We can't do the callbacks below in thread per connection mode.
+ if(_communicator.getProperties().getPropertyAsInt("Ice.ThreadPerConnection") == 0)
+ {
+ so.p.opVoid();
+ }
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
+ private Ice.Communicator _communicator;
}
private static class AMI_MyClass_opByteSI extends Test.AMI_MyClass_opByteS
{
- public void
- ice_response(byte[] rso, byte[] bso)
- {
- test(bso.length == 4);
- test(bso[0] == (byte)0x22);
- test(bso[1] == (byte)0x12);
- test(bso[2] == (byte)0x11);
- test(bso[3] == (byte)0x01);
- test(rso.length == 8);
- test(rso[0] == (byte)0x01);
- test(rso[1] == (byte)0x11);
- test(rso[2] == (byte)0x12);
- test(rso[3] == (byte)0x22);
- test(rso[4] == (byte)0xf1);
- test(rso[5] == (byte)0xf2);
- test(rso[6] == (byte)0xf3);
- test(rso[7] == (byte)0xf4);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(byte[] rso, byte[] bso)
+ {
+ test(bso.length == 4);
+ test(bso[0] == (byte)0x22);
+ test(bso[1] == (byte)0x12);
+ test(bso[2] == (byte)0x11);
+ test(bso[3] == (byte)0x01);
+ test(rso.length == 8);
+ test(rso[0] == (byte)0x01);
+ test(rso[1] == (byte)0x11);
+ test(rso[2] == (byte)0x12);
+ test(rso[3] == (byte)0x22);
+ test(rso[4] == (byte)0xf1);
+ test(rso[5] == (byte)0xf2);
+ test(rso[6] == (byte)0xf3);
+ test(rso[7] == (byte)0xf4);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opBoolSI extends Test.AMI_MyClass_opBoolS
{
- public void
- ice_response(boolean[] rso, boolean[] bso)
- {
- test(bso.length == 4);
- test(bso[0]);
- test(bso[1]);
- test(!bso[2]);
- test(!bso[3]);
- test(rso.length == 3);
- test(!rso[0]);
- test(rso[1]);
- test(rso[2]);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(boolean[] rso, boolean[] bso)
+ {
+ test(bso.length == 4);
+ test(bso[0]);
+ test(bso[1]);
+ test(!bso[2]);
+ test(!bso[3]);
+ test(rso.length == 3);
+ test(!rso[0]);
+ test(rso[1]);
+ test(rso[2]);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opShortIntLongSI extends Test.AMI_MyClass_opShortIntLongS
{
- public void
- ice_response(long[] rso, short[] sso, int[] iso,
- long[] lso)
- {
- test(sso.length == 3);
- test(sso[0] == 1);
- test(sso[1] == 2);
- test(sso[2] == 3);
- test(iso.length == 4);
- test(iso[0] == 8);
- test(iso[1] == 7);
- test(iso[2] == 6);
- test(iso[3] == 5);
- test(lso.length == 6);
- test(lso[0] == 10);
- test(lso[1] == 30);
- test(lso[2] == 20);
- test(lso[3] == 10);
- test(lso[4] == 30);
- test(lso[5] == 20);
- test(rso.length == 3);
- test(rso[0] == 10);
- test(rso[1] == 30);
- test(rso[2] == 20);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(long[] rso, short[] sso, int[] iso,
+ long[] lso)
+ {
+ test(sso.length == 3);
+ test(sso[0] == 1);
+ test(sso[1] == 2);
+ test(sso[2] == 3);
+ test(iso.length == 4);
+ test(iso[0] == 8);
+ test(iso[1] == 7);
+ test(iso[2] == 6);
+ test(iso[3] == 5);
+ test(lso.length == 6);
+ test(lso[0] == 10);
+ test(lso[1] == 30);
+ test(lso[2] == 20);
+ test(lso[3] == 10);
+ test(lso[4] == 30);
+ test(lso[5] == 20);
+ test(rso.length == 3);
+ test(rso[0] == 10);
+ test(rso[1] == 30);
+ test(rso[2] == 20);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opFloatDoubleSI extends Test.AMI_MyClass_opFloatDoubleS
{
- public void
- ice_response(double[] rso, float[] fso, double[] dso)
- {
+ public void
+ ice_response(double[] rso, float[] fso, double[] dso)
+ {
test(fso.length == 2);
test(fso[0] == 3.14f);
test(fso[1] == 1.11f);
@@ -500,29 +500,29 @@ class TwowaysAMI
test(rso[2] == 1.3E10);
test((float)rso[3] == 3.14f);
test((float)rso[4] == 1.11f);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opStringSI extends Test.AMI_MyClass_opStringS
{
- public void
- ice_response(String[] rso, String[] sso)
- {
+ public void
+ ice_response(String[] rso, String[] sso)
+ {
test(sso.length == 4);
test(sso[0].equals("abc"));
test(sso[1].equals("de"));
@@ -532,160 +532,160 @@ class TwowaysAMI
test(rso[0].equals("fghi"));
test(rso[1].equals("de"));
test(rso[2].equals("abc"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opByteSSI extends Test.AMI_MyClass_opByteSS
{
- public void
- ice_response(byte[][] rso, byte[][] bso)
- {
- test(bso.length == 2);
- test(bso[0].length == 1);
- test(bso[0][0] == (byte)0xff);
- test(bso[1].length == 3);
- test(bso[1][0] == (byte)0x01);
- test(bso[1][1] == (byte)0x11);
- test(bso[1][2] == (byte)0x12);
- test(rso.length == 4);
- test(rso[0].length == 3);
- test(rso[0][0] == (byte)0x01);
- test(rso[0][1] == (byte)0x11);
- test(rso[0][2] == (byte)0x12);
- test(rso[1].length == 1);
- test(rso[1][0] == (byte)0xff);
- test(rso[2].length == 1);
- test(rso[2][0] == (byte)0x0e);
- test(rso[3].length == 2);
- test(rso[3][0] == (byte)0xf2);
- test(rso[3][1] == (byte)0xf1);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(byte[][] rso, byte[][] bso)
+ {
+ test(bso.length == 2);
+ test(bso[0].length == 1);
+ test(bso[0][0] == (byte)0xff);
+ test(bso[1].length == 3);
+ test(bso[1][0] == (byte)0x01);
+ test(bso[1][1] == (byte)0x11);
+ test(bso[1][2] == (byte)0x12);
+ test(rso.length == 4);
+ test(rso[0].length == 3);
+ test(rso[0][0] == (byte)0x01);
+ test(rso[0][1] == (byte)0x11);
+ test(rso[0][2] == (byte)0x12);
+ test(rso[1].length == 1);
+ test(rso[1][0] == (byte)0xff);
+ test(rso[2].length == 1);
+ test(rso[2][0] == (byte)0x0e);
+ test(rso[3].length == 2);
+ test(rso[3][0] == (byte)0xf2);
+ test(rso[3][1] == (byte)0xf1);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opBoolSSI extends Test.AMI_MyClass_opBoolSS
{
- public void
- ice_response(boolean[][] rso, boolean[][] bso)
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(boolean[][] rso, boolean[][] bso)
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opShortIntLongSSI extends Test.AMI_MyClass_opShortIntLongSS
{
- public void
- ice_response(long[][] rso, short[][] sso, int[][] iso, long[][] lso)
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(long[][] rso, short[][] sso, int[][] iso, long[][] lso)
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opFloatDoubleSSI extends Test.AMI_MyClass_opFloatDoubleSS
{
- public void
- ice_response(double[][] rso, float[][] fso, double[][] dso)
- {
- test(fso.length == 3);
- test(fso[0].length == 1);
- test(fso[0][0] == 3.14f);
- test(fso[1].length == 1);
- test(fso[1][0] == 1.11f);
- test(fso[2].length == 0);
- test(dso.length == 1);
- test(dso[0].length == 3);
- test(dso[0][0] == 1.1E10);
- test(dso[0][1] == 1.2E10);
- test(dso[0][2] == 1.3E10);
- test(rso.length == 2);
- test(rso[0].length == 3);
- test(rso[0][0] == 1.1E10);
- test(rso[0][1] == 1.2E10);
- test(rso[0][2] == 1.3E10);
- test(rso[1].length == 3);
- test(rso[1][0] == 1.1E10);
- test(rso[1][1] == 1.2E10);
- test(rso[1][2] == 1.3E10);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(double[][] rso, float[][] fso, double[][] dso)
+ {
+ test(fso.length == 3);
+ test(fso[0].length == 1);
+ test(fso[0][0] == 3.14f);
+ test(fso[1].length == 1);
+ test(fso[1][0] == 1.11f);
+ test(fso[2].length == 0);
+ test(dso.length == 1);
+ test(dso[0].length == 3);
+ test(dso[0][0] == 1.1E10);
+ test(dso[0][1] == 1.2E10);
+ test(dso[0][2] == 1.3E10);
+ test(rso.length == 2);
+ test(rso[0].length == 3);
+ test(rso[0][0] == 1.1E10);
+ test(rso[0][1] == 1.2E10);
+ test(rso[0][2] == 1.3E10);
+ test(rso[1].length == 3);
+ test(rso[1][0] == 1.1E10);
+ test(rso[1][1] == 1.2E10);
+ test(rso[1][2] == 1.3E10);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opStringSSI extends Test.AMI_MyClass_opStringSS
{
- public void
- ice_response(String[][] rso, String[][] sso)
- {
+ public void
+ ice_response(String[][] rso, String[][] sso)
+ {
test(sso.length == 5);
test(sso[0].length == 1);
test(sso[0][0].equals("abc"));
@@ -701,84 +701,84 @@ class TwowaysAMI
test(rso[0][0].equals("xyz"));
test(rso[1].length == 0);
test(rso[2].length == 0);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opStringSSSI extends Test.AMI_MyClass_opStringSSS
{
- public void
- ice_response(String[][][] rsso, String[][][] ssso)
- {
- test(ssso.length == 5);
- test(ssso[0].length == 2);
- test(ssso[0][0].length == 2);
- test(ssso[0][1].length == 1);
- test(ssso[1].length == 1);
- test(ssso[1][0].length == 1);
- test(ssso[2].length == 2);
- test(ssso[2][0].length == 2);
- test(ssso[2][1].length == 1);
- test(ssso[3].length == 1);
- test(ssso[3][0].length == 1);
- test(ssso[4].length == 0);
- test(ssso[0][0][0].equals("abc"));
- test(ssso[0][0][1].equals("de"));
- test(ssso[0][1][0].equals("xyz"));
- test(ssso[1][0][0].equals("hello"));
- test(ssso[2][0][0].equals(""));
- test(ssso[2][0][1].equals(""));
- test(ssso[2][1][0].equals("abcd"));
- test(ssso[3][0][0].equals(""));
-
- test(rsso.length == 3);
- test(rsso[0].length == 0);
- test(rsso[1].length == 1);
- test(rsso[1][0].length == 1);
- test(rsso[2].length == 2);
- test(rsso[2][0].length == 2);
- test(rsso[2][1].length == 1);
- test(rsso[1][0][0].equals(""));
- test(rsso[2][0][0].equals(""));
- test(rsso[2][0][1].equals(""));
- test(rsso[2][1][0].equals("abcd"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response(String[][][] rsso, String[][][] ssso)
+ {
+ test(ssso.length == 5);
+ test(ssso[0].length == 2);
+ test(ssso[0][0].length == 2);
+ test(ssso[0][1].length == 1);
+ test(ssso[1].length == 1);
+ test(ssso[1][0].length == 1);
+ test(ssso[2].length == 2);
+ test(ssso[2][0].length == 2);
+ test(ssso[2][1].length == 1);
+ test(ssso[3].length == 1);
+ test(ssso[3][0].length == 1);
+ test(ssso[4].length == 0);
+ test(ssso[0][0][0].equals("abc"));
+ test(ssso[0][0][1].equals("de"));
+ test(ssso[0][1][0].equals("xyz"));
+ test(ssso[1][0][0].equals("hello"));
+ test(ssso[2][0][0].equals(""));
+ test(ssso[2][0][1].equals(""));
+ test(ssso[2][1][0].equals("abcd"));
+ test(ssso[3][0][0].equals(""));
+
+ test(rsso.length == 3);
+ test(rsso[0].length == 0);
+ test(rsso[1].length == 1);
+ test(rsso[1][0].length == 1);
+ test(rsso[2].length == 2);
+ test(rsso[2][0].length == 2);
+ test(rsso[2][1].length == 1);
+ test(rsso[1][0][0].equals(""));
+ test(rsso[2][0][0].equals(""));
+ test(rsso[2][0][1].equals(""));
+ test(rsso[2][1][0].equals("abcd"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opByteBoolDI extends Test.AMI_MyClass_opByteBoolD
{
- public void
- ice_response(java.util.Map ro, java.util.Map _do)
- {
+ public void
+ ice_response(java.util.Map ro, java.util.Map _do)
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put(new Byte((byte)10), Boolean.TRUE);
di1.put(new Byte((byte)100), Boolean.FALSE);
@@ -788,29 +788,29 @@ class TwowaysAMI
test(((Boolean)ro.get(new Byte((byte)11))).booleanValue() == false);
test(((Boolean)ro.get(new Byte((byte)100))).booleanValue() == false);
test(((Boolean)ro.get(new Byte((byte)101))).booleanValue() == true);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opShortIntDI extends Test.AMI_MyClass_opShortIntD
{
- public void
- ice_response(java.util.Map ro, java.util.Map _do)
- {
+ public void
+ ice_response(java.util.Map ro, java.util.Map _do)
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put(new Short((short)110), new Integer(-1));
di1.put(new Short((short)1100), new Integer(123123));
@@ -820,29 +820,29 @@ class TwowaysAMI
test(((Integer)ro.get(new Short((short)111))).intValue() == -100);
test(((Integer)ro.get(new Short((short)1100))).intValue() == 123123);
test(((Integer)ro.get(new Short((short)1101))).intValue() == 0);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opLongFloatDI extends Test.AMI_MyClass_opLongFloatD
{
- public void
- ice_response(java.util.Map ro, java.util.Map _do)
- {
+ public void
+ ice_response(java.util.Map ro, java.util.Map _do)
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put(new Long(999999110L), new Float(-1.1f));
di1.put(new Long(999999111L), new Float(123123.2f));
@@ -852,29 +852,29 @@ class TwowaysAMI
test(((Float)ro.get(new Long(999999120L))).floatValue() == -100.4f);
test(((Float)ro.get(new Long(999999111L))).floatValue() == 123123.2f);
test(((Float)ro.get(new Long(999999130L))).floatValue() == 0.5f);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opStringStringDI extends Test.AMI_MyClass_opStringStringD
{
- public void
- ice_response(java.util.Map ro, java.util.Map _do)
- {
+ public void
+ ice_response(java.util.Map ro, java.util.Map _do)
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put("foo", "abc -1.1");
di1.put("bar", "abc 123123.2");
@@ -884,29 +884,29 @@ class TwowaysAMI
test(((String)ro.get("FOO")).equals("abc -100.4"));
test(((String)ro.get("bar")).equals("abc 123123.2"));
test(((String)ro.get("BAR")).equals("abc 0.5"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opStringMyEnumDI extends Test.AMI_MyClass_opStringMyEnumD
{
- public void
- ice_response(java.util.Map ro, java.util.Map _do)
- {
+ public void
+ ice_response(java.util.Map ro, java.util.Map _do)
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put("abc", Test.MyEnum.enum1);
di1.put("", Test.MyEnum.enum2);
@@ -916,254 +916,254 @@ class TwowaysAMI
test(((Test.MyEnum)ro.get("qwerty")) == Test.MyEnum.enum3);
test(((Test.MyEnum)ro.get("")) == Test.MyEnum.enum2);
test(((Test.MyEnum)ro.get("Hello!!")) == Test.MyEnum.enum2);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opIntSI extends Test.AMI_MyClass_opIntS
{
AMI_MyClass_opIntSI(int l)
- {
- _l = l;
- }
-
- public void
- ice_response(int[] r)
- {
- test(r.length == _l);
- for(int j = 0; j < r.length; ++j)
- {
- test(r[j] == -j);
- }
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private int _l;
- private Callback callback = new Callback();
+ {
+ _l = l;
+ }
+
+ public void
+ ice_response(int[] r)
+ {
+ test(r.length == _l);
+ for(int j = 0; j < r.length; ++j)
+ {
+ test(r[j] == -j);
+ }
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private int _l;
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opContextEqualI extends Test.AMI_MyClass_opContext
{
AMI_MyClass_opContextEqualI(java.util.Map d)
- {
- _d = d;
- }
-
- public void
- ice_response(java.util.Map r)
- {
- test(r.equals(_d));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private java.util.Map _d;
- private Callback callback = new Callback();
+ {
+ _d = d;
+ }
+
+ public void
+ ice_response(java.util.Map r)
+ {
+ test(r.equals(_d));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private java.util.Map _d;
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opContextNotEqualI extends Test.AMI_MyClass_opContext
{
AMI_MyClass_opContextNotEqualI(java.util.Map d)
- {
- _d = d;
- }
-
- public void
- ice_response(java.util.Map r)
- {
- test(!r.equals(_d));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private java.util.Map _d;
- private Callback callback = new Callback();
+ {
+ _d = d;
+ }
+
+ public void
+ ice_response(java.util.Map r)
+ {
+ test(!r.equals(_d));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private java.util.Map _d;
+ private Callback callback = new Callback();
}
private static class AMI_MyDerivedClass_opDerivedI extends Test.AMI_MyDerivedClass_opDerived
{
- public void
- ice_response()
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_MyClass_opDoubleMarshalingI extends Test.AMI_MyClass_opDoubleMarshaling
{
- public void
- ice_response()
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
static void
twowaysAMI(Ice.Communicator communicator, Test.MyClassPrx p)
{
{
- // Check that a call to a void operation raises TwowayOnlyException
- // in the ice_exception() callback instead of at the point of call.
- Test.MyClassPrx oneway = Test.MyClassPrxHelper.uncheckedCast(p.ice_oneway());
- AMI_MyClass_opVoidExI cb = new AMI_MyClass_opVoidExI();
- try
- {
- oneway.opVoid_async(cb);
- }
- catch(java.lang.Exception ex)
- {
- test(false);
- }
- test(cb.check());
- }
-
- {
- // Check that a call to a twoway operation raises TwowayOnlyException
- // in the ice_exception() callback instead of at the point of call.
- Test.MyClassPrx oneway = Test.MyClassPrxHelper.uncheckedCast(p.ice_oneway());
- AMI_MyClass_opByteExI cb = new AMI_MyClass_opByteExI();
- try
- {
- oneway.opByte_async(cb, (byte)0, (byte)0);
- }
- catch(java.lang.Exception ex)
- {
- test(false);
- }
- test(cb.check());
- }
-
- {
- AMI_MyClass_opVoidI cb = new AMI_MyClass_opVoidI();
- p.opVoid_async(cb);
- test(cb.check());
- // Let's check if we can reuse the same callback object for another call.
- p.opVoid_async(cb);
- test(cb.check());
- }
-
- {
- AMI_MyClass_opByteI cb = new AMI_MyClass_opByteI();
- p.opByte_async(cb, (byte)0xff, (byte)0x0f);
- test(cb.check());
- }
-
- {
- AMI_MyClass_opBoolI cb = new AMI_MyClass_opBoolI();
- p.opBool_async(cb, true, false);
- test(cb.check());
- }
-
- {
- AMI_MyClass_opShortIntLongI cb = new AMI_MyClass_opShortIntLongI();
- p.opShortIntLong_async(cb, (short)10, 11, 12L);
- test(cb.check());
- }
-
- {
- AMI_MyClass_opFloatDoubleI cb = new AMI_MyClass_opFloatDoubleI();
- p.opFloatDouble_async(cb, 3.14f, 1.1E10);
- test(cb.check());
- // Let's check if we can reuse the same callback object for another call.
- p.opFloatDouble_async(cb, 3.14f, 1.1E10);
- test(cb.check());
- }
-
- {
- AMI_MyClass_opStringI cb = new AMI_MyClass_opStringI();
- p.opString_async(cb, "hello", "world");
- test(cb.check());
- }
-
- {
- AMI_MyClass_opMyEnumI cb = new AMI_MyClass_opMyEnumI();
- p.opMyEnum_async(cb, Test.MyEnum.enum2);
- test(cb.check());
- }
-
- {
- AMI_MyClass_opMyClassI cb = new AMI_MyClass_opMyClassI(communicator);
- p.opMyClass_async(cb, p);
- test(cb.check());
- }
-
- {
+ // Check that a call to a void operation raises TwowayOnlyException
+ // in the ice_exception() callback instead of at the point of call.
+ Test.MyClassPrx oneway = Test.MyClassPrxHelper.uncheckedCast(p.ice_oneway());
+ AMI_MyClass_opVoidExI cb = new AMI_MyClass_opVoidExI();
+ try
+ {
+ oneway.opVoid_async(cb);
+ }
+ catch(java.lang.Exception ex)
+ {
+ test(false);
+ }
+ test(cb.check());
+ }
+
+ {
+ // Check that a call to a twoway operation raises TwowayOnlyException
+ // in the ice_exception() callback instead of at the point of call.
+ Test.MyClassPrx oneway = Test.MyClassPrxHelper.uncheckedCast(p.ice_oneway());
+ AMI_MyClass_opByteExI cb = new AMI_MyClass_opByteExI();
+ try
+ {
+ oneway.opByte_async(cb, (byte)0, (byte)0);
+ }
+ catch(java.lang.Exception ex)
+ {
+ test(false);
+ }
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opVoidI cb = new AMI_MyClass_opVoidI();
+ p.opVoid_async(cb);
+ test(cb.check());
+ // Let's check if we can reuse the same callback object for another call.
+ p.opVoid_async(cb);
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opByteI cb = new AMI_MyClass_opByteI();
+ p.opByte_async(cb, (byte)0xff, (byte)0x0f);
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opBoolI cb = new AMI_MyClass_opBoolI();
+ p.opBool_async(cb, true, false);
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opShortIntLongI cb = new AMI_MyClass_opShortIntLongI();
+ p.opShortIntLong_async(cb, (short)10, 11, 12L);
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opFloatDoubleI cb = new AMI_MyClass_opFloatDoubleI();
+ p.opFloatDouble_async(cb, 3.14f, 1.1E10);
+ test(cb.check());
+ // Let's check if we can reuse the same callback object for another call.
+ p.opFloatDouble_async(cb, 3.14f, 1.1E10);
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opStringI cb = new AMI_MyClass_opStringI();
+ p.opString_async(cb, "hello", "world");
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opMyEnumI cb = new AMI_MyClass_opMyEnumI();
+ p.opMyEnum_async(cb, Test.MyEnum.enum2);
+ test(cb.check());
+ }
+
+ {
+ AMI_MyClass_opMyClassI cb = new AMI_MyClass_opMyClassI(communicator);
+ p.opMyClass_async(cb, p);
+ test(cb.check());
+ }
+
+ {
Test.Structure si1 = new Test.Structure();
si1.p = p;
si1.e = Test.MyEnum.enum3;
@@ -1174,165 +1174,165 @@ class TwowaysAMI
si2.e = Test.MyEnum.enum2;
si2.s = new Test.AnotherStruct();
si2.s.s = "def";
-
- AMI_MyClass_opStructI cb = new AMI_MyClass_opStructI(communicator);
- p.opStruct_async(cb, si1, si2);
- test(cb.check());
- }
-
- {
+
+ AMI_MyClass_opStructI cb = new AMI_MyClass_opStructI(communicator);
+ p.opStruct_async(cb, si1, si2);
+ test(cb.check());
+ }
+
+ {
final byte[] bsi1 =
- {
- (byte)0x01,
- (byte)0x11,
- (byte)0x12,
- (byte)0x22
- };
+ {
+ (byte)0x01,
+ (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);
- test(cb.check());
- }
-
- {
+ {
+ (byte)0xf1,
+ (byte)0xf2,
+ (byte)0xf3,
+ (byte)0xf4
+ };
+
+ AMI_MyClass_opByteSI cb = new AMI_MyClass_opByteSI();
+ p.opByteS_async(cb, bsi1, bsi2);
+ test(cb.check());
+ }
+
+ {
final boolean[] bsi1 = { true, true, false };
final boolean[] bsi2 = { false };
-
- AMI_MyClass_opBoolSI cb = new AMI_MyClass_opBoolSI();
- p.opBoolS_async(cb, bsi1, bsi2);
- test(cb.check());
- }
-
- {
+
+ AMI_MyClass_opBoolSI cb = new AMI_MyClass_opBoolSI();
+ p.opBoolS_async(cb, bsi1, bsi2);
+ test(cb.check());
+ }
+
+ {
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);
- test(cb.check());
- }
-
- {
+
+ AMI_MyClass_opShortIntLongSI cb = new AMI_MyClass_opShortIntLongSI();
+ p.opShortIntLongS_async(cb, ssi, isi, lsi);
+ test(cb.check());
+ }
+
+ {
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);
- test(cb.check());
- }
-
- {
+
+ AMI_MyClass_opFloatDoubleSI cb = new AMI_MyClass_opFloatDoubleSI();
+ p.opFloatDoubleS_async(cb, fsi, dsi);
+ test(cb.check());
+ }
+
+ {
final String[] ssi1 = { "abc", "de", "fghi" };
final String[] ssi2 = { "xyz" };
-
- AMI_MyClass_opStringSI cb = new AMI_MyClass_opStringSI();
- p.opStringS_async(cb, ssi1, ssi2);
- test(cb.check());
- }
-
- {
+
+ AMI_MyClass_opStringSI cb = new AMI_MyClass_opStringSI();
+ p.opStringS_async(cb, ssi1, ssi2);
+ test(cb.check());
+ }
+
+ {
final byte[][] bsi1 =
- {
- { (byte)0x01, (byte)0x11, (byte)0x12 },
- { (byte)0xff }
- };
+ {
+ { (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);
- test(cb.check());
- }
+ {
+ { (byte)0x0e },
+ { (byte)0xf2, (byte)0xf1 }
+ };
+
+ AMI_MyClass_opByteSSI cb = new AMI_MyClass_opByteSSI();
+ p.opByteSS_async(cb, bsi1, bsi2);
+ test(cb.check());
+ }
- {
+ {
final float[][] fsi =
- {
- { 3.14f },
- { 1.11f },
- { },
- };
+ {
+ { 3.14f },
+ { 1.11f },
+ { },
+ };
final double[][] dsi =
- {
- { 1.1E10, 1.2E10, 1.3E10 }
- };
+ {
+ { 1.1E10, 1.2E10, 1.3E10 }
+ };
- AMI_MyClass_opFloatDoubleSSI cb = new AMI_MyClass_opFloatDoubleSSI();
- p.opFloatDoubleSS_async(cb, fsi, dsi);
- test(cb.check());
- }
+ AMI_MyClass_opFloatDoubleSSI cb = new AMI_MyClass_opFloatDoubleSSI();
+ p.opFloatDoubleSS_async(cb, fsi, dsi);
+ test(cb.check());
+ }
- {
+ {
final String[][] ssi1 =
- {
- { "abc" },
- { "de", "fghi" }
- };
+ {
+ { "abc" },
+ { "de", "fghi" }
+ };
final String[][] ssi2 =
- {
- { },
- { },
- { "xyz" }
- };
-
- AMI_MyClass_opStringSSI cb = new AMI_MyClass_opStringSSI();
- p.opStringSS_async(cb, ssi1, ssi2);
- test(cb.check());
- }
-
- {
- final String[][][] sssi1 =
- {
- {
- {
- "abc", "de"
- },
- {
- "xyz"
- }
- },
- {
- {
- "hello"
- }
- }
- };
-
- final String[][][] sssi2 =
- {
- {
- {
- "", ""
- },
- {
- "abcd"
- }
- },
- {
- {
- ""
- }
- },
- {
- }
- };
-
- AMI_MyClass_opStringSSSI cb = new AMI_MyClass_opStringSSSI();
- p.opStringSSS_async(cb, sssi1, sssi2);
- test(cb.check());
- }
-
- {
+ {
+ { },
+ { },
+ { "xyz" }
+ };
+
+ AMI_MyClass_opStringSSI cb = new AMI_MyClass_opStringSSI();
+ p.opStringSS_async(cb, ssi1, ssi2);
+ test(cb.check());
+ }
+
+ {
+ final String[][][] sssi1 =
+ {
+ {
+ {
+ "abc", "de"
+ },
+ {
+ "xyz"
+ }
+ },
+ {
+ {
+ "hello"
+ }
+ }
+ };
+
+ final String[][][] sssi2 =
+ {
+ {
+ {
+ "", ""
+ },
+ {
+ "abcd"
+ }
+ },
+ {
+ {
+ ""
+ }
+ },
+ {
+ }
+ };
+
+ AMI_MyClass_opStringSSSI cb = new AMI_MyClass_opStringSSSI();
+ p.opStringSSS_async(cb, sssi1, sssi2);
+ test(cb.check());
+ }
+
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put(new Byte((byte)10), Boolean.TRUE);
di1.put(new Byte((byte)100), Boolean.FALSE);
@@ -1341,12 +1341,12 @@ class TwowaysAMI
di2.put(new Byte((byte)11), Boolean.FALSE);
di2.put(new Byte((byte)101), Boolean.TRUE);
- AMI_MyClass_opByteBoolDI cb = new AMI_MyClass_opByteBoolDI();
- p.opByteBoolD_async(cb, di1, di2);
- test(cb.check());
- }
+ AMI_MyClass_opByteBoolDI cb = new AMI_MyClass_opByteBoolDI();
+ p.opByteBoolD_async(cb, di1, di2);
+ test(cb.check());
+ }
- {
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put(new Short((short)110), new Integer(-1));
di1.put(new Short((short)1100), new Integer(123123));
@@ -1355,12 +1355,12 @@ class TwowaysAMI
di2.put(new Short((short)111), new Integer(-100));
di2.put(new Short((short)1101), new Integer(0));
- AMI_MyClass_opShortIntDI cb = new AMI_MyClass_opShortIntDI();
- p.opShortIntD_async(cb, di1, di2);
- test(cb.check());
- }
+ AMI_MyClass_opShortIntDI cb = new AMI_MyClass_opShortIntDI();
+ p.opShortIntD_async(cb, di1, di2);
+ test(cb.check());
+ }
- {
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put(new Long(999999110L), new Float(-1.1f));
di1.put(new Long(999999111L), new Float(123123.2f));
@@ -1369,12 +1369,12 @@ class TwowaysAMI
di2.put(new Long(999999120L), new Float(-100.4f));
di2.put(new Long(999999130L), new Float(0.5f));
- AMI_MyClass_opLongFloatDI cb = new AMI_MyClass_opLongFloatDI();
- p.opLongFloatD_async(cb, di1, di2);
- test(cb.check());
- }
+ AMI_MyClass_opLongFloatDI cb = new AMI_MyClass_opLongFloatDI();
+ p.opLongFloatD_async(cb, di1, di2);
+ test(cb.check());
+ }
- {
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put("foo", "abc -1.1");
di1.put("bar", "abc 123123.2");
@@ -1383,12 +1383,12 @@ class TwowaysAMI
di2.put("FOO", "abc -100.4");
di2.put("BAR", "abc 0.5");
- AMI_MyClass_opStringStringDI cb = new AMI_MyClass_opStringStringDI();
- p.opStringStringD_async(cb, di1, di2);
- test(cb.check());
- }
+ AMI_MyClass_opStringStringDI cb = new AMI_MyClass_opStringStringDI();
+ p.opStringStringD_async(cb, di1, di2);
+ test(cb.check());
+ }
- {
+ {
java.util.Map di1 = new java.util.HashMap();
di1.put("abc", Test.MyEnum.enum1);
di1.put("", Test.MyEnum.enum2);
@@ -1397,235 +1397,235 @@ class TwowaysAMI
di2.put("qwerty", Test.MyEnum.enum3);
di2.put("Hello!!", Test.MyEnum.enum2);
- AMI_MyClass_opStringMyEnumDI cb = new AMI_MyClass_opStringMyEnumDI();
- p.opStringMyEnumD_async(cb, di1, di2);
- test(cb.check());
- }
-
- {
- int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
-
- for(int l = 0; l < lengths.length; ++l)
- {
- int[] s = new int[lengths[l]];
- for(int i = 0; i < s.length; ++i)
- {
- s[i] = i;
- }
- AMI_MyClass_opIntSI cb = new AMI_MyClass_opIntSI(lengths[l]);
- p.opIntS_async(cb, s);
- test(cb.check());
- }
- }
-
- {
- java.util.Map ctx = new java.util.HashMap();
- ctx.put("one", "ONE");
- ctx.put("two", "TWO");
- ctx.put("three", "THREE");
- {
- test(p.ice_getContext().isEmpty());
- AMI_MyClass_opContextNotEqualI cb = new AMI_MyClass_opContextNotEqualI(ctx);
- p.opContext_async(cb);
- test(cb.check());
- }
- {
- test(p.ice_getContext().isEmpty());
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
- p.opContext_async(cb, ctx);
- test(cb.check());
- }
- Test.MyClassPrx p2 = Test.MyClassPrxHelper.checkedCast(p.ice_context(ctx));
- test(p2.ice_getContext().equals(ctx));
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
- p2.opContext_async(cb);
- test(cb.check());
- }
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
- p2.opContext_async(cb, ctx);
- test(cb.check());
- }
-
- {
- //
- // Test that default context is obtained correctly from communicator.
- //
+ AMI_MyClass_opStringMyEnumDI cb = new AMI_MyClass_opStringMyEnumDI();
+ p.opStringMyEnumD_async(cb, di1, di2);
+ test(cb.check());
+ }
+
+ {
+ int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
+
+ for(int l = 0; l < lengths.length; ++l)
+ {
+ int[] s = new int[lengths[l]];
+ for(int i = 0; i < s.length; ++i)
+ {
+ s[i] = i;
+ }
+ AMI_MyClass_opIntSI cb = new AMI_MyClass_opIntSI(lengths[l]);
+ p.opIntS_async(cb, s);
+ test(cb.check());
+ }
+ }
+
+ {
+ java.util.Map ctx = new java.util.HashMap();
+ ctx.put("one", "ONE");
+ ctx.put("two", "TWO");
+ ctx.put("three", "THREE");
+ {
+ test(p.ice_getContext().isEmpty());
+ AMI_MyClass_opContextNotEqualI cb = new AMI_MyClass_opContextNotEqualI(ctx);
+ p.opContext_async(cb);
+ test(cb.check());
+ }
+ {
+ test(p.ice_getContext().isEmpty());
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
+ p.opContext_async(cb, ctx);
+ test(cb.check());
+ }
+ Test.MyClassPrx p2 = Test.MyClassPrxHelper.checkedCast(p.ice_context(ctx));
+ test(p2.ice_getContext().equals(ctx));
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
+ p2.opContext_async(cb);
+ test(cb.check());
+ }
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
+ p2.opContext_async(cb, ctx);
+ test(cb.check());
+ }
+
+ {
+ //
+ // Test that default context is obtained correctly from communicator.
+ //
/* DEPRECATED
- java.util.HashMap dflt = new java.util.HashMap();
- dflt.put("a", "b");
- communicator.setDefaultContext(dflt);
- {
- AMI_MyClass_opContextNotEqualI cb = new AMI_MyClass_opContextNotEqualI(dflt);
- p.opContext_async(cb);
- test(cb.check());
- }
-
- p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_context(new java.util.HashMap()));
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(new java.util.HashMap());
- p2.opContext_async(cb);
- test(cb.check());
- }
-
- p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_defaultContext());
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(dflt);
- p2.opContext_async(cb);
- test(cb.check());
- }
-
- communicator.setDefaultContext(new java.util.HashMap());
- {
- AMI_MyClass_opContextNotEqualI cb = new AMI_MyClass_opContextNotEqualI(new java.util.HashMap());
- p2.opContext_async(cb);
- test(cb.check());
- }
-
- communicator.setDefaultContext(dflt);
- Test.MyClassPrx c = Test.MyClassPrxHelper.checkedCast(
- communicator.stringToProxy("test:default -p 12010 -t 10000"));
- {
- java.util.HashMap tmp = new java.util.HashMap();
- tmp.put("a", "b");
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
- c.opContext_async(cb);
- test(cb.check());
- }
-
- dflt.put("a", "c");
- Test.MyClassPrx c2 = Test.MyClassPrxHelper.uncheckedCast(c.ice_context(dflt));
- {
- java.util.HashMap tmp = new java.util.HashMap();
- tmp.put("a", "c");
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
- c2.opContext_async(cb);
- test(cb.check());
- }
-
- dflt.clear();
- Test.MyClassPrx c3 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_context(dflt));
- {
- java.util.HashMap tmp = new java.util.HashMap();
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
- c3.opContext_async(cb);
- test(cb.check());
- }
-
- Test.MyClassPrx c4 = Test.MyClassPrxHelper.uncheckedCast(c.ice_defaultContext());
- {
- java.util.HashMap tmp = new java.util.HashMap();
- tmp.put("a", "b");
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
- c4.opContext_async(cb);
- test(cb.check());
- }
-
- dflt.put("a", "d");
- communicator.setDefaultContext(dflt);
-
- Test.MyClassPrx c5 = Test.MyClassPrxHelper.uncheckedCast(c.ice_defaultContext());
- {
- java.util.HashMap tmp = new java.util.HashMap();
- tmp.put("a", "d");
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
- c5.opContext_async(cb);
- test(cb.check());
- }
-
- communicator.setDefaultContext(new java.util.HashMap());
+ java.util.HashMap dflt = new java.util.HashMap();
+ dflt.put("a", "b");
+ communicator.setDefaultContext(dflt);
+ {
+ AMI_MyClass_opContextNotEqualI cb = new AMI_MyClass_opContextNotEqualI(dflt);
+ p.opContext_async(cb);
+ test(cb.check());
+ }
+
+ p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_context(new java.util.HashMap()));
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(new java.util.HashMap());
+ p2.opContext_async(cb);
+ test(cb.check());
+ }
+
+ p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_defaultContext());
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(dflt);
+ p2.opContext_async(cb);
+ test(cb.check());
+ }
+
+ communicator.setDefaultContext(new java.util.HashMap());
+ {
+ AMI_MyClass_opContextNotEqualI cb = new AMI_MyClass_opContextNotEqualI(new java.util.HashMap());
+ p2.opContext_async(cb);
+ test(cb.check());
+ }
+
+ communicator.setDefaultContext(dflt);
+ Test.MyClassPrx c = Test.MyClassPrxHelper.checkedCast(
+ communicator.stringToProxy("test:default -p 12010 -t 10000"));
+ {
+ java.util.HashMap tmp = new java.util.HashMap();
+ tmp.put("a", "b");
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
+ c.opContext_async(cb);
+ test(cb.check());
+ }
+
+ dflt.put("a", "c");
+ Test.MyClassPrx c2 = Test.MyClassPrxHelper.uncheckedCast(c.ice_context(dflt));
+ {
+ java.util.HashMap tmp = new java.util.HashMap();
+ tmp.put("a", "c");
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
+ c2.opContext_async(cb);
+ test(cb.check());
+ }
+
+ dflt.clear();
+ Test.MyClassPrx c3 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_context(dflt));
+ {
+ java.util.HashMap tmp = new java.util.HashMap();
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
+ c3.opContext_async(cb);
+ test(cb.check());
+ }
+
+ Test.MyClassPrx c4 = Test.MyClassPrxHelper.uncheckedCast(c.ice_defaultContext());
+ {
+ java.util.HashMap tmp = new java.util.HashMap();
+ tmp.put("a", "b");
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
+ c4.opContext_async(cb);
+ test(cb.check());
+ }
+
+ dflt.put("a", "d");
+ communicator.setDefaultContext(dflt);
+
+ Test.MyClassPrx c5 = Test.MyClassPrxHelper.uncheckedCast(c.ice_defaultContext());
+ {
+ java.util.HashMap tmp = new java.util.HashMap();
+ tmp.put("a", "d");
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(tmp);
+ c5.opContext_async(cb);
+ test(cb.check());
+ }
+
+ communicator.setDefaultContext(new java.util.HashMap());
*/
- }
- }
-
- {
- //
- // Test implicit context propagation
- //
-
- String[] impls = {"Shared", "SharedWithoutLocking", "PerThread"};
- for(int i = 0; i < 3; i++)
- {
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = communicator.getProperties()._clone();
- initData.properties.setProperty("Ice.ImplicitContext", impls[i]);
-
- Ice.Communicator ic = Ice.Util.initialize(initData);
-
- java.util.Map ctx = new java.util.HashMap();
- ctx.put("one", "ONE");
- ctx.put("two", "TWO");
- ctx.put("three", "THREE");
-
- Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(
- ic.stringToProxy("test:default -p 12010 -t 10000"));
-
- ic.getImplicitContext().setContext(ctx);
- test(ic.getImplicitContext().getContext().equals(ctx));
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
- p3.opContext_async(cb);
- test(cb.check());
- }
-
- ic.getImplicitContext().set("zero", "ZERO");
- test(ic.getImplicitContext().get("zero").equals("ZERO"));
- test(ic.getImplicitContext().getWithDefault("foobar", "foo").equals("foo"));
-
- ctx = ic.getImplicitContext().getContext();
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
- p3.opContext_async(cb);
- test(cb.check());
- }
-
- java.util.Map prxContext = new java.util.HashMap();
- prxContext.put("one", "UN");
- prxContext.put("four", "QUATRE");
-
- java.util.Map combined = new java.util.HashMap(ctx);
- combined.putAll(prxContext);
- test(combined.get("one").equals("UN"));
-
- p3 = Test.MyClassPrxHelper.uncheckedCast(p3.ice_context(prxContext));
-
- ic.getImplicitContext().setContext(null);
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(prxContext);
- p3.opContext_async(cb);
- test(cb.check());
- }
-
- ic.getImplicitContext().setContext(ctx);
- {
- AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(combined);
- p3.opContext_async(cb);
- test(cb.check());
- }
-
- ic.destroy();
- }
- }
-
- {
- double d = 1278312346.0 / 13.0;
- double[] ds = new double[5];
- for(int i = 0; i < 5; i++)
- {
- ds[i] = d;
- }
- AMI_MyClass_opDoubleMarshalingI cb = new AMI_MyClass_opDoubleMarshalingI();
- p.opDoubleMarshaling_async(cb, d, ds);
- test(cb.check());
- }
-
- {
- Test.MyDerivedClassPrx derived = Test.MyDerivedClassPrxHelper.checkedCast(p);
- test(derived != null);
- AMI_MyDerivedClass_opDerivedI cb = new AMI_MyDerivedClass_opDerivedI();
- derived.opDerived_async(cb);
- test(cb.check());
- }
+ }
+ }
+
+ {
+ //
+ // Test implicit context propagation
+ //
+
+ String[] impls = {"Shared", "SharedWithoutLocking", "PerThread"};
+ for(int i = 0; i < 3; i++)
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = communicator.getProperties()._clone();
+ initData.properties.setProperty("Ice.ImplicitContext", impls[i]);
+
+ Ice.Communicator ic = Ice.Util.initialize(initData);
+
+ java.util.Map ctx = new java.util.HashMap();
+ ctx.put("one", "ONE");
+ ctx.put("two", "TWO");
+ ctx.put("three", "THREE");
+
+ Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(
+ ic.stringToProxy("test:default -p 12010 -t 10000"));
+
+ ic.getImplicitContext().setContext(ctx);
+ test(ic.getImplicitContext().getContext().equals(ctx));
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
+ p3.opContext_async(cb);
+ test(cb.check());
+ }
+
+ ic.getImplicitContext().set("zero", "ZERO");
+ test(ic.getImplicitContext().get("zero").equals("ZERO"));
+ test(ic.getImplicitContext().getWithDefault("foobar", "foo").equals("foo"));
+
+ ctx = ic.getImplicitContext().getContext();
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(ctx);
+ p3.opContext_async(cb);
+ test(cb.check());
+ }
+
+ java.util.Map prxContext = new java.util.HashMap();
+ prxContext.put("one", "UN");
+ prxContext.put("four", "QUATRE");
+
+ java.util.Map combined = new java.util.HashMap(ctx);
+ combined.putAll(prxContext);
+ test(combined.get("one").equals("UN"));
+
+ p3 = Test.MyClassPrxHelper.uncheckedCast(p3.ice_context(prxContext));
+
+ ic.getImplicitContext().setContext(null);
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(prxContext);
+ p3.opContext_async(cb);
+ test(cb.check());
+ }
+
+ ic.getImplicitContext().setContext(ctx);
+ {
+ AMI_MyClass_opContextEqualI cb = new AMI_MyClass_opContextEqualI(combined);
+ p3.opContext_async(cb);
+ test(cb.check());
+ }
+
+ ic.destroy();
+ }
+ }
+
+ {
+ double d = 1278312346.0 / 13.0;
+ double[] ds = new double[5];
+ for(int i = 0; i < 5; i++)
+ {
+ ds[i] = d;
+ }
+ AMI_MyClass_opDoubleMarshalingI cb = new AMI_MyClass_opDoubleMarshalingI();
+ p.opDoubleMarshaling_async(cb, d, ds);
+ test(cb.check());
+ }
+
+ {
+ Test.MyDerivedClassPrx derived = Test.MyDerivedClassPrxHelper.checkedCast(p);
+ test(derived != null);
+ AMI_MyDerivedClass_opDerivedI cb = new AMI_MyDerivedClass_opDerivedI();
+ derived.opDerived_async(cb);
+ test(cb.check());
+ }
}
}
diff --git a/java/test/Ice/operationsAMD/MyDerivedClassI.java b/java/test/Ice/operationsAMD/MyDerivedClassI.java
index 5b173590abe..d97d0eb3225 100644
--- a/java/test/Ice/operationsAMD/MyDerivedClassI.java
+++ b/java/test/Ice/operationsAMD/MyDerivedClassI.java
@@ -20,19 +20,19 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
static class Thread_opVoid extends Thread
{
- public
- Thread_opVoid(Test.AMD_MyClass_opVoid cb)
- {
- _cb = cb;
- }
-
- public void
- run()
- {
- _cb.ice_response();
- }
+ public
+ Thread_opVoid(Test.AMD_MyClass_opVoid cb)
+ {
+ _cb = cb;
+ }
+
+ public void
+ run()
+ {
+ _cb.ice_response();
+ }
- private Test.AMD_MyClass_opVoid _cb;
+ private Test.AMD_MyClass_opVoid _cb;
}
public
@@ -44,73 +44,73 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
shutdown_async(Test.AMD_MyClass_shutdown cb,
- Ice.Current current)
- {
- while(_opVoidThread != null)
- {
- try
- {
- _opVoidThread.join();
- _opVoidThread = null;
- }
- catch(java.lang.InterruptedException ex)
- {
- }
- }
+ Ice.Current current)
+ {
+ while(_opVoidThread != null)
+ {
+ try
+ {
+ _opVoidThread.join();
+ _opVoidThread = null;
+ }
+ catch(java.lang.InterruptedException ex)
+ {
+ }
+ }
_adapter.getCommunicator().shutdown();
- cb.ice_response();
+ cb.ice_response();
}
public void
opVoid_async(Test.AMD_MyClass_opVoid cb,
- Ice.Current current)
+ Ice.Current current)
{
- while(_opVoidThread != null)
- {
- try
- {
- _opVoidThread.join();
- _opVoidThread = null;
- }
- catch(java.lang.InterruptedException ex)
- {
- }
- }
+ while(_opVoidThread != null)
+ {
+ try
+ {
+ _opVoidThread.join();
+ _opVoidThread = null;
+ }
+ catch(java.lang.InterruptedException ex)
+ {
+ }
+ }
- _opVoidThread = new Thread_opVoid(cb);
- _opVoidThread.start();
+ _opVoidThread = new Thread_opVoid(cb);
+ _opVoidThread.start();
}
public void
opSleep_async(Test.AMD_MyClass_opSleep cb, int duration, Ice.Current current)
{
- while(true)
- {
- try
- {
- Thread.currentThread().sleep(duration);
- cb.ice_response();
- break;
- }
- catch(java.lang.InterruptedException ex)
- {
- }
- }
+ while(true)
+ {
+ try
+ {
+ Thread.currentThread().sleep(duration);
+ cb.ice_response();
+ break;
+ }
+ catch(java.lang.InterruptedException ex)
+ {
+ }
+ }
}
public void
opBool_async(Test.AMD_MyClass_opBool cb,
- boolean p1, boolean p2,
- Ice.Current current)
+ boolean p1, boolean p2,
+ Ice.Current current)
{
- cb.ice_response(p2, p1);
+ cb.ice_response(p2, p1);
}
public void
opBoolS_async(Test.AMD_MyClass_opBoolS cb,
- boolean[] p1, boolean[] p2,
- Ice.Current current)
+ boolean[] p1, boolean[] p2,
+ Ice.Current current)
{
boolean[] p3 = new boolean[p1.length + p2.length];
System.arraycopy(p1, 0, p3, 0, p1.length);
@@ -126,8 +126,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opBoolSS_async(Test.AMD_MyClass_opBoolSS cb,
- boolean[][] p1, boolean[][] p2,
- Ice.Current current)
+ boolean[][] p1, boolean[][] p2,
+ Ice.Current current)
{
boolean[][] p3 = new boolean[p1.length + p2.length][];
System.arraycopy(p1, 0, p3, 0, p1.length);
@@ -143,16 +143,16 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opByte_async(Test.AMD_MyClass_opByte cb,
- byte p1, byte p2,
- Ice.Current current)
+ byte p1, byte p2,
+ Ice.Current current)
{
cb.ice_response(p1, (byte)(p1 ^ p2));
}
public void
opByteBoolD_async(Test.AMD_MyClass_opByteBoolD cb,
- java.util.Map p1, java.util.Map p2,
- Ice.Current current)
+ java.util.Map p1, java.util.Map p2,
+ Ice.Current current)
{
java.util.Map p3 = p1;
java.util.Map r = new java.util.HashMap();
@@ -163,8 +163,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opByteS_async(Test.AMD_MyClass_opByteS cb,
- byte[] p1, byte[] p2,
- Ice.Current current)
+ byte[] p1, byte[] p2,
+ Ice.Current current)
{
byte[] p3 = new byte[p1.length];
for(int i = 0; i < p1.length; i++)
@@ -180,8 +180,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opByteSS_async(Test.AMD_MyClass_opByteSS cb,
- byte[][] p1, byte[][] p2,
- Ice.Current current)
+ byte[][] p1, byte[][] p2,
+ Ice.Current current)
{
byte[][] p3 = new byte[p1.length][];
for(int i = 0; i < p1.length; i++)
@@ -197,16 +197,16 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opFloatDouble_async(Test.AMD_MyClass_opFloatDouble cb,
- float p1, double p2,
- Ice.Current current)
+ float p1, double p2,
+ Ice.Current current)
{
cb.ice_response(p2, p1, p2);
}
public void
opFloatDoubleS_async(Test.AMD_MyClass_opFloatDoubleS cb,
- float[] p1, double[] p2,
- Ice.Current current)
+ float[] p1, double[] p2,
+ Ice.Current current)
{
float[] p3 = p1;
double[] p4 = new double[p2.length];
@@ -225,8 +225,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opFloatDoubleSS_async(Test.AMD_MyClass_opFloatDoubleSS cb,
- float[][] p1, double[][] p2,
- Ice.Current current)
+ float[][] p1, double[][] p2,
+ Ice.Current current)
{
float[][] p3 = p1;
double[][] p4 = new double[p2.length][];
@@ -242,8 +242,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opLongFloatD_async(Test.AMD_MyClass_opLongFloatD cb,
- java.util.Map p1, java.util.Map p2,
- Ice.Current current)
+ java.util.Map p1, java.util.Map p2,
+ Ice.Current current)
{
java.util.Map p3 = p1;
java.util.Map r = new java.util.HashMap();
@@ -254,27 +254,27 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opMyClass_async(Test.AMD_MyClass_opMyClass cb,
- Test.MyClassPrx p1,
- Ice.Current current)
+ Test.MyClassPrx p1,
+ Ice.Current current)
{
Test.MyClassPrx p2 = p1;
Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(
- _adapter.createProxy(_adapter.getCommunicator().stringToIdentity("noSuchIdentity")));
+ _adapter.createProxy(_adapter.getCommunicator().stringToIdentity("noSuchIdentity")));
cb.ice_response(Test.MyClassPrxHelper.uncheckedCast(_adapter.createProxy(_identity)), p2, p3);
}
public void
opMyEnum_async(Test.AMD_MyClass_opMyEnum cb,
- Test.MyEnum p1,
- Ice.Current current)
+ Test.MyEnum p1,
+ Ice.Current current)
{
cb.ice_response(Test.MyEnum.enum3, p1);
}
public void
opShortIntD_async(Test.AMD_MyClass_opShortIntD cb,
- java.util.Map p1, java.util.Map p2,
- Ice.Current current)
+ java.util.Map p1, java.util.Map p2,
+ Ice.Current current)
{
java.util.Map p3 = p1;
java.util.Map r = new java.util.HashMap();
@@ -285,16 +285,16 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opShortIntLong_async(Test.AMD_MyClass_opShortIntLong cb,
- short p1, int p2, long p3,
- Ice.Current current)
+ short p1, int p2, long p3,
+ Ice.Current current)
{
cb.ice_response(p3, p1, p2, p3);
}
public void
opShortIntLongS_async(Test.AMD_MyClass_opShortIntLongS cb,
- short[] p1, int[] p2, long[] p3,
- Ice.Current current)
+ short[] p1, int[] p2, long[] p3,
+ Ice.Current current)
{
short[] p4 = p1;
int[] p5 = new int[p2.length];
@@ -310,8 +310,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opShortIntLongSS_async(Test.AMD_MyClass_opShortIntLongSS cb,
- short[][] p1, int[][] p2, long[][] p3,
- Ice.Current current)
+ short[][] p1, int[][] p2, long[][] p3,
+ Ice.Current current)
{
short[][] p4 = p1;
int[][] p5 = new int[p2.length][];
@@ -327,16 +327,16 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opString_async(Test.AMD_MyClass_opString cb,
- String p1, String p2,
- Ice.Current current)
+ String p1, String p2,
+ Ice.Current current)
{
- cb.ice_response(p1 + " " + p2, p2 + " " + p1);
+ cb.ice_response(p1 + " " + p2, p2 + " " + p1);
}
public void
opStringMyEnumD_async(Test.AMD_MyClass_opStringMyEnumD cb,
- java.util.Map p1, java.util.Map p2,
- Ice.Current current)
+ java.util.Map p1, java.util.Map p2,
+ Ice.Current current)
{
java.util.Map p3 = p1;
java.util.Map r = new java.util.HashMap();
@@ -348,11 +348,11 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opIntS_async(Test.AMD_MyClass_opIntS cb, int[] s, Ice.Current current)
{
- int[] r = new int[s.length];
- for(int i = 0; i < r.length; ++i)
- {
- r[i] = -s[i];
- }
+ int[] r = new int[s.length];
+ for(int i = 0; i < r.length; ++i)
+ {
+ r[i] = -s[i];
+ }
cb.ice_response(r);
}
@@ -371,19 +371,19 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opDoubleMarshaling_async(Test.AMD_MyClass_opDoubleMarshaling cb, double p1, double[] p2, Ice.Current current)
{
- double d = 1278312346.0 / 13.0;
- test(p1 == d);
- for(int i = 0; i < p2.length; ++i)
- {
- test(p2[i] == d);
- }
- cb.ice_response();
+ double d = 1278312346.0 / 13.0;
+ test(p1 == d);
+ for(int i = 0; i < p2.length; ++i)
+ {
+ test(p2[i] == d);
+ }
+ cb.ice_response();
}
public void
opStringS_async(Test.AMD_MyClass_opStringS cb,
- String[] p1, String[] p2,
- Ice.Current current)
+ String[] p1, String[] p2,
+ Ice.Current current)
{
String[] p3 = new String[p1.length + p2.length];
System.arraycopy(p1, 0, p3, 0, p1.length);
@@ -399,8 +399,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opStringSS_async(Test.AMD_MyClass_opStringSS cb,
- String[][] p1, String[][] p2,
- Ice.Current current)
+ String[][] p1, String[][] p2,
+ Ice.Current current)
{
String[][] p3 = new String[p1.length + p2.length][];
System.arraycopy(p1, 0, p3, 0, p1.length);
@@ -416,8 +416,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opStringSSS_async(Test.AMD_MyClass_opStringSSS cb,
- String[][][] p1, String[][][] p2,
- Ice.Current current)
+ String[][][] p1, String[][][] p2,
+ Ice.Current current)
{
String[][][] p3 = new String[p1.length + p2.length][][];
System.arraycopy(p1, 0, p3, 0, p1.length);
@@ -433,8 +433,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opStringStringD_async(Test.AMD_MyClass_opStringStringD cb,
- java.util.Map p1, java.util.Map p2,
- Ice.Current current)
+ java.util.Map p1, java.util.Map p2,
+ Ice.Current current)
{
java.util.Map p3 = p1;
java.util.Map r = new java.util.HashMap();
@@ -445,8 +445,8 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opStruct_async(Test.AMD_MyClass_opStruct cb,
- Test.Structure p1, Test.Structure p2,
- Ice.Current current)
+ Test.Structure p1, Test.Structure p2,
+ Ice.Current current)
{
Test.Structure p3 = p1;
p3.s.s = "a new string";
@@ -455,9 +455,9 @@ public final class MyDerivedClassI extends Test.MyDerivedClass
public void
opDerived_async(Test.AMD_MyDerivedClass_opDerived cb,
- Ice.Current current)
+ Ice.Current current)
{
- cb.ice_response();
+ cb.ice_response();
}
private Ice.ObjectAdapter _adapter;
diff --git a/java/test/Ice/operationsAMD/Server.java b/java/test/Ice/operationsAMD/Server.java
index c69b403de75..b60fa538c33 100644
--- a/java/test/Ice/operationsAMD/Server.java
+++ b/java/test/Ice/operationsAMD/Server.java
@@ -31,11 +31,11 @@ public class Server
try
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.Warn.Connections", "0");
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
communicator = Ice.Util.initialize(argsH, initData);
status = run(args, communicator);
@@ -59,7 +59,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/operationsAMD/TestAMD.ice b/java/test/Ice/operationsAMD/TestAMD.ice
index 00df3c3a676..8efa097d48a 100644
--- a/java/test/Ice/operationsAMD/TestAMD.ice
+++ b/java/test/Ice/operationsAMD/TestAMD.ice
@@ -75,75 +75,75 @@ dictionary<string, MyEnum> StringMyEnumD;
void opSleep(int duration);
byte opByte(byte p1, byte p2,
- out byte p3);
+ out byte p3);
bool opBool(bool p1, bool p2,
- out bool p3);
+ out bool p3);
long opShortIntLong(short p1, int p2, long p3,
- out short p4, out int p5, out long p6);
+ out short p4, out int p5, out long p6);
double opFloatDouble(float p1, double p2,
- out float p3, out double p4);
+ out float p3, out double p4);
string opString(string p1, string p2,
- out string p3);
+ out string p3);
MyEnum opMyEnum(MyEnum p1, out MyEnum p2);
MyClass* opMyClass(MyClass* p1, out MyClass* p2, out MyClass* p3);
Structure opStruct(Structure p1, Structure p2,
- out Structure p3);
+ out Structure p3);
ByteS opByteS(ByteS p1, ByteS p2,
- out ByteS p3);
+ out ByteS p3);
BoolS opBoolS(BoolS p1, BoolS p2,
- out BoolS p3);
+ out BoolS p3);
LongS opShortIntLongS(Test::ShortS p1, IntS p2, LongS p3,
- out ::Test::ShortS p4, out IntS p5, out LongS p6);
+ out ::Test::ShortS p4, out IntS p5, out LongS p6);
DoubleS opFloatDoubleS(FloatS p1, DoubleS p2,
- out FloatS p3, out DoubleS p4);
+ out FloatS p3, out DoubleS p4);
StringS opStringS(StringS p1, StringS p2,
- out StringS p3);
+ out StringS p3);
ByteSS opByteSS(ByteSS p1, ByteSS p2,
- out ByteSS p3);
+ out ByteSS p3);
BoolSS opBoolSS(BoolSS p1, BoolSS p2,
- out BoolSS p3);
+ out BoolSS p3);
LongSS opShortIntLongSS(ShortSS p1, IntSS p2, LongSS p3,
- out ShortSS p4, out IntSS p5, out LongSS p6);
+ out ShortSS p4, out IntSS p5, out LongSS p6);
DoubleSS opFloatDoubleSS(FloatSS p1, DoubleSS p2,
- out FloatSS p3, out DoubleSS p4);
+ out FloatSS p3, out DoubleSS p4);
StringSS opStringSS(StringSS p1, StringSS p2,
- out StringSS p3);
+ out StringSS p3);
StringSSS opStringSSS(StringSSS p1, StringSSS p2,
- out StringSSS p3);
+ out StringSSS p3);
ByteBoolD opByteBoolD(ByteBoolD p1, ByteBoolD p2,
- out ByteBoolD p3);
+ out ByteBoolD p3);
ShortIntD opShortIntD(ShortIntD p1, ShortIntD p2,
- out ShortIntD p3);
+ out ShortIntD p3);
LongFloatD opLongFloatD(LongFloatD p1, LongFloatD p2,
- out LongFloatD p3);
+ out LongFloatD p3);
StringStringD opStringStringD(StringStringD p1, StringStringD p2,
- out StringStringD p3);
+ out StringStringD p3);
StringMyEnumD opStringMyEnumD(StringMyEnumD p1, StringMyEnumD p2,
- out StringMyEnumD p3);
+ out StringMyEnumD p3);
IntS opIntS(IntS s);
diff --git a/java/test/Ice/package/Client.java b/java/test/Ice/package/Client.java
index c0e7bf3b020..6593ce9b6f5 100644
--- a/java/test/Ice/package/Client.java
+++ b/java/test/Ice/package/Client.java
@@ -47,7 +47,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/package/Server.java b/java/test/Ice/package/Server.java
index 76daf0eb098..6833dc9f669 100644
--- a/java/test/Ice/package/Server.java
+++ b/java/test/Ice/package/Server.java
@@ -51,7 +51,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/retry/AllTests.java b/java/test/Ice/retry/AllTests.java
index 28385951ee1..e7c2f061ecd 100644
--- a/java/test/Ice/retry/AllTests.java
+++ b/java/test/Ice/retry/AllTests.java
@@ -94,8 +94,8 @@ public class AllTests
public void
ice_exception(Ice.LocalException ex)
{
- test(ex instanceof Ice.ConnectionLostException);
- callback.called();
+ test(ex instanceof Ice.ConnectionLostException);
+ callback.called();
}
public boolean
@@ -115,7 +115,7 @@ public class AllTests
String ref = "retry:default -p 12010 -t 10000";
Ice.ObjectPrx base1 = communicator.stringToProxy(ref);
test(base1 != null);
- Ice.ObjectPrx base2 = communicator.stringToProxy(ref);
+ Ice.ObjectPrx base2 = communicator.stringToProxy(ref);
test(base2 != null);
out.println("ok");
@@ -123,51 +123,51 @@ public class AllTests
out.flush();
Test.RetryPrx retry1 = Test.RetryPrxHelper.checkedCast(base1);
test(retry1 != null);
- test(retry1.equals(base1));
+ test(retry1.equals(base1));
Test.RetryPrx retry2 = Test.RetryPrxHelper.checkedCast(base2);
test(retry2 != null);
- test(retry2.equals(base2));
+ test(retry2.equals(base2));
out.println("ok");
- out.print("calling regular operation with first proxy... ");
- out.flush();
- retry1.op(false);
- out.println("ok");
-
- out.print("calling operation to kill connection with second proxy... ");
- out.flush();
- try
- {
- retry2.op(true);
- test(false);
- }
- catch(Ice.ConnectionLostException ex)
- {
- out.println("ok");
- }
+ out.print("calling regular operation with first proxy... ");
+ out.flush();
+ retry1.op(false);
+ out.println("ok");
+
+ out.print("calling operation to kill connection with second proxy... ");
+ out.flush();
+ try
+ {
+ retry2.op(true);
+ test(false);
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ out.println("ok");
+ }
out.print("calling regular operation with first proxy again... ");
out.flush();
- retry1.op(false);
- out.println("ok");
-
- AMIRegular cb1 = new AMIRegular();
- AMIException cb2 = new AMIException();
-
- out.print("calling regular AMI operation with first proxy... ");
- retry1.op_async(cb1, false);
- test(cb1.check());
- out.println("ok");
-
- out.print("calling AMI operation to kill connection with second proxy... ");
- retry2.op_async(cb2, true);
- test(cb2.check());
- out.println("ok");
-
- out.print("calling regular AMI operation with first proxy again... ");
- retry1.op_async(cb1, false);
- test(cb1.check());
- out.println("ok");
+ retry1.op(false);
+ out.println("ok");
+
+ AMIRegular cb1 = new AMIRegular();
+ AMIException cb2 = new AMIException();
+
+ out.print("calling regular AMI operation with first proxy... ");
+ retry1.op_async(cb1, false);
+ test(cb1.check());
+ out.println("ok");
+
+ out.print("calling AMI operation to kill connection with second proxy... ");
+ retry2.op_async(cb2, true);
+ test(cb2.check());
+ out.println("ok");
+
+ out.print("calling regular AMI operation with first proxy again... ");
+ retry1.op_async(cb1, false);
+ test(cb1.check());
+ out.println("ok");
return retry1;
}
diff --git a/java/test/Ice/retry/Client.java b/java/test/Ice/retry/Client.java
index 3200822416e..d801ad6b535 100644
--- a/java/test/Ice/retry/Client.java
+++ b/java/test/Ice/retry/Client.java
@@ -25,22 +25,22 @@ public class Client
try
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
- //
- // For this test, we want to disable retries.
- //
- initData.properties.setProperty("Ice.RetryIntervals", "-1");
+ //
+ // For this test, we want to disable retries.
+ //
+ initData.properties.setProperty("Ice.RetryIntervals", "-1");
- //
- // We don't want connection warnings because of the timeout test.
- //
- initData.properties.setProperty("Ice.Warn.Connections", "0");
+ //
+ // We don't want connection warnings because of the timeout test.
+ //
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
communicator = Ice.Util.initialize(argsH, initData);
-
+
status = run(argsH.value, communicator, System.out);
}
catch(Ice.LocalException ex)
@@ -62,7 +62,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/retry/RetryI.java b/java/test/Ice/retry/RetryI.java
index ef6dfcdc4c7..c8354acdbfa 100644
--- a/java/test/Ice/retry/RetryI.java
+++ b/java/test/Ice/retry/RetryI.java
@@ -20,9 +20,9 @@ public final class RetryI extends _RetryDisp
op(boolean kill, Ice.Current current)
{
if(kill)
- {
- current.con.close(true);
- }
+ {
+ current.con.close(true);
+ }
}
public void
diff --git a/java/test/Ice/retry/Server.java b/java/test/Ice/retry/Server.java
index ae0e79d2886..25cb40a1445 100644
--- a/java/test/Ice/retry/Server.java
+++ b/java/test/Ice/retry/Server.java
@@ -12,15 +12,15 @@ public class Server
public static int
run(String[] args, Ice.Communicator communicator, java.io.PrintStream out)
{
- //
- // When running as a MIDlet the properties for the server may be
- // overridden by configuration. If it isn't then we assume
- // defaults.
- //
- if(communicator.getProperties().getProperty("Ice.OA.TestAdapter.Endpoints").length() == 0)
- {
- communicator.getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000");
- }
+ //
+ // When running as a MIDlet the properties for the server may be
+ // overridden by configuration. If it isn't then we assume
+ // defaults.
+ //
+ if(communicator.getProperties().getProperty("Ice.OA.TestAdapter.Endpoints").length() == 0)
+ {
+ communicator.getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ }
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
adapter.add(new RetryI(), communicator.stringToIdentity("retry"));
@@ -60,7 +60,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/servantLocator/AllTests.java b/java/test/Ice/servantLocator/AllTests.java
index eaf730541b0..74f19f9e24f 100644
--- a/java/test/Ice/servantLocator/AllTests.java
+++ b/java/test/Ice/servantLocator/AllTests.java
@@ -24,101 +24,101 @@ public class AllTests
public static void
testExceptions(TestIntfPrx obj, boolean collocated)
{
- try
- {
- obj.requestFailedException();
- test(false);
- }
- catch(ObjectNotExistException ex)
- {
- if(!collocated)
- {
- test(ex.id.equals(obj.ice_getIdentity()));
- test(ex.facet.equals(obj.ice_getFacet()));
- test(ex.operation.equals("requestFailedException"));
- }
- }
-
- try
- {
- obj.unknownUserException();
- test(false);
- }
- catch(UnknownUserException ex)
- {
- test(ex.unknown.equals("reason"));
- }
-
- try
- {
- obj.unknownLocalException();
- test(false);
- }
- catch(UnknownLocalException ex)
- {
- test(ex.unknown.equals("reason"));
- }
-
- try
- {
- obj.unknownException();
- test(false);
- }
- catch(UnknownException ex)
- {
- test(ex.unknown.equals("reason"));
- }
-
- //
- // User exceptions are checked exceptions
- //
-// try
-// {
-// obj.userException();
-// test(false);
-// }
-// catch(UnknownUserException ex)
-// {
-// //System.err.println(ex.unknown);
-// test(!collocated);
-// test(ex.unknown.equals("Test::TestIntfUserException"));
-// }
-// catch(TestIntfUserException ex)
-// {
-// test(collocated);
-// }
-
- try
- {
- obj.localException();
- test(false);
- }
- catch(UnknownLocalException ex)
- {
- //System.err.println(ex.unknown);
- test(!collocated);
- test(ex.unknown.indexOf("Ice.SocketException") >= 0);
- }
- catch(SocketException ex)
- {
- test(collocated);
- }
-
- try
- {
- obj.javaException();
- test(false);
- }
- catch(UnknownException ex)
- {
- //System.err.println(ex.unknown);
- test(!collocated);
- test(ex.unknown.indexOf("java.lang.RuntimeException: message") >= 0);
- }
- catch(java.lang.RuntimeException ex)
- {
- test(collocated);
- }
+ try
+ {
+ obj.requestFailedException();
+ test(false);
+ }
+ catch(ObjectNotExistException ex)
+ {
+ if(!collocated)
+ {
+ test(ex.id.equals(obj.ice_getIdentity()));
+ test(ex.facet.equals(obj.ice_getFacet()));
+ test(ex.operation.equals("requestFailedException"));
+ }
+ }
+
+ try
+ {
+ obj.unknownUserException();
+ test(false);
+ }
+ catch(UnknownUserException ex)
+ {
+ test(ex.unknown.equals("reason"));
+ }
+
+ try
+ {
+ obj.unknownLocalException();
+ test(false);
+ }
+ catch(UnknownLocalException ex)
+ {
+ test(ex.unknown.equals("reason"));
+ }
+
+ try
+ {
+ obj.unknownException();
+ test(false);
+ }
+ catch(UnknownException ex)
+ {
+ test(ex.unknown.equals("reason"));
+ }
+
+ //
+ // User exceptions are checked exceptions
+ //
+// try
+// {
+// obj.userException();
+// test(false);
+// }
+// catch(UnknownUserException ex)
+// {
+// //System.err.println(ex.unknown);
+// test(!collocated);
+// test(ex.unknown.equals("Test::TestIntfUserException"));
+// }
+// catch(TestIntfUserException ex)
+// {
+// test(collocated);
+// }
+
+ try
+ {
+ obj.localException();
+ test(false);
+ }
+ catch(UnknownLocalException ex)
+ {
+ //System.err.println(ex.unknown);
+ test(!collocated);
+ test(ex.unknown.indexOf("Ice.SocketException") >= 0);
+ }
+ catch(SocketException ex)
+ {
+ test(collocated);
+ }
+
+ try
+ {
+ obj.javaException();
+ test(false);
+ }
+ catch(UnknownException ex)
+ {
+ //System.err.println(ex.unknown);
+ test(!collocated);
+ test(ex.unknown.indexOf("java.lang.RuntimeException: message") >= 0);
+ }
+ catch(java.lang.RuntimeException ex)
+ {
+ test(collocated);
+ }
}
public static TestIntfPrx
@@ -138,54 +138,54 @@ public class AllTests
test(obj.equals(base));
System.out.println("ok");
- System.out.print("testing servant locator... ");
+ System.out.print("testing servant locator... ");
System.out.flush();
- base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000");
- obj = TestIntfPrxHelper.checkedCast(base);
- try
- {
- TestIntfPrxHelper.checkedCast(communicator.stringToProxy("category/unknown:default -p 12010 -t 10000"));
- }
- catch(ObjectNotExistException ex)
- {
- }
- System.out.println("ok");
-
- System.out.print("testing default servant locator... ");
+ base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000");
+ obj = TestIntfPrxHelper.checkedCast(base);
+ try
+ {
+ TestIntfPrxHelper.checkedCast(communicator.stringToProxy("category/unknown:default -p 12010 -t 10000"));
+ }
+ catch(ObjectNotExistException ex)
+ {
+ }
+ System.out.println("ok");
+
+ System.out.print("testing default servant locator... ");
System.out.flush();
- base = communicator.stringToProxy("anothercat/locate:default -p 12010 -t 10000");
- obj = TestIntfPrxHelper.checkedCast(base);
- base = communicator.stringToProxy("locate:default -p 12010 -t 10000");
- obj = TestIntfPrxHelper.checkedCast(base);
- try
- {
- TestIntfPrxHelper.checkedCast(communicator.stringToProxy("anothercat/unknown:default -p 12010 -t 10000"));
- }
- catch(ObjectNotExistException ex)
- {
- }
- try
- {
- TestIntfPrxHelper.checkedCast(communicator.stringToProxy("unknown:default -p 12010 -t 10000"));
- }
- catch(ObjectNotExistException ex)
- {
- }
- System.out.println("ok");
-
- System.out.print("testing locate exceptions... ");
+ base = communicator.stringToProxy("anothercat/locate:default -p 12010 -t 10000");
+ obj = TestIntfPrxHelper.checkedCast(base);
+ base = communicator.stringToProxy("locate:default -p 12010 -t 10000");
+ obj = TestIntfPrxHelper.checkedCast(base);
+ try
+ {
+ TestIntfPrxHelper.checkedCast(communicator.stringToProxy("anothercat/unknown:default -p 12010 -t 10000"));
+ }
+ catch(ObjectNotExistException ex)
+ {
+ }
+ try
+ {
+ TestIntfPrxHelper.checkedCast(communicator.stringToProxy("unknown:default -p 12010 -t 10000"));
+ }
+ catch(ObjectNotExistException ex)
+ {
+ }
+ System.out.println("ok");
+
+ System.out.print("testing locate exceptions... ");
System.out.flush();
- base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000");
- obj = TestIntfPrxHelper.checkedCast(base);
- testExceptions(obj, collocated);
- System.out.println("ok");
+ base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000");
+ obj = TestIntfPrxHelper.checkedCast(base);
+ testExceptions(obj, collocated);
+ System.out.println("ok");
- System.out.print("testing finished exceptions... ");
+ System.out.print("testing finished exceptions... ");
System.out.flush();
- base = communicator.stringToProxy("category/finished:default -p 12010 -t 10000");
- obj = TestIntfPrxHelper.checkedCast(base);
- testExceptions(obj, collocated);
- System.out.println("ok");
+ base = communicator.stringToProxy("category/finished:default -p 12010 -t 10000");
+ obj = TestIntfPrxHelper.checkedCast(base);
+ testExceptions(obj, collocated);
+ System.out.println("ok");
return obj;
}
diff --git a/java/test/Ice/servantLocator/Client.java b/java/test/Ice/servantLocator/Client.java
index 403616d3c10..808b9c46d6e 100644
--- a/java/test/Ice/servantLocator/Client.java
+++ b/java/test/Ice/servantLocator/Client.java
@@ -17,7 +17,7 @@ public class Client
run(String[] args)
{
TestIntfPrx obj = AllTests.allTests(communicator(), false);
- obj.shutdown();
+ obj.shutdown();
return 0;
}
}
diff --git a/java/test/Ice/servantLocator/Collocated.java b/java/test/Ice/servantLocator/Collocated.java
index 96147dd2775..7600e2c2a9a 100644
--- a/java/test/Ice/servantLocator/Collocated.java
+++ b/java/test/Ice/servantLocator/Collocated.java
@@ -15,12 +15,12 @@ public class Collocated
run(String[] args)
{
communicator().getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000");
- communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0");
+ communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0");
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter");
adapter.addServantLocator(new ServantLocatorI("category"), "category");
adapter.addServantLocator(new ServantLocatorI(""), "");
- adapter.add(new TestI(), communicator().stringToIdentity("asm"));
+ adapter.add(new TestI(), communicator().stringToIdentity("asm"));
AllTests.allTests(communicator(), true);
diff --git a/java/test/Ice/servantLocator/ServantLocatorI.java b/java/test/Ice/servantLocator/ServantLocatorI.java
index 7fab16bfb87..ec40d3fbc5f 100644
--- a/java/test/Ice/servantLocator/ServantLocatorI.java
+++ b/java/test/Ice/servantLocator/ServantLocatorI.java
@@ -15,7 +15,7 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public
ServantLocatorI(String category)
{
- _category = category;
+ _category = category;
_deactivated = false;
}
@@ -39,22 +39,22 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
locate(Ice.Current current, Ice.LocalObjectHolder cookie)
{
synchronized(this)
- {
- test(!_deactivated);
- }
+ {
+ test(!_deactivated);
+ }
- test(current.id.category.equals(_category) || _category.length() == 0);
-
- if(current.id.name.equals("unknown"))
- {
- return null;
- }
+ test(current.id.category.equals(_category) || _category.length() == 0);
+
+ if(current.id.name.equals("unknown"))
+ {
+ return null;
+ }
- test(current.id.name.equals("locate") || current.id.name.equals("finished"));
- if(current.id.name.equals("locate"))
- {
- exception(current);
- }
+ test(current.id.name.equals("locate") || current.id.name.equals("finished"));
+ if(current.id.name.equals("locate"))
+ {
+ exception(current);
+ }
cookie.value = new CookieI();
@@ -64,19 +64,19 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public void
finished(Ice.Current current, Ice.Object servant, Ice.LocalObject cookie)
{
- synchronized(this)
- {
- test(!_deactivated);
- }
+ synchronized(this)
+ {
+ test(!_deactivated);
+ }
- test(current.id.category.equals(_category) || _category.length() == 0);
- test(current.id.name.equals("locate") || current.id.name.equals("finished"));
-
- if(current.id.name.equals("finished"))
- {
- exception(current);
- }
-
+ test(current.id.category.equals(_category) || _category.length() == 0);
+ test(current.id.name.equals("locate") || current.id.name.equals("finished"));
+
+ if(current.id.name.equals("finished"))
+ {
+ exception(current);
+ }
+
Cookie co = (Cookie)cookie;
test(co.message().equals("blahblah"));
}
@@ -84,49 +84,49 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public synchronized void
deactivate(String category)
{
- synchronized(this)
- {
- test(!_deactivated);
+ synchronized(this)
+ {
+ test(!_deactivated);
- _deactivated = true;
- }
+ _deactivated = true;
+ }
}
private void
exception(Ice.Current current)
{
- if(current.operation.equals("requestFailedException"))
- {
- throw new ObjectNotExistException();
- }
- else if(current.operation.equals("unknownUserException"))
- {
- throw new UnknownUserException("reason");
- }
- else if(current.operation.equals("unknownLocalException"))
- {
- throw new UnknownLocalException("reason");
- }
- else if(current.operation.equals("unknownException"))
- {
- throw new UnknownException("reason");
- }
- //
- // User exceptions are checked exceptions in Java, so it's not
- // possible to throw it from the servant locator.
- //
-// else if(current.operation.equals("userException"))
-// {
-// throw new TestIntfUserException();
-// }
- else if(current.operation.equals("localException"))
- {
- throw new SocketException(0);
- }
- else if(current.operation.equals("javaException"))
- {
- throw new java.lang.RuntimeException("message");
- }
+ if(current.operation.equals("requestFailedException"))
+ {
+ throw new ObjectNotExistException();
+ }
+ else if(current.operation.equals("unknownUserException"))
+ {
+ throw new UnknownUserException("reason");
+ }
+ else if(current.operation.equals("unknownLocalException"))
+ {
+ throw new UnknownLocalException("reason");
+ }
+ else if(current.operation.equals("unknownException"))
+ {
+ throw new UnknownException("reason");
+ }
+ //
+ // User exceptions are checked exceptions in Java, so it's not
+ // possible to throw it from the servant locator.
+ //
+// else if(current.operation.equals("userException"))
+// {
+// throw new TestIntfUserException();
+// }
+ else if(current.operation.equals("localException"))
+ {
+ throw new SocketException(0);
+ }
+ else if(current.operation.equals("javaException"))
+ {
+ throw new java.lang.RuntimeException("message");
+ }
}
private boolean _deactivated;
diff --git a/java/test/Ice/servantLocator/Server.java b/java/test/Ice/servantLocator/Server.java
index a6e9f74be45..25bf925deb5 100644
--- a/java/test/Ice/servantLocator/Server.java
+++ b/java/test/Ice/servantLocator/Server.java
@@ -15,12 +15,12 @@ public class Server
run(String[] args)
{
communicator().getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000");
- communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0");
+ communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0");
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter");
adapter.addServantLocator(new ServantLocatorI("category"), "category");
adapter.addServantLocator(new ServantLocatorI(""), "");
- adapter.add(new TestI(), communicator().stringToIdentity("asm"));
+ adapter.add(new TestI(), communicator().stringToIdentity("asm"));
adapter.activate();
adapter.waitForDeactivate();
@@ -33,7 +33,7 @@ public class Server
{
TestServer app = new TestServer();
int result = app.main("Server", args);
- System.gc();
+ System.gc();
System.exit(result);
}
}
diff --git a/java/test/Ice/servantLocatorAMD/ServantLocatorI.java b/java/test/Ice/servantLocatorAMD/ServantLocatorI.java
index 7fab16bfb87..ec40d3fbc5f 100644
--- a/java/test/Ice/servantLocatorAMD/ServantLocatorI.java
+++ b/java/test/Ice/servantLocatorAMD/ServantLocatorI.java
@@ -15,7 +15,7 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public
ServantLocatorI(String category)
{
- _category = category;
+ _category = category;
_deactivated = false;
}
@@ -39,22 +39,22 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
locate(Ice.Current current, Ice.LocalObjectHolder cookie)
{
synchronized(this)
- {
- test(!_deactivated);
- }
+ {
+ test(!_deactivated);
+ }
- test(current.id.category.equals(_category) || _category.length() == 0);
-
- if(current.id.name.equals("unknown"))
- {
- return null;
- }
+ test(current.id.category.equals(_category) || _category.length() == 0);
+
+ if(current.id.name.equals("unknown"))
+ {
+ return null;
+ }
- test(current.id.name.equals("locate") || current.id.name.equals("finished"));
- if(current.id.name.equals("locate"))
- {
- exception(current);
- }
+ test(current.id.name.equals("locate") || current.id.name.equals("finished"));
+ if(current.id.name.equals("locate"))
+ {
+ exception(current);
+ }
cookie.value = new CookieI();
@@ -64,19 +64,19 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public void
finished(Ice.Current current, Ice.Object servant, Ice.LocalObject cookie)
{
- synchronized(this)
- {
- test(!_deactivated);
- }
+ synchronized(this)
+ {
+ test(!_deactivated);
+ }
- test(current.id.category.equals(_category) || _category.length() == 0);
- test(current.id.name.equals("locate") || current.id.name.equals("finished"));
-
- if(current.id.name.equals("finished"))
- {
- exception(current);
- }
-
+ test(current.id.category.equals(_category) || _category.length() == 0);
+ test(current.id.name.equals("locate") || current.id.name.equals("finished"));
+
+ if(current.id.name.equals("finished"))
+ {
+ exception(current);
+ }
+
Cookie co = (Cookie)cookie;
test(co.message().equals("blahblah"));
}
@@ -84,49 +84,49 @@ public final class ServantLocatorI extends Ice.LocalObjectImpl implements Ice.Se
public synchronized void
deactivate(String category)
{
- synchronized(this)
- {
- test(!_deactivated);
+ synchronized(this)
+ {
+ test(!_deactivated);
- _deactivated = true;
- }
+ _deactivated = true;
+ }
}
private void
exception(Ice.Current current)
{
- if(current.operation.equals("requestFailedException"))
- {
- throw new ObjectNotExistException();
- }
- else if(current.operation.equals("unknownUserException"))
- {
- throw new UnknownUserException("reason");
- }
- else if(current.operation.equals("unknownLocalException"))
- {
- throw new UnknownLocalException("reason");
- }
- else if(current.operation.equals("unknownException"))
- {
- throw new UnknownException("reason");
- }
- //
- // User exceptions are checked exceptions in Java, so it's not
- // possible to throw it from the servant locator.
- //
-// else if(current.operation.equals("userException"))
-// {
-// throw new TestIntfUserException();
-// }
- else if(current.operation.equals("localException"))
- {
- throw new SocketException(0);
- }
- else if(current.operation.equals("javaException"))
- {
- throw new java.lang.RuntimeException("message");
- }
+ if(current.operation.equals("requestFailedException"))
+ {
+ throw new ObjectNotExistException();
+ }
+ else if(current.operation.equals("unknownUserException"))
+ {
+ throw new UnknownUserException("reason");
+ }
+ else if(current.operation.equals("unknownLocalException"))
+ {
+ throw new UnknownLocalException("reason");
+ }
+ else if(current.operation.equals("unknownException"))
+ {
+ throw new UnknownException("reason");
+ }
+ //
+ // User exceptions are checked exceptions in Java, so it's not
+ // possible to throw it from the servant locator.
+ //
+// else if(current.operation.equals("userException"))
+// {
+// throw new TestIntfUserException();
+// }
+ else if(current.operation.equals("localException"))
+ {
+ throw new SocketException(0);
+ }
+ else if(current.operation.equals("javaException"))
+ {
+ throw new java.lang.RuntimeException("message");
+ }
}
private boolean _deactivated;
diff --git a/java/test/Ice/servantLocatorAMD/Server.java b/java/test/Ice/servantLocatorAMD/Server.java
index a6e9f74be45..25bf925deb5 100644
--- a/java/test/Ice/servantLocatorAMD/Server.java
+++ b/java/test/Ice/servantLocatorAMD/Server.java
@@ -15,12 +15,12 @@ public class Server
run(String[] args)
{
communicator().getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000");
- communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0");
+ communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0");
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter");
adapter.addServantLocator(new ServantLocatorI("category"), "category");
adapter.addServantLocator(new ServantLocatorI(""), "");
- adapter.add(new TestI(), communicator().stringToIdentity("asm"));
+ adapter.add(new TestI(), communicator().stringToIdentity("asm"));
adapter.activate();
adapter.waitForDeactivate();
@@ -33,7 +33,7 @@ public class Server
{
TestServer app = new TestServer();
int result = app.main("Server", args);
- System.gc();
+ System.gc();
System.exit(result);
}
}
diff --git a/java/test/Ice/servantLocatorAMD/TestI.java b/java/test/Ice/servantLocatorAMD/TestI.java
index bbdbecb3a28..eaa5657feba 100644
--- a/java/test/Ice/servantLocatorAMD/TestI.java
+++ b/java/test/Ice/servantLocatorAMD/TestI.java
@@ -14,31 +14,31 @@ public final class TestI extends _TestIntfDisp
public void
requestFailedException_async(AMD_TestIntf_requestFailedException cb, Ice.Current current)
{
- cb.ice_response();
+ cb.ice_response();
}
public void
unknownUserException_async(AMD_TestIntf_unknownUserException cb, Ice.Current current)
{
- cb.ice_response();
+ cb.ice_response();
}
public void
unknownLocalException_async(AMD_TestIntf_unknownLocalException cb, Ice.Current current)
{
- cb.ice_response();
+ cb.ice_response();
}
public void
unknownException_async(AMD_TestIntf_unknownException cb, Ice.Current current)
{
- cb.ice_response();
+ cb.ice_response();
}
public void
localException_async(AMD_TestIntf_localException cb, Ice.Current current)
{
- cb.ice_response();
+ cb.ice_response();
}
// public void
@@ -50,13 +50,13 @@ public final class TestI extends _TestIntfDisp
public void
javaException_async(AMD_TestIntf_javaException cb, Ice.Current current)
{
- cb.ice_response();
+ cb.ice_response();
}
public void
shutdown_async(AMD_TestIntf_shutdown cb, Ice.Current current)
{
current.adapter.deactivate();
- cb.ice_response();
+ cb.ice_response();
}
}
diff --git a/java/test/Ice/slicing/exceptions/csrc/AllTests.java b/java/test/Ice/slicing/exceptions/csrc/AllTests.java
index 14870c18a3f..f2684bc9aff 100644
--- a/java/test/Ice/slicing/exceptions/csrc/AllTests.java
+++ b/java/test/Ice/slicing/exceptions/csrc/AllTests.java
@@ -22,606 +22,606 @@ 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;
+ 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_TestIntf_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("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::KnownDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::KnownDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::KnownMostDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_knownIntermediateAsKnownIntermediate
+ extends AMI_TestIntf_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("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_knownMostDerivedAsKnownIntermediate
+ extends AMI_TestIntf_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("Test::KnownMostDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_knownMostDerivedAsKnownMostDerived
+ extends AMI_TestIntf_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("Test::KnownMostDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_unknownMostDerived1AsKnownIntermediate
+ extends AMI_TestIntf_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("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::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_TestIntf_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("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ 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("Test::Base"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
public static TestIntfPrx
@@ -641,395 +641,395 @@ public class AllTests
test(test.equals(base));
System.out.println("ok");
- System.out.print("base... ");
+ System.out.print("base... ");
+ System.out.flush();
+ {
+ try
+ {
+ test.baseAsBase();
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("Base.b"));
+ test(b.ice_name().equals("Test::Base"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.unknownDerivedAsBase();
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("UnknownDerived.b"));
+ test(b.ice_name().equals("Test::Base"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.knownDerivedAsBase();
+ test(false);
+ }
+ catch(KnownDerived k)
+ {
+ test(k.b.equals("KnownDerived.b"));
+ test(k.kd.equals("KnownDerived.kd"));
+ test(k.ice_name().equals("Test::KnownDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.knownDerivedAsKnownDerived();
+ test(false);
+ }
+ catch(KnownDerived k)
+ {
+ test(k.b.equals("KnownDerived.b"));
+ test(k.kd.equals("KnownDerived.kd"));
+ test(k.ice_name().equals("Test::KnownDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.unknownIntermediateAsBase();
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("UnknownIntermediate.b"));
+ test(b.ice_name().equals("Test::Base"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.knownIntermediateAsBase();
+ test(false);
+ }
+ catch(KnownIntermediate ki)
+ {
+ test(ki.b.equals("KnownIntermediate.b"));
+ test(ki.ki.equals("KnownIntermediate.ki"));
+ test(ki.ice_name().equals("Test::KnownIntermediate"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.knownMostDerivedAsBase();
+ test(false);
+ }
+ 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("Test::KnownMostDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.knownIntermediateAsKnownIntermediate();
+ test(false);
+ }
+ catch(KnownIntermediate ki)
+ {
+ test(ki.b.equals("KnownIntermediate.b"));
+ test(ki.ki.equals("KnownIntermediate.ki"));
+ test(ki.ice_name().equals("Test::KnownIntermediate"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
- {
- try
- {
- test.baseAsBase();
- test(false);
- }
- catch(Base b)
- {
- test(b.b.equals("Base.b"));
- test(b.ice_name().equals("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("base (AMI)... ");
+ {
+ try
+ {
+ test.knownMostDerivedAsKnownIntermediate();
+ test(false);
+ }
+ 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("Test::KnownMostDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("non-slicing of known most derived as intermediate (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();
- {
- try
- {
- test.unknownDerivedAsBase();
- test(false);
- }
- catch(Base b)
- {
- test(b.b.equals("UnknownDerived.b"));
- test(b.ice_name().equals("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.knownDerivedAsBase();
- test(false);
- }
- catch(KnownDerived k)
- {
- test(k.b.equals("KnownDerived.b"));
- test(k.kd.equals("KnownDerived.kd"));
- test(k.ice_name().equals("Test::KnownDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.knownDerivedAsKnownDerived();
- test(false);
- }
- catch(KnownDerived k)
- {
- test(k.b.equals("KnownDerived.b"));
- test(k.kd.equals("KnownDerived.kd"));
- test(k.ice_name().equals("Test::KnownDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.unknownIntermediateAsBase();
- test(false);
- }
- catch(Base b)
- {
- test(b.b.equals("UnknownIntermediate.b"));
- test(b.ice_name().equals("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.knownIntermediateAsBase();
- test(false);
- }
- catch(KnownIntermediate ki)
- {
- test(ki.b.equals("KnownIntermediate.b"));
- test(ki.ki.equals("KnownIntermediate.ki"));
- test(ki.ice_name().equals("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.knownMostDerivedAsBase();
- test(false);
- }
- 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("Test::KnownMostDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.knownIntermediateAsKnownIntermediate();
- test(false);
- }
- catch(KnownIntermediate ki)
- {
- test(ki.b.equals("KnownIntermediate.b"));
- test(ki.ki.equals("KnownIntermediate.ki"));
- test(ki.ice_name().equals("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.knownMostDerivedAsKnownIntermediate();
- test(false);
- }
- 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("Test::KnownMostDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.knownMostDerivedAsKnownMostDerived();
- test(false);
- }
- 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("Test::KnownMostDerived"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.unknownMostDerived1AsBase();
- test(false);
- }
- catch(KnownIntermediate ki)
- {
- test(ki.b.equals("UnknownMostDerived1.b"));
- test(ki.ki.equals("UnknownMostDerived1.ki"));
- test(ki.ice_name().equals("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.unknownMostDerived1AsKnownIntermediate();
- test(false);
- }
- catch(KnownIntermediate ki)
- {
- test(ki.b.equals("UnknownMostDerived1.b"));
- test(ki.ki.equals("UnknownMostDerived1.ki"));
- test(ki.ice_name().equals("Test::KnownIntermediate"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- 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();
- {
- try
- {
- test.unknownMostDerived2AsBase();
- test(false);
- }
- catch(Base b)
- {
- test(b.b.equals("UnknownMostDerived2.b"));
- test(b.ice_name().equals("Test::Base"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- 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");
+ {
+ 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();
+ {
+ try
+ {
+ test.knownMostDerivedAsKnownMostDerived();
+ test(false);
+ }
+ 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("Test::KnownMostDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.unknownMostDerived1AsBase();
+ test(false);
+ }
+ catch(KnownIntermediate ki)
+ {
+ test(ki.b.equals("UnknownMostDerived1.b"));
+ test(ki.ki.equals("UnknownMostDerived1.ki"));
+ test(ki.ice_name().equals("Test::KnownIntermediate"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.unknownMostDerived1AsKnownIntermediate();
+ test(false);
+ }
+ catch(KnownIntermediate ki)
+ {
+ test(ki.b.equals("UnknownMostDerived1.b"));
+ test(ki.ki.equals("UnknownMostDerived1.ki"));
+ test(ki.ice_name().equals("Test::KnownIntermediate"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ 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();
+ {
+ try
+ {
+ test.unknownMostDerived2AsBase();
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("UnknownMostDerived2.b"));
+ test(b.ice_name().equals("Test::Base"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ 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/csrc/Client.java b/java/test/Ice/slicing/exceptions/csrc/Client.java
index b766d24bc3f..14feb00a91a 100644
--- a/java/test/Ice/slicing/exceptions/csrc/Client.java
+++ b/java/test/Ice/slicing/exceptions/csrc/Client.java
@@ -49,7 +49,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/slicing/exceptions/ssrc/Server.java b/java/test/Ice/slicing/exceptions/ssrc/Server.java
index 1274fb465dc..03ede9cb41c 100644
--- a/java/test/Ice/slicing/exceptions/ssrc/Server.java
+++ b/java/test/Ice/slicing/exceptions/ssrc/Server.java
@@ -53,7 +53,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/slicing/exceptions/ssrc/TestI.java b/java/test/Ice/slicing/exceptions/ssrc/TestI.java
index 40ddeb88d1c..5f1070b7e95 100644
--- a/java/test/Ice/slicing/exceptions/ssrc/TestI.java
+++ b/java/test/Ice/slicing/exceptions/ssrc/TestI.java
@@ -28,134 +28,134 @@ public final class TestI extends _TestIntfDisp
throws Base
{
Base b = new Base();
- b.b = "Base.b";
- throw b;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ UnknownMostDerived2 umd2 = new UnknownMostDerived2();
+ umd2.b = "UnknownMostDerived2.b";
+ umd2.ui = "UnknownMostDerived2.ui";
+ umd2.umd2 = "UnknownMostDerived2.umd2";
+ throw umd2;
}
private Ice.ObjectAdapter _adapter;
}
diff --git a/java/test/Ice/slicing/exceptionsAMD/Server.java b/java/test/Ice/slicing/exceptionsAMD/Server.java
index f444f94ba6d..c1a6dba0ac3 100644
--- a/java/test/Ice/slicing/exceptionsAMD/Server.java
+++ b/java/test/Ice/slicing/exceptionsAMD/Server.java
@@ -53,7 +53,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/slicing/exceptionsAMD/TestI.java b/java/test/Ice/slicing/exceptionsAMD/TestI.java
index 9c5dc78e31b..1f2b85dba9e 100644
--- a/java/test/Ice/slicing/exceptionsAMD/TestI.java
+++ b/java/test/Ice/slicing/exceptionsAMD/TestI.java
@@ -21,7 +21,7 @@ public final class TestI extends _TestIntfDisp
shutdown_async(AMD_TestIntf_shutdown cb, Ice.Current current)
{
_adapter.getCommunicator().shutdown();
- cb.ice_response();
+ cb.ice_response();
}
public void
@@ -29,115 +29,115 @@ public final class TestI extends _TestIntfDisp
throws Base
{
Base b = new Base();
- b.b = "Base.b";
- cb.ice_exception(b);
+ b.b = "Base.b";
+ cb.ice_exception(b);
}
public void
unknownDerivedAsBase_async(AMD_TestIntf_unknownDerivedAsBase cb, Ice.Current current)
throws Base
{
- UnknownDerived d = new UnknownDerived();
- d.b = "UnknownDerived.b";
- d.ud = "UnknownDerived.ud";
- cb.ice_exception(d);
+ UnknownDerived d = new UnknownDerived();
+ d.b = "UnknownDerived.b";
+ d.ud = "UnknownDerived.ud";
+ cb.ice_exception(d);
}
public void
knownDerivedAsBase_async(AMD_TestIntf_knownDerivedAsBase cb, Ice.Current current)
throws Base
{
- KnownDerived d = new KnownDerived();
- d.b = "KnownDerived.b";
- d.kd = "KnownDerived.kd";
- cb.ice_exception(d);
+ KnownDerived d = new KnownDerived();
+ d.b = "KnownDerived.b";
+ d.kd = "KnownDerived.kd";
+ cb.ice_exception(d);
}
public void
knownDerivedAsKnownDerived_async(AMD_TestIntf_knownDerivedAsKnownDerived cb, Ice.Current current)
throws KnownDerived
{
- KnownDerived d = new KnownDerived();
- d.b = "KnownDerived.b";
- d.kd = "KnownDerived.kd";
- cb.ice_exception(d);
+ KnownDerived d = new KnownDerived();
+ d.b = "KnownDerived.b";
+ d.kd = "KnownDerived.kd";
+ cb.ice_exception(d);
}
public void
unknownIntermediateAsBase_async(AMD_TestIntf_unknownIntermediateAsBase cb, Ice.Current current)
throws Base
{
- UnknownIntermediate ui = new UnknownIntermediate();
- ui.b = "UnknownIntermediate.b";
- ui.ui = "UnknownIntermediate.ui";
- cb.ice_exception(ui);
+ UnknownIntermediate ui = new UnknownIntermediate();
+ ui.b = "UnknownIntermediate.b";
+ ui.ui = "UnknownIntermediate.ui";
+ cb.ice_exception(ui);
}
public void
knownIntermediateAsBase_async(AMD_TestIntf_knownIntermediateAsBase cb, Ice.Current current)
throws Base
{
- KnownIntermediate ki = new KnownIntermediate();
- ki.b = "KnownIntermediate.b";
- ki.ki = "KnownIntermediate.ki";
- cb.ice_exception(ki);
+ KnownIntermediate ki = new KnownIntermediate();
+ ki.b = "KnownIntermediate.b";
+ ki.ki = "KnownIntermediate.ki";
+ cb.ice_exception(ki);
}
public void
knownMostDerivedAsBase_async(AMD_TestIntf_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);
+ 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_TestIntf_knownIntermediateAsKnownIntermediate cb,
- Ice.Current current)
+ Ice.Current current)
throws KnownIntermediate
{
- KnownIntermediate ki = new KnownIntermediate();
- ki.b = "KnownIntermediate.b";
- ki.ki = "KnownIntermediate.ki";
- cb.ice_exception(ki);
+ KnownIntermediate ki = new KnownIntermediate();
+ ki.b = "KnownIntermediate.b";
+ ki.ki = "KnownIntermediate.ki";
+ cb.ice_exception(ki);
}
public void
knownMostDerivedAsKnownIntermediate_async(AMD_TestIntf_knownMostDerivedAsKnownIntermediate cb,
- Ice.Current current)
+ 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);
+ 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_TestIntf_knownMostDerivedAsKnownMostDerived cb,
- Ice.Current current)
+ 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);
+ 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_TestIntf_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);
+ UnknownMostDerived1 umd1 = new UnknownMostDerived1();
+ umd1.b = "UnknownMostDerived1.b";
+ umd1.ki = "UnknownMostDerived1.ki";
+ umd1.umd1 = "UnknownMostDerived1.umd1";
+ cb.ice_exception(umd1);
}
public void
@@ -145,22 +145,22 @@ public final class TestI extends _TestIntfDisp
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);
+ 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_TestIntf_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);
+ 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/objects/Test.ice b/java/test/Ice/slicing/objects/Test.ice
index 9d31ce660b5..01e91579311 100644
--- a/java/test/Ice/slicing/objects/Test.ice
+++ b/java/test/Ice/slicing/objects/Test.ice
@@ -67,7 +67,7 @@ exception DerivedException extends BaseException
D1 pd1;
};
-class Forward; // Forward-declared class defined in another compilation unit
+class Forward; // Forward-declared class defined in another compilation unit
["ami"] interface TestIntf
{
@@ -104,7 +104,7 @@ class Forward; // Forward-declared class defined in another compilation unit
void throwDerivedAsDerived() throws DerivedException;
void throwUnknownDerivedAsBase() throws BaseException;
- void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly.
+ void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly.
void shutdown();
};
diff --git a/java/test/Ice/slicing/objects/csrc/AllTests.java b/java/test/Ice/slicing/objects/csrc/AllTests.java
index 6a74f627600..6e0c9b244d6 100644
--- a/java/test/Ice/slicing/objects/csrc/AllTests.java
+++ b/java/test/Ice/slicing/objects/csrc/AllTests.java
@@ -22,967 +22,967 @@ 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;
+ 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_SBaseAsObjectI extends AMI_TestIntf_SBaseAsObject
{
public void
- ice_response(Ice.Object o)
- {
- test(o != null);
- test(o.ice_id().equals("::Test::SBase"));
- SBase sb = (SBase)o;
- test(sb != null);
- test(sb.sb.equals("SBase.sb"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(Ice.Object o)
+ {
+ test(o != null);
+ test(o.ice_id().equals("::Test::SBase"));
+ SBase sb = (SBase)o;
+ test(sb != null);
+ test(sb.sb.equals("SBase.sb"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_SBaseAsSBaseI extends AMI_TestIntf_SBaseAsSBase
{
public void
- ice_response(SBase sb)
- {
- test(sb.sb.equals("SBase.sb"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(SBase sb)
+ {
+ test(sb.sb.equals("SBase.sb"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_SBSKnownDerivedAsSBaseI extends AMI_TestIntf_SBSKnownDerivedAsSBase
{
public void
- ice_response(SBase sb)
- {
- test(sb.sb.equals("SBSKnownDerived.sb"));
- SBSKnownDerived sbskd = (SBSKnownDerived)sb;
- test(sbskd != null);
- test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(SBase sb)
+ {
+ test(sb.sb.equals("SBSKnownDerived.sb"));
+ SBSKnownDerived sbskd = (SBSKnownDerived)sb;
+ test(sbskd != null);
+ test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI
- extends AMI_TestIntf_SBSKnownDerivedAsSBSKnownDerived
+ extends AMI_TestIntf_SBSKnownDerivedAsSBSKnownDerived
{
public void
- ice_response(SBSKnownDerived sbskd)
- {
- test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(SBSKnownDerived sbskd)
+ {
+ test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_SBSUnknownDerivedAsSBaseI extends AMI_TestIntf_SBSUnknownDerivedAsSBase
{
public void
- ice_response(SBase sb)
- {
- test(sb.sb.equals("SBSUnknownDerived.sb"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(SBase sb)
+ {
+ test(sb.sb.equals("SBSUnknownDerived.sb"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_SUnknownAsObjectI extends AMI_TestIntf_SUnknownAsObject
{
public void
- ice_response(Ice.Object o)
- {
- test(false);
- }
+ ice_response(Ice.Object o)
+ {
+ test(false);
+ }
- public void
- ice_exception(Ice.LocalException exc)
- {
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
- test(exc.ice_name().equals("Ice::NoObjectFactoryException"));
- callback.called();
- }
+ test(exc.ice_name().equals("Ice::NoObjectFactoryException"));
+ callback.called();
+ }
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
- public boolean
- check()
- {
- return callback.check();
- }
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
- private Callback callback = new Callback();
+ private Callback callback = new Callback();
}
private static class AMI_Test_oneElementCycleI extends AMI_TestIntf_oneElementCycle
{
public void
- ice_response(B b)
- {
- test(b != null);
- test(b.ice_id().equals("::Test::B"));
- test(b.sb.equals("B1.sb"));
- test(b.pb == b);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B b)
+ {
+ test(b != null);
+ test(b.ice_id().equals("::Test::B"));
+ test(b.sb.equals("B1.sb"));
+ test(b.pb == b);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_twoElementCycleI extends AMI_TestIntf_twoElementCycle
{
public void
- ice_response(B b1)
- {
- test(b1 != null);
- test(b1.ice_id().equals("::Test::B"));
- test(b1.sb.equals("B1.sb"));
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B"));
- test(b2.sb.equals("B2.sb"));
- test(b2.pb == b1);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B b1)
+ {
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::B"));
+ test(b1.sb.equals("B1.sb"));
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B"));
+ test(b2.sb.equals("B2.sb"));
+ test(b2.pb == b1);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_D1AsBI extends AMI_TestIntf_D1AsB
{
public void
- ice_response(B b1)
- {
- test(b1 != null);
- test(b1.ice_id().equals("::Test::D1"));
- test(b1.sb.equals("D1.sb"));
- test(b1.pb != null);
- test(b1.pb != b1);
- D1 d1 = (D1)b1;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 != null);
- test(d1.pd1 != b1);
- test(b1.pb == d1.pd1);
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.pb == b1);
- test(b2.sb.equals("D2.sb"));
- test(b2.ice_id().equals("::Test::B"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B b1)
+ {
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::D1"));
+ test(b1.sb.equals("D1.sb"));
+ test(b1.pb != null);
+ test(b1.pb != b1);
+ D1 d1 = (D1)b1;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 != null);
+ test(d1.pd1 != b1);
+ test(b1.pb == d1.pd1);
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.pb == b1);
+ test(b2.sb.equals("D2.sb"));
+ test(b2.ice_id().equals("::Test::B"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_D1AsD1I extends AMI_TestIntf_D1AsD1
{
public void
- ice_response(D1 d1)
- {
- test(d1 != null);
- test(d1.ice_id().equals("::Test::D1"));
- test(d1.sb.equals("D1.sb"));
- test(d1.pb != null);
- test(d1.pb != d1);
-
- B b2 = d1.pb;
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B"));
- test(b2.sb.equals("D2.sb"));
- test(b2.pb == d1);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(D1 d1)
+ {
+ test(d1 != null);
+ test(d1.ice_id().equals("::Test::D1"));
+ test(d1.sb.equals("D1.sb"));
+ test(d1.pb != null);
+ test(d1.pb != d1);
+
+ B b2 = d1.pb;
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B"));
+ test(b2.sb.equals("D2.sb"));
+ test(b2.pb == d1);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_D2AsBI extends AMI_TestIntf_D2AsB
{
public void
- ice_response(B b2)
- {
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B"));
- test(b2.sb.equals("D2.sb"));
- test(b2.pb != null);
- test(b2.pb != b2);
-
- B b1 = b2.pb;
- test(b1 != null);
- test(b1.ice_id().equals("::Test::D1"));
- test(b1.sb.equals("D1.sb"));
- test(b1.pb == b2);
- D1 d1 = (D1)b1;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 == b2);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B b2)
+ {
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B"));
+ test(b2.sb.equals("D2.sb"));
+ test(b2.pb != null);
+ test(b2.pb != b2);
+
+ B b1 = b2.pb;
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::D1"));
+ test(b1.sb.equals("D1.sb"));
+ test(b1.pb == b2);
+ D1 d1 = (D1)b1;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 == b2);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_paramTest1I extends AMI_TestIntf_paramTest1
{
public void
- ice_response(B b1, B b2)
- {
- test(b1 != null);
- test(b1.ice_id().equals("::Test::D1"));
- test(b1.sb.equals("D1.sb"));
- test(b1.pb == b2);
- D1 d1 = (D1)b1;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 == b2);
-
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B")); // No factory, must be sliced
- test(b2.sb.equals("D2.sb"));
- test(b2.pb == b1);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B b1, B b2)
+ {
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::D1"));
+ test(b1.sb.equals("D1.sb"));
+ test(b1.pb == b2);
+ D1 d1 = (D1)b1;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 == b2);
+
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B")); // No factory, must be sliced
+ test(b2.sb.equals("D2.sb"));
+ test(b2.pb == b1);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_paramTest2I extends AMI_TestIntf_paramTest2
{
public void
- ice_response(B b2, B b1)
- {
- test(b1 != null);
- test(b1.ice_id().equals("::Test::D1"));
- test(b1.sb.equals("D1.sb"));
- test(b1.pb == b2);
- D1 d1 = (D1)b1;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 == b2);
-
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B")); // No factory, must be sliced
- test(b2.sb.equals("D2.sb"));
- test(b2.pb == b1);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B b2, B b1)
+ {
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::D1"));
+ test(b1.sb.equals("D1.sb"));
+ test(b1.pb == b2);
+ D1 d1 = (D1)b1;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 == b2);
+
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B")); // No factory, must be sliced
+ test(b2.sb.equals("D2.sb"));
+ test(b2.pb == b1);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_returnTest1I extends AMI_TestIntf_returnTest1
{
public void
- ice_response(B r, B p1, B p2)
- {
- test(r == p1);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B r, B p1, B p2)
+ {
+ test(r == p1);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_returnTest2I extends AMI_TestIntf_returnTest2
{
public void
- ice_response(B r, B p1, B p2)
- {
- test(r == p1);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B r, B p1, B p2)
+ {
+ test(r == p1);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_returnTest3I extends AMI_TestIntf_returnTest3
{
public void
- ice_response(B b)
- {
- r = b;
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
-
- public B r;
+ ice_response(B b)
+ {
+ r = b;
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
+
+ public B r;
}
private static class AMI_Test_paramTest3I extends AMI_TestIntf_paramTest3
{
public void
- ice_response(B ret, B p1, B p2)
- {
- test(p1 != null);
- test(p1.sb.equals("D2.sb (p1 1)"));
- test(p1.pb == null);
- test(p1.ice_id().equals("::Test::B"));
-
- test(p2 != null);
- test(p2.sb.equals("D2.sb (p2 1)"));
- test(p2.pb == null);
- test(p2.ice_id().equals("::Test::B"));
-
- test(ret != null);
- test(ret.sb.equals("D1.sb (p2 2)"));
- test(ret.pb == null);
- test(ret.ice_id().equals("::Test::D1"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B ret, B p1, B p2)
+ {
+ test(p1 != null);
+ test(p1.sb.equals("D2.sb (p1 1)"));
+ test(p1.pb == null);
+ test(p1.ice_id().equals("::Test::B"));
+
+ test(p2 != null);
+ test(p2.sb.equals("D2.sb (p2 1)"));
+ test(p2.pb == null);
+ test(p2.ice_id().equals("::Test::B"));
+
+ test(ret != null);
+ test(ret.sb.equals("D1.sb (p2 2)"));
+ test(ret.pb == null);
+ test(ret.ice_id().equals("::Test::D1"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_paramTest4I extends AMI_TestIntf_paramTest4
{
public void
- ice_response(B ret, B b)
- {
- test(b != null);
- test(b.sb.equals("D4.sb (1)"));
- test(b.pb == null);
- test(b.ice_id().equals("::Test::B"));
-
- test(ret != null);
- test(ret.sb.equals("B.sb (2)"));
- test(ret.pb == null);
- test(ret.ice_id().equals("::Test::B"));
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(B ret, B b)
+ {
+ test(b != null);
+ test(b.sb.equals("D4.sb (1)"));
+ test(b.pb == null);
+ test(b.ice_id().equals("::Test::B"));
+
+ test(ret != null);
+ test(ret.sb.equals("B.sb (2)"));
+ test(ret.pb == null);
+ test(ret.ice_id().equals("::Test::B"));
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_sequenceTestI extends AMI_TestIntf_sequenceTest
{
public void
- ice_response(SS ss)
- {
- r = ss;
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
-
- public SS r;
+ ice_response(SS ss)
+ {
+ r = ss;
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
+
+ public SS r;
}
private static class AMI_Test_dictionaryTestI extends AMI_TestIntf_dictionaryTest
{
public void
- ice_response(java.util.Map r, java.util.Map bout)
- {
- this.r = r;
- this.bout = bout;
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
-
- public java.util.Map r;
- public java.util.Map bout;
+ ice_response(java.util.Map r, java.util.Map bout)
+ {
+ this.r = r;
+ this.bout = bout;
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
+
+ public java.util.Map r;
+ public java.util.Map bout;
}
private static class AMI_Test_throwBaseAsBaseI extends AMI_TestIntf_throwBaseAsBase
{
public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- BaseException e = (BaseException)exc;
- test(e.ice_name().equals("Test::BaseException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb"));
- test(e.pb.pb == e.pb);
- }
- catch(Exception e)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ BaseException e = (BaseException)exc;
+ test(e.ice_name().equals("Test::BaseException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb"));
+ test(e.pb.pb == e.pb);
+ }
+ catch(Exception e)
+ {
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_throwDerivedAsBaseI extends AMI_TestIntf_throwDerivedAsBase
{
public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- DerivedException e = (DerivedException)exc;
- test(e.ice_name().equals("Test::DerivedException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb1"));
- test(e.pb.pb == e.pb);
- test(e.sde.equals("sde1"));
- test(e.pd1 != null);
- test(e.pd1.sb.equals("sb2"));
- test(e.pd1.pb == e.pd1);
- test(e.pd1.sd1.equals("sd2"));
- test(e.pd1.pd1 == e.pd1);
- }
- catch(Exception e)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ DerivedException e = (DerivedException)exc;
+ test(e.ice_name().equals("Test::DerivedException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb1"));
+ test(e.pb.pb == e.pb);
+ test(e.sde.equals("sde1"));
+ test(e.pd1 != null);
+ test(e.pd1.sb.equals("sb2"));
+ test(e.pd1.pb == e.pd1);
+ test(e.pd1.sd1.equals("sd2"));
+ test(e.pd1.pd1 == e.pd1);
+ }
+ catch(Exception e)
+ {
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_throwDerivedAsDerivedI extends AMI_TestIntf_throwDerivedAsDerived
{
public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- DerivedException e = (DerivedException)exc;
- test(e.ice_name().equals("Test::DerivedException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb1"));
- test(e.pb.pb == e.pb);
- test(e.sde.equals("sde1"));
- test(e.pd1 != null);
- test(e.pd1.sb.equals("sb2"));
- test(e.pd1.pb == e.pd1);
- test(e.pd1.sd1.equals("sd2"));
- test(e.pd1.pd1 == e.pd1);
- }
- catch(Exception e)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ DerivedException e = (DerivedException)exc;
+ test(e.ice_name().equals("Test::DerivedException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb1"));
+ test(e.pb.pb == e.pb);
+ test(e.sde.equals("sde1"));
+ test(e.pd1 != null);
+ test(e.pd1.sb.equals("sb2"));
+ test(e.pd1.pb == e.pd1);
+ test(e.pd1.sd1.equals("sd2"));
+ test(e.pd1.pd1 == e.pd1);
+ }
+ catch(Exception e)
+ {
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_throwUnknownDerivedAsBaseI extends AMI_TestIntf_throwUnknownDerivedAsBase
{
public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- try
- {
- BaseException e = (BaseException)exc;
- test(e.ice_name().equals("Test::BaseException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb d2"));
- test(e.pb.pb == e.pb);
- }
- catch(Exception e)
- {
- test(false);
- }
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ try
+ {
+ BaseException e = (BaseException)exc;
+ test(e.ice_name().equals("Test::BaseException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb d2"));
+ test(e.pb.pb == e.pb);
+ }
+ catch(Exception e)
+ {
+ test(false);
+ }
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMI_Test_useForwardI extends AMI_TestIntf_useForward
{
public void
- ice_response(Forward f)
- {
- test(f != null);
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException exc)
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.UserException exc)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ ice_response(Forward f)
+ {
+ test(f != null);
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException exc)
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.UserException exc)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
public static TestIntfPrx
@@ -1002,1323 +1002,1323 @@ public class AllTests
test(test.equals(base));
System.out.println("ok");
- System.out.print("base as Object... ");
- System.out.flush();
- {
- Ice.Object o;
- SBase sb = null;
- try
- {
- o = test.SBaseAsObject();
- test(o != null);
- test(o.ice_id().equals("::Test::SBase"));
- sb = (SBase)o;
- }
- catch(Exception ex)
- {
- test(false);
- }
- test(sb != null);
- test(sb.sb.equals("SBase.sb"));
- }
- System.out.println("ok");
-
- System.out.print("base as Object (AMI)... ");
- System.out.flush();
- {
- AMI_Test_SBaseAsObjectI cb = new AMI_Test_SBaseAsObjectI();
- test.SBaseAsObject_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("base as base... ");
- System.out.flush();
- {
- SBase sb;
- try
- {
- sb = test.SBaseAsSBase();
- test(sb.sb.equals("SBase.sb"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("base as base (AMI)... ");
- System.out.flush();
- {
- AMI_Test_SBaseAsSBaseI cb = new AMI_Test_SBaseAsSBaseI();
- test.SBaseAsSBase_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("base with known derived as base... ");
- System.out.flush();
- {
- SBase sb;
- SBSKnownDerived sbskd = null;
- try
- {
- sb = test.SBSKnownDerivedAsSBase();
- test(sb.sb.equals("SBSKnownDerived.sb"));
- sbskd = (SBSKnownDerived)sb;
- }
- catch(Exception ex)
- {
- test(false);
- }
- test(sbskd != null);
- test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
- }
- System.out.println("ok");
-
- System.out.print("base with known derived as base (AMI)... ");
- System.out.flush();
- {
- AMI_Test_SBSKnownDerivedAsSBaseI cb = new AMI_Test_SBSKnownDerivedAsSBaseI();
- test.SBSKnownDerivedAsSBase_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("base with known derived as known derived... ");
- System.out.flush();
- {
- SBSKnownDerived sbskd;
- try
- {
- sbskd = test.SBSKnownDerivedAsSBSKnownDerived();
- test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("base with known derived as known derived (AMI)... ");
- System.out.flush();
- {
- AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI cb = new AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI();
- test.SBSKnownDerivedAsSBSKnownDerived_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("base with unknown derived as base... ");
- System.out.flush();
- {
- SBase sb;
- try
- {
- sb = test.SBSUnknownDerivedAsSBase();
- test(sb.sb.equals("SBSUnknownDerived.sb"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("base with unknown derived as base (AMI)... ");
- System.out.flush();
- {
- AMI_Test_SBSUnknownDerivedAsSBaseI cb = new AMI_Test_SBSUnknownDerivedAsSBaseI();
- test.SBSUnknownDerivedAsSBase_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("unknown with Object as Object... ");
- System.out.flush();
- {
- Ice.Object o;
- try
- {
- o = test.SUnknownAsObject();
- test(false);
- }
- catch(Ice.NoObjectFactoryException ex)
- {
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("unknown with Object as Object (AMI)... ");
- System.out.flush();
- {
- AMI_Test_SUnknownAsObjectI cb = new AMI_Test_SUnknownAsObjectI();
- test.SUnknownAsObject_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("one-element cycle... ");
- System.out.flush();
- {
- try
- {
- B b = test.oneElementCycle();
- test(b != null);
- test(b.ice_id().equals("::Test::B"));
- test(b.sb.equals("B1.sb"));
- test(b.pb == b);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("one-element cycle (AMI)... ");
- System.out.flush();
- {
- AMI_Test_oneElementCycleI cb = new AMI_Test_oneElementCycleI();
- test.oneElementCycle_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("two-element cycle... ");
- System.out.flush();
- {
- try
- {
- B b1 = test.twoElementCycle();
- test(b1 != null);
- test(b1.ice_id().equals("::Test::B"));
- test(b1.sb.equals("B1.sb"));
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B"));
- test(b2.sb.equals("B2.sb"));
- test(b2.pb == b1);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("two-element cycle (AMI)... ");
- System.out.flush();
- {
- AMI_Test_twoElementCycleI cb = new AMI_Test_twoElementCycleI();
- test.twoElementCycle_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("known derived pointer slicing as base... ");
- System.out.flush();
- {
- try
- {
- B b1;
- b1 = test.D1AsB();
- test(b1 != null);
- test(b1.ice_id().equals("::Test::D1"));
- test(b1.sb.equals("D1.sb"));
- test(b1.pb != null);
- test(b1.pb != b1);
- D1 d1 = (D1)b1;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 != null);
- test(d1.pd1 != b1);
- test(b1.pb == d1.pd1);
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.pb == b1);
- test(b2.sb.equals("D2.sb"));
- test(b2.ice_id().equals("::Test::B"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("known derived pointer slicing as base (AMI)... ");
- System.out.flush();
- {
- AMI_Test_D1AsBI cb = new AMI_Test_D1AsBI();
- test.D1AsB_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("known derived pointer slicing as derived... ");
- System.out.flush();
- {
- try
- {
- D1 d1;
- d1 = test.D1AsD1();
- test(d1 != null);
- test(d1.ice_id().equals("::Test::D1"));
- test(d1.sb.equals("D1.sb"));
- test(d1.pb != null);
- test(d1.pb != d1);
-
- B b2 = d1.pb;
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B"));
- test(b2.sb.equals("D2.sb"));
- test(b2.pb == d1);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("known derived pointer slicing as derived (AMI)... ");
- System.out.flush();
- {
- AMI_Test_D1AsD1I cb = new AMI_Test_D1AsD1I();
- test.D1AsD1_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("unknown derived pointer slicing as base... ");
- System.out.flush();
- {
- try
- {
- B b2;
- b2 = test.D2AsB();
- test(b2 != null);
- test(b2.ice_id().equals("::Test::B"));
- test(b2.sb.equals("D2.sb"));
- test(b2.pb != null);
- test(b2.pb != b2);
-
- B b1 = b2.pb;
- test(b1 != null);
- test(b1.ice_id().equals("::Test::D1"));
- test(b1.sb.equals("D1.sb"));
- test(b1.pb == b2);
- D1 d1 = (D1)b1;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 == b2);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("unknown derived pointer slicing as base (AMI)... ");
- System.out.flush();
- {
- AMI_Test_D2AsBI cb = new AMI_Test_D2AsBI();
- test.D2AsB_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing with known first... ");
- System.out.flush();
- {
- try
- {
- BHolder b1 = new BHolder();
- BHolder b2 = new BHolder();
- test.paramTest1(b1, b2);
-
- test(b1.value != null);
- test(b1.value.ice_id().equals("::Test::D1"));
- test(b1.value.sb.equals("D1.sb"));
- test(b1.value.pb == b2.value);
- D1 d1 = (D1)b1.value;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 == b2.value);
-
- test(b2.value != null);
- test(b2.value.ice_id().equals("::Test::B")); // No factory, must be sliced
- test(b2.value.sb.equals("D2.sb"));
- test(b2.value.pb == b1.value);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing with known first (AMI)... ");
- System.out.flush();
- {
- AMI_Test_paramTest1I cb = new AMI_Test_paramTest1I();
- test.paramTest1_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing with unknown first... ");
- System.out.flush();
- {
- try
- {
- BHolder b2 = new BHolder();
- BHolder b1 = new BHolder();
- test.paramTest2(b2, b1);
-
- test(b1.value != null);
- test(b1.value.ice_id().equals("::Test::D1"));
- test(b1.value.sb.equals("D1.sb"));
- test(b1.value.pb == b2.value);
- D1 d1 = (D1)b1.value;
- test(d1 != null);
- test(d1.sd1.equals("D1.sd1"));
- test(d1.pd1 == b2.value);
-
- test(b2.value != null);
- test(b2.value.ice_id().equals("::Test::B")); // No factory, must be sliced
- test(b2.value.sb.equals("D2.sb"));
- test(b2.value.pb == b1.value);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing with unknown first (AMI)... ");
- System.out.flush();
- {
- AMI_Test_paramTest2I cb = new AMI_Test_paramTest2I();
- test.paramTest2_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("return value identity with known first... ");
- System.out.flush();
- {
- try
- {
- BHolder p1 = new BHolder();
- BHolder p2 = new BHolder();
- B r = test.returnTest1(p1, p2);
- test(r == p1.value);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("return value identity with known first (AMI)... ");
- System.out.flush();
- {
- AMI_Test_returnTest1I cb = new AMI_Test_returnTest1I();
- test.returnTest1_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("return value identity with unknown first... ");
- System.out.flush();
- {
- try
- {
- BHolder p1 = new BHolder();
- BHolder p2 = new BHolder();
- B r = test.returnTest2(p1, p2);
- test(r == p1.value);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("return value identity with unknown first (AMI)... ");
- System.out.flush();
- {
- AMI_Test_returnTest2I cb = new AMI_Test_returnTest2I();
- test.returnTest2_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("return value identity for input params known first... ");
- System.out.flush();
- {
- try
- {
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D3 d3 = new D3();
- d3.pb = d1;
- d3.sb = "D3.sb";
- d3.sd3 = "D3.sd3";
- d3.pd3 = d1;
- d1.pb = d3;
- d1.pd1 = d3;
-
- B b1 = test.returnTest3(d1, d3);
-
- test(b1 != null);
- test(b1.sb.equals("D1.sb"));
- test(b1.ice_id().equals("::Test::D1"));
- D1 p1 = (D1)b1;
- test(p1 != null);
- test(p1.sd1.equals("D1.sd1"));
- test(p1.pd1 == b1.pb);
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.sb.equals("D3.sb"));
- test(b2.ice_id().equals("::Test::B")); // Sliced by server
- test(b2.pb == b1);
- try
- {
- D3 p3 = (D3)b2;
- test(false);
- }
- catch(ClassCastException ex)
- {
- }
-
- test(b1 != d1);
- test(b1 != d3);
- test(b2 != d1);
- test(b2 != d3);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("return value identity for input params known first (AMI)... ");
- System.out.flush();
- {
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D3 d3 = new D3();
- d3.pb = d1;
- d3.sb = "D3.sb";
- d3.sd3 = "D3.sd3";
- d3.pd3 = d1;
- d1.pb = d3;
- d1.pd1 = d3;
-
- AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
- test.returnTest3_async(cb, d1, d3);
- test(cb.check());
- B b1 = cb.r;
-
- test(b1 != null);
- test(b1.sb.equals("D1.sb"));
- test(b1.ice_id().equals("::Test::D1"));
- D1 p1 = (D1)b1;
- test(p1 != null);
- test(p1.sd1.equals("D1.sd1"));
- test(p1.pd1 == b1.pb);
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.sb.equals("D3.sb"));
- test(b2.ice_id().equals("::Test::B")); // Sliced by server
- test(b2.pb == b1);
- try
- {
- D3 p3 = (D3)b2;
- test(false);
- }
- catch(ClassCastException ex)
- {
- }
-
- test(b1 != d1);
- test(b1 != d3);
- test(b2 != d1);
- test(b2 != d3);
- }
- System.out.println("ok");
-
- System.out.print("return value identity for input params unknown first... ");
- System.out.flush();
- {
- try
- {
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D3 d3 = new D3();
- d3.pb = d1;
- d3.sb = "D3.sb";
- d3.sd3 = "D3.sd3";
- d3.pd3 = d1;
- d1.pb = d3;
- d1.pd1 = d3;
-
- B b1 = test.returnTest3(d3, d1);
-
- test(b1 != null);
- test(b1.sb.equals("D3.sb"));
- test(b1.ice_id().equals("::Test::B")); // Sliced by server
-
- try
- {
- D3 p1 = (D3)b1;
- test(false);
- }
- catch(ClassCastException ex)
- {
- }
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.sb.equals("D1.sb"));
- test(b2.ice_id().equals("::Test::D1"));
- test(b2.pb == b1);
- D1 p3 = (D1)b2;
- test(p3 != null);
- test(p3.sd1.equals("D1.sd1"));
- test(p3.pd1 == b1);
-
- test(b1 != d1);
- test(b1 != d3);
- test(b2 != d1);
- test(b2 != d3);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("return value identity for input params unknown first (AMI)... ");
- System.out.flush();
- {
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D3 d3 = new D3();
- d3.pb = d1;
- d3.sb = "D3.sb";
- d3.sd3 = "D3.sd3";
- d3.pd3 = d1;
- d1.pb = d3;
- d1.pd1 = d3;
-
- AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
- test.returnTest3_async(cb, d3, d1);
- test(cb.check());
- B b1 = cb.r;
-
- test(b1 != null);
- test(b1.sb.equals("D3.sb"));
- test(b1.ice_id().equals("::Test::B")); // Sliced by server
-
- try
- {
- D3 p1 = (D3)b1;
- test(false);
- }
- catch(ClassCastException ex)
- {
- }
-
- B b2 = b1.pb;
- test(b2 != null);
- test(b2.sb.equals("D1.sb"));
- test(b2.ice_id().equals("::Test::D1"));
- test(b2.pb == b1);
- D1 p3 = (D1)b2;
- test(p3 != null);
- test(p3.sd1.equals("D1.sd1"));
- test(p3.pd1 == b1);
-
- test(b1 != d1);
- test(b1 != d3);
- test(b2 != d1);
- test(b2 != d3);
- }
- System.out.println("ok");
-
- System.out.print("remainder unmarshaling (3 instances)... ");
- System.out.flush();
- {
- try
- {
- BHolder p1 = new BHolder();
- BHolder p2 = new BHolder();
- B ret = test.paramTest3(p1, p2);
-
- test(p1.value != null);
- test(p1.value.sb.equals("D2.sb (p1 1)"));
- test(p1.value.pb == null);
- test(p1.value.ice_id().equals("::Test::B"));
-
- test(p2.value != null);
- test(p2.value.sb.equals("D2.sb (p2 1)"));
- test(p2.value.pb == null);
- test(p2.value.ice_id().equals("::Test::B"));
-
- test(ret != null);
- test(ret.sb.equals("D1.sb (p2 2)"));
- test(ret.pb == null);
- test(ret.ice_id().equals("::Test::D1"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("remainder unmarshaling (3 instances) (AMI)... ");
- System.out.flush();
- {
- AMI_Test_paramTest3I cb = new AMI_Test_paramTest3I();
- test.paramTest3_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("remainder unmarshaling (4 instances)... ");
- System.out.flush();
- {
- try
- {
- BHolder b = new BHolder();
- B ret = test.paramTest4(b);
-
- test(b.value != null);
- test(b.value.sb.equals("D4.sb (1)"));
- test(b.value.pb == null);
- test(b.value.ice_id().equals("::Test::B"));
-
- test(ret != null);
- test(ret.sb.equals("B.sb (2)"));
- test(ret.pb == null);
- test(ret.ice_id().equals("::Test::B"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("remainder unmarshaling (4 instances) (AMI)... ");
- System.out.flush();
- {
- AMI_Test_paramTest4I cb = new AMI_Test_paramTest4I();
- test.paramTest4_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing, instance marshaled in unknown derived as base... ");
- System.out.flush();
- {
- try
- {
- B b1 = new B();
- b1.sb = "B.sb(1)";
- b1.pb = b1;
-
- D3 d3 = new D3();
- d3.sb = "D3.sb";
- d3.pb = d3;
- d3.sd3 = "D3.sd3";
- d3.pd3 = b1;
-
- B b2 = new B();
- b2.sb = "B.sb(2)";
- b2.pb = b1;
-
- B r = test.returnTest3(d3, b2);
-
- test(r != null);
- test(r.ice_id().equals("::Test::B"));
- test(r.sb.equals("D3.sb"));
- test(r.pb == r);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing, instance marshaled in unknown derived as base (AMI)... ");
- System.out.flush();
- {
- B b1 = new B();
- b1.sb = "B.sb(1)";
- b1.pb = b1;
-
- D3 d3 = new D3();
- d3.sb = "D3.sb";
- d3.pb = d3;
- d3.sd3 = "D3.sd3";
- d3.pd3 = b1;
-
- B b2 = new B();
- b2.sb = "B.sb(2)";
- b2.pb = b1;
-
- AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
- test.returnTest3_async(cb, d3, b2);
- test(cb.check());
- B r = cb.r;
-
- test(r != null);
- test(r.ice_id().equals("::Test::B"));
- test(r.sb.equals("D3.sb"));
- test(r.pb == r);
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing, instance marshaled in unknown derived as derived... ");
- System.out.flush();
- {
- try
- {
- D1 d11 = new D1();
- d11.sb = "D1.sb(1)";
- d11.pb = d11;
- d11.sd1 = "D1.sd1(1)";
-
- D3 d3 = new D3();
- d3.sb = "D3.sb";
- d3.pb = d3;
- d3.sd3 = "D3.sd3";
- d3.pd3 = d11;
-
- D1 d12 = new D1();
- d12.sb = "D1.sb(2)";
- d12.pb = d12;
- d12.sd1 = "D1.sd1(2)";
- d12.pd1 = d11;
-
- B r = test.returnTest3(d3, d12);
- test(r != null);
- test(r.ice_id().equals("::Test::B"));
- test(r.sb.equals("D3.sb"));
- test(r.pb == r);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("param ptr slicing, instance marshaled in unknown derived as derived (AMI)... ");
- System.out.flush();
- {
- D1 d11 = new D1();
- d11.sb = "D1.sb(1)";
- d11.pb = d11;
- d11.sd1 = "D1.sd1(1)";
-
- D3 d3 = new D3();
- d3.sb = "D3.sb";
- d3.pb = d3;
- d3.sd3 = "D3.sd3";
- d3.pd3 = d11;
-
- D1 d12 = new D1();
- d12.sb = "D1.sb(2)";
- d12.pb = d12;
- d12.sd1 = "D1.sd1(2)";
- d12.pd1 = d11;
-
- AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
- test.returnTest3_async(cb, d3, d12);
- test(cb.check());
- B r = cb.r;
-
- test(r != null);
- test(r.ice_id().equals("::Test::B"));
- test(r.sb.equals("D3.sb"));
- test(r.pb == r);
- }
- System.out.println("ok");
-
- System.out.print("sequence slicing... ");
- System.out.flush();
- {
- try
- {
- SS ss;
- {
- B ss1b = new B();
- ss1b.sb = "B.sb";
- ss1b.pb = ss1b;
-
- D1 ss1d1 = new D1();
- ss1d1.sb = "D1.sb";
- ss1d1.sd1 = "D1.sd1";
- ss1d1.pb = ss1b;
-
- D3 ss1d3 = new D3();
- ss1d3.sb = "D3.sb";
- ss1d3.sd3 = "D3.sd3";
- ss1d3.pb = ss1b;
-
- B ss2b = new B();
- ss2b.sb = "B.sb";
- ss2b.pb = ss1b;
-
- D1 ss2d1 = new D1();
- ss2d1.sb = "D1.sb";
- ss2d1.sd1 = "D1.sd1";
- ss2d1.pb = ss2b;
-
- D3 ss2d3 = new D3();
- ss2d3.sb = "D3.sb";
- ss2d3.sd3 = "D3.sd3";
- ss2d3.pb = ss2b;
-
- ss1d1.pd1 = ss2b;
- ss1d3.pd3 = ss2d1;
-
- ss2d1.pd1 = ss1d3;
- ss2d3.pd3 = ss1d1;
-
- SS1 ss1 = new SS1();
- ss1.s = new B[3];
- ss1.s[0] = ss1b;
- ss1.s[1] = ss1d1;
- ss1.s[2] = ss1d3;
-
- SS2 ss2 = new SS2();
- ss2.s = new B[3];
- ss2.s[0] = ss2b;
- ss2.s[1] = ss2d1;
- ss2.s[2] = ss2d3;
-
- ss = test.sequenceTest(ss1, ss2);
- }
-
- test(ss.c1 != null);
- B ss1b = ss.c1.s[0];
- B ss1d1 = ss.c1.s[1];
- test(ss.c2 != null);
- B ss1d3 = ss.c1.s[2];
-
- test(ss.c2 != null);
- B ss2b = ss.c2.s[0];
- B ss2d1 = ss.c2.s[1];
- B ss2d3 = ss.c2.s[2];
-
- test(ss1b.pb == ss1b);
- test(ss1d1.pb == ss1b);
- test(ss1d3.pb == ss1b);
-
- test(ss2b.pb == ss1b);
- test(ss2d1.pb == ss2b);
- test(ss2d3.pb == ss2b);
-
- test(ss1b.ice_id().equals("::Test::B"));
- test(ss1d1.ice_id().equals("::Test::D1"));
- test(ss1d3.ice_id().equals("::Test::B"));
-
- test(ss2b.ice_id().equals("::Test::B"));
- test(ss2d1.ice_id().equals("::Test::D1"));
- test(ss2d3.ice_id().equals("::Test::B"));
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("sequence slicing (AMI)... ");
- System.out.flush();
- {
- SS ss;
- {
- B ss1b = new B();
- ss1b.sb = "B.sb";
- ss1b.pb = ss1b;
-
- D1 ss1d1 = new D1();
- ss1d1.sb = "D1.sb";
- ss1d1.sd1 = "D1.sd1";
- ss1d1.pb = ss1b;
-
- D3 ss1d3 = new D3();
- ss1d3.sb = "D3.sb";
- ss1d3.sd3 = "D3.sd3";
- ss1d3.pb = ss1b;
-
- B ss2b = new B();
- ss2b.sb = "B.sb";
- ss2b.pb = ss1b;
-
- D1 ss2d1 = new D1();
- ss2d1.sb = "D1.sb";
- ss2d1.sd1 = "D1.sd1";
- ss2d1.pb = ss2b;
-
- D3 ss2d3 = new D3();
- ss2d3.sb = "D3.sb";
- ss2d3.sd3 = "D3.sd3";
- ss2d3.pb = ss2b;
-
- ss1d1.pd1 = ss2b;
- ss1d3.pd3 = ss2d1;
-
- ss2d1.pd1 = ss1d3;
- ss2d3.pd3 = ss1d1;
-
- SS1 ss1 = new SS1();
- ss1.s = new B[3];
- ss1.s[0] = ss1b;
- ss1.s[1] = ss1d1;
- ss1.s[2] = ss1d3;
-
- SS2 ss2 = new SS2();
- ss2.s = new B[3];
- ss2.s[0] = ss2b;
- ss2.s[1] = ss2d1;
- ss2.s[2] = ss2d3;
-
- AMI_Test_sequenceTestI cb = new AMI_Test_sequenceTestI();
- test.sequenceTest_async(cb, ss1, ss2);
- test(cb.check());
- ss = cb.r;
- }
- test(ss.c1 != null);
- B ss1b = ss.c1.s[0];
- B ss1d1 = ss.c1.s[1];
- test(ss.c2 != null);
- B ss1d3 = ss.c1.s[2];
-
- test(ss.c2 != null);
- B ss2b = ss.c2.s[0];
- B ss2d1 = ss.c2.s[1];
- B ss2d3 = ss.c2.s[2];
-
- test(ss1b.pb == ss1b);
- test(ss1d1.pb == ss1b);
- test(ss1d3.pb == ss1b);
-
- test(ss2b.pb == ss1b);
- test(ss2d1.pb == ss2b);
- test(ss2d3.pb == ss2b);
-
- test(ss1b.ice_id().equals("::Test::B"));
- test(ss1d1.ice_id().equals("::Test::D1"));
- test(ss1d3.ice_id().equals("::Test::B"));
-
- test(ss2b.ice_id().equals("::Test::B"));
- test(ss2d1.ice_id().equals("::Test::D1"));
- test(ss2d3.ice_id().equals("::Test::B"));
- }
- System.out.println("ok");
-
- System.out.print("dictionary slicing... ");
- System.out.flush();
- {
- try
- {
- java.util.IdentityHashMap bin = new java.util.IdentityHashMap();
- BDictHolder bout = new BDictHolder();
- java.util.Map r;
- int i;
- for(i = 0; i < 10; ++i)
- {
- String s = "D1." + new Integer(i).toString();
- D1 d1 = new D1();
- d1.sb = s;
- d1.pb = d1;
- d1.sd1 = s;
- bin.put(new Integer(i), d1);
- }
-
- r = test.dictionaryTest(bin, bout);
-
- test(bout.value.size() == 10);
- for(i = 0; i < 10; ++i)
- {
- B b = (B)bout.value.get(new Integer(i * 10));
- test(b != null);
- String s = "D1." + new Integer(i).toString();
- test(b.sb.equals(s));
- test(b.pb != null);
- test(b.pb != b);
- test(b.pb.sb.equals(s));
- test(b.pb.pb == b.pb);
- }
-
- test(r.size() == 10);
- for(i = 0; i < 10; ++i)
- {
- B b = (B)r.get(new Integer(i * 20));
- test(b != null);
- String s = "D1." + new Integer(i * 20).toString();
- test(b.sb.equals(s));
- test(b.pb == (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20))));
- D1 d1 = (D1)b;
- test(d1 != null);
- test(d1.sd1.equals(s));
- test(d1.pd1 == d1);
- }
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("dictionary slicing (AMI)... ");
- System.out.flush();
- {
- java.util.Map bin = new java.util.HashMap();
- java.util.Map bout;
- java.util.Map r;
- int i;
- for(i = 0; i < 10; ++i)
- {
- String s = "D1." + new Integer(i).toString();
- D1 d1 = new D1();
- d1.sb = s;
- d1.pb = d1;
- d1.sd1 = s;
- bin.put(new Integer(i), d1);
- }
-
- AMI_Test_dictionaryTestI cb = new AMI_Test_dictionaryTestI();
- test.dictionaryTest_async(cb, bin);
- test(cb.check());
- bout = cb.bout;
- r = cb.r;
-
- test(bout.size() == 10);
- for(i = 0; i < 10; ++i)
- {
- B b = (B)bout.get(new Integer(i * 10));
- test(b != null);
- String s = "D1." + new Integer(i).toString();
- test(b.sb.equals(s));
- test(b.pb != null);
- test(b.pb != b);
- test(b.pb.sb.equals(s));
- test(b.pb.pb == b.pb);
- }
-
- test(r.size() == 10);
- for(i = 0; i < 10; ++i)
- {
- B b = (B)r.get(new Integer(i * 20));
- test(b != null);
- String s = "D1." + new Integer(i * 20).toString();
- test(b.sb.equals(s));
- test(b.pb == (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20))));
- D1 d1 = (D1)b;
- test(d1 != null);
- test(d1.sd1.equals(s));
- test(d1.pd1 == d1);
- }
- }
- System.out.println("ok");
-
- System.out.print("base exception thrown as base exception... ");
- System.out.flush();
- {
- try
- {
- test.throwBaseAsBase();
- test(false);
- }
- catch(BaseException e)
- {
- test(e.ice_name().equals("Test::BaseException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb"));
- test(e.pb.pb == e.pb);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("base exception thrown as base exception (AMI)... ");
- System.out.flush();
- {
- AMI_Test_throwBaseAsBaseI cb = new AMI_Test_throwBaseAsBaseI();
- test.throwBaseAsBase_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("derived exception thrown as base exception... ");
- System.out.flush();
- {
- try
- {
- test.throwDerivedAsBase();
- test(false);
- }
- catch(DerivedException e)
- {
- test(e.ice_name().equals("Test::DerivedException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb1"));
- test(e.pb.pb == e.pb);
- test(e.sde.equals("sde1"));
- test(e.pd1 != null);
- test(e.pd1.sb.equals("sb2"));
- test(e.pd1.pb == e.pd1);
- test(e.pd1.sd1.equals("sd2"));
- test(e.pd1.pd1 == e.pd1);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("derived exception thrown as base exception (AMI)... ");
- System.out.flush();
- {
- AMI_Test_throwDerivedAsBaseI cb = new AMI_Test_throwDerivedAsBaseI();
- test.throwDerivedAsBase_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("derived exception thrown as derived exception... ");
- System.out.flush();
- {
- try
- {
- test.throwDerivedAsDerived();
- test(false);
- }
- catch(DerivedException e)
- {
- test(e.ice_name().equals("Test::DerivedException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb1"));
- test(e.pb.pb == e.pb);
- test(e.sde.equals("sde1"));
- test(e.pd1 != null);
- test(e.pd1.sb.equals("sb2"));
- test(e.pd1.pb == e.pd1);
- test(e.pd1.sd1.equals("sd2"));
- test(e.pd1.pd1 == e.pd1);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("derived exception thrown as derived exception (AMI)... ");
- System.out.flush();
- {
- AMI_Test_throwDerivedAsDerivedI cb = new AMI_Test_throwDerivedAsDerivedI();
- test.throwDerivedAsDerived_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("unknown derived exception thrown as base exception... ");
- System.out.flush();
- {
- try
- {
- test.throwUnknownDerivedAsBase();
- test(false);
- }
- catch(BaseException e)
- {
- test(e.ice_name().equals("Test::BaseException"));
- test(e.sbe.equals("sbe"));
- test(e.pb != null);
- test(e.pb.sb.equals("sb d2"));
- test(e.pb.pb == e.pb);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("unknown derived exception thrown as base exception (AMI)... ");
- System.out.flush();
- {
- AMI_Test_throwUnknownDerivedAsBaseI cb = new AMI_Test_throwUnknownDerivedAsBaseI();
- test.throwUnknownDerivedAsBase_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
-
- System.out.print("forward-declared class... ");
- System.out.flush();
- {
- try
- {
- ForwardHolder f = new ForwardHolder();
- test.useForward(f);
- test(f.value != null);
- }
- catch(Exception ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
-
- System.out.print("forward-declared class (AMI)... ");
- System.out.flush();
- {
- AMI_Test_useForwardI cb = new AMI_Test_useForwardI();
- test.useForward_async(cb);
- test(cb.check());
- }
- System.out.println("ok");
+ System.out.print("base as Object... ");
+ System.out.flush();
+ {
+ Ice.Object o;
+ SBase sb = null;
+ try
+ {
+ o = test.SBaseAsObject();
+ test(o != null);
+ test(o.ice_id().equals("::Test::SBase"));
+ sb = (SBase)o;
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ test(sb != null);
+ test(sb.sb.equals("SBase.sb"));
+ }
+ System.out.println("ok");
+
+ System.out.print("base as Object (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_SBaseAsObjectI cb = new AMI_Test_SBaseAsObjectI();
+ test.SBaseAsObject_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("base as base... ");
+ System.out.flush();
+ {
+ SBase sb;
+ try
+ {
+ sb = test.SBaseAsSBase();
+ test(sb.sb.equals("SBase.sb"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("base as base (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_SBaseAsSBaseI cb = new AMI_Test_SBaseAsSBaseI();
+ test.SBaseAsSBase_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("base with known derived as base... ");
+ System.out.flush();
+ {
+ SBase sb;
+ SBSKnownDerived sbskd = null;
+ try
+ {
+ sb = test.SBSKnownDerivedAsSBase();
+ test(sb.sb.equals("SBSKnownDerived.sb"));
+ sbskd = (SBSKnownDerived)sb;
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ test(sbskd != null);
+ test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
+ }
+ System.out.println("ok");
+
+ System.out.print("base with known derived as base (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_SBSKnownDerivedAsSBaseI cb = new AMI_Test_SBSKnownDerivedAsSBaseI();
+ test.SBSKnownDerivedAsSBase_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("base with known derived as known derived... ");
+ System.out.flush();
+ {
+ SBSKnownDerived sbskd;
+ try
+ {
+ sbskd = test.SBSKnownDerivedAsSBSKnownDerived();
+ test(sbskd.sbskd.equals("SBSKnownDerived.sbskd"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("base with known derived as known derived (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI cb = new AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI();
+ test.SBSKnownDerivedAsSBSKnownDerived_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("base with unknown derived as base... ");
+ System.out.flush();
+ {
+ SBase sb;
+ try
+ {
+ sb = test.SBSUnknownDerivedAsSBase();
+ test(sb.sb.equals("SBSUnknownDerived.sb"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("base with unknown derived as base (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_SBSUnknownDerivedAsSBaseI cb = new AMI_Test_SBSUnknownDerivedAsSBaseI();
+ test.SBSUnknownDerivedAsSBase_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("unknown with Object as Object... ");
+ System.out.flush();
+ {
+ Ice.Object o;
+ try
+ {
+ o = test.SUnknownAsObject();
+ test(false);
+ }
+ catch(Ice.NoObjectFactoryException ex)
+ {
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("unknown with Object as Object (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_SUnknownAsObjectI cb = new AMI_Test_SUnknownAsObjectI();
+ test.SUnknownAsObject_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("one-element cycle... ");
+ System.out.flush();
+ {
+ try
+ {
+ B b = test.oneElementCycle();
+ test(b != null);
+ test(b.ice_id().equals("::Test::B"));
+ test(b.sb.equals("B1.sb"));
+ test(b.pb == b);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("one-element cycle (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_oneElementCycleI cb = new AMI_Test_oneElementCycleI();
+ test.oneElementCycle_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("two-element cycle... ");
+ System.out.flush();
+ {
+ try
+ {
+ B b1 = test.twoElementCycle();
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::B"));
+ test(b1.sb.equals("B1.sb"));
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B"));
+ test(b2.sb.equals("B2.sb"));
+ test(b2.pb == b1);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("two-element cycle (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_twoElementCycleI cb = new AMI_Test_twoElementCycleI();
+ test.twoElementCycle_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("known derived pointer slicing as base... ");
+ System.out.flush();
+ {
+ try
+ {
+ B b1;
+ b1 = test.D1AsB();
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::D1"));
+ test(b1.sb.equals("D1.sb"));
+ test(b1.pb != null);
+ test(b1.pb != b1);
+ D1 d1 = (D1)b1;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 != null);
+ test(d1.pd1 != b1);
+ test(b1.pb == d1.pd1);
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.pb == b1);
+ test(b2.sb.equals("D2.sb"));
+ test(b2.ice_id().equals("::Test::B"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("known derived pointer slicing as base (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_D1AsBI cb = new AMI_Test_D1AsBI();
+ test.D1AsB_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("known derived pointer slicing as derived... ");
+ System.out.flush();
+ {
+ try
+ {
+ D1 d1;
+ d1 = test.D1AsD1();
+ test(d1 != null);
+ test(d1.ice_id().equals("::Test::D1"));
+ test(d1.sb.equals("D1.sb"));
+ test(d1.pb != null);
+ test(d1.pb != d1);
+
+ B b2 = d1.pb;
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B"));
+ test(b2.sb.equals("D2.sb"));
+ test(b2.pb == d1);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("known derived pointer slicing as derived (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_D1AsD1I cb = new AMI_Test_D1AsD1I();
+ test.D1AsD1_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("unknown derived pointer slicing as base... ");
+ System.out.flush();
+ {
+ try
+ {
+ B b2;
+ b2 = test.D2AsB();
+ test(b2 != null);
+ test(b2.ice_id().equals("::Test::B"));
+ test(b2.sb.equals("D2.sb"));
+ test(b2.pb != null);
+ test(b2.pb != b2);
+
+ B b1 = b2.pb;
+ test(b1 != null);
+ test(b1.ice_id().equals("::Test::D1"));
+ test(b1.sb.equals("D1.sb"));
+ test(b1.pb == b2);
+ D1 d1 = (D1)b1;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 == b2);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("unknown derived pointer slicing as base (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_D2AsBI cb = new AMI_Test_D2AsBI();
+ test.D2AsB_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing with known first... ");
+ System.out.flush();
+ {
+ try
+ {
+ BHolder b1 = new BHolder();
+ BHolder b2 = new BHolder();
+ test.paramTest1(b1, b2);
+
+ test(b1.value != null);
+ test(b1.value.ice_id().equals("::Test::D1"));
+ test(b1.value.sb.equals("D1.sb"));
+ test(b1.value.pb == b2.value);
+ D1 d1 = (D1)b1.value;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 == b2.value);
+
+ test(b2.value != null);
+ test(b2.value.ice_id().equals("::Test::B")); // No factory, must be sliced
+ test(b2.value.sb.equals("D2.sb"));
+ test(b2.value.pb == b1.value);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing with known first (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_paramTest1I cb = new AMI_Test_paramTest1I();
+ test.paramTest1_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing with unknown first... ");
+ System.out.flush();
+ {
+ try
+ {
+ BHolder b2 = new BHolder();
+ BHolder b1 = new BHolder();
+ test.paramTest2(b2, b1);
+
+ test(b1.value != null);
+ test(b1.value.ice_id().equals("::Test::D1"));
+ test(b1.value.sb.equals("D1.sb"));
+ test(b1.value.pb == b2.value);
+ D1 d1 = (D1)b1.value;
+ test(d1 != null);
+ test(d1.sd1.equals("D1.sd1"));
+ test(d1.pd1 == b2.value);
+
+ test(b2.value != null);
+ test(b2.value.ice_id().equals("::Test::B")); // No factory, must be sliced
+ test(b2.value.sb.equals("D2.sb"));
+ test(b2.value.pb == b1.value);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing with unknown first (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_paramTest2I cb = new AMI_Test_paramTest2I();
+ test.paramTest2_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity with known first... ");
+ System.out.flush();
+ {
+ try
+ {
+ BHolder p1 = new BHolder();
+ BHolder p2 = new BHolder();
+ B r = test.returnTest1(p1, p2);
+ test(r == p1.value);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity with known first (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_returnTest1I cb = new AMI_Test_returnTest1I();
+ test.returnTest1_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity with unknown first... ");
+ System.out.flush();
+ {
+ try
+ {
+ BHolder p1 = new BHolder();
+ BHolder p2 = new BHolder();
+ B r = test.returnTest2(p1, p2);
+ test(r == p1.value);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity with unknown first (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_returnTest2I cb = new AMI_Test_returnTest2I();
+ test.returnTest2_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity for input params known first... ");
+ System.out.flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D3 d3 = new D3();
+ d3.pb = d1;
+ d3.sb = "D3.sb";
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = d1;
+ d1.pb = d3;
+ d1.pd1 = d3;
+
+ B b1 = test.returnTest3(d1, d3);
+
+ test(b1 != null);
+ test(b1.sb.equals("D1.sb"));
+ test(b1.ice_id().equals("::Test::D1"));
+ D1 p1 = (D1)b1;
+ test(p1 != null);
+ test(p1.sd1.equals("D1.sd1"));
+ test(p1.pd1 == b1.pb);
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.equals("D3.sb"));
+ test(b2.ice_id().equals("::Test::B")); // Sliced by server
+ test(b2.pb == b1);
+ try
+ {
+ D3 p3 = (D3)b2;
+ test(false);
+ }
+ catch(ClassCastException ex)
+ {
+ }
+
+ test(b1 != d1);
+ test(b1 != d3);
+ test(b2 != d1);
+ test(b2 != d3);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity for input params known first (AMI)... ");
+ System.out.flush();
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D3 d3 = new D3();
+ d3.pb = d1;
+ d3.sb = "D3.sb";
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = d1;
+ d1.pb = d3;
+ d1.pd1 = d3;
+
+ AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
+ test.returnTest3_async(cb, d1, d3);
+ test(cb.check());
+ B b1 = cb.r;
+
+ test(b1 != null);
+ test(b1.sb.equals("D1.sb"));
+ test(b1.ice_id().equals("::Test::D1"));
+ D1 p1 = (D1)b1;
+ test(p1 != null);
+ test(p1.sd1.equals("D1.sd1"));
+ test(p1.pd1 == b1.pb);
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.equals("D3.sb"));
+ test(b2.ice_id().equals("::Test::B")); // Sliced by server
+ test(b2.pb == b1);
+ try
+ {
+ D3 p3 = (D3)b2;
+ test(false);
+ }
+ catch(ClassCastException ex)
+ {
+ }
+
+ test(b1 != d1);
+ test(b1 != d3);
+ test(b2 != d1);
+ test(b2 != d3);
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity for input params unknown first... ");
+ System.out.flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D3 d3 = new D3();
+ d3.pb = d1;
+ d3.sb = "D3.sb";
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = d1;
+ d1.pb = d3;
+ d1.pd1 = d3;
+
+ B b1 = test.returnTest3(d3, d1);
+
+ test(b1 != null);
+ test(b1.sb.equals("D3.sb"));
+ test(b1.ice_id().equals("::Test::B")); // Sliced by server
+
+ try
+ {
+ D3 p1 = (D3)b1;
+ test(false);
+ }
+ catch(ClassCastException ex)
+ {
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.equals("D1.sb"));
+ test(b2.ice_id().equals("::Test::D1"));
+ test(b2.pb == b1);
+ D1 p3 = (D1)b2;
+ test(p3 != null);
+ test(p3.sd1.equals("D1.sd1"));
+ test(p3.pd1 == b1);
+
+ test(b1 != d1);
+ test(b1 != d3);
+ test(b2 != d1);
+ test(b2 != d3);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("return value identity for input params unknown first (AMI)... ");
+ System.out.flush();
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D3 d3 = new D3();
+ d3.pb = d1;
+ d3.sb = "D3.sb";
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = d1;
+ d1.pb = d3;
+ d1.pd1 = d3;
+
+ AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
+ test.returnTest3_async(cb, d3, d1);
+ test(cb.check());
+ B b1 = cb.r;
+
+ test(b1 != null);
+ test(b1.sb.equals("D3.sb"));
+ test(b1.ice_id().equals("::Test::B")); // Sliced by server
+
+ try
+ {
+ D3 p1 = (D3)b1;
+ test(false);
+ }
+ catch(ClassCastException ex)
+ {
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.equals("D1.sb"));
+ test(b2.ice_id().equals("::Test::D1"));
+ test(b2.pb == b1);
+ D1 p3 = (D1)b2;
+ test(p3 != null);
+ test(p3.sd1.equals("D1.sd1"));
+ test(p3.pd1 == b1);
+
+ test(b1 != d1);
+ test(b1 != d3);
+ test(b2 != d1);
+ test(b2 != d3);
+ }
+ System.out.println("ok");
+
+ System.out.print("remainder unmarshaling (3 instances)... ");
+ System.out.flush();
+ {
+ try
+ {
+ BHolder p1 = new BHolder();
+ BHolder p2 = new BHolder();
+ B ret = test.paramTest3(p1, p2);
+
+ test(p1.value != null);
+ test(p1.value.sb.equals("D2.sb (p1 1)"));
+ test(p1.value.pb == null);
+ test(p1.value.ice_id().equals("::Test::B"));
+
+ test(p2.value != null);
+ test(p2.value.sb.equals("D2.sb (p2 1)"));
+ test(p2.value.pb == null);
+ test(p2.value.ice_id().equals("::Test::B"));
+
+ test(ret != null);
+ test(ret.sb.equals("D1.sb (p2 2)"));
+ test(ret.pb == null);
+ test(ret.ice_id().equals("::Test::D1"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("remainder unmarshaling (3 instances) (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_paramTest3I cb = new AMI_Test_paramTest3I();
+ test.paramTest3_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("remainder unmarshaling (4 instances)... ");
+ System.out.flush();
+ {
+ try
+ {
+ BHolder b = new BHolder();
+ B ret = test.paramTest4(b);
+
+ test(b.value != null);
+ test(b.value.sb.equals("D4.sb (1)"));
+ test(b.value.pb == null);
+ test(b.value.ice_id().equals("::Test::B"));
+
+ test(ret != null);
+ test(ret.sb.equals("B.sb (2)"));
+ test(ret.pb == null);
+ test(ret.ice_id().equals("::Test::B"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("remainder unmarshaling (4 instances) (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_paramTest4I cb = new AMI_Test_paramTest4I();
+ test.paramTest4_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing, instance marshaled in unknown derived as base... ");
+ System.out.flush();
+ {
+ try
+ {
+ B b1 = new B();
+ b1.sb = "B.sb(1)";
+ b1.pb = b1;
+
+ D3 d3 = new D3();
+ d3.sb = "D3.sb";
+ d3.pb = d3;
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = b1;
+
+ B b2 = new B();
+ b2.sb = "B.sb(2)";
+ b2.pb = b1;
+
+ B r = test.returnTest3(d3, b2);
+
+ test(r != null);
+ test(r.ice_id().equals("::Test::B"));
+ test(r.sb.equals("D3.sb"));
+ test(r.pb == r);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing, instance marshaled in unknown derived as base (AMI)... ");
+ System.out.flush();
+ {
+ B b1 = new B();
+ b1.sb = "B.sb(1)";
+ b1.pb = b1;
+
+ D3 d3 = new D3();
+ d3.sb = "D3.sb";
+ d3.pb = d3;
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = b1;
+
+ B b2 = new B();
+ b2.sb = "B.sb(2)";
+ b2.pb = b1;
+
+ AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
+ test.returnTest3_async(cb, d3, b2);
+ test(cb.check());
+ B r = cb.r;
+
+ test(r != null);
+ test(r.ice_id().equals("::Test::B"));
+ test(r.sb.equals("D3.sb"));
+ test(r.pb == r);
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing, instance marshaled in unknown derived as derived... ");
+ System.out.flush();
+ {
+ try
+ {
+ D1 d11 = new D1();
+ d11.sb = "D1.sb(1)";
+ d11.pb = d11;
+ d11.sd1 = "D1.sd1(1)";
+
+ D3 d3 = new D3();
+ d3.sb = "D3.sb";
+ d3.pb = d3;
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = d11;
+
+ D1 d12 = new D1();
+ d12.sb = "D1.sb(2)";
+ d12.pb = d12;
+ d12.sd1 = "D1.sd1(2)";
+ d12.pd1 = d11;
+
+ B r = test.returnTest3(d3, d12);
+ test(r != null);
+ test(r.ice_id().equals("::Test::B"));
+ test(r.sb.equals("D3.sb"));
+ test(r.pb == r);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("param ptr slicing, instance marshaled in unknown derived as derived (AMI)... ");
+ System.out.flush();
+ {
+ D1 d11 = new D1();
+ d11.sb = "D1.sb(1)";
+ d11.pb = d11;
+ d11.sd1 = "D1.sd1(1)";
+
+ D3 d3 = new D3();
+ d3.sb = "D3.sb";
+ d3.pb = d3;
+ d3.sd3 = "D3.sd3";
+ d3.pd3 = d11;
+
+ D1 d12 = new D1();
+ d12.sb = "D1.sb(2)";
+ d12.pb = d12;
+ d12.sd1 = "D1.sd1(2)";
+ d12.pd1 = d11;
+
+ AMI_Test_returnTest3I cb = new AMI_Test_returnTest3I();
+ test.returnTest3_async(cb, d3, d12);
+ test(cb.check());
+ B r = cb.r;
+
+ test(r != null);
+ test(r.ice_id().equals("::Test::B"));
+ test(r.sb.equals("D3.sb"));
+ test(r.pb == r);
+ }
+ System.out.println("ok");
+
+ System.out.print("sequence slicing... ");
+ System.out.flush();
+ {
+ try
+ {
+ SS ss;
+ {
+ B ss1b = new B();
+ ss1b.sb = "B.sb";
+ ss1b.pb = ss1b;
+
+ D1 ss1d1 = new D1();
+ ss1d1.sb = "D1.sb";
+ ss1d1.sd1 = "D1.sd1";
+ ss1d1.pb = ss1b;
+
+ D3 ss1d3 = new D3();
+ ss1d3.sb = "D3.sb";
+ ss1d3.sd3 = "D3.sd3";
+ ss1d3.pb = ss1b;
+
+ B ss2b = new B();
+ ss2b.sb = "B.sb";
+ ss2b.pb = ss1b;
+
+ D1 ss2d1 = new D1();
+ ss2d1.sb = "D1.sb";
+ ss2d1.sd1 = "D1.sd1";
+ ss2d1.pb = ss2b;
+
+ D3 ss2d3 = new D3();
+ ss2d3.sb = "D3.sb";
+ ss2d3.sd3 = "D3.sd3";
+ ss2d3.pb = ss2b;
+
+ ss1d1.pd1 = ss2b;
+ ss1d3.pd3 = ss2d1;
+
+ ss2d1.pd1 = ss1d3;
+ ss2d3.pd3 = ss1d1;
+
+ SS1 ss1 = new SS1();
+ ss1.s = new B[3];
+ ss1.s[0] = ss1b;
+ ss1.s[1] = ss1d1;
+ ss1.s[2] = ss1d3;
+
+ SS2 ss2 = new SS2();
+ ss2.s = new B[3];
+ ss2.s[0] = ss2b;
+ ss2.s[1] = ss2d1;
+ ss2.s[2] = ss2d3;
+
+ ss = test.sequenceTest(ss1, ss2);
+ }
+
+ test(ss.c1 != null);
+ B ss1b = ss.c1.s[0];
+ B ss1d1 = ss.c1.s[1];
+ test(ss.c2 != null);
+ B ss1d3 = ss.c1.s[2];
+
+ test(ss.c2 != null);
+ B ss2b = ss.c2.s[0];
+ B ss2d1 = ss.c2.s[1];
+ B ss2d3 = ss.c2.s[2];
+
+ test(ss1b.pb == ss1b);
+ test(ss1d1.pb == ss1b);
+ test(ss1d3.pb == ss1b);
+
+ test(ss2b.pb == ss1b);
+ test(ss2d1.pb == ss2b);
+ test(ss2d3.pb == ss2b);
+
+ test(ss1b.ice_id().equals("::Test::B"));
+ test(ss1d1.ice_id().equals("::Test::D1"));
+ test(ss1d3.ice_id().equals("::Test::B"));
+
+ test(ss2b.ice_id().equals("::Test::B"));
+ test(ss2d1.ice_id().equals("::Test::D1"));
+ test(ss2d3.ice_id().equals("::Test::B"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("sequence slicing (AMI)... ");
+ System.out.flush();
+ {
+ SS ss;
+ {
+ B ss1b = new B();
+ ss1b.sb = "B.sb";
+ ss1b.pb = ss1b;
+
+ D1 ss1d1 = new D1();
+ ss1d1.sb = "D1.sb";
+ ss1d1.sd1 = "D1.sd1";
+ ss1d1.pb = ss1b;
+
+ D3 ss1d3 = new D3();
+ ss1d3.sb = "D3.sb";
+ ss1d3.sd3 = "D3.sd3";
+ ss1d3.pb = ss1b;
+
+ B ss2b = new B();
+ ss2b.sb = "B.sb";
+ ss2b.pb = ss1b;
+
+ D1 ss2d1 = new D1();
+ ss2d1.sb = "D1.sb";
+ ss2d1.sd1 = "D1.sd1";
+ ss2d1.pb = ss2b;
+
+ D3 ss2d3 = new D3();
+ ss2d3.sb = "D3.sb";
+ ss2d3.sd3 = "D3.sd3";
+ ss2d3.pb = ss2b;
+
+ ss1d1.pd1 = ss2b;
+ ss1d3.pd3 = ss2d1;
+
+ ss2d1.pd1 = ss1d3;
+ ss2d3.pd3 = ss1d1;
+
+ SS1 ss1 = new SS1();
+ ss1.s = new B[3];
+ ss1.s[0] = ss1b;
+ ss1.s[1] = ss1d1;
+ ss1.s[2] = ss1d3;
+
+ SS2 ss2 = new SS2();
+ ss2.s = new B[3];
+ ss2.s[0] = ss2b;
+ ss2.s[1] = ss2d1;
+ ss2.s[2] = ss2d3;
+
+ AMI_Test_sequenceTestI cb = new AMI_Test_sequenceTestI();
+ test.sequenceTest_async(cb, ss1, ss2);
+ test(cb.check());
+ ss = cb.r;
+ }
+ test(ss.c1 != null);
+ B ss1b = ss.c1.s[0];
+ B ss1d1 = ss.c1.s[1];
+ test(ss.c2 != null);
+ B ss1d3 = ss.c1.s[2];
+
+ test(ss.c2 != null);
+ B ss2b = ss.c2.s[0];
+ B ss2d1 = ss.c2.s[1];
+ B ss2d3 = ss.c2.s[2];
+
+ test(ss1b.pb == ss1b);
+ test(ss1d1.pb == ss1b);
+ test(ss1d3.pb == ss1b);
+
+ test(ss2b.pb == ss1b);
+ test(ss2d1.pb == ss2b);
+ test(ss2d3.pb == ss2b);
+
+ test(ss1b.ice_id().equals("::Test::B"));
+ test(ss1d1.ice_id().equals("::Test::D1"));
+ test(ss1d3.ice_id().equals("::Test::B"));
+
+ test(ss2b.ice_id().equals("::Test::B"));
+ test(ss2d1.ice_id().equals("::Test::D1"));
+ test(ss2d3.ice_id().equals("::Test::B"));
+ }
+ System.out.println("ok");
+
+ System.out.print("dictionary slicing... ");
+ System.out.flush();
+ {
+ try
+ {
+ java.util.IdentityHashMap bin = new java.util.IdentityHashMap();
+ BDictHolder bout = new BDictHolder();
+ java.util.Map r;
+ int i;
+ for(i = 0; i < 10; ++i)
+ {
+ String s = "D1." + new Integer(i).toString();
+ D1 d1 = new D1();
+ d1.sb = s;
+ d1.pb = d1;
+ d1.sd1 = s;
+ bin.put(new Integer(i), d1);
+ }
+
+ r = test.dictionaryTest(bin, bout);
+
+ test(bout.value.size() == 10);
+ for(i = 0; i < 10; ++i)
+ {
+ B b = (B)bout.value.get(new Integer(i * 10));
+ test(b != null);
+ String s = "D1." + new Integer(i).toString();
+ test(b.sb.equals(s));
+ test(b.pb != null);
+ test(b.pb != b);
+ test(b.pb.sb.equals(s));
+ test(b.pb.pb == b.pb);
+ }
+
+ test(r.size() == 10);
+ for(i = 0; i < 10; ++i)
+ {
+ B b = (B)r.get(new Integer(i * 20));
+ test(b != null);
+ String s = "D1." + new Integer(i * 20).toString();
+ test(b.sb.equals(s));
+ test(b.pb == (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20))));
+ D1 d1 = (D1)b;
+ test(d1 != null);
+ test(d1.sd1.equals(s));
+ test(d1.pd1 == d1);
+ }
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("dictionary slicing (AMI)... ");
+ System.out.flush();
+ {
+ java.util.Map bin = new java.util.HashMap();
+ java.util.Map bout;
+ java.util.Map r;
+ int i;
+ for(i = 0; i < 10; ++i)
+ {
+ String s = "D1." + new Integer(i).toString();
+ D1 d1 = new D1();
+ d1.sb = s;
+ d1.pb = d1;
+ d1.sd1 = s;
+ bin.put(new Integer(i), d1);
+ }
+
+ AMI_Test_dictionaryTestI cb = new AMI_Test_dictionaryTestI();
+ test.dictionaryTest_async(cb, bin);
+ test(cb.check());
+ bout = cb.bout;
+ r = cb.r;
+
+ test(bout.size() == 10);
+ for(i = 0; i < 10; ++i)
+ {
+ B b = (B)bout.get(new Integer(i * 10));
+ test(b != null);
+ String s = "D1." + new Integer(i).toString();
+ test(b.sb.equals(s));
+ test(b.pb != null);
+ test(b.pb != b);
+ test(b.pb.sb.equals(s));
+ test(b.pb.pb == b.pb);
+ }
+
+ test(r.size() == 10);
+ for(i = 0; i < 10; ++i)
+ {
+ B b = (B)r.get(new Integer(i * 20));
+ test(b != null);
+ String s = "D1." + new Integer(i * 20).toString();
+ test(b.sb.equals(s));
+ test(b.pb == (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20))));
+ D1 d1 = (D1)b;
+ test(d1 != null);
+ test(d1.sd1.equals(s));
+ test(d1.pd1 == d1);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("base exception thrown as base exception... ");
+ System.out.flush();
+ {
+ try
+ {
+ test.throwBaseAsBase();
+ test(false);
+ }
+ catch(BaseException e)
+ {
+ test(e.ice_name().equals("Test::BaseException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb"));
+ test(e.pb.pb == e.pb);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("base exception thrown as base exception (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_throwBaseAsBaseI cb = new AMI_Test_throwBaseAsBaseI();
+ test.throwBaseAsBase_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("derived exception thrown as base exception... ");
+ System.out.flush();
+ {
+ try
+ {
+ test.throwDerivedAsBase();
+ test(false);
+ }
+ catch(DerivedException e)
+ {
+ test(e.ice_name().equals("Test::DerivedException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb1"));
+ test(e.pb.pb == e.pb);
+ test(e.sde.equals("sde1"));
+ test(e.pd1 != null);
+ test(e.pd1.sb.equals("sb2"));
+ test(e.pd1.pb == e.pd1);
+ test(e.pd1.sd1.equals("sd2"));
+ test(e.pd1.pd1 == e.pd1);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("derived exception thrown as base exception (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_throwDerivedAsBaseI cb = new AMI_Test_throwDerivedAsBaseI();
+ test.throwDerivedAsBase_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("derived exception thrown as derived exception... ");
+ System.out.flush();
+ {
+ try
+ {
+ test.throwDerivedAsDerived();
+ test(false);
+ }
+ catch(DerivedException e)
+ {
+ test(e.ice_name().equals("Test::DerivedException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb1"));
+ test(e.pb.pb == e.pb);
+ test(e.sde.equals("sde1"));
+ test(e.pd1 != null);
+ test(e.pd1.sb.equals("sb2"));
+ test(e.pd1.pb == e.pd1);
+ test(e.pd1.sd1.equals("sd2"));
+ test(e.pd1.pd1 == e.pd1);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("derived exception thrown as derived exception (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_throwDerivedAsDerivedI cb = new AMI_Test_throwDerivedAsDerivedI();
+ test.throwDerivedAsDerived_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("unknown derived exception thrown as base exception... ");
+ System.out.flush();
+ {
+ try
+ {
+ test.throwUnknownDerivedAsBase();
+ test(false);
+ }
+ catch(BaseException e)
+ {
+ test(e.ice_name().equals("Test::BaseException"));
+ test(e.sbe.equals("sbe"));
+ test(e.pb != null);
+ test(e.pb.sb.equals("sb d2"));
+ test(e.pb.pb == e.pb);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("unknown derived exception thrown as base exception (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_throwUnknownDerivedAsBaseI cb = new AMI_Test_throwUnknownDerivedAsBaseI();
+ test.throwUnknownDerivedAsBase_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
+
+ System.out.print("forward-declared class... ");
+ System.out.flush();
+ {
+ try
+ {
+ ForwardHolder f = new ForwardHolder();
+ test.useForward(f);
+ test(f.value != null);
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
+
+ System.out.print("forward-declared class (AMI)... ");
+ System.out.flush();
+ {
+ AMI_Test_useForwardI cb = new AMI_Test_useForwardI();
+ test.useForward_async(cb);
+ test(cb.check());
+ }
+ System.out.println("ok");
return test;
}
diff --git a/java/test/Ice/slicing/objects/csrc/Client.java b/java/test/Ice/slicing/objects/csrc/Client.java
index b766d24bc3f..14feb00a91a 100644
--- a/java/test/Ice/slicing/objects/csrc/Client.java
+++ b/java/test/Ice/slicing/objects/csrc/Client.java
@@ -49,7 +49,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/slicing/objects/ssrc/Server.java b/java/test/Ice/slicing/objects/ssrc/Server.java
index 1274fb465dc..03ede9cb41c 100644
--- a/java/test/Ice/slicing/objects/ssrc/Server.java
+++ b/java/test/Ice/slicing/objects/ssrc/Server.java
@@ -53,7 +53,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/slicing/objects/ssrc/TestI.java b/java/test/Ice/slicing/objects/ssrc/TestI.java
index 68ea468f68c..fdad2fb3487 100644
--- a/java/test/Ice/slicing/objects/ssrc/TestI.java
+++ b/java/test/Ice/slicing/objects/ssrc/TestI.java
@@ -26,324 +26,324 @@ public final class TestI extends _TestIntfDisp
public Ice.Object
SBaseAsObject(Ice.Current current)
{
- SBase sb = new SBase();
- sb.sb = "SBase.sb";
- return sb;
+ SBase sb = new SBase();
+ sb.sb = "SBase.sb";
+ return sb;
}
public SBase
SBaseAsSBase(Ice.Current current)
{
- SBase sb = new SBase();
- sb.sb = "SBase.sb";
- return sb;
+ SBase sb = new SBase();
+ sb.sb = "SBase.sb";
+ return sb;
}
public SBase
SBSKnownDerivedAsSBase(Ice.Current current)
{
- SBSKnownDerived sbskd = new SBSKnownDerived();
- sbskd.sb = "SBSKnownDerived.sb";
- sbskd.sbskd = "SBSKnownDerived.sbskd";
- return sbskd;
+ SBSKnownDerived sbskd = new SBSKnownDerived();
+ sbskd.sb = "SBSKnownDerived.sb";
+ sbskd.sbskd = "SBSKnownDerived.sbskd";
+ return sbskd;
}
public SBSKnownDerived
SBSKnownDerivedAsSBSKnownDerived(Ice.Current current)
{
- SBSKnownDerived sbskd = new SBSKnownDerived();
- sbskd.sb = "SBSKnownDerived.sb";
- sbskd.sbskd = "SBSKnownDerived.sbskd";
- return sbskd;
+ SBSKnownDerived sbskd = new SBSKnownDerived();
+ sbskd.sb = "SBSKnownDerived.sb";
+ sbskd.sbskd = "SBSKnownDerived.sbskd";
+ return sbskd;
}
public SBase
SBSUnknownDerivedAsSBase(Ice.Current current)
{
- SBSUnknownDerived sbsud = new SBSUnknownDerived();
- sbsud.sb = "SBSUnknownDerived.sb";
- sbsud.sbsud = "SBSUnknownDerived.sbsud";
- return sbsud;
+ SBSUnknownDerived sbsud = new SBSUnknownDerived();
+ sbsud.sb = "SBSUnknownDerived.sb";
+ sbsud.sbsud = "SBSUnknownDerived.sbsud";
+ return sbsud;
}
public Ice.Object
SUnknownAsObject(Ice.Current current)
{
- SUnknown su = new SUnknown();
- su.su = "SUnknown.su";
- return su;
+ SUnknown su = new SUnknown();
+ su.su = "SUnknown.su";
+ return su;
}
public B
oneElementCycle(Ice.Current current)
{
- B b = new B();
- b.sb = "B1.sb";
- b.pb = b;
- return b;
+ B b = new B();
+ b.sb = "B1.sb";
+ b.pb = b;
+ return b;
}
public B
twoElementCycle(Ice.Current current)
{
- B b1 = new B();
- b1.sb = "B1.sb";
- B b2 = new B();
- b2.sb = "B2.sb";
- b2.pb = b1;
- b1.pb = b2;
- return b1;
+ B b1 = new B();
+ b1.sb = "B1.sb";
+ B b2 = new B();
+ b2.sb = "B2.sb";
+ b2.pb = b1;
+ b1.pb = b2;
+ return b1;
}
public B
D1AsB(Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- return d1;
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ return d1;
}
public D1
D1AsD1(Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- return d1;
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ return d1;
}
public B
D2AsB(Ice.Current current)
{
- D2 d2 = new D2();
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- D1 d1 = new D1();
- d1.pb = d2;
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- d1.pd1 = d2;
- d2.pb = d1;
- d2.pd2 = d1;
- return d2;
+ D2 d2 = new D2();
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ D1 d1 = new D1();
+ d1.pb = d2;
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ d1.pd1 = d2;
+ d2.pb = d1;
+ d2.pd2 = d1;
+ return d2;
}
public void
paramTest1(BHolder p1, BHolder p2, Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- p1.value = d1;
- p2.value = d2;
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ p1.value = d1;
+ p2.value = d2;
}
public void
paramTest2(BHolder p1, BHolder p2, Ice.Current current)
{
- paramTest1(p2, p1, current);
+ paramTest1(p2, p1, current);
}
public B
paramTest3(BHolder p1, BHolder p2, Ice.Current current)
{
- D2 d2 = new D2();
- d2.sb = "D2.sb (p1 1)";
- d2.pb = null;
- d2.sd2 = "D2.sd2 (p1 1)";
- p1.value = d2;
-
- D1 d1 = new D1();
- d1.sb = "D1.sb (p1 2)";
- d1.pb = null;
- d1.sd1 = "D1.sd2 (p1 2)";
- d1.pd1 = null;
- d2.pd2 = d1;
-
- D2 d4 = new D2();
- d4.sb = "D2.sb (p2 1)";
- d4.pb = null;
- d4.sd2 = "D2.sd2 (p2 1)";
- p2.value = d4;
-
- D1 d3 = new D1();
- d3.sb = "D1.sb (p2 2)";
- d3.pb = null;
- d3.sd1 = "D1.sd2 (p2 2)";
- d3.pd1 = null;
- d4.pd2 = d3;
-
- return d3;
+ D2 d2 = new D2();
+ d2.sb = "D2.sb (p1 1)";
+ d2.pb = null;
+ d2.sd2 = "D2.sd2 (p1 1)";
+ p1.value = d2;
+
+ D1 d1 = new D1();
+ d1.sb = "D1.sb (p1 2)";
+ d1.pb = null;
+ d1.sd1 = "D1.sd2 (p1 2)";
+ d1.pd1 = null;
+ d2.pd2 = d1;
+
+ D2 d4 = new D2();
+ d4.sb = "D2.sb (p2 1)";
+ d4.pb = null;
+ d4.sd2 = "D2.sd2 (p2 1)";
+ p2.value = d4;
+
+ D1 d3 = new D1();
+ d3.sb = "D1.sb (p2 2)";
+ d3.pb = null;
+ d3.sd1 = "D1.sd2 (p2 2)";
+ d3.pd1 = null;
+ d4.pd2 = d3;
+
+ return d3;
}
public B
paramTest4(BHolder p1, Ice.Current current)
{
- D4 d4 = new D4();
- d4.sb = "D4.sb (1)";
- d4.pb = null;
- d4.p1 = new B();
- d4.p1.sb = "B.sb (1)";
- d4.p2 = new B();
- d4.p2.sb = "B.sb (2)";
- p1.value = d4;
- return d4.p2;
+ D4 d4 = new D4();
+ d4.sb = "D4.sb (1)";
+ d4.pb = null;
+ d4.p1 = new B();
+ d4.p1.sb = "B.sb (1)";
+ d4.p2 = new B();
+ d4.p2.sb = "B.sb (2)";
+ p1.value = d4;
+ return d4.p2;
}
public B
returnTest1(BHolder p1, BHolder p2, Ice.Current current)
{
- Ice.Current c;
- paramTest1(p1, p2, current);
- return p1.value;
+ Ice.Current c;
+ paramTest1(p1, p2, current);
+ return p1.value;
}
public B
returnTest2(BHolder p1, BHolder p2, Ice.Current current)
{
- Ice.Current c;
- paramTest1(p2, p1, current);
- return p1.value;
+ Ice.Current c;
+ paramTest1(p2, p1, current);
+ return p1.value;
}
public B
returnTest3(B p1, B p2, Ice.Current current)
{
- return p1;
+ return p1;
}
public SS
sequenceTest(SS1 p1, SS2 p2, Ice.Current current)
{
- SS ss = new SS();
- ss.c1 = p1;
- ss.c2 = p2;
- return ss;
+ SS ss = new SS();
+ ss.c1 = p1;
+ ss.c2 = p2;
+ return ss;
}
public java.util.Map
dictionaryTest(java.util.Map bin, BDictHolder bout, Ice.Current current)
{
- bout.value = new java.util.HashMap();
- int i;
- for(i = 0; i < 10; ++i)
- {
- B b = (B)bin.get(new Integer(i));
- D2 d2 = new D2();
- d2.sb = b.sb;
- d2.pb = b.pb;
- d2.sd2 = "D2";
- d2.pd2 = d2;
- bout.value.put(new Integer(i * 10), d2);
- }
- java.util.Map r = new java.util.HashMap();
- for(i = 0; i < 10; ++i)
- {
- String s = "D1." + new Integer(i * 20).toString();
- D1 d1 = new D1();
- d1.sb = s;
- d1.pb = (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20)));
- d1.sd1 = s;
- d1.pd1 = d1;
- r.put(new Integer(i * 20), d1);
- }
- return r;
+ bout.value = new java.util.HashMap();
+ int i;
+ for(i = 0; i < 10; ++i)
+ {
+ B b = (B)bin.get(new Integer(i));
+ D2 d2 = new D2();
+ d2.sb = b.sb;
+ d2.pb = b.pb;
+ d2.sd2 = "D2";
+ d2.pd2 = d2;
+ bout.value.put(new Integer(i * 10), d2);
+ }
+ java.util.Map r = new java.util.HashMap();
+ for(i = 0; i < 10; ++i)
+ {
+ String s = "D1." + new Integer(i * 20).toString();
+ D1 d1 = new D1();
+ d1.sb = s;
+ d1.pb = (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20)));
+ d1.sd1 = s;
+ d1.pd1 = d1;
+ r.put(new Integer(i * 20), d1);
+ }
+ return r;
}
public void
throwBaseAsBase(Ice.Current current)
throws BaseException
{
- BaseException be = new BaseException();
- be.sbe = "sbe";
- be.pb = new B();
- be.pb.sb = "sb";
- be.pb.pb = be.pb;
- throw be;
+ BaseException be = new BaseException();
+ be.sbe = "sbe";
+ be.pb = new B();
+ be.pb.sb = "sb";
+ be.pb.pb = be.pb;
+ throw be;
}
public void
throwDerivedAsBase(Ice.Current current)
throws BaseException
{
- DerivedException de = new DerivedException();
- de.sbe = "sbe";
- de.pb = new B();
- de.pb.sb = "sb1";
- de.pb.pb = de.pb;
- de.sde = "sde1";
- de.pd1 = new D1();
- de.pd1.sb = "sb2";
- de.pd1.pb = de.pd1;
- de.pd1.sd1 = "sd2";
- de.pd1.pd1 = de.pd1;
- throw de;
+ DerivedException de = new DerivedException();
+ de.sbe = "sbe";
+ de.pb = new B();
+ de.pb.sb = "sb1";
+ de.pb.pb = de.pb;
+ de.sde = "sde1";
+ de.pd1 = new D1();
+ de.pd1.sb = "sb2";
+ de.pd1.pb = de.pd1;
+ de.pd1.sd1 = "sd2";
+ de.pd1.pd1 = de.pd1;
+ throw de;
}
public void
throwDerivedAsDerived(Ice.Current current)
throws DerivedException
{
- DerivedException de = new DerivedException();
- de.sbe = "sbe";
- de.pb = new B();
- de.pb.sb = "sb1";
- de.pb.pb = de.pb;
- de.sde = "sde1";
- de.pd1 = new D1();
- de.pd1.sb = "sb2";
- de.pd1.pb = de.pd1;
- de.pd1.sd1 = "sd2";
- de.pd1.pd1 = de.pd1;
- throw de;
+ DerivedException de = new DerivedException();
+ de.sbe = "sbe";
+ de.pb = new B();
+ de.pb.sb = "sb1";
+ de.pb.pb = de.pb;
+ de.sde = "sde1";
+ de.pd1 = new D1();
+ de.pd1.sb = "sb2";
+ de.pd1.pb = de.pd1;
+ de.pd1.sd1 = "sd2";
+ de.pd1.pd1 = de.pd1;
+ throw de;
}
public void
throwUnknownDerivedAsBase(Ice.Current current)
- throws BaseException
+ throws BaseException
{
- D2 d2 = new D2();
- d2.sb = "sb d2";
- d2.pb = d2;
- d2.sd2 = "sd2 d2";
- d2.pd2 = d2;
-
- UnknownDerivedException ude = new UnknownDerivedException();
- ude.sbe = "sbe";
- ude.pb = d2;
- ude.sude = "sude";
- ude.pd2 = d2;
- throw ude;
+ D2 d2 = new D2();
+ d2.sb = "sb d2";
+ d2.pb = d2;
+ d2.sd2 = "sd2 d2";
+ d2.pd2 = d2;
+
+ UnknownDerivedException ude = new UnknownDerivedException();
+ ude.sbe = "sbe";
+ ude.pb = d2;
+ ude.sude = "sude";
+ ude.pd2 = d2;
+ throw ude;
}
public void
useForward(ForwardHolder f, Ice.Current current)
{
- f.value = new Forward();
- f.value.h = new Hidden();
- f.value.h.f = f.value;
+ f.value = new Forward();
+ f.value.h = new Hidden();
+ f.value.h.f = f.value;
}
private Ice.ObjectAdapter _adapter;
diff --git a/java/test/Ice/slicing/objectsAMD/Server.java b/java/test/Ice/slicing/objectsAMD/Server.java
index f444f94ba6d..c1a6dba0ac3 100644
--- a/java/test/Ice/slicing/objectsAMD/Server.java
+++ b/java/test/Ice/slicing/objectsAMD/Server.java
@@ -53,7 +53,7 @@ public class Server
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/slicing/objectsAMD/TestAMD.ice b/java/test/Ice/slicing/objectsAMD/TestAMD.ice
index 9303d9e8325..1fe41bec3f5 100644
--- a/java/test/Ice/slicing/objectsAMD/TestAMD.ice
+++ b/java/test/Ice/slicing/objectsAMD/TestAMD.ice
@@ -67,7 +67,7 @@ exception DerivedException extends BaseException
D1 pd1;
};
-class Forward; // Forward-declared class defined in another compilation unit
+class Forward; // Forward-declared class defined in another compilation unit
["ami", "amd"] interface TestIntf
{
@@ -104,7 +104,7 @@ class Forward; // Forward-declared class defined in another compilation unit
void throwDerivedAsDerived() throws DerivedException;
void throwUnknownDerivedAsBase() throws BaseException;
- void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly.
+ void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly.
void shutdown();
};
diff --git a/java/test/Ice/slicing/objectsAMD/TestI.java b/java/test/Ice/slicing/objectsAMD/TestI.java
index ba3ff59afcf..3700d9dae29 100644
--- a/java/test/Ice/slicing/objectsAMD/TestI.java
+++ b/java/test/Ice/slicing/objectsAMD/TestI.java
@@ -21,353 +21,353 @@ public final class TestI extends _TestIntfDisp
shutdown_async(AMD_TestIntf_shutdown cb, Ice.Current current)
{
_adapter.getCommunicator().shutdown();
- cb.ice_response();
+ cb.ice_response();
}
public void
SBaseAsObject_async(AMD_TestIntf_SBaseAsObject cb, Ice.Current current)
{
- SBase sb = new SBase();
- sb.sb = "SBase.sb";
- cb.ice_response(sb);
+ SBase sb = new SBase();
+ sb.sb = "SBase.sb";
+ cb.ice_response(sb);
}
public void
SBaseAsSBase_async(AMD_TestIntf_SBaseAsSBase cb, Ice.Current current)
{
- SBase sb = new SBase();
- sb.sb = "SBase.sb";
- cb.ice_response(sb);
+ SBase sb = new SBase();
+ sb.sb = "SBase.sb";
+ cb.ice_response(sb);
}
public void
SBSKnownDerivedAsSBase_async(AMD_TestIntf_SBSKnownDerivedAsSBase cb, Ice.Current current)
{
- SBSKnownDerived sbskd = new SBSKnownDerived();
- sbskd.sb = "SBSKnownDerived.sb";
- sbskd.sbskd = "SBSKnownDerived.sbskd";
- cb.ice_response(sbskd);
+ SBSKnownDerived sbskd = new SBSKnownDerived();
+ sbskd.sb = "SBSKnownDerived.sb";
+ sbskd.sbskd = "SBSKnownDerived.sbskd";
+ cb.ice_response(sbskd);
}
public void
SBSKnownDerivedAsSBSKnownDerived_async(AMD_TestIntf_SBSKnownDerivedAsSBSKnownDerived cb, Ice.Current current)
{
- SBSKnownDerived sbskd = new SBSKnownDerived();
- sbskd.sb = "SBSKnownDerived.sb";
- sbskd.sbskd = "SBSKnownDerived.sbskd";
- cb.ice_response(sbskd);
+ SBSKnownDerived sbskd = new SBSKnownDerived();
+ sbskd.sb = "SBSKnownDerived.sb";
+ sbskd.sbskd = "SBSKnownDerived.sbskd";
+ cb.ice_response(sbskd);
}
public void
SBSUnknownDerivedAsSBase_async(AMD_TestIntf_SBSUnknownDerivedAsSBase cb, Ice.Current current)
{
- SBSUnknownDerived sbsud = new SBSUnknownDerived();
- sbsud.sb = "SBSUnknownDerived.sb";
- sbsud.sbsud = "SBSUnknownDerived.sbsud";
- cb.ice_response(sbsud);
+ SBSUnknownDerived sbsud = new SBSUnknownDerived();
+ sbsud.sb = "SBSUnknownDerived.sb";
+ sbsud.sbsud = "SBSUnknownDerived.sbsud";
+ cb.ice_response(sbsud);
}
public void
SUnknownAsObject_async(AMD_TestIntf_SUnknownAsObject cb, Ice.Current current)
{
- SUnknown su = new SUnknown();
- su.su = "SUnknown.su";
- cb.ice_response(su);
+ SUnknown su = new SUnknown();
+ su.su = "SUnknown.su";
+ cb.ice_response(su);
}
public void
oneElementCycle_async(AMD_TestIntf_oneElementCycle cb, Ice.Current current)
{
- B b = new B();
- b.sb = "B1.sb";
- b.pb = b;
- cb.ice_response(b);
+ B b = new B();
+ b.sb = "B1.sb";
+ b.pb = b;
+ cb.ice_response(b);
}
public void
twoElementCycle_async(AMD_TestIntf_twoElementCycle cb, Ice.Current current)
{
- B b1 = new B();
- b1.sb = "B1.sb";
- B b2 = new B();
- b2.sb = "B2.sb";
- b2.pb = b1;
- b1.pb = b2;
- cb.ice_response(b1);
+ B b1 = new B();
+ b1.sb = "B1.sb";
+ B b2 = new B();
+ b2.sb = "B2.sb";
+ b2.pb = b1;
+ b1.pb = b2;
+ cb.ice_response(b1);
}
public void
D1AsB_async(AMD_TestIntf_D1AsB cb, Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- cb.ice_response(d1);
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ cb.ice_response(d1);
}
public void
D1AsD1_async(AMD_TestIntf_D1AsD1 cb, Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- cb.ice_response(d1);
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ cb.ice_response(d1);
}
public void
D2AsB_async(AMD_TestIntf_D2AsB cb, Ice.Current current)
{
- D2 d2 = new D2();
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- D1 d1 = new D1();
- d1.pb = d2;
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- d1.pd1 = d2;
- d2.pb = d1;
- d2.pd2 = d1;
- cb.ice_response(d2);
+ D2 d2 = new D2();
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ D1 d1 = new D1();
+ d1.pb = d2;
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ d1.pd1 = d2;
+ d2.pb = d1;
+ d2.pd2 = d1;
+ cb.ice_response(d2);
}
public void
paramTest1_async(AMD_TestIntf_paramTest1 cb, Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- cb.ice_response(d1, d2);
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ cb.ice_response(d1, d2);
}
public void
paramTest2_async(AMD_TestIntf_paramTest2 cb, Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- cb.ice_response(d2, d1);
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ cb.ice_response(d2, d1);
}
public void
paramTest3_async(AMD_TestIntf_paramTest3 cb, Ice.Current current)
{
- D2 d2 = new D2();
- d2.sb = "D2.sb (p1 1)";
- d2.pb = null;
- d2.sd2 = "D2.sd2 (p1 1)";
-
- D1 d1 = new D1();
- d1.sb = "D1.sb (p1 2)";
- d1.pb = null;
- d1.sd1 = "D1.sd2 (p1 2)";
- d1.pd1 = null;
- d2.pd2 = d1;
-
- D2 d4 = new D2();
- d4.sb = "D2.sb (p2 1)";
- d4.pb = null;
- d4.sd2 = "D2.sd2 (p2 1)";
-
- D1 d3 = new D1();
- d3.sb = "D1.sb (p2 2)";
- d3.pb = null;
- d3.sd1 = "D1.sd2 (p2 2)";
- d3.pd1 = null;
- d4.pd2 = d3;
- cb.ice_response(d3, d2, d4);
+ D2 d2 = new D2();
+ d2.sb = "D2.sb (p1 1)";
+ d2.pb = null;
+ d2.sd2 = "D2.sd2 (p1 1)";
+
+ D1 d1 = new D1();
+ d1.sb = "D1.sb (p1 2)";
+ d1.pb = null;
+ d1.sd1 = "D1.sd2 (p1 2)";
+ d1.pd1 = null;
+ d2.pd2 = d1;
+
+ D2 d4 = new D2();
+ d4.sb = "D2.sb (p2 1)";
+ d4.pb = null;
+ d4.sd2 = "D2.sd2 (p2 1)";
+
+ D1 d3 = new D1();
+ d3.sb = "D1.sb (p2 2)";
+ d3.pb = null;
+ d3.sd1 = "D1.sd2 (p2 2)";
+ d3.pd1 = null;
+ d4.pd2 = d3;
+ cb.ice_response(d3, d2, d4);
}
public void
paramTest4_async(AMD_TestIntf_paramTest4 cb, Ice.Current current)
{
- D4 d4 = new D4();
- d4.sb = "D4.sb (1)";
- d4.pb = null;
- d4.p1 = new B();
- d4.p1.sb = "B.sb (1)";
- d4.p2 = new B();
- d4.p2.sb = "B.sb (2)";
- cb.ice_response(d4.p2, d4);
+ D4 d4 = new D4();
+ d4.sb = "D4.sb (1)";
+ d4.pb = null;
+ d4.p1 = new B();
+ d4.p1.sb = "B.sb (1)";
+ d4.p2 = new B();
+ d4.p2.sb = "B.sb (2)";
+ cb.ice_response(d4.p2, d4);
}
public void
returnTest1_async(AMD_TestIntf_returnTest1 cb, Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- cb.ice_response(d2, d2, d1);
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ cb.ice_response(d2, d2, d1);
}
public void
returnTest2_async(AMD_TestIntf_returnTest2 cb, Ice.Current current)
{
- D1 d1 = new D1();
- d1.sb = "D1.sb";
- d1.sd1 = "D1.sd1";
- D2 d2 = new D2();
- d2.pb = d1;
- d2.sb = "D2.sb";
- d2.sd2 = "D2.sd2";
- d2.pd2 = d1;
- d1.pb = d2;
- d1.pd1 = d2;
- cb.ice_response(d1, d1, d2);
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D2 d2 = new D2();
+ d2.pb = d1;
+ d2.sb = "D2.sb";
+ d2.sd2 = "D2.sd2";
+ d2.pd2 = d1;
+ d1.pb = d2;
+ d1.pd1 = d2;
+ cb.ice_response(d1, d1, d2);
}
public void
returnTest3_async(AMD_TestIntf_returnTest3 cb, B p1, B p2, Ice.Current current)
{
- cb.ice_response(p1);
+ cb.ice_response(p1);
}
public void
sequenceTest_async(AMD_TestIntf_sequenceTest cb, SS1 p1, SS2 p2, Ice.Current current)
{
- SS ss = new SS();
- ss.c1 = p1;
- ss.c2 = p2;
- cb.ice_response(ss);
+ SS ss = new SS();
+ ss.c1 = p1;
+ ss.c2 = p2;
+ cb.ice_response(ss);
}
public void
dictionaryTest_async(AMD_TestIntf_dictionaryTest cb, java.util.Map bin, Ice.Current current)
{
- java.util.Map bout = new java.util.HashMap();
- int i;
- for(i = 0; i < 10; ++i)
- {
- B b = (B)bin.get(new Integer(i));
- D2 d2 = new D2();
- d2.sb = b.sb;
- d2.pb = b.pb;
- d2.sd2 = "D2";
- d2.pd2 = d2;
- bout.put(new Integer(i * 10), d2);
- }
- java.util.Map r = new java.util.HashMap();
- for(i = 0; i < 10; ++i)
- {
- String s = "D1." + new Integer(i * 20).toString();
- D1 d1 = new D1();
- d1.sb = s;
- d1.pb = (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20)));
- d1.sd1 = s;
- d1.pd1 = d1;
- r.put(new Integer(i * 20), d1);
- }
- cb.ice_response(r, bout);
+ java.util.Map bout = new java.util.HashMap();
+ int i;
+ for(i = 0; i < 10; ++i)
+ {
+ B b = (B)bin.get(new Integer(i));
+ D2 d2 = new D2();
+ d2.sb = b.sb;
+ d2.pb = b.pb;
+ d2.sd2 = "D2";
+ d2.pd2 = d2;
+ bout.put(new Integer(i * 10), d2);
+ }
+ java.util.Map r = new java.util.HashMap();
+ for(i = 0; i < 10; ++i)
+ {
+ String s = "D1." + new Integer(i * 20).toString();
+ D1 d1 = new D1();
+ d1.sb = s;
+ d1.pb = (i == 0 ? (B)null : (B)r.get(new Integer((i - 1) * 20)));
+ d1.sd1 = s;
+ d1.pd1 = d1;
+ r.put(new Integer(i * 20), d1);
+ }
+ cb.ice_response(r, bout);
}
public void
throwBaseAsBase_async(AMD_TestIntf_throwBaseAsBase cb, Ice.Current current)
throws BaseException
{
- BaseException be = new BaseException();
- be.sbe = "sbe";
- be.pb = new B();
- be.pb.sb = "sb";
- be.pb.pb = be.pb;
- cb.ice_exception(be);
+ BaseException be = new BaseException();
+ be.sbe = "sbe";
+ be.pb = new B();
+ be.pb.sb = "sb";
+ be.pb.pb = be.pb;
+ cb.ice_exception(be);
}
public void
throwDerivedAsBase_async(AMD_TestIntf_throwDerivedAsBase cb, Ice.Current current)
throws BaseException
{
- DerivedException de = new DerivedException();
- de.sbe = "sbe";
- de.pb = new B();
- de.pb.sb = "sb1";
- de.pb.pb = de.pb;
- de.sde = "sde1";
- de.pd1 = new D1();
- de.pd1.sb = "sb2";
- de.pd1.pb = de.pd1;
- de.pd1.sd1 = "sd2";
- de.pd1.pd1 = de.pd1;
- cb.ice_exception(de);
+ DerivedException de = new DerivedException();
+ de.sbe = "sbe";
+ de.pb = new B();
+ de.pb.sb = "sb1";
+ de.pb.pb = de.pb;
+ de.sde = "sde1";
+ de.pd1 = new D1();
+ de.pd1.sb = "sb2";
+ de.pd1.pb = de.pd1;
+ de.pd1.sd1 = "sd2";
+ de.pd1.pd1 = de.pd1;
+ cb.ice_exception(de);
}
public void
throwDerivedAsDerived_async(AMD_TestIntf_throwDerivedAsDerived cb, Ice.Current current)
throws DerivedException
{
- DerivedException de = new DerivedException();
- de.sbe = "sbe";
- de.pb = new B();
- de.pb.sb = "sb1";
- de.pb.pb = de.pb;
- de.sde = "sde1";
- de.pd1 = new D1();
- de.pd1.sb = "sb2";
- de.pd1.pb = de.pd1;
- de.pd1.sd1 = "sd2";
- de.pd1.pd1 = de.pd1;
- cb.ice_exception(de);
+ DerivedException de = new DerivedException();
+ de.sbe = "sbe";
+ de.pb = new B();
+ de.pb.sb = "sb1";
+ de.pb.pb = de.pb;
+ de.sde = "sde1";
+ de.pd1 = new D1();
+ de.pd1.sb = "sb2";
+ de.pd1.pb = de.pd1;
+ de.pd1.sd1 = "sd2";
+ de.pd1.pd1 = de.pd1;
+ cb.ice_exception(de);
}
public void
throwUnknownDerivedAsBase_async(AMD_TestIntf_throwUnknownDerivedAsBase cb, Ice.Current current)
- throws BaseException
+ throws BaseException
{
- D2 d2 = new D2();
- d2.sb = "sb d2";
- d2.pb = d2;
- d2.sd2 = "sd2 d2";
- d2.pd2 = d2;
-
- UnknownDerivedException ude = new UnknownDerivedException();
- ude.sbe = "sbe";
- ude.pb = d2;
- ude.sude = "sude";
- ude.pd2 = d2;
- cb.ice_exception(ude);
+ D2 d2 = new D2();
+ d2.sb = "sb d2";
+ d2.pb = d2;
+ d2.sd2 = "sd2 d2";
+ d2.pd2 = d2;
+
+ UnknownDerivedException ude = new UnknownDerivedException();
+ ude.sbe = "sbe";
+ ude.pb = d2;
+ ude.sude = "sude";
+ ude.pd2 = d2;
+ cb.ice_exception(ude);
}
public void
useForward_async(AMD_TestIntf_useForward cb, Ice.Current current)
{
- Forward f = new Forward();
- f = new Forward();
- f.h = new Hidden();
- f.h.f = f;
- cb.ice_response(f);
+ Forward f = new Forward();
+ f = new Forward();
+ f.h = new Hidden();
+ f.h.f = f;
+ cb.ice_response(f);
}
private Ice.ObjectAdapter _adapter;
diff --git a/java/test/Ice/stream/Client.java b/java/test/Ice/stream/Client.java
index 44d15aeab6a..560afec548e 100644
--- a/java/test/Ice/stream/Client.java
+++ b/java/test/Ice/stream/Client.java
@@ -78,36 +78,36 @@ public class Client
private static class MyClassFactoryWrapper extends Ice.LocalObjectImpl implements Ice.ObjectFactory
{
- MyClassFactoryWrapper()
- {
- _factory = Test.MyClass.ice_factory();
- }
-
- public Ice.Object
- create(String type)
- {
- return _factory.create(type);
- }
-
- public void
- destroy()
- {
- }
-
- void
- setFactory(Ice.ObjectFactory factory)
- {
- _factory = factory;
- }
-
- private Ice.ObjectFactory _factory;
+ MyClassFactoryWrapper()
+ {
+ _factory = Test.MyClass.ice_factory();
+ }
+
+ public Ice.Object
+ create(String type)
+ {
+ return _factory.create(type);
+ }
+
+ public void
+ destroy()
+ {
+ }
+
+ void
+ setFactory(Ice.ObjectFactory factory)
+ {
+ _factory = factory;
+ }
+
+ private Ice.ObjectFactory _factory;
}
private static int
run(String[] args, Ice.Communicator communicator)
{
- MyClassFactoryWrapper factoryWrapper = new MyClassFactoryWrapper();
- communicator.addObjectFactory(factoryWrapper, Test.MyClass.ice_staticId());
+ MyClassFactoryWrapper factoryWrapper = new MyClassFactoryWrapper();
+ communicator.addObjectFactory(factoryWrapper, Test.MyClass.ice_staticId());
Ice.InputStream in;
Ice.OutputStream out;
@@ -506,7 +506,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/Ice/timeout/AllTests.java b/java/test/Ice/timeout/AllTests.java
index 8a2ff1d6350..6484d7aee2e 100644
--- a/java/test/Ice/timeout/AllTests.java
+++ b/java/test/Ice/timeout/AllTests.java
@@ -14,414 +14,414 @@ public class AllTests
private static void
test(boolean b)
{
- if(!b)
- {
- throw new RuntimeException();
- }
+ if(!b)
+ {
+ throw new RuntimeException();
+ }
}
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;
+ 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 AMISendData extends Test.AMI_Timeout_sendData
{
- public void
- ice_response()
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMISendDataEx extends Test.AMI_Timeout_sendData
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(ex instanceof Ice.TimeoutException);
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(ex instanceof Ice.TimeoutException);
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMISleep extends Test.AMI_Timeout_sleep
{
- public void
- ice_response()
- {
- callback.called();
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(false);
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ callback.called();
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(false);
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
private static class AMISleepEx extends Test.AMI_Timeout_sleep
{
- public void
- ice_response()
- {
- test(false);
- }
-
- public void
- ice_exception(Ice.LocalException ex)
- {
- test(ex instanceof Ice.TimeoutException);
- callback.called();
- }
-
- public boolean
- check()
- {
- return callback.check();
- }
-
- private Callback callback = new Callback();
+ public void
+ ice_response()
+ {
+ test(false);
+ }
+
+ public void
+ ice_exception(Ice.LocalException ex)
+ {
+ test(ex instanceof Ice.TimeoutException);
+ callback.called();
+ }
+
+ public boolean
+ check()
+ {
+ return callback.check();
+ }
+
+ private Callback callback = new Callback();
}
public static Test.TimeoutPrx
allTests(Ice.Communicator communicator, java.io.PrintStream out)
{
- String sref = "timeout:default -p 12010 -t 10000";
- Ice.ObjectPrx obj = communicator.stringToProxy(sref);
- test(obj != null);
-
- TimeoutPrx timeout = TimeoutPrxHelper.checkedCast(obj);
- test(timeout != null);
-
- out.print("testing connect timeout... ");
- out.flush();
- {
- //
- // Expect ConnectTimeoutException.
- //
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
- to.holdAdapter(1000);
- to.ice_getConnection().close(true); // Force a reconnect.
- try
- {
- to.op();
- test(false);
- }
- catch(Ice.ConnectTimeoutException ex)
- {
- // Expected.
- }
- }
- {
- //
- // Expect success.
- //
- timeout.op(); // Ensure adapter is active.
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
- to.holdAdapter(500);
- to.ice_getConnection().close(true); // Force a reconnect.
- try
- {
- to.op();
- }
- catch(Ice.ConnectTimeoutException ex)
- {
- test(false);
- }
- }
- out.println("ok");
-
- out.print("testing read timeout... ");
- out.flush();
- {
- //
- // Expect TimeoutException.
- //
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
- try
- {
- to.sleep(750);
- test(false);
- }
- catch(Ice.TimeoutException ex)
- {
- // Expected.
- }
- }
- {
- //
- // Expect success.
- //
- timeout.op(); // Ensure adapter is active.
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
- try
- {
- to.sleep(500);
- }
- catch(Ice.TimeoutException ex)
- {
- test(false);
- }
- }
- out.println("ok");
-
- out.print("testing write timeout... ");
- out.flush();
- {
- //
- // Expect TimeoutException.
- //
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
- to.holdAdapter(750);
- try
- {
- byte[] seq = new byte[100000];
- to.sendData(seq);
- test(false);
- }
- catch(Ice.TimeoutException ex)
- {
- // Expected.
- }
- }
- {
- //
- // Expect success.
- //
- timeout.op(); // Ensure adapter is active.
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
- to.holdAdapter(500);
- try
- {
- byte[] seq = new byte[100000];
- to.sendData(seq);
- }
- catch(Ice.TimeoutException ex)
- {
- test(false);
- }
- }
- out.println("ok");
-
- out.print("testing AMI read timeout... ");
- out.flush();
- {
- //
- // The resolution of AMI timeouts is limited by the connection monitor
- // thread. We set Ice.MonitorConnections=1 (one second) in main().
- //
- // Expect TimeoutException.
- //
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
- AMISleepEx cb = new AMISleepEx();
- to.sleep_async(cb, 2000);
- test(cb.check());
- }
- {
- //
- // Expect success.
- //
- timeout.op(); // Ensure adapter is active.
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
- AMISleep cb = new AMISleep();
- to.sleep_async(cb, 500);
- test(cb.check());
- }
- out.println("ok");
-
- out.print("testing AMI write timeout... ");
- out.flush();
- {
- //
- // The resolution of AMI timeouts is limited by the connection monitor
- // thread. We set Ice.MonitorConnections=1 (one second) in main().
- //
- // Expect TimeoutException.
- //
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
- to.holdAdapter(2000);
- byte[] seq = new byte[100000];
- AMISendDataEx cb = new AMISendDataEx();
- to.sendData_async(cb, seq);
- test(cb.check());
- }
- {
- //
- // Expect success.
- //
- timeout.op(); // Ensure adapter is active.
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
- to.holdAdapter(500);
- byte[] seq = new byte[100000];
- AMISendData cb = new AMISendData();
- to.sendData_async(cb, seq);
- test(cb.check());
- }
- out.println("ok");
-
- out.print("testing timeout overrides... ");
- out.flush();
- {
- //
- // Test Ice.Override.Timeout. This property overrides all
- // endpoint timeouts.
- //
- String[] args = new String[0];
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = communicator.getProperties()._clone();
- initData.properties.setProperty("Ice.Override.Timeout", "500");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- TimeoutPrx to = TimeoutPrxHelper.checkedCast(comm.stringToProxy(sref));
- try
- {
- to.sleep(750);
- test(false);
- }
- catch(Ice.TimeoutException ex)
- {
- // Expected.
- }
- //
- // Calling ice_timeout() should have no effect.
- //
- timeout.op(); // Ensure adapter is active.
- to = TimeoutPrxHelper.checkedCast(to.ice_timeout(1000));
- try
- {
- to.sleep(750);
- test(false);
- }
- catch(Ice.TimeoutException ex)
- {
- // Expected.
- }
- comm.destroy();
- }
- {
- //
- // Test Ice.Override.ConnectTimeout.
- //
- String[] args = new String[0];
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = communicator.getProperties()._clone();
- initData.properties.setProperty("Ice.Override.ConnectTimeout", "750");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- timeout.holdAdapter(1250);
- TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(comm.stringToProxy(sref));
- try
- {
- to.op();
- test(false);
- }
- catch(Ice.ConnectTimeoutException ex)
- {
- // Expected.
- }
- //
- // Calling ice_timeout() should have no effect on the connect timeout.
- //
- timeout.op(); // Ensure adapter is active.
- timeout.holdAdapter(1250);
- to = TimeoutPrxHelper.uncheckedCast(to.ice_timeout(1500));
- try
- {
- to.op();
- test(false);
- }
- catch(Ice.ConnectTimeoutException ex)
- {
- // Expected.
- }
- //
- // Verify that timeout set via ice_timeout() is still used for requests.
- //
- to.op(); // Force connection.
- try
- {
- to.sleep(1750);
- test(false);
- }
- catch(Ice.TimeoutException ex)
- {
- // Expected.
- }
- comm.destroy();
- }
- out.println("ok");
-
- return timeout;
+ String sref = "timeout:default -p 12010 -t 10000";
+ Ice.ObjectPrx obj = communicator.stringToProxy(sref);
+ test(obj != null);
+
+ TimeoutPrx timeout = TimeoutPrxHelper.checkedCast(obj);
+ test(timeout != null);
+
+ out.print("testing connect timeout... ");
+ out.flush();
+ {
+ //
+ // Expect ConnectTimeoutException.
+ //
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
+ to.holdAdapter(1000);
+ to.ice_getConnection().close(true); // Force a reconnect.
+ try
+ {
+ to.op();
+ test(false);
+ }
+ catch(Ice.ConnectTimeoutException ex)
+ {
+ // Expected.
+ }
+ }
+ {
+ //
+ // Expect success.
+ //
+ timeout.op(); // Ensure adapter is active.
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
+ to.holdAdapter(500);
+ to.ice_getConnection().close(true); // Force a reconnect.
+ try
+ {
+ to.op();
+ }
+ catch(Ice.ConnectTimeoutException ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("testing read timeout... ");
+ out.flush();
+ {
+ //
+ // Expect TimeoutException.
+ //
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
+ try
+ {
+ to.sleep(750);
+ test(false);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ // Expected.
+ }
+ }
+ {
+ //
+ // Expect success.
+ //
+ timeout.op(); // Ensure adapter is active.
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
+ try
+ {
+ to.sleep(500);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("testing write timeout... ");
+ out.flush();
+ {
+ //
+ // Expect TimeoutException.
+ //
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
+ to.holdAdapter(750);
+ try
+ {
+ byte[] seq = new byte[100000];
+ to.sendData(seq);
+ test(false);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ // Expected.
+ }
+ }
+ {
+ //
+ // Expect success.
+ //
+ timeout.op(); // Ensure adapter is active.
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
+ to.holdAdapter(500);
+ try
+ {
+ byte[] seq = new byte[100000];
+ to.sendData(seq);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("testing AMI read timeout... ");
+ out.flush();
+ {
+ //
+ // The resolution of AMI timeouts is limited by the connection monitor
+ // thread. We set Ice.MonitorConnections=1 (one second) in main().
+ //
+ // Expect TimeoutException.
+ //
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
+ AMISleepEx cb = new AMISleepEx();
+ to.sleep_async(cb, 2000);
+ test(cb.check());
+ }
+ {
+ //
+ // Expect success.
+ //
+ timeout.op(); // Ensure adapter is active.
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
+ AMISleep cb = new AMISleep();
+ to.sleep_async(cb, 500);
+ test(cb.check());
+ }
+ out.println("ok");
+
+ out.print("testing AMI write timeout... ");
+ out.flush();
+ {
+ //
+ // The resolution of AMI timeouts is limited by the connection monitor
+ // thread. We set Ice.MonitorConnections=1 (one second) in main().
+ //
+ // Expect TimeoutException.
+ //
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(500));
+ to.holdAdapter(2000);
+ byte[] seq = new byte[100000];
+ AMISendDataEx cb = new AMISendDataEx();
+ to.sendData_async(cb, seq);
+ test(cb.check());
+ }
+ {
+ //
+ // Expect success.
+ //
+ timeout.op(); // Ensure adapter is active.
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000));
+ to.holdAdapter(500);
+ byte[] seq = new byte[100000];
+ AMISendData cb = new AMISendData();
+ to.sendData_async(cb, seq);
+ test(cb.check());
+ }
+ out.println("ok");
+
+ out.print("testing timeout overrides... ");
+ out.flush();
+ {
+ //
+ // Test Ice.Override.Timeout. This property overrides all
+ // endpoint timeouts.
+ //
+ String[] args = new String[0];
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = communicator.getProperties()._clone();
+ initData.properties.setProperty("Ice.Override.Timeout", "500");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ TimeoutPrx to = TimeoutPrxHelper.checkedCast(comm.stringToProxy(sref));
+ try
+ {
+ to.sleep(750);
+ test(false);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ // Expected.
+ }
+ //
+ // Calling ice_timeout() should have no effect.
+ //
+ timeout.op(); // Ensure adapter is active.
+ to = TimeoutPrxHelper.checkedCast(to.ice_timeout(1000));
+ try
+ {
+ to.sleep(750);
+ test(false);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ // Expected.
+ }
+ comm.destroy();
+ }
+ {
+ //
+ // Test Ice.Override.ConnectTimeout.
+ //
+ String[] args = new String[0];
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = communicator.getProperties()._clone();
+ initData.properties.setProperty("Ice.Override.ConnectTimeout", "750");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ timeout.holdAdapter(1250);
+ TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(comm.stringToProxy(sref));
+ try
+ {
+ to.op();
+ test(false);
+ }
+ catch(Ice.ConnectTimeoutException ex)
+ {
+ // Expected.
+ }
+ //
+ // Calling ice_timeout() should have no effect on the connect timeout.
+ //
+ timeout.op(); // Ensure adapter is active.
+ timeout.holdAdapter(1250);
+ to = TimeoutPrxHelper.uncheckedCast(to.ice_timeout(1500));
+ try
+ {
+ to.op();
+ test(false);
+ }
+ catch(Ice.ConnectTimeoutException ex)
+ {
+ // Expected.
+ }
+ //
+ // Verify that timeout set via ice_timeout() is still used for requests.
+ //
+ to.op(); // Force connection.
+ try
+ {
+ to.sleep(1750);
+ test(false);
+ }
+ catch(Ice.TimeoutException ex)
+ {
+ // Expected.
+ }
+ comm.destroy();
+ }
+ out.println("ok");
+
+ return timeout;
}
}
diff --git a/java/test/Ice/timeout/Client.java b/java/test/Ice/timeout/Client.java
index 18077666e71..3fcec904a74 100644
--- a/java/test/Ice/timeout/Client.java
+++ b/java/test/Ice/timeout/Client.java
@@ -12,61 +12,61 @@ public class Client
public static int
run(String[] args, Ice.Communicator communicator, java.io.PrintStream out)
{
- Test.TimeoutPrx timeout = AllTests.allTests(communicator, out);
- timeout.shutdown();
- return 0;
+ Test.TimeoutPrx timeout = AllTests.allTests(communicator, out);
+ timeout.shutdown();
+ return 0;
}
public static void
main(String[] args)
{
- int status = 0;
- Ice.Communicator communicator = null;
+ int status = 0;
+ Ice.Communicator communicator = null;
- try
- {
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
+ try
+ {
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
- //
- // For this test, we want to disable retries.
- //
- initData.properties.setProperty("Ice.RetryIntervals", "-1");
+ //
+ // For this test, we want to disable retries.
+ //
+ initData.properties.setProperty("Ice.RetryIntervals", "-1");
- //
- // This test kills connections, so we don't want warnings.
- //
- initData.properties.setProperty("Ice.Warn.Connections", "0");
+ //
+ // This test kills connections, so we don't want warnings.
+ //
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
- //
- // Check for AMI timeouts every second.
- //
- initData.properties.setProperty("Ice.MonitorConnections", "1");
+ //
+ // Check for AMI timeouts every second.
+ //
+ initData.properties.setProperty("Ice.MonitorConnections", "1");
- communicator = Ice.Util.initialize(argsH, initData);
- status = run(argsH.value, communicator, System.out);
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
+ communicator = Ice.Util.initialize(argsH, initData);
+ status = run(argsH.value, communicator, System.out);
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
- }
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
+ }
- System.gc();
- System.exit(status);
+ System.gc();
+ System.exit(status);
}
}
diff --git a/java/test/Ice/timeout/Server.java b/java/test/Ice/timeout/Server.java
index 5a52f526046..50f87044eb3 100644
--- a/java/test/Ice/timeout/Server.java
+++ b/java/test/Ice/timeout/Server.java
@@ -12,64 +12,64 @@ public class Server
public static int
run(String[] args, Ice.Communicator communicator, java.io.PrintStream out)
{
- //
- // When running as a MIDlet the properties for the server may be
- // overridden by configuration. If it isn't then we assume
- // defaults.
- //
- if(communicator.getProperties().getProperty("Ice.OA.TestAdapter.Endpoints").length() == 0)
- {
- communicator.getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000");
- }
+ //
+ // When running as a MIDlet the properties for the server may be
+ // overridden by configuration. If it isn't then we assume
+ // defaults.
+ //
+ if(communicator.getProperties().getProperty("Ice.OA.TestAdapter.Endpoints").length() == 0)
+ {
+ communicator.getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000");
+ }
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
- adapter.add(new TimeoutI(), communicator.stringToIdentity("timeout"));
- adapter.activate();
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
+ adapter.add(new TimeoutI(), communicator.stringToIdentity("timeout"));
+ adapter.activate();
- communicator.waitForShutdown();
- return 0;
+ communicator.waitForShutdown();
+ return 0;
}
public static void
main(String[] args)
{
- int status = 0;
- Ice.Communicator communicator = null;
+ int status = 0;
+ Ice.Communicator communicator = null;
- try
- {
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
-
- //
- // This test kills connections, so we don't want warnings.
- //
- initData.properties.setProperty("Ice.Warn.Connections", "0");
+ try
+ {
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+
+ //
+ // This test kills connections, so we don't want warnings.
+ //
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
- communicator = Ice.Util.initialize(argsH, initData);
- status = run(argsH.value, communicator, System.out);
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
+ communicator = Ice.Util.initialize(argsH, initData);
+ status = run(argsH.value, communicator, System.out);
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
- }
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
+ }
- System.gc();
- System.exit(status);
+ System.gc();
+ System.exit(status);
}
}
diff --git a/java/test/Ice/timeout/TimeoutI.java b/java/test/Ice/timeout/TimeoutI.java
index 73d26461fde..0221ce830b1 100644
--- a/java/test/Ice/timeout/TimeoutI.java
+++ b/java/test/Ice/timeout/TimeoutI.java
@@ -13,28 +13,28 @@ class TimeoutI extends _TimeoutDisp
{
static class ActivateAdapterThread extends Thread
{
- ActivateAdapterThread(Ice.ObjectAdapter adapter, int timeout)
- {
- _adapter = adapter;
- _timeout = timeout;
- }
+ ActivateAdapterThread(Ice.ObjectAdapter adapter, int timeout)
+ {
+ _adapter = adapter;
+ _timeout = timeout;
+ }
- public void
- run()
- {
- _adapter.waitForHold();
- try
- {
- sleep(_timeout);
- }
- catch(InterruptedException ex)
- {
- }
- _adapter.activate();
- }
+ public void
+ run()
+ {
+ _adapter.waitForHold();
+ try
+ {
+ sleep(_timeout);
+ }
+ catch(InterruptedException ex)
+ {
+ }
+ _adapter.activate();
+ }
- Ice.ObjectAdapter _adapter;
- int _timeout;
+ Ice.ObjectAdapter _adapter;
+ int _timeout;
}
public void
@@ -50,26 +50,26 @@ class TimeoutI extends _TimeoutDisp
public void
sleep(int to, Ice.Current current)
{
- try
- {
- Thread.currentThread().sleep(to);
- }
- catch(InterruptedException ex)
- {
- }
+ try
+ {
+ Thread.currentThread().sleep(to);
+ }
+ catch(InterruptedException ex)
+ {
+ }
}
public void
holdAdapter(int to, Ice.Current current)
{
- current.adapter.hold();
- Thread thread = new ActivateAdapterThread(current.adapter, to);
- thread.start();
+ current.adapter.hold();
+ Thread thread = new ActivateAdapterThread(current.adapter, to);
+ thread.start();
}
public void
shutdown(Ice.Current current)
{
- current.adapter.getCommunicator().shutdown();
+ current.adapter.getCommunicator().shutdown();
}
}
diff --git a/java/test/Ice/translator/Metadata.ice b/java/test/Ice/translator/Metadata.ice
index 5dfaaba4ea1..ff74074ad8e 100644
--- a/java/test/Ice/translator/Metadata.ice
+++ b/java/test/Ice/translator/Metadata.ice
@@ -26,15 +26,15 @@ module MetadataTest
["java:type:java.util.ArrayList"] ObjectSeq modifiedObjectSeqMember;
["java:type:Test.CustomList"] ObjectList modifiedObjectListMember;
- StringDict stringDictMember;
- StringMap stringMapMember;
- ["java:type:java.util.TreeMap"] StringDict modifiedStringDictMember;
- ["java:type:java.util.IdentityHashMap"] StringMap modifiedStringMapMember;
+ StringDict stringDictMember;
+ StringMap stringMapMember;
+ ["java:type:java.util.TreeMap"] StringDict modifiedStringDictMember;
+ ["java:type:java.util.IdentityHashMap"] StringMap modifiedStringMapMember;
- ObjectDict objectDictMember;
- ObjectMap objectMapMember;
- ["java:type:java.util.TreeMap"] ObjectDict modifiedObjectDictMember;
- ["java:type:java.util.IdentityHashMap"] ObjectMap modifiedObjectMapMember;
+ ObjectDict objectDictMember;
+ ObjectMap objectMapMember;
+ ["java:type:java.util.TreeMap"] ObjectDict modifiedObjectDictMember;
+ ["java:type:java.util.IdentityHashMap"] ObjectMap modifiedObjectMapMember;
IntSeq opIntSeq(IntSeq inArg, out IntSeq outArg);
IntList opIntList(IntList inArg, out IntList outArg);
@@ -79,9 +79,9 @@ module MetadataTest
opObjectList2(["java:type:java.util.ArrayList"] ObjectList inArg,
out ["java:type:Test.CustomList"] ObjectList outArg);
- ["java:type:java.util.IdentityHashMap"] StringMap
- opStringMap2(["java:type:java.util.IdentityHashMap"] StringMap inArg,
- out ["java:type:java.util.IdentityHashMap"] StringMap outArg);
+ ["java:type:java.util.IdentityHashMap"] StringMap
+ opStringMap2(["java:type:java.util.IdentityHashMap"] StringMap inArg,
+ out ["java:type:java.util.IdentityHashMap"] StringMap outArg);
["ami", "java:type:java.util.LinkedList"] IntSeq
opIntSeq2AMI(["java:type:java.util.ArrayList"] IntSeq inArg,
diff --git a/java/test/Ice/translator/Metadata2.ice b/java/test/Ice/translator/Metadata2.ice
index 5dfaaba4ea1..ff74074ad8e 100644
--- a/java/test/Ice/translator/Metadata2.ice
+++ b/java/test/Ice/translator/Metadata2.ice
@@ -26,15 +26,15 @@ module MetadataTest
["java:type:java.util.ArrayList"] ObjectSeq modifiedObjectSeqMember;
["java:type:Test.CustomList"] ObjectList modifiedObjectListMember;
- StringDict stringDictMember;
- StringMap stringMapMember;
- ["java:type:java.util.TreeMap"] StringDict modifiedStringDictMember;
- ["java:type:java.util.IdentityHashMap"] StringMap modifiedStringMapMember;
+ StringDict stringDictMember;
+ StringMap stringMapMember;
+ ["java:type:java.util.TreeMap"] StringDict modifiedStringDictMember;
+ ["java:type:java.util.IdentityHashMap"] StringMap modifiedStringMapMember;
- ObjectDict objectDictMember;
- ObjectMap objectMapMember;
- ["java:type:java.util.TreeMap"] ObjectDict modifiedObjectDictMember;
- ["java:type:java.util.IdentityHashMap"] ObjectMap modifiedObjectMapMember;
+ ObjectDict objectDictMember;
+ ObjectMap objectMapMember;
+ ["java:type:java.util.TreeMap"] ObjectDict modifiedObjectDictMember;
+ ["java:type:java.util.IdentityHashMap"] ObjectMap modifiedObjectMapMember;
IntSeq opIntSeq(IntSeq inArg, out IntSeq outArg);
IntList opIntList(IntList inArg, out IntList outArg);
@@ -79,9 +79,9 @@ module MetadataTest
opObjectList2(["java:type:java.util.ArrayList"] ObjectList inArg,
out ["java:type:Test.CustomList"] ObjectList outArg);
- ["java:type:java.util.IdentityHashMap"] StringMap
- opStringMap2(["java:type:java.util.IdentityHashMap"] StringMap inArg,
- out ["java:type:java.util.IdentityHashMap"] StringMap outArg);
+ ["java:type:java.util.IdentityHashMap"] StringMap
+ opStringMap2(["java:type:java.util.IdentityHashMap"] StringMap inArg,
+ out ["java:type:java.util.IdentityHashMap"] StringMap outArg);
["ami", "java:type:java.util.LinkedList"] IntSeq
opIntSeq2AMI(["java:type:java.util.ArrayList"] IntSeq inArg,
diff --git a/java/test/IceGrid/simple/AllTests.java b/java/test/IceGrid/simple/AllTests.java
index 064298fc6a5..2bc7f9bd774 100644
--- a/java/test/IceGrid/simple/AllTests.java
+++ b/java/test/IceGrid/simple/AllTests.java
@@ -14,15 +14,15 @@ public class AllTests
static private class SessionKeepAliveThread extends Thread
{
SessionKeepAliveThread(IceGrid.AdminSessionPrx session, long timeout)
- {
- _session = session;
- _timeout = timeout;
- _terminated = false;
- }
+ {
+ _session = session;
+ _timeout = timeout;
+ _terminated = false;
+ }
- synchronized public void
- run()
- {
+ synchronized public void
+ run()
+ {
while(!_terminated)
{
try
@@ -34,29 +34,29 @@ public class AllTests
}
if(_terminated)
{
- break;
- }
+ break;
+ }
try
{
_session.keepAlive();
}
catch(Ice.LocalException ex)
{
- break;
+ break;
}
}
- }
+ }
- synchronized private void
- terminate()
- {
- _terminated = true;
- notify();
- }
+ synchronized private void
+ terminate()
+ {
+ _terminated = true;
+ notify();
+ }
- final private IceGrid.AdminSessionPrx _session;
- final private long _timeout;
- private boolean _terminated;
+ final private IceGrid.AdminSessionPrx _session;
+ final private long _timeout;
+ private boolean _terminated;
}
private static void
test(boolean b)
@@ -70,210 +70,210 @@ public class AllTests
public static void
allTests(Ice.Communicator communicator)
{
- System.out.print("testing stringToProxy... ");
- System.out.flush();
- String ref = "test @ TestAdapter";
- Ice.ObjectPrx base = communicator.stringToProxy(ref);
- test(base != null);
- System.out.println("ok");
+ System.out.print("testing stringToProxy... ");
+ System.out.flush();
+ String ref = "test @ TestAdapter";
+ Ice.ObjectPrx base = communicator.stringToProxy(ref);
+ test(base != null);
+ System.out.println("ok");
- System.out.print("testing checked cast... ");
- System.out.flush();
- TestIntfPrx obj = TestIntfPrxHelper.checkedCast(base);
- test(obj != null);
- test(obj.equals(base));
- System.out.println("ok");
-
- System.out.print("pinging server... ");
- System.out.flush();
- obj.ice_ping();
- System.out.println("ok");
-
- System.out.print("shutting down server... ");
- System.out.flush();
- obj.shutdown();
- System.out.println("ok");
+ System.out.print("testing checked cast... ");
+ System.out.flush();
+ TestIntfPrx obj = TestIntfPrxHelper.checkedCast(base);
+ test(obj != null);
+ test(obj.equals(base));
+ System.out.println("ok");
+
+ System.out.print("pinging server... ");
+ System.out.flush();
+ obj.ice_ping();
+ System.out.println("ok");
+
+ System.out.print("shutting down server... ");
+ System.out.flush();
+ obj.shutdown();
+ System.out.println("ok");
}
public static void
allTestsWithDeploy(Ice.Communicator communicator)
{
- System.out.print("testing stringToProxy... ");
- System.out.flush();
- Ice.ObjectPrx base = communicator.stringToProxy("test @ TestAdapter");
- test(base != null);
- Ice.ObjectPrx base2 = communicator.stringToProxy("test");
- test(base2 != null);
- System.out.println("ok");
+ System.out.print("testing stringToProxy... ");
+ System.out.flush();
+ Ice.ObjectPrx base = communicator.stringToProxy("test @ TestAdapter");
+ test(base != null);
+ Ice.ObjectPrx base2 = communicator.stringToProxy("test");
+ test(base2 != null);
+ System.out.println("ok");
- System.out.print("testing checked cast... ");
- System.out.flush();
- TestIntfPrx obj = TestIntfPrxHelper.checkedCast(base);
- test(obj != null);
- test(obj.equals(base));
- TestIntfPrx obj2 = TestIntfPrxHelper.checkedCast(base2);
- test(obj2 != null);
- test(obj2.equals(base2));
- System.out.println("ok");
-
- System.out.print("pinging server... ");
- System.out.flush();
- obj.ice_ping();
- obj2.ice_ping();
- System.out.println("ok");
+ System.out.print("testing checked cast... ");
+ System.out.flush();
+ TestIntfPrx obj = TestIntfPrxHelper.checkedCast(base);
+ test(obj != null);
+ test(obj.equals(base));
+ TestIntfPrx obj2 = TestIntfPrxHelper.checkedCast(base2);
+ test(obj2 != null);
+ test(obj2.equals(base2));
+ System.out.println("ok");
+
+ System.out.print("pinging server... ");
+ System.out.flush();
+ obj.ice_ping();
+ obj2.ice_ping();
+ System.out.println("ok");
- System.out.print("testing reference with unknown identity... ");
- System.out.flush();
- try
- {
- communicator.stringToProxy("unknown/unknown").ice_ping();
- test(false);
- }
- catch(Ice.NotRegisteredException ex)
- {
- test(ex.kindOfObject.equals("object"));
- test(ex.id.equals("unknown/unknown"));
- }
- System.out.println("ok");
+ System.out.print("testing reference with unknown identity... ");
+ System.out.flush();
+ try
+ {
+ communicator.stringToProxy("unknown/unknown").ice_ping();
+ test(false);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ test(ex.kindOfObject.equals("object"));
+ test(ex.id.equals("unknown/unknown"));
+ }
+ System.out.println("ok");
- System.out.print("testing reference with unknown adapter... ");
- System.out.flush();
- try
- {
- communicator.stringToProxy("test @ TestAdapterUnknown").ice_ping();
- test(false);
- }
- catch(Ice.NotRegisteredException ex)
- {
- test(ex.kindOfObject.equals("object adapter"));
- test(ex.id.equals("TestAdapterUnknown"));
- }
- System.out.println("ok");
+ System.out.print("testing reference with unknown adapter... ");
+ System.out.flush();
+ try
+ {
+ communicator.stringToProxy("test @ TestAdapterUnknown").ice_ping();
+ test(false);
+ }
+ catch(Ice.NotRegisteredException ex)
+ {
+ test(ex.kindOfObject.equals("object adapter"));
+ test(ex.id.equals("TestAdapterUnknown"));
+ }
+ System.out.println("ok");
- IceGrid.RegistryPrx registry = IceGrid.RegistryPrxHelper.checkedCast(
- communicator.stringToProxy("IceGrid/Registry"));
- test(registry != null);
- IceGrid.AdminSessionPrx session = null;
- try
- {
- session = registry.createAdminSession("foo", "bar");
- }
- catch(IceGrid.PermissionDeniedException e)
- {
- test(false);
- }
+ IceGrid.RegistryPrx registry = IceGrid.RegistryPrxHelper.checkedCast(
+ communicator.stringToProxy("IceGrid/Registry"));
+ test(registry != null);
+ IceGrid.AdminSessionPrx session = null;
+ try
+ {
+ session = registry.createAdminSession("foo", "bar");
+ }
+ catch(IceGrid.PermissionDeniedException e)
+ {
+ test(false);
+ }
- SessionKeepAliveThread keepAlive = new SessionKeepAliveThread(session, registry.getSessionTimeout()/2);
- keepAlive.start();
+ SessionKeepAliveThread keepAlive = new SessionKeepAliveThread(session, registry.getSessionTimeout()/2);
+ keepAlive.start();
- IceGrid.AdminPrx admin = session.getAdmin();
- test(admin != null);
+ IceGrid.AdminPrx admin = session.getAdmin();
+ test(admin != null);
- try
- {
- admin.enableServer("server", false);
- admin.stopServer("server");
- }
- catch(IceGrid.ServerNotExistException ex)
- {
- test(false);
- }
- catch(IceGrid.ServerStopException ex)
- {
- test(false);
- }
- catch(IceGrid.NodeUnreachableException ex)
- {
- test(false);
- }
- catch(IceGrid.DeploymentException ex)
- {
- test(false);
- }
+ try
+ {
+ admin.enableServer("server", false);
+ admin.stopServer("server");
+ }
+ catch(IceGrid.ServerNotExistException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.ServerStopException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.NodeUnreachableException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.DeploymentException ex)
+ {
+ test(false);
+ }
- System.out.print("testing whether server is still reachable... ");
- System.out.flush();
- try
- {
- obj = TestIntfPrxHelper.checkedCast(base);
- test(false);
- }
- catch(Ice.NoEndpointException ex)
- {
- }
- try
- {
- obj2 = TestIntfPrxHelper.checkedCast(base2);
- test(false);
- }
- catch(Ice.NoEndpointException ex)
- {
- }
-
- try
- {
- admin.enableServer("server", true);
- }
- catch(IceGrid.ServerNotExistException ex)
- {
- test(false);
- }
- catch(IceGrid.NodeUnreachableException ex)
- {
- test(false);
- }
- catch(IceGrid.DeploymentException ex)
- {
- test(false);
- }
+ System.out.print("testing whether server is still reachable... ");
+ System.out.flush();
+ try
+ {
+ obj = TestIntfPrxHelper.checkedCast(base);
+ test(false);
+ }
+ catch(Ice.NoEndpointException ex)
+ {
+ }
+ try
+ {
+ obj2 = TestIntfPrxHelper.checkedCast(base2);
+ test(false);
+ }
+ catch(Ice.NoEndpointException ex)
+ {
+ }
+
+ try
+ {
+ admin.enableServer("server", true);
+ }
+ catch(IceGrid.ServerNotExistException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.NodeUnreachableException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.DeploymentException ex)
+ {
+ test(false);
+ }
- try
- {
- obj = TestIntfPrxHelper.checkedCast(base);
- }
- catch(Ice.NoEndpointException ex)
- {
- test(false);
- }
- try
- {
- obj2 = TestIntfPrxHelper.checkedCast(base2);
- }
- catch(Ice.NoEndpointException ex)
- {
- test(false);
- }
- System.out.println("ok");
+ try
+ {
+ obj = TestIntfPrxHelper.checkedCast(base);
+ }
+ catch(Ice.NoEndpointException ex)
+ {
+ test(false);
+ }
+ try
+ {
+ obj2 = TestIntfPrxHelper.checkedCast(base2);
+ }
+ catch(Ice.NoEndpointException ex)
+ {
+ test(false);
+ }
+ System.out.println("ok");
- try
- {
- admin.stopServer("server");
- }
- catch(IceGrid.ServerNotExistException ex)
- {
- test(false);
- }
- catch(IceGrid.ServerStopException ex)
- {
- test(false);
- }
- catch(IceGrid.NodeUnreachableException ex)
- {
- test(false);
- }
- catch(IceGrid.DeploymentException ex)
- {
- test(false);
- }
+ try
+ {
+ admin.stopServer("server");
+ }
+ catch(IceGrid.ServerNotExistException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.ServerStopException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.NodeUnreachableException ex)
+ {
+ test(false);
+ }
+ catch(IceGrid.DeploymentException ex)
+ {
+ test(false);
+ }
- keepAlive.terminate();
- try
- {
- keepAlive.join();
- }
- catch(InterruptedException e)
- {
- }
- session.destroy();
+ keepAlive.terminate();
+ try
+ {
+ keepAlive.join();
+ }
+ catch(InterruptedException e)
+ {
+ }
+ session.destroy();
}
}
diff --git a/java/test/IceGrid/simple/Client.java b/java/test/IceGrid/simple/Client.java
index 55e98a2c68b..0c91947c647 100644
--- a/java/test/IceGrid/simple/Client.java
+++ b/java/test/IceGrid/simple/Client.java
@@ -14,28 +14,28 @@ public class Client
private static int
run(String[] args, Ice.Communicator communicator)
{
- boolean withDeploy = false;
- for(int i = 1; i < args.length; i++)
- {
- if(args[i].equals("--with-deploy"))
- {
- withDeploy = true;
- break;
- }
- }
+ boolean withDeploy = false;
+ for(int i = 1; i < args.length; i++)
+ {
+ if(args[i].equals("--with-deploy"))
+ {
+ withDeploy = true;
+ break;
+ }
+ }
- ;
+ ;
- if(!withDeploy)
- {
- AllTests.allTests(communicator);
- }
- else
- {
- AllTests.allTestsWithDeploy(communicator);
- }
+ if(!withDeploy)
+ {
+ AllTests.allTests(communicator);
+ }
+ else
+ {
+ AllTests.allTestsWithDeploy(communicator);
+ }
- return 0;
+ return 0;
}
public static void
@@ -68,7 +68,7 @@ public class Client
}
}
- System.gc();
+ System.gc();
System.exit(status);
}
}
diff --git a/java/test/IceGrid/simple/Server.java b/java/test/IceGrid/simple/Server.java
index 57120f60324..33556af6d0d 100644
--- a/java/test/IceGrid/simple/Server.java
+++ b/java/test/IceGrid/simple/Server.java
@@ -12,31 +12,31 @@ public class Server extends Ice.Application
public int
run(String[] args)
{
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- argsH.value = communicator().getProperties().parseCommandLineOptions("TestAdapter", argsH.value);
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ argsH.value = communicator().getProperties().parseCommandLineOptions("TestAdapter", argsH.value);
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter");
Ice.Object object = new TestI(adapter);
adapter.add(object, communicator().stringToIdentity("test"));
- shutdownOnInterrupt();
- try
- {
- adapter.activate();
- }
- catch(Ice.ObjectAdapterDeactivatedException ex)
- {
- }
+ shutdownOnInterrupt();
+ try
+ {
+ adapter.activate();
+ }
+ catch(Ice.ObjectAdapterDeactivatedException ex)
+ {
+ }
communicator().waitForShutdown();
- defaultInterrupt();
+ defaultInterrupt();
return 0;
}
public static void
main(String[] args)
{
- Server server = new Server();
- int status = server.main("test.IceGrid.simple.Server", args);
- System.gc();
- System.exit(status);
+ Server server = new Server();
+ int status = server.main("test.IceGrid.simple.Server", args);
+ System.gc();
+ System.exit(status);
}
}
diff --git a/java/test/IceGrid/simple/run.py b/java/test/IceGrid/simple/run.py
index ebf2b561009..e87b74d5f71 100755
--- a/java/test/IceGrid/simple/run.py
+++ b/java/test/IceGrid/simple/run.py
@@ -33,7 +33,7 @@ os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.g
# Test client/server without on demand activation.
#
IceGridAdmin.iceGridClientServerTest(name, "", "--Ice.OA.TestAdapter.Endpoints=default" + \
- " --Ice.OA.TestAdapter.AdapterId=TestAdapter")
+ " --Ice.OA.TestAdapter.AdapterId=TestAdapter")
#
# Test client/server with on demand activation.
diff --git a/java/test/IceSSL/certs/makecerts.py b/java/test/IceSSL/certs/makecerts.py
index 6e5621a9ae6..228296ca59b 100755
--- a/java/test/IceSSL/certs/makecerts.py
+++ b/java/test/IceSSL/certs/makecerts.py
@@ -63,18 +63,18 @@ for x in ("cacert1", "cacert2"):
ts = x + ".jks"
os.system("openssl x509 -in " + os.path.join(cppcerts, x) + ".pem -outform DER -out " + x + ".der")
if force or not os.path.exists(ts):
- if os.path.exists(ts):
- os.remove(ts)
- os.system("keytool -import -alias cacert -file " + x + ".der -keystore " + ts + \
- " -storepass password -noprompt")
- print "Created " + ts
+ if os.path.exists(ts):
+ os.remove(ts)
+ os.system("keytool -import -alias cacert -file " + x + ".der -keystore " + ts + \
+ " -storepass password -noprompt")
+ print "Created " + ts
#
# Create a truststore containing both CA certificates.
#
if force or not os.path.exists("cacerts.jks"):
if os.path.exists("cacerts.jks"):
- os.remove("cacerts.jks")
+ os.remove("cacerts.jks")
os.system("keytool -import -alias cacert1 -file cacert1.der -keystore cacerts.jks -storepass password -noprompt")
os.system("keytool -import -alias cacert2 -file cacert2.der -keystore cacerts.jks -storepass password -noprompt")
print "Created cacerts.jks"
@@ -87,19 +87,19 @@ for x in certs:
p12 = x.replace("nopass_", "") + ".p12"
ks = x.replace("nopass_", "") + ".jks"
if x.find("1") > 0:
- cacert = "cacert1"
+ cacert = "cacert1"
else:
- cacert = "cacert2"
+ cacert = "cacert2"
if force or not os.path.exists(ks):
- if os.path.exists(ks):
- os.remove(ks)
- cert = os.path.join(cppcerts, x)
- ca = os.path.join(cppcerts, cacert) + ".pem"
- os.system("openssl pkcs12 -in " + cert + "_pub.pem -inkey " + cert + "_priv.pem -export -out " + p12 + \
- " -name cert -passout pass:password -certfile " + ca)
- os.system("java -classpath ../../../certs ImportKey " + p12 + " cert " + cacert + ".der " + ks + " password")
- os.remove(p12)
- print "Created " + ks
+ if os.path.exists(ks):
+ os.remove(ks)
+ cert = os.path.join(cppcerts, x)
+ ca = os.path.join(cppcerts, cacert) + ".pem"
+ os.system("openssl pkcs12 -in " + cert + "_pub.pem -inkey " + cert + "_priv.pem -export -out " + p12 + \
+ " -name cert -passout pass:password -certfile " + ca)
+ os.system("java -classpath ../../../certs ImportKey " + p12 + " cert " + cacert + ".der " + ks + " password")
+ os.remove(p12)
+ print "Created " + ks
#
# Create a keystore that contains both RSA and DSS certificates.
@@ -107,19 +107,19 @@ for x in certs:
ks = "s_rsa_dsa_ca1.jks"
if force or not os.path.exists(ks):
if os.path.exists(ks):
- os.remove(ks)
+ os.remove(ks)
cacert = "cacert1"
ca = os.path.join(cppcerts, cacert) + ".pem"
p12 = "s_dsa_nopass_ca1.p12"
cert = os.path.join(cppcerts, "s_dsa_nopass_ca1")
os.system("openssl pkcs12 -in " + cert + "_pub.pem -inkey " + cert + "_priv.pem -export -out " + p12 + \
- " -name dsacert -passout pass:password -certfile " + ca)
+ " -name dsacert -passout pass:password -certfile " + ca)
os.system("java -classpath ../../../certs ImportKey " + p12 + " dsacert " + cacert + ".der " + ks + " password")
os.remove(p12)
p12 = "s_rsa_nopass_ca1.p12"
cert = os.path.join(cppcerts, "s_rsa_nopass_ca1")
os.system("openssl pkcs12 -in " + cert + "_pub.pem -inkey " + cert + "_priv.pem -export -out " + p12 + \
- " -name rsacert -passout pass:password -certfile " + ca)
+ " -name rsacert -passout pass:password -certfile " + ca)
os.system("java -classpath ../../../certs ImportKey " + p12 + " rsacert " + cacert + ".der " + ks + " password")
os.remove(p12)
print "Created " + ks
@@ -130,7 +130,7 @@ if force or not os.path.exists(ks):
for x in ("cacert1", "cacert2"):
cert = x + ".der"
if os.path.exists(cert):
- os.remove(cert)
+ os.remove(cert)
#
# Done.
#
diff --git a/java/test/IceSSL/configuration/AllTests.java b/java/test/IceSSL/configuration/AllTests.java
index a49154d0c7e..96d3444dcaa 100644
--- a/java/test/IceSSL/configuration/AllTests.java
+++ b/java/test/IceSSL/configuration/AllTests.java
@@ -15,84 +15,84 @@ class CertificateVerifierI implements IceSSL.CertificateVerifier
{
CertificateVerifierI()
{
- reset();
+ reset();
}
public boolean
verify(IceSSL.ConnectionInfo info)
{
- if(info.certs != null)
- {
- try
- {
- java.util.Collection subjectAltNames =
- ((java.security.cert.X509Certificate)info.certs[0]).getSubjectAlternativeNames();
- test(subjectAltNames != null);
- java.util.ArrayList ipAddresses = new java.util.ArrayList();
- java.util.ArrayList dnsNames = new java.util.ArrayList();
- java.util.Iterator i = subjectAltNames.iterator();
- while(i.hasNext())
- {
- java.util.List l = (java.util.List)i.next();
- test(!l.isEmpty());
- Integer n = (Integer)l.get(0);
- if(n.intValue() == 7)
- {
- ipAddresses.add((String)l.get(1));
- }
- else if(n.intValue() == 2)
- {
- dnsNames.add((String)l.get(1));
- }
- }
+ if(info.certs != null)
+ {
+ try
+ {
+ java.util.Collection subjectAltNames =
+ ((java.security.cert.X509Certificate)info.certs[0]).getSubjectAlternativeNames();
+ test(subjectAltNames != null);
+ java.util.ArrayList ipAddresses = new java.util.ArrayList();
+ java.util.ArrayList dnsNames = new java.util.ArrayList();
+ java.util.Iterator i = subjectAltNames.iterator();
+ while(i.hasNext())
+ {
+ java.util.List l = (java.util.List)i.next();
+ test(!l.isEmpty());
+ Integer n = (Integer)l.get(0);
+ if(n.intValue() == 7)
+ {
+ ipAddresses.add((String)l.get(1));
+ }
+ else if(n.intValue() == 2)
+ {
+ dnsNames.add((String)l.get(1));
+ }
+ }
- test(dnsNames.contains("server"));
- test(ipAddresses.contains("127.0.0.1"));
- }
- catch(java.security.cert.CertificateParsingException ex)
- {
- test(false);
- }
- }
+ test(dnsNames.contains("server"));
+ test(ipAddresses.contains("127.0.0.1"));
+ }
+ catch(java.security.cert.CertificateParsingException ex)
+ {
+ test(false);
+ }
+ }
- _hadCert = info.certs != null;
- _invoked = true;
- return _returnValue;
+ _hadCert = info.certs != null;
+ _invoked = true;
+ return _returnValue;
}
void
reset()
{
- _returnValue = true;
- _invoked = false;
- _hadCert = false;
+ _returnValue = true;
+ _invoked = false;
+ _hadCert = false;
}
void
returnValue(boolean b)
{
- _returnValue = b;
+ _returnValue = b;
}
boolean
invoked()
{
- return _invoked;
+ return _invoked;
}
boolean
hadCert()
{
- return _hadCert;
+ return _hadCert;
}
private static void
test(boolean b)
{
- if(!b)
- {
- throw new RuntimeException();
- }
+ if(!b)
+ {
+ throw new RuntimeException();
+ }
}
private boolean _returnValue;
@@ -105,1305 +105,1305 @@ public class AllTests
private static void
test(boolean b)
{
- if(!b)
- {
- throw new RuntimeException();
- }
+ if(!b)
+ {
+ throw new RuntimeException();
+ }
}
private static Ice.InitializationData
createClientProps(String defaultDir, String defaultHost, boolean threadPool)
{
- Ice.InitializationData result = new Ice.InitializationData();
- result.properties = Ice.Util.createProperties();
- result.properties.setProperty("Ice.Plugin.IceSSL", "IceSSL.PluginFactory");
- if(!threadPool)
- {
- result.properties.setProperty("Ice.ThreadPerConnection", "1");
- }
- result.properties.setProperty("Ice.RetryIntervals", "-1");
- result.properties.setProperty("IceSSL.DefaultDir", defaultDir);
- result.properties.setProperty("IceSSL.Random", "seed.dat");
- if(defaultHost.length() > 0)
- {
- result.properties.setProperty("Ice.Default.Host", defaultHost);
- }
- return result;
+ Ice.InitializationData result = new Ice.InitializationData();
+ result.properties = Ice.Util.createProperties();
+ result.properties.setProperty("Ice.Plugin.IceSSL", "IceSSL.PluginFactory");
+ if(!threadPool)
+ {
+ result.properties.setProperty("Ice.ThreadPerConnection", "1");
+ }
+ result.properties.setProperty("Ice.RetryIntervals", "-1");
+ result.properties.setProperty("IceSSL.DefaultDir", defaultDir);
+ result.properties.setProperty("IceSSL.Random", "seed.dat");
+ if(defaultHost.length() > 0)
+ {
+ result.properties.setProperty("Ice.Default.Host", defaultHost);
+ }
+ return result;
}
private static java.util.Map
createServerProps(String defaultDir, String defaultHost, boolean threadPool)
{
- java.util.Map result = new java.util.HashMap();
- result.put("Ice.Plugin.IceSSL", "IceSSL.PluginFactory");
- if(!threadPool)
- {
- result.put("Ice.ThreadPerConnection", "1");
- }
- result.put("IceSSL.DefaultDir", defaultDir);
- result.put("IceSSL.Random", "seed.dat");
- if(defaultHost.length() > 0)
- {
- result.put("Ice.Default.Host", defaultHost);
- }
- return result;
+ java.util.Map result = new java.util.HashMap();
+ result.put("Ice.Plugin.IceSSL", "IceSSL.PluginFactory");
+ if(!threadPool)
+ {
+ result.put("Ice.ThreadPerConnection", "1");
+ }
+ result.put("IceSSL.DefaultDir", defaultDir);
+ result.put("IceSSL.Random", "seed.dat");
+ if(defaultHost.length() > 0)
+ {
+ result.put("Ice.Default.Host", defaultHost);
+ }
+ return result;
}
public static Test.ServerFactoryPrx
allTests(Ice.Communicator communicator, String testDir, boolean threadPool)
{
- final String factoryRef = "factory:tcp -p 12010 -t 10000";
- Ice.ObjectPrx b = communicator.stringToProxy(factoryRef);
- test(b != null);
- Test.ServerFactoryPrx factory = Test.ServerFactoryPrxHelper.checkedCast(b);
+ final String factoryRef = "factory:tcp -p 12010 -t 10000";
+ Ice.ObjectPrx b = communicator.stringToProxy(factoryRef);
+ test(b != null);
+ Test.ServerFactoryPrx factory = Test.ServerFactoryPrxHelper.checkedCast(b);
- final String defaultHost = communicator.getProperties().getProperty("Ice.Default.Host");
- final String defaultDir = testDir + "/../certs";
+ final String defaultHost = communicator.getProperties().getProperty("Ice.Default.Host");
+ final String defaultDir = testDir + "/../certs";
- final String[] args = new String[0];
+ final String[] args = new String[0];
- System.out.print("testing manual initialization... ");
- System.out.flush();
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("Ice.InitPlugins", "0");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Ice.ObjectPrx p = comm.stringToProxy("dummy:ssl -p 9999");
- try
- {
- p.ice_ping();
- test(false);
- }
- catch(Ice.PluginInitializationException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("Ice.InitPlugins", "0");
- initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- initData.properties.setProperty("IceSSL.VerifyPeer", "0");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Ice.PluginManager pm = comm.getPluginManager();
- pm.initializePlugins();
- Ice.ObjectPrx obj = comm.stringToProxy(factoryRef);
- test(obj != null);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(obj);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- d.put("IceSSL.VerifyPeer", "0");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ System.out.print("testing manual initialization... ");
+ System.out.flush();
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("Ice.InitPlugins", "0");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Ice.ObjectPrx p = comm.stringToProxy("dummy:ssl -p 9999");
+ try
+ {
+ p.ice_ping();
+ test(false);
+ }
+ catch(Ice.PluginInitializationException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("Ice.InitPlugins", "0");
+ initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ initData.properties.setProperty("IceSSL.VerifyPeer", "0");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Ice.PluginManager pm = comm.getPluginManager();
+ pm.initializePlugins();
+ Ice.ObjectPrx obj = comm.stringToProxy(factoryRef);
+ test(obj != null);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(obj);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ d.put("IceSSL.VerifyPeer", "0");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing certificate verification... ");
- System.out.flush();
- {
- //
- // Test IceSSL.VerifyPeer=0. Client does not have a certificate,
- // but it still verifies the server's.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "0");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.noCert();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- //
- // Validate that we can get the connection info.
- //
- try
- {
- IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(server.ice_getConnection());
- test(info.certs.length == 2);
- }
- catch(IceSSL.ConnectionInvalidException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
+ System.out.print("testing certificate verification... ");
+ System.out.flush();
+ {
+ //
+ // Test IceSSL.VerifyPeer=0. Client does not have a certificate,
+ // but it still verifies the server's.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "0");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.noCert();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ //
+ // Validate that we can get the connection info.
+ //
+ try
+ {
+ IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(server.ice_getConnection());
+ test(info.certs.length == 2);
+ }
+ catch(IceSSL.ConnectionInvalidException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
- //
- // Test IceSSL.VerifyPeer=1. Client does not have a certificate.
- //
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "1");
- server = fact.createServer(d);
- try
- {
- server.noCert();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
+ //
+ // Test IceSSL.VerifyPeer=1. Client does not have a certificate.
+ //
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "1");
+ server = fact.createServer(d);
+ try
+ {
+ server.noCert();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
- //
- // Test IceSSL.VerifyPeer=2. This should fail because the client
- // does not supply a certificate.
- //
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.ConnectionLostException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
+ //
+ // Test IceSSL.VerifyPeer=2. This should fail because the client
+ // does not supply a certificate.
+ //
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
- comm.destroy();
+ comm.destroy();
- //
- // Test IceSSL.VerifyPeer=1. This should fail because the server
- // does not supply a certificate.
- //
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- initData.properties.setProperty("IceSSL.VerifyPeer", "1");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- d.put("IceSSL.VerifyPeer", "0");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
+ //
+ // Test IceSSL.VerifyPeer=1. This should fail because the server
+ // does not supply a certificate.
+ //
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ initData.properties.setProperty("IceSSL.VerifyPeer", "1");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ d.put("IceSSL.VerifyPeer", "0");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
- //
- // Test IceSSL.VerifyPeer=1. Client has a certificate.
- //
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "1");
- server = fact.createServer(d);
- try
- {
- char[] password = "password".toCharArray();
+ //
+ // Test IceSSL.VerifyPeer=1. Client has a certificate.
+ //
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "1");
+ server = fact.createServer(d);
+ try
+ {
+ char[] password = "password".toCharArray();
- java.io.FileInputStream fis = new java.io.FileInputStream(defaultDir + "/c_rsa_ca1.jks");
- java.security.KeyStore clientKeystore = java.security.KeyStore.getInstance("JKS");
- clientKeystore.load(fis, password);
- java.security.cert.X509Certificate clientCert =
- (java.security.cert.X509Certificate)clientKeystore.getCertificate("cert");
- server.checkCert(clientCert.getSubjectDN().toString(), clientCert.getIssuerDN().toString());
+ java.io.FileInputStream fis = new java.io.FileInputStream(defaultDir + "/c_rsa_ca1.jks");
+ java.security.KeyStore clientKeystore = java.security.KeyStore.getInstance("JKS");
+ clientKeystore.load(fis, password);
+ java.security.cert.X509Certificate clientCert =
+ (java.security.cert.X509Certificate)clientKeystore.getCertificate("cert");
+ server.checkCert(clientCert.getSubjectDN().toString(), clientCert.getIssuerDN().toString());
- fis = new java.io.FileInputStream(defaultDir + "/s_rsa_ca1.jks");
- java.security.KeyStore serverKeystore = java.security.KeyStore.getInstance("JKS");
- serverKeystore.load(fis, password);
- java.security.cert.X509Certificate serverCert =
- (java.security.cert.X509Certificate)serverKeystore.getCertificate("cert");
- java.security.cert.X509Certificate caCert =
- (java.security.cert.X509Certificate)serverKeystore.getCertificate("cacert");
+ fis = new java.io.FileInputStream(defaultDir + "/s_rsa_ca1.jks");
+ java.security.KeyStore serverKeystore = java.security.KeyStore.getInstance("JKS");
+ serverKeystore.load(fis, password);
+ java.security.cert.X509Certificate serverCert =
+ (java.security.cert.X509Certificate)serverKeystore.getCertificate("cert");
+ java.security.cert.X509Certificate caCert =
+ (java.security.cert.X509Certificate)serverKeystore.getCertificate("cacert");
- IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(server.ice_getConnection());
+ IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(server.ice_getConnection());
- test(info.certs.length == 2);
+ test(info.certs.length == 2);
- test(caCert.equals(info.certs[1]));
- test(serverCert.equals(info.certs[0]));
- }
- catch(Exception ex)
- {
- test(false);
- }
- fact.destroyServer(server);
+ test(caCert.equals(info.certs[1]));
+ test(serverCert.equals(info.certs[0]));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
- //
- // Test IceSSL.VerifyPeer=2. Client has a certificate.
- //
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- server = fact.createServer(d);
- try
- {
- char[] password = "password".toCharArray();
+ //
+ // Test IceSSL.VerifyPeer=2. Client has a certificate.
+ //
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ server = fact.createServer(d);
+ try
+ {
+ char[] password = "password".toCharArray();
- java.io.FileInputStream fis = new java.io.FileInputStream(defaultDir + "/c_rsa_ca1.jks");
- java.security.KeyStore clientKeystore = java.security.KeyStore.getInstance("JKS");
- clientKeystore.load(fis, password);
- java.security.cert.X509Certificate clientCert =
- (java.security.cert.X509Certificate)clientKeystore.getCertificate("cert");
- server.checkCert(clientCert.getSubjectDN().toString(), clientCert.getIssuerDN().toString());
- }
- catch(Exception ex)
- {
- test(false);
- }
- fact.destroyServer(server);
+ java.io.FileInputStream fis = new java.io.FileInputStream(defaultDir + "/c_rsa_ca1.jks");
+ java.security.KeyStore clientKeystore = java.security.KeyStore.getInstance("JKS");
+ clientKeystore.load(fis, password);
+ java.security.cert.X509Certificate clientCert =
+ (java.security.cert.X509Certificate)clientKeystore.getCertificate("cert");
+ server.checkCert(clientCert.getSubjectDN().toString(), clientCert.getIssuerDN().toString());
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
- comm.destroy();
+ comm.destroy();
- //
- // Test IceSSL.VerifyPeer=1. This should fail because the
- // client doesn't trust the server's CA.
- //
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca2.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert2.jks");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "1");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
+ //
+ // Test IceSSL.VerifyPeer=1. This should fail because the
+ // client doesn't trust the server's CA.
+ //
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca2.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert2.jks");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "1");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
- comm.destroy();
+ comm.destroy();
- //
- // Test IceSSL.VerifyPeer=2. This should fail because the
- // server doesn't trust the client's CA.
- //
- // NOTE: In C++ this test fails with VerifyPeer=1, but JSSE seems
- // to allow the handshake to continue unless we set VerifyPeer=2.
- //
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca2.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.ConnectionLostException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
+ //
+ // Test IceSSL.VerifyPeer=2. This should fail because the
+ // server doesn't trust the client's CA.
+ //
+ // NOTE: In C++ this test fails with VerifyPeer=1, but JSSE seems
+ // to allow the handshake to continue unless we set VerifyPeer=2.
+ //
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca2.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
- //
- // Verify that IceSSL.CheckCertName has no effect in a server.
- //
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- comm = Ice.Util.initialize(args, initData);
+ //
+ // Verify that IceSSL.CheckCertName has no effect in a server.
+ //
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.CheckCertName", "1");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.CheckCertName", "1");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing custom certificate verifier... ");
- System.out.flush();
- {
- //
- // ADH is allowed but will not have a certificate.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- initData.properties.setProperty("IceSSL.VerifyPeer", "0");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- IceSSL.Plugin plugin = (IceSSL.Plugin)comm.getPluginManager().getPlugin("IceSSL");
- test(plugin != null);
- CertificateVerifierI verifier = new CertificateVerifierI();
- plugin.setCertificateVerifier(verifier);
+ System.out.print("testing custom certificate verifier... ");
+ System.out.flush();
+ {
+ //
+ // ADH is allowed but will not have a certificate.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ initData.properties.setProperty("IceSSL.VerifyPeer", "0");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ IceSSL.Plugin plugin = (IceSSL.Plugin)comm.getPluginManager().getPlugin("IceSSL");
+ test(plugin != null);
+ CertificateVerifierI verifier = new CertificateVerifierI();
+ plugin.setCertificateVerifier(verifier);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- d.put("IceSSL.VerifyPeer", "0");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- String cipherSub = "DH_anon";
- server.checkCipher(cipherSub);
- IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(server.ice_getConnection());
- test(info.cipher.indexOf(cipherSub) >= 0);
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- test(verifier.invoked());
- test(!verifier.hadCert());
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ d.put("IceSSL.VerifyPeer", "0");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ String cipherSub = "DH_anon";
+ server.checkCipher(cipherSub);
+ IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(server.ice_getConnection());
+ test(info.cipher.indexOf(cipherSub) >= 0);
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ test(verifier.invoked());
+ test(!verifier.hadCert());
- //
- // Have the verifier return false. Close the connection explicitly
- // to force a new connection to be established.
- //
- verifier.reset();
- verifier.returnValue(false);
- server.ice_getConnection().close(false);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- test(verifier.invoked());
- test(!verifier.hadCert());
+ //
+ // Have the verifier return false. Close the connection explicitly
+ // to force a new connection to be established.
+ //
+ verifier.reset();
+ verifier.returnValue(false);
+ server.ice_getConnection().close(false);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ test(verifier.invoked());
+ test(!verifier.hadCert());
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- //
- // Verify that a server certificate is present.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- IceSSL.Plugin plugin = (IceSSL.Plugin)comm.getPluginManager().getPlugin("IceSSL");
- test(plugin != null);
- CertificateVerifierI verifier = new CertificateVerifierI();
- plugin.setCertificateVerifier(verifier);
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ //
+ // Verify that a server certificate is present.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ IceSSL.Plugin plugin = (IceSSL.Plugin)comm.getPluginManager().getPlugin("IceSSL");
+ test(plugin != null);
+ CertificateVerifierI verifier = new CertificateVerifierI();
+ plugin.setCertificateVerifier(verifier);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- test(verifier.invoked());
- test(verifier.hadCert());
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ test(verifier.invoked());
+ test(verifier.hadCert());
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing protocols... ");
- System.out.flush();
- {
- //
- // This should fail because the client and server have no protocol
- // in common.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.Protocols", "ssl3");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- d.put("IceSSL.Protocols", "tls1");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.ConnectionLostException ex)
- {
- // Expected for thread pool.
- test(threadPool);
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
+ System.out.print("testing protocols... ");
+ System.out.flush();
+ {
+ //
+ // This should fail because the client and server have no protocol
+ // in common.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.Protocols", "ssl3");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ d.put("IceSSL.Protocols", "tls1");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ // Expected for thread pool.
+ test(threadPool);
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
- //
- // This should succeed.
- //
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- d.put("IceSSL.Protocols", "tls1, ssl3");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ //
+ // This should succeed.
+ //
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ d.put("IceSSL.Protocols", "tls1, ssl3");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing expired certificates... ");
- System.out.flush();
- {
- //
- // This should fail because the server's certificate is expired.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1_exp.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
+ System.out.print("testing expired certificates... ");
+ System.out.flush();
+ {
+ //
+ // This should fail because the server's certificate is expired.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1_exp.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
- //
- // This should fail because the client's certificate is expired.
- //
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1_exp.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.ConnectionLostException ex)
- {
- // Expected.
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ //
+ // This should fail because the client's certificate is expired.
+ //
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1_exp.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing multiple CA certificates... ");
- System.out.flush();
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacerts.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca2.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacerts.jks");
- d.put("IceSSL.VerifyPeer", "2");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ System.out.print("testing multiple CA certificates... ");
+ System.out.flush();
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacerts.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca2.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacerts.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing password failure... ");
- System.out.flush();
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- // Don't specify the password.
- //initData.properties.setProperty("IceSSL.Password", "password");
- try
- {
- Ice.Util.initialize(args, initData);
- test(false);
- }
- catch(Ice.PluginInitializationException ex)
- {
- // Expected.
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- }
- System.out.println("ok");
+ System.out.print("testing password failure... ");
+ System.out.flush();
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ // Don't specify the password.
+ //initData.properties.setProperty("IceSSL.Password", "password");
+ try
+ {
+ Ice.Util.initialize(args, initData);
+ test(false);
+ }
+ catch(Ice.PluginInitializationException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ }
+ System.out.println("ok");
- System.out.print("testing ciphers... ");
- System.out.flush();
- {
- //
- // The server has a certificate but the client doesn't. They should
- // negotiate to use ADH since we explicitly enable it.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- initData.properties.setProperty("IceSSL.VerifyPeer", "0");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.Ciphers", "ALL");
- d.put("IceSSL.VerifyPeer", "1");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- //
- // Configure a server with RSA and DSA certificates.
- //
- // First try a client with a DSA certificate.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_dsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "1");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
+ System.out.print("testing ciphers... ");
+ System.out.flush();
+ {
+ //
+ // The server has a certificate but the client doesn't. They should
+ // negotiate to use ADH since we explicitly enable it.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ initData.properties.setProperty("IceSSL.VerifyPeer", "0");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.Ciphers", "ALL");
+ d.put("IceSSL.VerifyPeer", "1");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ //
+ // Configure a server with RSA and DSA certificates.
+ //
+ // First try a client with a DSA certificate.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_dsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "1");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
- //
- // Next try a client with an RSA certificate.
- //
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "1");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
+ //
+ // Next try a client with an RSA certificate.
+ //
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "1");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
- //
- // Next try a client with ADH. This should fail.
- //
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
- comm = Ice.Util.initialize(args, initData);
- fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "1");
- server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.ConnectionLostException ex)
- {
- // Expected for thread pool.
- test(threadPool);
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- //
- // Configure a server with RSA and a client with DSA. This should fail.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_dsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DSS.*)");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.ConnectionLostException ex)
- {
- // Expected for thread pool.
- test(threadPool);
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- //
- // Configure the server with both RSA and DSA certificates, but use the
- // Alias property to select the RSA certificate. This should fail.
- //
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_dsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DSS.*)");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Alias", "rsacert");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.VerifyPeer", "2");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.SecurityException ex)
- {
- // Expected.
- }
- catch(Ice.ConnectionLostException ex)
- {
- // Expected for thread pool.
- test(threadPool);
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ //
+ // Next try a client with ADH. This should fail.
+ //
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DH_anon.*)");
+ comm = Ice.Util.initialize(args, initData);
+ fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "1");
+ server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ // Expected for thread pool.
+ test(threadPool);
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ //
+ // Configure a server with RSA and a client with DSA. This should fail.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_dsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DSS.*)");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ // Expected for thread pool.
+ test(threadPool);
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ //
+ // Configure the server with both RSA and DSA certificates, but use the
+ // Alias property to select the RSA certificate. This should fail.
+ //
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_dsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.Ciphers", "NONE (.*DSS.*)");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Alias", "rsacert");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.VerifyPeer", "2");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.SecurityException ex)
+ {
+ // Expected.
+ }
+ catch(Ice.ConnectionLostException ex)
+ {
+ // Expected for thread pool.
+ test(threadPool);
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing IceSSL.TrustOnly... ");
- System.out.flush();
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.TrustOnly",
- "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Server");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.TrustOnly",
- "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.TrustOnly", "CN=Server");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.TrustOnly", "CN=Client");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.TrustOnly", "CN=Client");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.TrustOnly", "CN=Server");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.TrustOnly", "C=Canada,CN=Server");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.TrustOnly", "C=Canada;CN=Server");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ System.out.print("testing IceSSL.TrustOnly... ");
+ System.out.flush();
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.TrustOnly",
+ "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Server");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.TrustOnly",
+ "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.TrustOnly", "CN=Server");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.TrustOnly", "CN=Client");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.TrustOnly", "CN=Client");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.TrustOnly", "CN=Server");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.TrustOnly", "C=Canada,CN=Server");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.TrustOnly", "C=Canada;CN=Server");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing IceSSL.TrustOnly.Client... ");
- System.out.flush();
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.TrustOnly.Client",
- "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Server");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- // Should have no effect.
- d.put("IceSSL.TrustOnly.Client",
- "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Server");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- initData.properties.setProperty("IceSSL.TrustOnly.Client", "CN=Client");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ System.out.print("testing IceSSL.TrustOnly.Client... ");
+ System.out.flush();
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.TrustOnly.Client",
+ "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Server");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ // Should have no effect.
+ d.put("IceSSL.TrustOnly.Client",
+ "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Server");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ initData.properties.setProperty("IceSSL.TrustOnly.Client", "CN=Client");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing IceSSL.TrustOnly.Server... ");
- System.out.flush();
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- // Should have no effect.
- initData.properties.setProperty("IceSSL.TrustOnly.Server",
- "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.TrustOnly.Server",
- "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.TrustOnly.Server", "CN=Server");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ System.out.print("testing IceSSL.TrustOnly.Server... ");
+ System.out.flush();
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ // Should have no effect.
+ initData.properties.setProperty("IceSSL.TrustOnly.Server",
+ "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.TrustOnly.Server",
+ "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.TrustOnly.Server", "CN=Server");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- System.out.print("testing IceSSL.TrustOnly.Server.<AdapterName>... ");
- System.out.flush();
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.TrustOnly.Server", "CN=bogus");
- d.put("IceSSL.TrustOnly.Server.ServerAdapter",
- "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- }
- catch(Ice.LocalException ex)
- {
- test(false);
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- {
- Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData = createClientProps(defaultDir, defaultHost, threadPool);
- initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
- initData.properties.setProperty("IceSSL.Password", "password");
- initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
- Ice.Communicator comm = Ice.Util.initialize(args, initData);
- Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
- test(fact != null);
- java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
- d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
- d.put("IceSSL.Password", "password");
- d.put("IceSSL.Truststore", "cacert1.jks");
- d.put("IceSSL.TrustOnly.Server.ServerAdapter", "CN=bogus");
- Test.ServerPrx server = fact.createServer(d);
- try
- {
- server.ice_ping();
- test(false);
- }
- catch(Ice.LocalException ex)
- {
- }
- fact.destroyServer(server);
- comm.destroy();
- }
- System.out.println("ok");
+ System.out.print("testing IceSSL.TrustOnly.Server.<AdapterName>... ");
+ System.out.flush();
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.TrustOnly.Server", "CN=bogus");
+ d.put("IceSSL.TrustOnly.Server.ServerAdapter",
+ "C=US, ST=Florida, O=ZeroC\\, Inc.,OU=Ice, emailAddress=info@zeroc.com, CN=Client");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ }
+ catch(Ice.LocalException ex)
+ {
+ test(false);
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ {
+ Ice.InitializationData initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData = createClientProps(defaultDir, defaultHost, threadPool);
+ initData.properties.setProperty("IceSSL.Keystore", "c_rsa_ca1.jks");
+ initData.properties.setProperty("IceSSL.Password", "password");
+ initData.properties.setProperty("IceSSL.Truststore", "cacert1.jks");
+ Ice.Communicator comm = Ice.Util.initialize(args, initData);
+ Test.ServerFactoryPrx fact = Test.ServerFactoryPrxHelper.checkedCast(comm.stringToProxy(factoryRef));
+ test(fact != null);
+ java.util.Map d = createServerProps(defaultDir, defaultHost, threadPool);
+ d.put("IceSSL.Keystore", "s_rsa_dsa_ca1.jks");
+ d.put("IceSSL.Password", "password");
+ d.put("IceSSL.Truststore", "cacert1.jks");
+ d.put("IceSSL.TrustOnly.Server.ServerAdapter", "CN=bogus");
+ Test.ServerPrx server = fact.createServer(d);
+ try
+ {
+ server.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException ex)
+ {
+ }
+ fact.destroyServer(server);
+ comm.destroy();
+ }
+ System.out.println("ok");
- return factory;
+ return factory;
}
}
diff --git a/java/test/IceSSL/configuration/Client.java b/java/test/IceSSL/configuration/Client.java
index 6cb43153c90..6479e180286 100644
--- a/java/test/IceSSL/configuration/Client.java
+++ b/java/test/IceSSL/configuration/Client.java
@@ -12,63 +12,63 @@ public class Client
private static int
run(String[] args, Ice.Communicator communicator)
{
- if(args.length < 1)
- {
- System.out.println("Usage: client testdir");
- return 1;
- }
+ if(args.length < 1)
+ {
+ System.out.println("Usage: client testdir");
+ return 1;
+ }
- Test.ServerFactoryPrx factory;
+ Test.ServerFactoryPrx factory;
- //
- // If we're using the JDK 1.4 plugin, we can only use thread-per-connection.
- // Otherwise, we run the test twice, once for each concurrency model.
- //
- System.out.println("testing with thread-per-connection.");
- factory = AllTests.allTests(communicator, args[0], false);
+ //
+ // If we're using the JDK 1.4 plugin, we can only use thread-per-connection.
+ // Otherwise, we run the test twice, once for each concurrency model.
+ //
+ System.out.println("testing with thread-per-connection.");
+ factory = AllTests.allTests(communicator, args[0], false);
- if(!IceSSL.Util.jdkTarget.equals("1.4"))
- {
- System.out.println("testing with thread pool.");
- AllTests.allTests(communicator, args[0], true);
- }
+ if(!IceSSL.Util.jdkTarget.equals("1.4"))
+ {
+ System.out.println("testing with thread pool.");
+ AllTests.allTests(communicator, args[0], true);
+ }
- factory.shutdown();
+ factory.shutdown();
- return 0;
+ return 0;
}
public static void main(String[] args)
{
- int status = 0;
- Ice.Communicator communicator = null;
+ int status = 0;
+ Ice.Communicator communicator = null;
- try
- {
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- communicator = Ice.Util.initialize(argsH);
- status = run(argsH.value, communicator);
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
+ try
+ {
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ communicator = Ice.Util.initialize(argsH);
+ status = run(argsH.value, communicator);
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
- }
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
+ }
- System.gc();
- System.exit(status);
+ System.gc();
+ System.exit(status);
}
}
diff --git a/java/test/IceSSL/configuration/Server.java b/java/test/IceSSL/configuration/Server.java
index 1502ac6d93c..740aeca563d 100644
--- a/java/test/IceSSL/configuration/Server.java
+++ b/java/test/IceSSL/configuration/Server.java
@@ -12,47 +12,47 @@ public class Server
private static int
run(String[] args, Ice.Communicator communicator)
{
- communicator.getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "tcp -p 12010");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
- Ice.Identity id = communicator.stringToIdentity("factory");
- adapter.add(new ServerFactoryI(), id);
- adapter.activate();
+ communicator.getProperties().setProperty("Ice.OA.TestAdapter.Endpoints", "tcp -p 12010");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
+ Ice.Identity id = communicator.stringToIdentity("factory");
+ adapter.add(new ServerFactoryI(), id);
+ adapter.activate();
- communicator.waitForShutdown();
- return 0;
+ communicator.waitForShutdown();
+ return 0;
}
public static void
main(String[] args)
{
- int status = 0;
- Ice.Communicator communicator = null;
+ int status = 0;
+ Ice.Communicator communicator = null;
- try
- {
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- communicator = Ice.Util.initialize(argsH);
- status = run(argsH.value, communicator);
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
-
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
- }
-
- System.exit(status);
+ try
+ {
+ Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
+ communicator = Ice.Util.initialize(argsH);
+ status = run(argsH.value, communicator);
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
+
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ status = 1;
+ }
+ }
+
+ System.exit(status);
}
}
diff --git a/java/test/IceSSL/configuration/ServerFactoryI.java b/java/test/IceSSL/configuration/ServerFactoryI.java
index dc29070639f..0d5c5ca6fa3 100644
--- a/java/test/IceSSL/configuration/ServerFactoryI.java
+++ b/java/test/IceSSL/configuration/ServerFactoryI.java
@@ -12,52 +12,52 @@ class ServerFactoryI extends Test._ServerFactoryDisp
private static void
test(boolean b)
{
- if(!b)
- {
+ if(!b)
+ {
throw new RuntimeException();
- }
+ }
}
public Test.ServerPrx
createServer(java.util.Map props, Ice.Current current)
{
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties();
- java.util.Iterator i = props.entrySet().iterator();
- while(i.hasNext())
- {
- java.util.Map.Entry e = (java.util.Map.Entry)i.next();
- initData.properties.setProperty((String)e.getKey(), (String)e.getValue());
- }
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ java.util.Iterator i = props.entrySet().iterator();
+ while(i.hasNext())
+ {
+ java.util.Map.Entry e = (java.util.Map.Entry)i.next();
+ initData.properties.setProperty((String)e.getKey(), (String)e.getValue());
+ }
- String[] args = new String[0];
- Ice.Communicator communicator = Ice.Util.initialize(args, initData);
- Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("ServerAdapter", "ssl");
- ServerI server = new ServerI(communicator);
- Ice.ObjectPrx obj = adapter.addWithUUID(server);
- _servers.put(obj.ice_getIdentity(), server);
- adapter.activate();
+ String[] args = new String[0];
+ Ice.Communicator communicator = Ice.Util.initialize(args, initData);
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("ServerAdapter", "ssl");
+ ServerI server = new ServerI(communicator);
+ Ice.ObjectPrx obj = adapter.addWithUUID(server);
+ _servers.put(obj.ice_getIdentity(), server);
+ adapter.activate();
- return Test.ServerPrxHelper.uncheckedCast(obj);
+ return Test.ServerPrxHelper.uncheckedCast(obj);
}
public void
destroyServer(Test.ServerPrx srv, Ice.Current current)
{
- Ice.Identity key = srv.ice_getIdentity();
- if(_servers.containsKey(key))
- {
- ServerI server = (ServerI)_servers.get(key);
- server.destroy();
- _servers.remove(key);
- }
+ Ice.Identity key = srv.ice_getIdentity();
+ if(_servers.containsKey(key))
+ {
+ ServerI server = (ServerI)_servers.get(key);
+ server.destroy();
+ _servers.remove(key);
+ }
}
public void
shutdown(Ice.Current current)
{
- test(_servers.size() == 0);
- current.adapter.getCommunicator().shutdown();
+ test(_servers.size() == 0);
+ current.adapter.getCommunicator().shutdown();
}
private java.util.HashMap _servers = new java.util.HashMap();
diff --git a/java/test/IceSSL/configuration/ServerI.java b/java/test/IceSSL/configuration/ServerI.java
index 40bf174f3d5..b796971e131 100644
--- a/java/test/IceSSL/configuration/ServerI.java
+++ b/java/test/IceSSL/configuration/ServerI.java
@@ -11,67 +11,67 @@ class ServerI extends Test._ServerDisp
{
ServerI(Ice.Communicator communicator)
{
- _communicator = communicator;
+ _communicator = communicator;
}
public void
noCert(Ice.Current current)
{
- try
- {
- IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con);
- test(info.certs == null);
- }
- catch(IceSSL.ConnectionInvalidException ex)
- {
- test(false);
- }
+ try
+ {
+ IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con);
+ test(info.certs == null);
+ }
+ catch(IceSSL.ConnectionInvalidException ex)
+ {
+ test(false);
+ }
}
public void
checkCert(String subjectDN, String issuerDN, Ice.Current current)
{
- try
- {
- IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con);
- java.security.cert.X509Certificate cert = (java.security.cert.X509Certificate)info.certs[0];
- test(info.certs.length == 2 &&
- cert.getSubjectDN().toString().equals(subjectDN) &&
- cert.getIssuerDN().toString().equals(issuerDN));
- }
- catch(IceSSL.ConnectionInvalidException ex)
- {
- test(false);
- }
+ try
+ {
+ IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con);
+ java.security.cert.X509Certificate cert = (java.security.cert.X509Certificate)info.certs[0];
+ test(info.certs.length == 2 &&
+ cert.getSubjectDN().toString().equals(subjectDN) &&
+ cert.getIssuerDN().toString().equals(issuerDN));
+ }
+ catch(IceSSL.ConnectionInvalidException ex)
+ {
+ test(false);
+ }
}
public void
checkCipher(String cipher, Ice.Current current)
{
- try
- {
- IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con);
- test(info.cipher.indexOf(cipher) >= 0);
- }
- catch(IceSSL.ConnectionInvalidException ex)
- {
- test(false);
- }
+ try
+ {
+ IceSSL.ConnectionInfo info = IceSSL.Util.getConnectionInfo(current.con);
+ test(info.cipher.indexOf(cipher) >= 0);
+ }
+ catch(IceSSL.ConnectionInvalidException ex)
+ {
+ test(false);
+ }
}
public void
destroy()
{
- _communicator.destroy();
+ _communicator.destroy();
}
private static void
test(boolean b)
{
- if(!b)
- {
- throw new RuntimeException();
- }
+ if(!b)
+ {
+ throw new RuntimeException();
+ }
}
private Ice.Communicator _communicator;
diff --git a/java/test/IceUtil/inputUtil/Client.java b/java/test/IceUtil/inputUtil/Client.java
index 3c9457b56d1..bf8db9dc3b1 100644
--- a/java/test/IceUtil/inputUtil/Client.java
+++ b/java/test/IceUtil/inputUtil/Client.java
@@ -23,86 +23,86 @@ public class Client
{
System.out.print("testing string to command line arguments... ");
System.out.flush();
- String[] args;
+ String[] args;
- try
- {
- test(IceUtil.Options.split("").length == 0);
-
- args = IceUtil.Options.split("\"\"");
- test(args.length == 1 && args[0].equals(""));
- args = IceUtil.Options.split("''");
- test(args.length == 1 && args[0].equals(""));
- args = IceUtil.Options.split("$''");
- test(args.length == 1 && args[0].equals(""));
+ try
+ {
+ test(IceUtil.Options.split("").length == 0);
+
+ args = IceUtil.Options.split("\"\"");
+ test(args.length == 1 && args[0].equals(""));
+ args = IceUtil.Options.split("''");
+ test(args.length == 1 && args[0].equals(""));
+ args = IceUtil.Options.split("$''");
+ test(args.length == 1 && args[0].equals(""));
- args = IceUtil.Options.split("-a -b -c");
- test(args.length == 3 && args[0].equals("-a") && args[1].equals("-b") && args[2].equals("-c"));
- args = IceUtil.Options.split("\"-a\" '-b' $'-c'");
- test(args.length == 3 && args[0].equals("-a") && args[1].equals("-b") && args[2].equals("-c"));
- args = IceUtil.Options.split(" '-b' \"-a\" $'-c' ");
- test(args.length == 3 && args[0].equals("-b") && args[1].equals("-a") && args[2].equals("-c"));
- args = IceUtil.Options.split(" $'-c' '-b' \"-a\" ");
- test(args.length == 3 && args[0].equals("-c") && args[1].equals("-b") && args[2].equals("-a"));
+ args = IceUtil.Options.split("-a -b -c");
+ test(args.length == 3 && args[0].equals("-a") && args[1].equals("-b") && args[2].equals("-c"));
+ args = IceUtil.Options.split("\"-a\" '-b' $'-c'");
+ test(args.length == 3 && args[0].equals("-a") && args[1].equals("-b") && args[2].equals("-c"));
+ args = IceUtil.Options.split(" '-b' \"-a\" $'-c' ");
+ test(args.length == 3 && args[0].equals("-b") && args[1].equals("-a") && args[2].equals("-c"));
+ args = IceUtil.Options.split(" $'-c' '-b' \"-a\" ");
+ test(args.length == 3 && args[0].equals("-c") && args[1].equals("-b") && args[2].equals("-a"));
- // Testing single quote
- args = IceUtil.Options.split("-Dir='C:\\\\test\\\\file'"); // -Dir='C:\\test\\file'
- test(args.length == 1 && args[0].equals("-Dir=C:\\\\test\\\\file")); // -Dir=C:\\test\\file
- args = IceUtil.Options.split("-Dir='C:\\test\\file'"); // -Dir='C:\test\file'
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
- args = IceUtil.Options.split("-Dir='C:\\test\\filewith\"quote'"); // -Dir='C:\test\filewith"quote'
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\filewith\"quote")); // -Dir=C:\test\filewith"quote
+ // Testing single quote
+ args = IceUtil.Options.split("-Dir='C:\\\\test\\\\file'"); // -Dir='C:\\test\\file'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\\\test\\\\file")); // -Dir=C:\\test\\file
+ args = IceUtil.Options.split("-Dir='C:\\test\\file'"); // -Dir='C:\test\file'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
+ args = IceUtil.Options.split("-Dir='C:\\test\\filewith\"quote'"); // -Dir='C:\test\filewith"quote'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\filewith\"quote")); // -Dir=C:\test\filewith"quote
- // Testing double quote
- args = IceUtil.Options.split("-Dir=\"C:\\\\test\\\\file\""); // -Dir="C:\\test\\file"
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
- args = IceUtil.Options.split("-Dir=\"C:\\test\\file\""); // -Dir="C:\test\file"
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
- args = IceUtil.Options.split("-Dir=\"C:\\test\\filewith\\\"quote\""); // -Dir="C:\test\filewith\"quote"
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\filewith\"quote")); // -Dir=C:\test\filewith"quote
+ // Testing double quote
+ args = IceUtil.Options.split("-Dir=\"C:\\\\test\\\\file\""); // -Dir="C:\\test\\file"
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
+ args = IceUtil.Options.split("-Dir=\"C:\\test\\file\""); // -Dir="C:\test\file"
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
+ args = IceUtil.Options.split("-Dir=\"C:\\test\\filewith\\\"quote\""); // -Dir="C:\test\filewith\"quote"
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\filewith\"quote")); // -Dir=C:\test\filewith"quote
- // Testing ANSI quote
- args = IceUtil.Options.split("-Dir=$'C:\\\\test\\\\file'"); // -Dir=$'C:\\test\\file'
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
- args = IceUtil.Options.split("-Dir=$'C:\\oest\\oile'"); // -Dir='C:\oest\oile'
- test(args.length == 1 && args[0].equals("-Dir=C:\\oest\\oile")); // -Dir=C:\oest\oile
- args = IceUtil.Options.split("-Dir=$'C:\\oest\\oilewith\"quote'"); // -Dir=$'C:\oest\oilewith"quote'
- test(args.length == 1 && args[0].equals("-Dir=C:\\oest\\oilewith\"quote")); // -Dir=C:\oest\oilewith"quote
- args = IceUtil.Options.split("-Dir=$'\\103\\072\\134\\164\\145\\163\\164\\134\\146\\151\\154\\145'");
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
- args = IceUtil.Options.split("-Dir=$'\\x43\\x3A\\x5C\\x74\\x65\\x73\\x74\\x5C\\x66\\x69\\x6C\\x65'");
- test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
- args = IceUtil.Options.split("-Dir=$'\\cM\\c_'"); // Control characters
- test(args.length == 1 && args[0].equals("-Dir=\015\037"));
- args = IceUtil.Options.split("-Dir=$'C:\\\\\\146\\x66\\cMi'"); // -Dir=$'C:\\\146\x66i\cMi'
- test(args.length == 1 && args[0].equals("-Dir=C:\\ff\015i"));
- args = IceUtil.Options.split("-Dir=$'C:\\\\\\cM\\x66\\146i'"); // -Dir=$'C:\\\cM\x66\146i'
- test(args.length == 1 && args[0].equals("-Dir=C:\\\015ffi"));
- }
- catch(IceUtil.Options.BadQuote ex)
- {
- test(false);
- }
+ // Testing ANSI quote
+ args = IceUtil.Options.split("-Dir=$'C:\\\\test\\\\file'"); // -Dir=$'C:\\test\\file'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
+ args = IceUtil.Options.split("-Dir=$'C:\\oest\\oile'"); // -Dir='C:\oest\oile'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\oest\\oile")); // -Dir=C:\oest\oile
+ args = IceUtil.Options.split("-Dir=$'C:\\oest\\oilewith\"quote'"); // -Dir=$'C:\oest\oilewith"quote'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\oest\\oilewith\"quote")); // -Dir=C:\oest\oilewith"quote
+ args = IceUtil.Options.split("-Dir=$'\\103\\072\\134\\164\\145\\163\\164\\134\\146\\151\\154\\145'");
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
+ args = IceUtil.Options.split("-Dir=$'\\x43\\x3A\\x5C\\x74\\x65\\x73\\x74\\x5C\\x66\\x69\\x6C\\x65'");
+ test(args.length == 1 && args[0].equals("-Dir=C:\\test\\file")); // -Dir=C:\test\file
+ args = IceUtil.Options.split("-Dir=$'\\cM\\c_'"); // Control characters
+ test(args.length == 1 && args[0].equals("-Dir=\015\037"));
+ args = IceUtil.Options.split("-Dir=$'C:\\\\\\146\\x66\\cMi'"); // -Dir=$'C:\\\146\x66i\cMi'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\ff\015i"));
+ args = IceUtil.Options.split("-Dir=$'C:\\\\\\cM\\x66\\146i'"); // -Dir=$'C:\\\cM\x66\146i'
+ test(args.length == 1 && args[0].equals("-Dir=C:\\\015ffi"));
+ }
+ catch(IceUtil.Options.BadQuote ex)
+ {
+ test(false);
+ }
- String[] badQuoteCommands = new String[6];
- badQuoteCommands[0] = "\"";
- badQuoteCommands[1] = "'";
- badQuoteCommands[2] = "\\$'";
- badQuoteCommands[3] = "-Dir=\"test";
- badQuoteCommands[4] = "-Dir='test";
- badQuoteCommands[5] = "-Dir=$'test";
- for(int i = 0; i < 6; ++i)
- {
- try
- {
- IceUtil.Options.split(badQuoteCommands[i]);
- test(false);
- }
- catch(IceUtil.Options.BadQuote ex)
- {
- }
- }
+ String[] badQuoteCommands = new String[6];
+ badQuoteCommands[0] = "\"";
+ badQuoteCommands[1] = "'";
+ badQuoteCommands[2] = "\\$'";
+ badQuoteCommands[3] = "-Dir=\"test";
+ badQuoteCommands[4] = "-Dir='test";
+ badQuoteCommands[5] = "-Dir=$'test";
+ for(int i = 0; i < 6; ++i)
+ {
+ try
+ {
+ IceUtil.Options.split(badQuoteCommands[i]);
+ test(false);
+ }
+ catch(IceUtil.Options.BadQuote ex)
+ {
+ }
+ }
- System.out.println("ok");
+ System.out.println("ok");
}
}