summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-01-15 16:02:54 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-01-15 16:02:54 +0100
commita10f33af6ee6298b4a7412a3819cc4818f086fa4 (patch)
tree7dc924b0692491a6419b81ae419b559ccef467cf /cpp/test
parentbug 3266 - fix IceSSL/C++ for custom contexts (diff)
downloadice-a10f33af6ee6298b4a7412a3819cc4818f086fa4.tar.bz2
ice-a10f33af6ee6298b4a7412a3819cc4818f086fa4.tar.xz
ice-a10f33af6ee6298b4a7412a3819cc4818f086fa4.zip
- Fixed errorDetection test
- Fixed bug 3504, added locator request queue.
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Ice/location/AllTests.cpp50
-rw-r--r--cpp/test/Ice/location/Test.ice2
-rw-r--r--cpp/test/Slice/errorDetection/IllegalIdentifier.ice42
-rwxr-xr-xcpp/test/Slice/errorDetection/run.py2
4 files changed, 73 insertions, 23 deletions
diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp
index 46b02be526b..77b8a09ec3a 100644
--- a/cpp/test/Ice/location/AllTests.cpp
+++ b/cpp/test/Ice/location/AllTests.cpp
@@ -288,6 +288,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref)
cout << "ok" << endl;
cout << "testing proxy from server... " << flush;
+ obj = TestIntfPrx::checkedCast(communicator->stringToProxy("test@TestAdapter"));
HelloPrx hello = obj->getHello();
test(hello->ice_getAdapterId() == "TestAdapter");
hello->sayHello();
@@ -296,7 +297,56 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref)
hello->sayHello();
cout << "ok" << endl;
+ cout << "testing locator request queuing... " << flush;
+ hello = obj->getReplicatedHello()->ice_locatorCacheTimeout(0)->ice_connectionCached(false);
+ count = locator->getRequestCount();
+ hello->ice_ping();
+ test(++count == locator->getRequestCount());
+ for(int i = 0; i < 1000; i++)
+ {
+ class AMICallback : public Test::AMI_Hello_sayHello
+ {
+ public:
+ virtual void
+ ice_exception(const Ice::Exception&)
+ {
+ test(false);
+ }
+
+ virtual void
+ ice_response()
+ {
+ }
+ };
+ hello->sayHello_async(new AMICallback());
+ }
+ test(locator->getRequestCount() > count && locator->getRequestCount() < count + 100);
+ count = locator->getRequestCount();
+ hello = hello->ice_adapterId("unknown");
+ for(int i = 0; i < 1000; i++)
+ {
+ class AMICallback : public Test::AMI_Hello_sayHello
+ {
+ public:
+ virtual void
+ ice_exception(const Ice::Exception& ex)
+ {
+ test(dynamic_cast<const Ice::NotRegisteredException*>(&ex));
+ }
+
+ virtual void
+ ice_response()
+ {
+ test(false);
+ }
+ };
+ hello->sayHello_async(new AMICallback());
+ }
+ test(locator->getRequestCount() > count && locator->getRequestCount() < count + 100);
+ cout << "ok" << endl;
+
cout << "testing proxy from server after shutdown... " << flush;
+ hello = obj->getReplicatedHello();
obj->shutdown();
manager->startServer();
hello->sayHello();
diff --git a/cpp/test/Ice/location/Test.ice b/cpp/test/Ice/location/Test.ice
index f53b85e18aa..95702e5cd4d 100644
--- a/cpp/test/Ice/location/Test.ice
+++ b/cpp/test/Ice/location/Test.ice
@@ -39,7 +39,7 @@ interface ServerManager
interface Hello
{
- void sayHello();
+ ["ami"] void sayHello();
};
interface TestIntf
diff --git a/cpp/test/Slice/errorDetection/IllegalIdentifier.ice b/cpp/test/Slice/errorDetection/IllegalIdentifier.ice
index 2da89686467..d50ddb4afe1 100644
--- a/cpp/test/Slice/errorDetection/IllegalIdentifier.ice
+++ b/cpp/test/Slice/errorDetection/IllegalIdentifier.ice
@@ -1,21 +1,21 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-
-//
-// Check that 'œ' is properly rejected in idenifiers
-//
-
-module Test
-{
- interface Œuvre
- {
- void cœur();
- };
-};
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+
+//
+// Check that 'œ' is properly rejected in idenifiers
+//
+
+module Test
+{
+ interface Œuvre
+ {
+ void cœur();
+ };
+};
diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py
index 769754c0b84..b10af237310 100755
--- a/cpp/test/Slice/errorDetection/run.py
+++ b/cpp/test/Slice/errorDetection/run.py
@@ -39,7 +39,7 @@ for file in files:
else:
command = slice2cpp + " -I. " + os.path.join(os.getcwd(), file);
stdin, stdout, stderr = os.popen3(command)
- lines1 = stdout.readlines()
+ lines1 = stderr.readlines()
lines2 = open(os.path.join(os.getcwd(), regex1.sub(".err", file)), "r").readlines()
if len(lines1) != len(lines2):
print "failed!"