diff options
Diffstat (limited to 'qpid/cpp')
27 files changed, 576 insertions, 63 deletions
diff --git a/qpid/cpp/CMakeLists.txt b/qpid/cpp/CMakeLists.txt index 5c37ecfc97..17411e90a4 100644 --- a/qpid/cpp/CMakeLists.txt +++ b/qpid/cpp/CMakeLists.txt @@ -80,6 +80,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "qpidc-${qpidc_version}") add_subdirectory(managementgen) add_subdirectory(etc) add_subdirectory(src) +add_subdirectory(bindings/qpid) add_subdirectory(docs/api) # add_subdirectory(docs/man) add_subdirectory(examples) diff --git a/qpid/cpp/bindings/qpid/CMakeLists.txt b/qpid/cpp/bindings/qpid/CMakeLists.txt new file mode 100644 index 0000000000..b44065d32f --- /dev/null +++ b/qpid/cpp/bindings/qpid/CMakeLists.txt @@ -0,0 +1,39 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +include(FindSWIG) +include(UseSWIG) +include(FindRuby) +include(FindPythonLibs) +include(FindPerlLibs) + +if (SWIG_FOUND) + if (PYTHONLIBS_FOUND) + add_subdirectory(python) + endif (PYTHONLIBS_FOUND) + + if (RUBY_FOUND) + add_subdirectory(ruby) + endif (RUBY_FOUND) + + if (PERLLIBS_FOUND) + add_subdirectory(perl) + endif (PERLLIBS_FOUND) +endif (SWIG_FOUND) diff --git a/qpid/cpp/bindings/qpid/dotnet/Makefile.am b/qpid/cpp/bindings/qpid/dotnet/Makefile.am index f2b106bcb2..b5c1f6dda5 100644 --- a/qpid/cpp/bindings/qpid/dotnet/Makefile.am +++ b/qpid/cpp/bindings/qpid/dotnet/Makefile.am @@ -81,6 +81,7 @@ EXTRA_DIST = winsdk_sources/winsdk_dotnet_examples.sln \ configure-windows.ps1 \ ReadMe.txt \ org.apache.qpid.messaging.sln \ + org.apache.qpid.messaging.sessionreceiver.sln \ test/messaging.test/messaging.test.address.cs \ test/messaging.test/messaging.test.duration.cs \ test/messaging.test/messaging.test.cs \ diff --git a/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln b/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln new file mode 100644 index 0000000000..90e98a4bbe --- /dev/null +++ b/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln @@ -0,0 +1,76 @@ +Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License
+#
+
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.Apache.Qpid.Messaging", "src\org.apache.qpid.messaging.vcproj", "{AA5A3B83-5F98-406D-A01C-5A921467A57D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "org.apache.qpid.messaging.sessionreceiver", "src\sessionreceiver\org.apache.qpid.messaging.sessionreceiver.csproj", "{B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ RelWithDebInfo|Win32 = RelWithDebInfo|Win32
+ RelWithDebInfo|x64 = RelWithDebInfo|x64
+ RelWithDebInfo|x86 = RelWithDebInfo|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Debug|Win32.Build.0 = Debug|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Debug|x64.ActiveCfg = Debug|x64
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Debug|x64.Build.0 = Debug|x64
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Debug|x86.ActiveCfg = Debug|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Debug|x86.Build.0 = Debug|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Release|Win32.ActiveCfg = Release|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Release|Win32.Build.0 = Release|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Release|x64.ActiveCfg = Release|x64
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Release|x64.Build.0 = Release|x64
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Release|x86.ActiveCfg = Release|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.Release|x86.Build.0 = Release|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Win32
+ {AA5A3B83-5F98-406D-A01C-5A921467A57D}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Win32
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Debug|Win32.ActiveCfg = Debug|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Debug|x64.ActiveCfg = Debug|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Debug|x64.Build.0 = Debug|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Debug|x86.ActiveCfg = Debug|x86
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Debug|x86.Build.0 = Debug|x86
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Release|Win32.ActiveCfg = Release|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Release|x64.ActiveCfg = Release|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Release|x64.Build.0 = Release|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Release|x86.ActiveCfg = Release|x86
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.Release|x86.Build.0 = Release|x86
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
+ {B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/qpid/cpp/bindings/qpid/examples/perl/client.pl b/qpid/cpp/bindings/qpid/examples/perl/client.pl index 93eec88e07..19d9d3f14f 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/client.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/client.pl @@ -20,13 +20,13 @@ use strict; use warnings; -use cqpid; +use cqpid_perl; my $url = ( @ARGV == 1 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672"; my $connectionOptions = ( @ARGV > 1 ) ? $ARGV[1] : ""; -my $connection = new cqpid::Connection($url, $connectionOptions); +my $connection = new cqpid_perl::Connection($url, $connectionOptions); eval { $connection->open(); @@ -35,7 +35,7 @@ my $session = $connection->createSession(); my $sender = $session->createSender("service_queue"); #create temp queue & receiver... -my $responseQueue = new cqpid::Address("#response-queue; {create:always, delete:always}"); +my $responseQueue = new cqpid_perl::Address("#response-queue; {create:always, delete:always}"); my $receiver = $session->createReceiver($responseQueue); #Now send some messages... @@ -47,7 +47,7 @@ my @s = ( "And the mome raths outgrabe." ); -my $request = new cqpid::Message(); +my $request = new cqpid_perl::Message(); $request->setReplyTo($responseQueue); for (my $i=0; $i<4; $i++) { $request->setContent($s[$i]); diff --git a/qpid/cpp/bindings/qpid/examples/perl/drain.pl b/qpid/cpp/bindings/qpid/examples/perl/drain.pl index 8010b7c95b..60ac0c50ed 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/drain.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/drain.pl @@ -20,7 +20,7 @@ use strict; use warnings; -use cqpid; +use cqpid_perl; use Getopt::Long; my $url = "127.0.0.1"; @@ -47,11 +47,11 @@ if ($#ARGV ge 0) { } sub getTimeout { - return ($forever) ? $cqpid::Duration::FOREVER : new cqpid::Duration($timeout*1000); + return ($forever) ? $cqpid_perl::Duration::FOREVER : new cqpid_perl::Duration($timeout*1000); } -my $connection = new cqpid::Connection($url, $connectionOptions); +my $connection = new cqpid_perl::Connection($url, $connectionOptions); eval { $connection->open(); @@ -59,13 +59,13 @@ eval { my $receiver = $session->createReceiver($address); my $timeout = getTimeout(); - my $message = new cqpid::Message(); + my $message = new cqpid_perl::Message(); my $i = 0; while($receiver->fetch($message, $timeout)) { print "Message(properties=" . $message->getProperties() . ",content='"; if ($message->getContentType() eq "amqp/map") { - my $content = cqpid::decodeMap($message); + my $content = cqpid_perl::decodeMap($message); map{ print "\n$_ => $content->{$_}"; } keys %{$content}; } else { @@ -77,7 +77,7 @@ eval { if ($replyto->getName()) { print "Replying to " . $message->getReplyTo()->str() . "...\n"; my $sender = $session->createSender($replyto); - my $response = new cqpid::Message("received by the server."); + my $response = new cqpid_perl::Message("received by the server."); $sender->send($response); } $session->acknowledge(); diff --git a/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl b/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl index cf2f05f8b7..a96b98a002 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl @@ -21,13 +21,13 @@ use strict; use warnings; use Data::Dumper; -use cqpid; +use cqpid_perl; my $broker = ( @ARGV > 0 ) ? $ARGV[0] : "localhost:5672"; my $address = ( @ARGV > 1 ) ? $ARGV[0] : "amq.topic"; my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[1] : ""; -my $connection = new cqpid::Connection($broker, $connectionOptions); +my $connection = new cqpid_perl::Connection($broker, $connectionOptions); eval { $connection->open(); @@ -36,12 +36,12 @@ eval { my $receiver = $session->createReceiver($address); my $sender = $session->createSender($address); - $sender->send(new cqpid::Message("Hello world!")); + $sender->send(new cqpid_perl::Message("Hello world!")); - #my $duration = new cqpid::Duration(1000); + #my $duration = new cqpid_perl::Duration(1000); #print ">>>" . $duration->getMilliseconds() . "\n"; - my $message = $receiver->fetch($cqpid::Duration::SECOND); + my $message = $receiver->fetch($cqpid_perl::Duration::SECOND); #$message->setDurable(1); #print "Durable: " . $message->getDurable() . "\n"; diff --git a/qpid/cpp/bindings/qpid/examples/perl/hello_xml.pl b/qpid/cpp/bindings/qpid/examples/perl/hello_xml.pl index c48a5225c2..cebf2ceee6 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/hello_xml.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/hello_xml.pl @@ -20,7 +20,7 @@ use strict; use warnings; -use cqpid; +use cqpid_perl; my $broker = ( @ARGV > 0 ) ? $ARGV[0] : "localhost:5672"; my $connectionOptions = ( @ARGV > 1 ) ? $ARGV[1] : ""; @@ -44,7 +44,7 @@ x-bindings: [{ exchange: xml-exchange, key: weather, arguments: { xquery:" $quer END -my $connection = new cqpid::Connection($broker, $connectionOptions); +my $connection = new cqpid_perl::Connection($broker, $connectionOptions); eval { $connection->open(); @@ -52,7 +52,7 @@ eval { my $receiver = $session->createReceiver($address); - my $message = new cqpid::Message(); + my $message = new cqpid_perl::Message(); my $content = <<END; <weather> diff --git a/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl b/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl index e3e8a201dd..2e2611e38f 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl @@ -21,21 +21,21 @@ use strict; use warnings; use Data::Dumper; -use cqpid; +use cqpid_perl; my $url = ( @ARGV > 0 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672"; my $address = ( @ARGV > 1 ) ? $ARGV[0] : "message_queue; {create: always}"; my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[1] : ""; -my $connection = new cqpid::Connection($url, $connectionOptions); +my $connection = new cqpid_perl::Connection($url, $connectionOptions); eval { $connection->open(); my $session = $connection->createSession(); my $receiver = $session->createReceiver($address); - my $content = cqpid::decodeMap($receiver->fetch()); - #my $content = cqpid::decodeList($receiver->fetch()); + my $content = cqpid_perl::decodeMap($receiver->fetch()); + #my $content = cqpid_perl::decodeList($receiver->fetch()); print Dumper($content); diff --git a/qpid/cpp/bindings/qpid/examples/perl/map_sender.pl b/qpid/cpp/bindings/qpid/examples/perl/map_sender.pl index 095acce0ab..4107cd48b9 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/map_sender.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/map_sender.pl @@ -21,13 +21,13 @@ use strict; use warnings; use Data::Dumper; -use cqpid; +use cqpid_perl; my $url = ( @ARGV > 0 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672"; my $address = ( @ARGV > 1 ) ? $ARGV[1] : "message_queue; {create: always}"; my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[2] : ""; -my $connection = new cqpid::Connection($url, $connectionOptions); +my $connection = new cqpid_perl::Connection($url, $connectionOptions); eval { $connection->open(); @@ -35,13 +35,13 @@ eval { my $session = $connection->createSession(); my $sender = $session->createSender($address); - my $message = new cqpid::Message(); + my $message = new cqpid_perl::Message(); my $content = { id => 987654321, name => "Widget", percent => sprintf("%.2f", 0.99), colours => [ qw (red green white) ], }; - cqpid::encode($content, $message); + cqpid_perl::encode($content, $message); $sender->send($message, 1); $connection->close(); diff --git a/qpid/cpp/bindings/qpid/examples/perl/server.pl b/qpid/cpp/bindings/qpid/examples/perl/server.pl index 0c64f15c66..b14da565b9 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/server.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/server.pl @@ -20,13 +20,13 @@ use strict; use warnings; -use cqpid; +use cqpid_perl; my $url = ( @ARGV == 1 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672"; my $connectionOptions = ( @ARGV > 1 ) ? $ARGV[1] : ""; -my $connection = new cqpid::Connection($url, $connectionOptions); +my $connection = new cqpid_perl::Connection($url, $connectionOptions); eval { $connection->open(); @@ -41,7 +41,7 @@ eval { my $sender = $session->createSender($address); my $s = $request->getContent(); $s = uc($s); - my $response = new cqpid::Message($s); + my $response = new cqpid_perl::Message($s); $sender->send($response); print "Processed request: " . $request->getContent() . " -> " . $response->getContent() . "\n"; $session->acknowledge(); diff --git a/qpid/cpp/bindings/qpid/examples/perl/spout.pl b/qpid/cpp/bindings/qpid/examples/perl/spout.pl index 50773a4fe2..7365e732bf 100644 --- a/qpid/cpp/bindings/qpid/examples/perl/spout.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/spout.pl @@ -20,7 +20,7 @@ use strict; use warnings; -use cqpid; +use cqpid_perl; use Getopt::Long; use Time::Local; @@ -77,19 +77,19 @@ sub setProperties { } } -my $connection = new cqpid::Connection($url, $connectionOptions); +my $connection = new cqpid_perl::Connection($url, $connectionOptions); eval { $connection->open(); my $session = $connection->createSession(); my $sender = $session->createSender($address); - my $message = new cqpid::Message(); + my $message = new cqpid_perl::Message(); setProperties($message) if (@properties); if (@entries) { my $content = {}; setEntries($content); - cqpid::encode($content, $message); + cqpid_perl::encode($content, $message); } elsif ($content) { $message->setContent($content); @@ -98,7 +98,7 @@ eval { my $receiver; if ($replyto) { - my $responseQueue = new cqpid::Address($replyto); + my $responseQueue = new cqpid_perl::Address($replyto); $receiver = $session->createReceiver($responseQueue); $message->setReplyTo($responseQueue); } diff --git a/qpid/cpp/bindings/qpid/perl/CMakeLists.txt b/qpid/cpp/bindings/qpid/perl/CMakeLists.txt new file mode 100644 index 0000000000..da3c0be41a --- /dev/null +++ b/qpid/cpp/bindings/qpid/perl/CMakeLists.txt @@ -0,0 +1,39 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +##------------------------------------------------------ +## Use Swig to generate a literal binding to the C++ API +##------------------------------------------------------ +set(CMAKE_SWIG_FLAGS "-w361,362,401,467,503") +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/perl.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/perl.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") + +swig_add_module(cqpid_perl perl ${CMAKE_CURRENT_SOURCE_DIR}/perl.i) +swig_link_libraries(cqpid_perl qpidmessaging qpidtypes qmf2 ${PERL_LIBRARY}) + +set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-I${PERL_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include") + +##---------------------------------- +## Install the complete Perl binding +##---------------------------------- +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid_perl.so + ${CMAKE_CURRENT_BINARY_DIR}/cqpid_perl.pm + DESTINATION ${PERL_VENDORARCH} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) diff --git a/qpid/cpp/bindings/qpid/perl/Makefile.am b/qpid/cpp/bindings/qpid/perl/Makefile.am index 982d493ba0..13ab66f032 100644 --- a/qpid/cpp/bindings/qpid/perl/Makefile.am +++ b/qpid/cpp/bindings/qpid/perl/Makefile.am @@ -22,21 +22,21 @@ if HAVE_PERL_DEVEL INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src -I$(PERL_INC) EXTRA_DIST = perl.i -BUILT_SOURCES = cqpid.cpp +BUILT_SOURCES = cqpid_perl.cpp SWIG_FLAGS = -w362,401 -cqpid.cpp: $(srcdir)/perl.i $(srcdir)/../qpid.i $(srcdir)/../../swig_perl_typemaps.i - $(SWIG) -perl -c++ $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I/usr/include -o cqpid.cpp $(srcdir)/perl.i +cqpid_perl.cpp: $(srcdir)/perl.i $(srcdir)/../qpid.i $(srcdir)/../../swig_perl_typemaps.i + $(SWIG) -perl -c++ $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I/usr/include -o cqpid_perl.cpp $(srcdir)/perl.i -lib_LTLIBRARIES = cqpid.la -cqpid_PERL = cqpid.pm +lib_LTLIBRARIES = libcqpid_perl.la +cqpid_perl_PERL = cqpid_perl.pm -cqpid_la_LDFLAGS = -avoid-version -module -shared -cqpid_la_LIBADD = -L$(top_builddir)/src/.libs -lqpidmessaging -lqpidtypes \ +libcqpid_perl_la_LDFLAGS = -avoid-version -shared +libcqpid_perl_la_LIBADD = -L$(top_builddir)/src/.libs -lqpidmessaging -lqpidtypes \ $(top_builddir)/src/libqpidmessaging.la $(top_builddir)/src/libqpidtypes.la -cqpid_la_CXXFLAGS = $(INCLUDES) -nodist_cqpid_la_SOURCES = cqpid.cpp +libcqpid_perl_la_CXXFLAGS = $(INCLUDES) +nodist_libcqpid_perl_la_SOURCES = cqpid_perl.cpp -CLEANFILES = cqpid.cpp cqpid.pm +CLEANFILES = cqpid_perl.cpp cqpid_perl.pm endif # HAVE_PERL_DEVEL diff --git a/qpid/cpp/bindings/qpid/perl/perl.i b/qpid/cpp/bindings/qpid/perl/perl.i index b7ae0568b6..38ac91761f 100644 --- a/qpid/cpp/bindings/qpid/perl/perl.i +++ b/qpid/cpp/bindings/qpid/perl/perl.i @@ -17,7 +17,7 @@ * under the License. */ -%module cqpid +%module cqpid_perl %include "std_string.i" %include "../../swig_perl_typemaps.i" diff --git a/qpid/cpp/bindings/qpid/python/CMakeLists.txt b/qpid/cpp/bindings/qpid/python/CMakeLists.txt new file mode 100644 index 0000000000..51c983f3cf --- /dev/null +++ b/qpid/cpp/bindings/qpid/python/CMakeLists.txt @@ -0,0 +1,46 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +##------------------------------------------------------ +## Use Swig to generate a literal binding to the C++ API +##------------------------------------------------------ +set(CMAKE_SWIG_FLAGS "-w361,362,401,467") +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") + +swig_add_module(cqpid python ${CMAKE_CURRENT_SOURCE_DIR}/python.i) +swig_link_libraries(cqpid qpidmessaging qpidtypes qmf2 ${PYTHON_LIBRARIES}) + +set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I${PYTHON_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include") + +##------------------------------------ +## Install the complete Python binding +##------------------------------------ +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE) +install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqpid.py + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})") +install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqpid.py + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})") +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqpid.py + ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyc + ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyo + ${CMAKE_CURRENT_BINARY_DIR}/_cqpid.so + DESTINATION ${PYTHON_SITE_PACKAGES} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) diff --git a/qpid/cpp/bindings/qpid/qpid.i b/qpid/cpp/bindings/qpid/qpid.i index e60ce1ce7c..01f9bff64d 100644 --- a/qpid/cpp/bindings/qpid/qpid.i +++ b/qpid/cpp/bindings/qpid/qpid.i @@ -27,6 +27,7 @@ #include <qpid/messaging/Sender.h> #include <qpid/messaging/Message.h> #include <qpid/messaging/Duration.h> +#include <qpid/messaging/FailoverUpdates.h> // // Wrapper functions for map-decode and list-decode. This allows us to avoid @@ -56,6 +57,7 @@ qpid::types::Variant::List& decodeList(const qpid::messaging::Message& msg) { %include <qpid/messaging/Sender.h> %include <qpid/messaging/Session.h> %include <qpid/messaging/Connection.h> +%include <qpid/messaging/FailoverUpdates.h> qpid::types::Variant::Map& decodeMap(const qpid::messaging::Message&); qpid::types::Variant::List& decodeList(const qpid::messaging::Message&); diff --git a/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt b/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt new file mode 100644 index 0000000000..7113d93b62 --- /dev/null +++ b/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt @@ -0,0 +1,39 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +##------------------------------------------------------ +## Use Swig to generate a literal binding to the C++ API +##------------------------------------------------------ +set(CMAKE_SWIG_FLAGS "-w361,362,401,467") +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") + +swig_add_module(cqpid ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i) +swig_link_libraries(cqpid qpidmessaging qpidtypes qmf2 ${RUBY_LIBRARY}) + +set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-I${RUBY_INCLUDE_DIR} -I${qpid-cpp_SOURCE_DIR}/include") + +##---------------------------------- +## Install the complete Ruby binding +##---------------------------------- +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid.so + RENAME cqpid.so + DESTINATION ${RUBY_SITEARCH_DIR} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt index 4b5a1b1c2c..d0ca2d9c2b 100644 --- a/qpid/cpp/src/CMakeLists.txt +++ b/qpid/cpp/src/CMakeLists.txt @@ -313,10 +313,6 @@ if (NOT Boost_FILESYSTEM_LIBRARY) set(Boost_FILESYSTEM_LIBRARY boost_filesystem) endif (NOT Boost_FILESYSTEM_LIBRARY) -if (NOT Boost_SYSTEM_LIBRARY) - set(Boost_SYSTEM_LIBRARY boost_system) -endif (NOT Boost_SYSTEM_LIBRARY) - if (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY) set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY boost_unit_test_framework) endif (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY) @@ -602,14 +598,14 @@ if (CMAKE_SYSTEM_NAME STREQUAL Windows) set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob2 /D NDEBUG") set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "/debug /INCREMENTAL:NO") - # Set the windows version for the .NET Binding cpp project - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src/org.apache.qpid.messaging.template.rc - ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/org.apache.qpid.messaging.rc) - - # Set the windows version for the .NET Binding sessionreceiver project - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src/sessionreceiver/properties/sessionreceiver-AssemblyInfo-template.cs - ${CMAKE_CURRENT_BINARY_DIR}/windows/generated_src/sessionreceiver-AssemblyInfo.cs) - + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src) + # Set the windows version for the .NET Binding cpp project + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src/org.apache.qpid.messaging.template.rc + ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/org.apache.qpid.messaging.rc) + # Set the windows version for the .NET Binding sessionreceiver project + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src/sessionreceiver/properties/sessionreceiver-AssemblyInfo-template.cs + ${CMAKE_CURRENT_BINARY_DIR}/windows/generated_src/sessionreceiver-AssemblyInfo.cs) + endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src) endif (MSVC) set (qpidtypes_platform_SOURCES @@ -1068,13 +1064,15 @@ endif (CPACK_GENERATOR STREQUAL "NSIS") # REVISION => Version of underlying implementation. # Bump if implementation changes but API/ABI doesn't # AGE => Number of API/ABI versions this is backward compatible with -set (qmf_version 1.0.0) +set (qmf_version 2.0.0) +set (qmf2_version 1.0.0) set (qmfengine_version 1.0.0) set (qmf_SOURCES qpid/agent/ManagementAgentImpl.cpp qpid/agent/ManagementAgentImpl.h ) + add_msvc_version (qmf library dll) add_library (qmf SHARED ${qmf_SOURCES}) target_link_libraries (qmf qpidclient) @@ -1085,6 +1083,83 @@ install (TARGETS qmf OPTIONAL COMPONENT ${QPID_COMPONENT_QMF}) install_pdb (qmf ${QPID_COMPONENT_QMF}) +if(NOT WIN32) + set (qmf2_HEADERS + ../include/qmf/AgentEvent.h + ../include/qmf/Agent.h + ../include/qmf/AgentSession.h + ../include/qmf/ConsoleEvent.h + ../include/qmf/ConsoleSession.h + ../include/qmf/DataAddr.h + ../include/qmf/Data.h + ../include/qmf/exceptions.h + ../include/qmf/Handle.h + ../include/qmf/ImportExport.h + ../include/qmf/Query.h + ../include/qmf/Schema.h + ../include/qmf/SchemaId.h + ../include/qmf/SchemaMethod.h + ../include/qmf/SchemaProperty.h + ../include/qmf/SchemaTypes.h + ../include/qmf/Subscription.h + ) + + set (qmf2_SOURCES + ${qmf2_HEADERS} + qmf/agentCapability.h + qmf/Agent.cpp + qmf/AgentEvent.cpp + qmf/AgentEventImpl.h + qmf/AgentImpl.h + qmf/AgentSession.cpp + qmf/AgentSubscription.cpp + qmf/AgentSubscription.h + qmf/ConsoleEvent.cpp + qmf/ConsoleEventImpl.h + qmf/ConsoleSession.cpp + qmf/ConsoleSessionImpl.h + qmf/constants.cpp + qmf/constants.h + qmf/DataAddr.cpp + qmf/DataAddrImpl.h + qmf/Data.cpp + qmf/DataImpl.h + qmf/exceptions.cpp + qmf/Expression.cpp + qmf/Expression.h + qmf/Hash.cpp + qmf/Hash.h + qmf/PrivateImplRef.h + qmf/Query.cpp + qmf/QueryImpl.h + qmf/Schema.cpp + qmf/SchemaCache.cpp + qmf/SchemaCache.h + qmf/SchemaId.cpp + qmf/SchemaIdImpl.h + qmf/SchemaImpl.h + qmf/SchemaMethod.cpp + qmf/SchemaMethodImpl.h + qmf/SchemaProperty.cpp + qmf/SchemaPropertyImpl.h + qmf/Subscription.cpp + qmf/SubscriptionImpl.h + ) + + add_msvc_version (qmf2 library dll) + add_library (qmf2 SHARED ${qmf2_SOURCES}) + target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient qpidcommon) + set_target_properties (qmf2 PROPERTIES + VERSION ${qmf2_version}) + install (TARGETS qmf2 OPTIONAL + DESTINATION ${QPID_INSTALL_LIBDIR} + COMPONENT ${QPID_COMPONENT_QMF}) + install (FILES ${qmf2_HEADERS} + DESTINATION ${QPID_INSTALL_INCLUDEDIR}/qmf + COMPONENT ${QPID_COMPONENT_QMF}) + install_pdb (qmf2 ${QPID_COMPONENT_QMF}) +endif (NOT WIN32) + set (qmfengine_SOURCES qmf/engine/Agent.cpp qmf/engine/BrokerProxyImpl.cpp diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am index 6fafff7d54..dfb2547613 100644 --- a/qpid/cpp/src/Makefile.am +++ b/qpid/cpp/src/Makefile.am @@ -56,7 +56,10 @@ windows_dist = \ qpid/broker/windows/BrokerDefaults.cpp \ qpid/broker/windows/SaslAuthenticator.cpp \ qpid/broker/windows/SslProtocolFactory.cpp \ - qpid/messaging/HandleInstantiator.cpp + qpid/messaging/HandleInstantiator.cpp \ + windows/resources/template-resource.rc \ + windows/resources/version-resource.h \ + windows/resources/qpid-icon.ico EXTRA_DIST= $(platform_dist) $(rgen_srcs) $(windows_dist) diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.cpp b/qpid/cpp/src/qpid/management/ManagementAgent.cpp index 23c999a98a..8b4defaa73 100644 --- a/qpid/cpp/src/qpid/management/ManagementAgent.cpp +++ b/qpid/cpp/src/qpid/management/ManagementAgent.cpp @@ -31,6 +31,7 @@ #include <qpid/broker/Message.h> #include "qpid/framing/MessageTransferBody.h" #include "qpid/sys/Time.h" +#include "qpid/sys/Thread.h" #include "qpid/broker/ConnectionState.h" #include "qpid/broker/AclModule.h" #include "qpid/types/Variant.h" @@ -2237,6 +2238,7 @@ void ManagementAgent::dispatchAgentCommandLH(Message& msg, bool viaLocal) uint32_t bufferLen = inBuffer.getPosition(); inBuffer.reset(); + setManagementExecutionContext((const qpid::broker::ConnectionState*) msg.getPublisher()); const framing::FieldTable *headers = msg.getApplicationHeaders(); if (headers && msg.getAppId() == "qmf2") { @@ -3085,3 +3087,21 @@ bool ManagementAgent::moveDeletedObjectsLH() { } return !deleteList.empty(); } + +namespace qpid { +namespace management { + +namespace { +QPID_TSS const qpid::broker::ConnectionState* executionContext = 0; +} + +void setManagementExecutionContext(const qpid::broker::ConnectionState* ctxt) +{ + executionContext = ctxt; +} +const qpid::broker::ConnectionState* getManagementExecutionContext() +{ + return executionContext; +} + +}} diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.h b/qpid/cpp/src/qpid/management/ManagementAgent.h index 0db19594a7..fb15dc6ed1 100644 --- a/qpid/cpp/src/qpid/management/ManagementAgent.h +++ b/qpid/cpp/src/qpid/management/ManagementAgent.h @@ -41,6 +41,9 @@ #include <map> namespace qpid { +namespace broker { +class ConnectionState; +} namespace management { class ManagementAgent @@ -422,6 +425,8 @@ private: void debugSnapshot(const char* title); }; +void setManagementExecutionContext(const qpid::broker::ConnectionState*); +const qpid::broker::ConnectionState* getManagementExecutionContext(); }} - + #endif /*!_ManagementAgent_*/ diff --git a/qpid/cpp/src/tests/MessagingFixture.h b/qpid/cpp/src/tests/MessagingFixture.h index 715de09bad..2312a87e9d 100644 --- a/qpid/cpp/src/tests/MessagingFixture.h +++ b/qpid/cpp/src/tests/MessagingFixture.h @@ -27,15 +27,19 @@ #include "qpid/client/Connection.h" #include "qpid/client/Session.h" #include "qpid/framing/Uuid.h" +#include "qpid/messaging/Address.h" #include "qpid/messaging/Connection.h" #include "qpid/messaging/Session.h" #include "qpid/messaging/Sender.h" #include "qpid/messaging/Receiver.h" #include "qpid/messaging/Message.h" +#include "qpid/types/Variant.h" namespace qpid { namespace tests { +using qpid::types::Variant; + struct BrokerAdmin { qpid::client::Connection connection; @@ -223,6 +227,119 @@ inline void receive(messaging::Receiver& receiver, uint count = 1, uint start = } } + +class MethodInvoker +{ + public: + MethodInvoker(messaging::Session& session) : replyTo("#; {create:always, node:{x-declare:{auto-delete:true}}}"), + sender(session.createSender("qmf.default.direct/broker")), + receiver(session.createReceiver(replyTo)) {} + + void createExchange(const std::string& name, const std::string& type, bool durable=false) + { + Variant::Map params; + params["name"]=name; + params["type"]="exchange"; + params["properties"] = Variant::Map(); + params["properties"].asMap()["exchange-type"] = type; + params["properties"].asMap()["durable"] = durable; + methodRequest("create", params); + } + + void deleteExchange(const std::string& name) + { + Variant::Map params; + params["name"]=name; + params["type"]="exchange"; + methodRequest("delete", params); + } + + void createQueue(const std::string& name, bool durable=false, bool autodelete=false, + const Variant::Map& options=Variant::Map()) + { + Variant::Map params; + params["name"]=name; + params["type"]="queue"; + params["properties"] = options; + params["properties"].asMap()["durable"] = durable; + params["properties"].asMap()["auto-delete"] = autodelete; + methodRequest("create", params); + } + + void deleteQueue(const std::string& name) + { + Variant::Map params; + params["name"]=name; + params["type"]="queue"; + methodRequest("delete", params); + } + + void bind(const std::string& exchange, const std::string& queue, const std::string& key, + const Variant::Map& options=Variant::Map()) + { + Variant::Map params; + params["name"]=(boost::format("%1%/%2%/%3%") % (exchange) % (queue) % (key)).str(); + params["type"]="binding"; + params["properties"] = options; + methodRequest("create", params); + } + + void unbind(const std::string& exchange, const std::string& queue, const std::string& key) + { + Variant::Map params; + params["name"]=(boost::format("%1%/%2%/%3%") % (exchange) % (queue) % (key)).str(); + params["type"]="binding"; + methodRequest("delete", params); + } + + void methodRequest(const std::string& method, const Variant::Map& inParams, Variant::Map* outParams = 0) + { + Variant::Map content; + Variant::Map objectId; + objectId["_object_name"] = "org.apache.qpid.broker:broker:amqp-broker"; + content["_object_id"] = objectId; + content["_method_name"] = method; + content["_arguments"] = inParams; + + messaging::Message request; + request.setReplyTo(replyTo); + request.getProperties()["x-amqp-0-10.app-id"] = "qmf2"; + request.getProperties()["qmf.opcode"] = "_method_request"; + encode(content, request); + + sender.send(request); + + messaging::Message response; + if (receiver.fetch(response, messaging::Duration::SECOND*5)) { + if (response.getProperties()["x-amqp-0-10.app-id"] == "qmf2") { + std::string opcode = response.getProperties()["qmf.opcode"]; + if (opcode == "_method_response") { + if (outParams) { + Variant::Map m; + decode(response, m); + *outParams = m["_arguments"].asMap(); + } + } else if (opcode == "_exception") { + Variant::Map m; + decode(response, m); + throw Exception(QPID_MSG("Error: " << m["_values"])); + } else { + throw Exception(QPID_MSG("Invalid response received, unexpected opcode: " << opcode)); + } + } else { + throw Exception(QPID_MSG("Invalid response received, not a qmfv2 message: app-id=" + << response.getProperties()["x-amqp-0-10.app-id"])); + } + } else { + throw Exception(QPID_MSG("No response received")); + } + } + private: + messaging::Address replyTo; + messaging::Sender sender; + messaging::Receiver receiver; +}; + }} // namespace qpid::tests #endif /*!TESTS_MESSAGINGFIXTURE_H*/ diff --git a/qpid/cpp/src/tests/MessagingSessionTests.cpp b/qpid/cpp/src/tests/MessagingSessionTests.cpp index 991ec847bf..f9a8b0e4c1 100644 --- a/qpid/cpp/src/tests/MessagingSessionTests.cpp +++ b/qpid/cpp/src/tests/MessagingSessionTests.cpp @@ -890,6 +890,53 @@ QPID_AUTO_TEST_CASE(testAcknowledge) BOOST_CHECK(!fix.session.createReceiver(fix.queue).fetch(m, Duration::IMMEDIATE)); } +QPID_AUTO_TEST_CASE(testQmfCreateAndDelete) +{ + MessagingFixture fix(Broker::Options(), true/*enable management*/); + MethodInvoker control(fix.session); + control.createQueue("my-queue"); + control.createExchange("my-exchange", "topic"); + control.bind("my-exchange", "my-queue", "subject1"); + + Sender sender = fix.session.createSender("my-exchange"); + Receiver receiver = fix.session.createReceiver("my-queue"); + Message out; + out.setSubject("subject1"); + out.setContent("one"); + sender.send(out); + Message in; + BOOST_CHECK(receiver.fetch(in, Duration::SECOND*5)); + BOOST_CHECK_EQUAL(out.getContent(), in.getContent()); + control.unbind("my-exchange", "my-queue", "subject1"); + control.bind("my-exchange", "my-queue", "subject2"); + + out.setContent("two"); + sender.send(out);//should be dropped + + out.setSubject("subject2"); + out.setContent("three"); + sender.send(out);//should not be dropped + + BOOST_CHECK(receiver.fetch(in, Duration::SECOND*5)); + BOOST_CHECK_EQUAL(out.getContent(), in.getContent()); + BOOST_CHECK(!receiver.fetch(in, Duration::IMMEDIATE)); + sender.close(); + receiver.close(); + + control.deleteExchange("my-exchange"); + messaging::Session other = fix.connection.createSession(); + { + ScopedSuppressLogging sl; + BOOST_CHECK_THROW(other.createSender("my-exchange"), qpid::messaging::NotFound); + } + control.deleteQueue("my-queue"); + other = fix.connection.createSession(); + { + ScopedSuppressLogging sl; + BOOST_CHECK_THROW(other.createReceiver("my-queue"), qpid::messaging::NotFound); + } +} + QPID_AUTO_TEST_SUITE_END() }} // namespace qpid::tests diff --git a/qpid/cpp/src/tests/QueueTest.cpp b/qpid/cpp/src/tests/QueueTest.cpp index 4d63d9bd97..e4e9897195 100644 --- a/qpid/cpp/src/tests/QueueTest.cpp +++ b/qpid/cpp/src/tests/QueueTest.cpp @@ -249,7 +249,7 @@ QPID_AUTO_TEST_CASE(testBound){ exchange2.reset(); //unbind the queue from all exchanges it knows it has been bound to: - queue->unbind(exchanges, queue); + queue->unbind(exchanges); //ensure the remaining exchanges don't still have the queue bound to them: FailOnDeliver deliverable; diff --git a/qpid/cpp/src/tests/qpid-ctrl b/qpid/cpp/src/tests/qpid-ctrl index 7b46c190fb..4246c57898 100755 --- a/qpid/cpp/src/tests/qpid-ctrl +++ b/qpid/cpp/src/tests/qpid-ctrl @@ -92,7 +92,10 @@ try: arguments = {} for a in args: name, val = nameval(a) - arguments[name] = val + if val[0] == '{' or val[0] == '[': + arguments[name] = eval(val) + else: + arguments[name] = val content = { "_object_id": {"_object_name": object_name}, "_method_name": method_name, diff --git a/qpid/cpp/src/tests/sender.cpp b/qpid/cpp/src/tests/sender.cpp index 9850e851da..063b5e87dc 100644 --- a/qpid/cpp/src/tests/sender.cpp +++ b/qpid/cpp/src/tests/sender.cpp @@ -120,7 +120,7 @@ void Sender::execute(AsyncSession& session, bool isRetry) string data; while (getline(std::cin, data)) { message.setData(data); - message.getHeaders().setInt("SN", ++sent); + //message.getHeaders().setInt("SN", ++sent); string matchKey; if (lvqMatchValues && getline(lvqMatchValues, matchKey)) { message.getHeaders().setString(QueueOptions::strLVQMatchProperty, matchKey); |