summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-08-26 16:04:55 +0000
committerAlan Conway <aconway@apache.org>2008-08-26 16:04:55 +0000
commitaf26c5868f44c0474f161c2923905206882c9e33 (patch)
treedf73d699365333267e5e1f1eb38cfb34ce94e7f3
parent9c9299dcbf78f868b13cd574822a9637671a8862 (diff)
downloadqpid-python-af26c5868f44c0474f161c2923905206882c9e33.tar.gz
Removed unused rpm targets and files.
Added src/tests/echotest.cpp from Gordon Sim. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@689123 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/Makefile.am23
-rw-r--r--qpid/cpp/configure.ac2
-rw-r--r--qpid/cpp/qpidc.spec.in302
-rw-r--r--qpid/cpp/rpm/README.qpidd-devel7
-rw-r--r--qpid/cpp/src/tests/Makefile.am4
-rw-r--r--qpid/cpp/src/tests/echotest.cpp131
6 files changed, 135 insertions, 334 deletions
diff --git a/qpid/cpp/Makefile.am b/qpid/cpp/Makefile.am
index a996db4eac..8e73ba5777 100644
--- a/qpid/cpp/Makefile.am
+++ b/qpid/cpp/Makefile.am
@@ -1,12 +1,8 @@
AUTOMAKE_OPTIONS = 1.9.2 foreign
ACLOCAL_AMFLAGS = -I m4
-SPEC=$(PACKAGE).spec
-
EXTRA_DIST = \
LICENSE NOTICE README RELEASE_NOTES DESIGN\
- $(SPEC) $(SPEC).in \
- rpm/README.qpidd-devel \
xml/cluster.xml
SUBDIRS = managementgen etc src docs/api docs/man examples
@@ -15,24 +11,5 @@ SUBDIRS = managementgen etc src docs/api docs/man examples
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
-#
-# Build RPMs from the distribution tarball.
-#
-RPMDIRS=rpm/BUILD rpm/RPMS rpm/SPECS rpm/SRPMS
-RPMMACROS=--define "_topdir @abs_builddir@/rpm" --define "_sourcedir @abs_builddir@"
-# Override this variable e.g. with -bs to produce srpm only
-RPMOPTS=-ba
-
-clean-local:
- -rm -rf $(RPMDIRS)
-.PHONY: rpmbuild
-rpmbuild: $(SPEC) dist-gzip
- mkdir -p $(RPMDIRS)
- QPID_PYTHON_DIR=@abs_top_srcdir@/../python rpmbuild $(RPMMACROS) $(RPMOPTS) $(SPEC)
-if HAS_RPMLINT
- rpmlint `find rpm -name '*.rpm'`
-else
- @echo "WARNING: rpmlint not found, could not validate RPMs."
-endif
diff --git a/qpid/cpp/configure.ac b/qpid/cpp/configure.ac
index 812d82c6ce..9c977d05d6 100644
--- a/qpid/cpp/configure.ac
+++ b/qpid/cpp/configure.ac
@@ -16,7 +16,6 @@ AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
AC_PREREQ(2.59)
AC_CONFIG_HEADERS([src/config.h])
-AC_CONFIG_SRCDIR([qpidc.spec.in])
AC_PROG_CC_STDC
AM_PROG_CC_C_O
@@ -321,7 +320,6 @@ fi
# Files to generate
AC_CONFIG_FILES([
- qpidc.spec
Makefile
examples/Makefile
examples/direct/Makefile
diff --git a/qpid/cpp/qpidc.spec.in b/qpid/cpp/qpidc.spec.in
deleted file mode 100644
index 72570c5671..0000000000
--- a/qpid/cpp/qpidc.spec.in
+++ /dev/null
@@ -1,302 +0,0 @@
-
-#
-# Spec file for Qpid C++ packages: qpidc qpidc-devel, qpidd, qpidd-devel
-# svn revision: $Rev$
-#
-%define qpidd qpidd
-
-Name: @PACKAGE@
-Version: @VERSION@
-Release: 34%{?dist}
-Summary: Libraries for Qpid C++ client applications
-Group: System Environment/Libraries
-License: Apache Software License
-URL: @URL@
-Source0: @DOWNLOAD_URL@/%{name}-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-ExclusiveArch: i386 x86_64
-
-BuildRequires: boost-devel
-BuildRequires: doxygen
-BuildRequires: e2fsprogs-devel
-BuildRequires: graphviz
-BuildRequires: help2man
-BuildRequires: libtool
-BuildRequires: pkgconfig
-BuildRequires: ruby
-
-Requires: boost
-
-Requires(post):/sbin/chkconfig
-Requires(preun):/sbin/chkconfig
-Requires(preun):/sbin/service
-Requires(postun):/sbin/service
-
-%description
-Run-time libraries for AMQP client applications developed using Qpid
-C++. Clients exchange messages with an AMQP message broker using
-the AMQP protocol.
-
-%package devel
-Summary: Header files and documentation for developing Qpid C++ clients
-Group: Development/System
-Requires: %name = %version-%release
-Requires: boost-devel
-Requires: e2fsprogs-devel
-Requires: python
-
-%description devel
-Libraries, header files and documentation for developing AMQP clients
-in C++ using Qpid. Qpid implements the AMQP messaging specification.
-
-%package -n %{qpidd}
-Summary: An AMQP message broker daemon
-Group: System Environment/Daemons
-Requires: %name = %version-%release
-Requires: openais
-Requires: xqilla
-Requires: xerces-c
-Requires: cyrus-sasl
-BuildRequires: cyrus-sasl-devel
-BuildRequires: xqilla-devel
-BuildRequires: xerces-c-devel
-BuildRequires: openais-devel
-
-%description -n %{qpidd}
-A message broker daemon that receives stores and routes messages using
-the open AMQP messaging protocol.
-
-%package -n %{qpidd}-devel
-Summary: Libraries and header files for developing Qpid broker extensions
-Group: Development/System
-Requires: %name-devel = %version-%release
-Requires: %{qpidd} = %version-%release
-Requires: openais-devel
-Requires: boost-devel
-Requires: xqilla-devel
-
-%description -n %{qpidd}-devel
-Libraries and header files for developing extensions to the
-Qpid broker daemon.
-
-%pre
-getent group qpidd >/dev/null || groupadd -r qpidd
-getent passwd qpidd >/dev/null || \
- useradd -r -m -g qpidd -d %{_libdir}/qpidd -s /sbin/nologin \
- -c "Owner of Qpidd Daemons" qpidd
-exit 0
-
-%prep
-%setup -q
-
-%build
-CXXFLAGS="%{optflags} -DNDEBUG -O3" \
-%configure --disable-static --without-cpg
-make %{?_smp_mflags}
-# Remove this generated perl file, we don't need it and it upsets rpmlint.
-rm docs/api/html/installdox
-
-%install
-rm -rf %{buildroot}
-make install DESTDIR=%{buildroot}
-install -Dp -m0755 etc/qpidd %{buildroot}%{_initrddir}/qpidd
-install -d -m0755 %{buildroot}%{_libdir}/qpidd
-install -Dp -m600 etc/qpidd.sasldb %{buildroot}/var/lib/qpidd/qpidd.sasldb
-install -d -m0755 %{buildroot}/var/run/qpidd
-rm -f %{buildroot}%_libdir/*.a
-rm -f %{buildroot}%_libdir/*.la
-
-%clean
-rm -rf %{buildroot}
-
-%check
-make check
-
-%files
-%defattr(-,root,root,-)
-%doc LICENSE NOTICE README
-%_libdir/libqpidcommon.so.0
-%_libdir/libqpidcommon.so.0.1.0
-%_libdir/libqpidclient.so.0
-%_libdir/libqpidclient.so.0.1.0
-
-%files devel
-%defattr(-,root,root,-)
-%_includedir/qpid/*.h
-%_includedir/qpid/amqp_0_10
-%_includedir/qpid/client
-%_includedir/qpid/framing
-%_includedir/qpid/sys
-%_includedir/qpid/log
-%_includedir/qpid/management
-%_includedir/qpid/agent
-%_libdir/libqpidcommon.so
-%_libdir/libqpidclient.so
-%_bindir/managementgen
-%_datadir/managementgen
-%doc %_datadir/%{name}/examples
-%doc docs/api/html
-
-%files -n %{qpidd}
-%defattr(-,root,root,-)
-%_libdir/libqpidbroker.so.0
-%_libdir/libqpidbroker.so.0.1.0
-%_libdir/libqpidcluster.so.0
-%_libdir/libqpidcluster.so.0.1.0
-%_libdir/libqpidacl.so.0
-%_libdir/libqpidacl.so.0.1.0
-%_sbindir/%{qpidd}
-%config(noreplace) %_sysconfdir/qpidd.conf
-%config(noreplace) %_sysconfdir/sasl2/qpidd.conf
-%{_initrddir}/%{qpidd}
-%attr(755, qpidd, qpidd) %_libdir/qpidd
-%attr(755, qpidd, qpidd) /var/run/qpidd
-%attr(600, qpidd, qpidd) %config(noreplace) /var/lib/qpidd/qpidd.sasldb
-%doc %_mandir/man1/%{qpidd}.*
-
-%files -n %{qpidd}-devel
-%defattr(-,root,root,-)
-%doc rpm/README.qpidd-devel
-%defattr(-,root,root,-)
-%_libdir/libqpidbroker.so
-%_libdir/libqpidcluster.so
-%_libdir/libqpidacl.so
-%_includedir/qpid/broker
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%post -n %{qpidd}
-# This adds the proper /etc/rc*.d links for the script
-/sbin/chkconfig --add qpidd
-/sbin/ldconfig
-
-%preun -n %{qpidd}
-# Check that this is actual deinstallation, not just removing for upgrade.
-if [ $1 = 0 ]; then
- /sbin/service qpidd stop >/dev/null 2>&1 || :
- /sbin/chkconfig --del qpidd
-fi
-
-%postun -n %{qpidd}
-if [ "$1" -ge "1" ]; then
- /sbin/service qpidd condrestart >/dev/null 2>&1 || :
-fi
-/sbin/ldconfig
-
-%changelog
-* Fri May 30 2008 Gordon Sim <gsim@redhat.com> - 0.2-34
-- Removed cppunit as a dependency, all tests now use boost framework
-
-* Fri May 9 2008 Matthew Farrellee <mfarrellee@redhat> - 0.2-33
-- Moved qpidd.conf from qpidc package to qpidd package
-- Added BuildRequires xqilla-devel and xerces-c-devel to qpidd for XML Exchange
-- Added BuildRequires openais-devel to qpidd for CPG
-- Added missing Requires xqilla-devel to qpidd-devel
-
-* Thu May 8 2008 Matthew Farrellee <mfarrellee@redhat> - 0.2-32
-- Added sasl2 config file for qpidd
-- Added cyrus-sasl dependencies
-
-* Wed May 7 2008 Matthew Farrellee <mfarrellee@redhat> - 0.2-31
-- Added python dependency, needed by managementgen
-
-* Wed May 7 2008 Matthew Farrellee <mfarrellee@redhat> - 0.2-30
-- Added management-types.xml to qpidc-devel package
-
-* Tue May 6 2008 Matthew Farrellee <mfarrellee@redhat> - 0.2-29
-- Added managementgen to the qpidc-devel package
-
-* Mon Apr 14 2008 Nuno Santos <nsantos@redhat.com> - 0.2-28
- - Fix home dir permissions
- - Bumped for Fedora 9
-
-* Mon Mar 31 2008 Nuno Santos <nsantos@redhat.com> - 0.2-25
-- Create user qpidd, start qpidd service as qpidd
-
-* Mon Feb 18 2008 Rafael Schloming <rafaels@redhat.com> - 0.2-24
-- Bug fix for TCK issue in Beta 3
-
-* Thu Feb 14 2008 Rafael Schloming <rafaels@redhat.com> - 0.2-23
-- Bumped to pull in fixes for Beta 3
-
-* Tue Feb 12 2008 Alan Conway <aconway@redhat.com> - 0.2-22
-- Added -g to compile flags for debug symbols.
-
-* Tue Feb 12 2008 Alan Conway <aconway@redhat.com> - 0.2-21
-- Create /var/lib/qpidd correctly.
-
-* Mon Feb 11 2008 Rafael Schloming <rafaels@redhat.com> - 0.2-20
-- bumped for Beta 3
-
-* Mon Jan 21 2008 Gordon Sim <gsim@redhat.com> - 0.2-18
-- bump up rev for recent changes to plugin modules & mgmt
-
-* Thu Jan 03 2008 Nuno Santos <nsantos@redhat.com> - 0.2-17
-- add missing header file SessionManager.h
-
-* Thu Jan 03 2008 Nuno Santos <nsantos@redhat.com> - 0.2-16
-- limit builds to i386 and x86_64 archs
-
-* Thu Jan 03 2008 Nuno Santos <nsantos@redhat.com> - 0.2-15
-- add ruby as a build dependency
-
-* Tue Dec 18 2007 Nuno Santos <nsantos@redhat.com> - 0.2-14
-- include fixes from Gordon Sim (fragmentation, lazy-loading, staging)
- and Alan Conway (exception handling in the client).
-
-* Thu Dec 6 2007 Alan Conway <aconway@redhat.com> - 0.2-13
-- installcheck target to build examples in installation.
-
-* Thu Nov 8 2007 Alan Conway <aconway@redhat.com> - 0.2-10
-- added examples to RPM package.
-
-* Thu Oct 9 2007 Alan Conway <aconway@redhat.com> - 0.2-9
-- added config(noreplace) for qpidd.conf
-
-* Thu Oct 4 2007 Alan Conway <aconway@redhat.com> - 0.2-8
-- Added qpidd.conf configuration file.
-- Updated man page to detail configuration options.
-
-* Thu Sep 20 2007 Alan Conway <aconway@redhat.com> - 0.2-7
-- Removed apr dependency.
-
-* Wed Aug 1 2007 Alan Conway <aconway@redhat.com> - 0.2-6
-- added --disable-cluster flag
-
-* Tue Apr 17 2007 Alan Conway <aconway@redhat.com> - 0.2-5
-- Add missing Requires: e2fsprogs-devel for qpidc-devel.
-
-* Tue Apr 17 2007 Alan Conway <aconway@redhat.com> - 0.2-4
-- longer broker_start timeout to avoid failures in plague builds.
-
-* Tue Apr 17 2007 Alan Conway <aconway@redhat.com> - 0.2-3
-- Add missing Requires: apr in qpidc.
-
-* Mon Apr 16 2007 Alan Conway <aconway@redhat.com> - 0.2-2
-- Bugfix for memory errors on x86_64.
-
-* Thu Apr 12 2007 Alan Conway <aconway@redhat.com> - 0.2-1
-- Bumped version number for rhm dependencies.
-
-* Wed Apr 11 2007 Alan Conway <aconway@redhat.com> - 0.1-5
-- Add qpidd-devel sub-package.
-
-* Mon Feb 19 2007 Jim Meyering <meyering@redhat.com> - 0.1-4
-- Address http://bugzilla.redhat.com/220630:
-- Remove redundant "cppunit" build-requires.
-- Add --disable-static.
-
-* Thu Jan 25 2007 Alan Conway <aconway@redhat.com> - 0.1-3
-- Applied Jim Meyerings fixes from http://mail-archives.apache.org/mod_mbox/incubator-qpid-dev/200701.mbox/<87hcugzmyp.fsf@rho.meyering.net>
-
-* Mon Dec 22 2006 Alan Conway <aconway@redhat.com> - 0.1-1
-- Fixed all rpmlint complaints (with help from David Lutterkort)
-- Added qpidd --daemon behaviour, fix init.rc scripts
-
-* Fri Dec 8 2006 David Lutterkort <dlutter@redhat.com> - 0.1-1
-- Initial version based on Jim Meyering's sketch and discussions with Alan
- Conway
-
diff --git a/qpid/cpp/rpm/README.qpidd-devel b/qpid/cpp/rpm/README.qpidd-devel
deleted file mode 100644
index f64a9de3b3..0000000000
--- a/qpid/cpp/rpm/README.qpidd-devel
+++ /dev/null
@@ -1,7 +0,0 @@
-
-This package provides header files needed to implement extensions to
-the Qpid broker daemon. This feature is experimental and undocumented,
-it is not require for normal use of qpid.
-
-See http://cwiki.apache.org/qpid/ for more information about the qpid project.
-
diff --git a/qpid/cpp/src/tests/Makefile.am b/qpid/cpp/src/tests/Makefile.am
index 31328ef59a..3b82aff8a8 100644
--- a/qpid/cpp/src/tests/Makefile.am
+++ b/qpid/cpp/src/tests/Makefile.am
@@ -99,6 +99,10 @@ check_PROGRAMS+=latencytest
latencytest_SOURCES=latencytest.cpp TestOptions.h ConnectionOptions.h
latencytest_LDADD=$(lib_client)
+check_PROGRAMS+=echotest
+echotest_SOURCES=echotest.cpp TestOptions.h ConnectionOptions.h
+echotest_LDADD=$(lib_client)
+
check_PROGRAMS+=client_test
client_test_SOURCES=client_test.cpp TestOptions.h ConnectionOptions.h
client_test_LDADD=$(lib_client)
diff --git a/qpid/cpp/src/tests/echotest.cpp b/qpid/cpp/src/tests/echotest.cpp
new file mode 100644
index 0000000000..36019d1a67
--- /dev/null
+++ b/qpid/cpp/src/tests/echotest.cpp
@@ -0,0 +1,131 @@
+#include <qpid/client/Connection.h>
+#include <qpid/client/SubscriptionManager.h>
+#include <qpid/client/Session.h>
+#include <qpid/client/Message.h>
+#include <qpid/client/MessageListener.h>
+#include <qpid/sys/Time.h>
+
+#include <iostream>
+
+using namespace qpid::client;
+using namespace qpid::framing;
+using namespace qpid::sys;
+using namespace std;
+
+struct Args : public qpid::Options,
+ public qpid::client::ConnectionSettings
+{
+ bool help;
+ uint count;
+ uint size;
+ bool summary;
+
+ Args() : qpid::Options("Simple latency test optins"), help(false), count(20), size(0), summary()
+ {
+ using namespace qpid;
+ addOptions()
+ ("help", optValue(help), "Print this usage statement")
+ ("count", optValue(count, "N"), "Number of messages to send")
+ ("size", optValue(count, "N"), "Size of messages")
+ ("broker,b", optValue(host, "HOST"), "Broker host to connect to")
+ ("port,p", optValue(port, "PORT"), "Broker port to connect to")
+ ("username", optValue(username, "USER"), "user name for broker log in.")
+ ("password", optValue(password, "PASSWORD"), "password for broker log in.")
+ ("mechanism", optValue(mechanism, "MECH"), "SASL mechanism to use when authenticating.")
+ ("tcp-nodelay", optValue(tcpNoDelay), "Turn on tcp-nodelay")
+ ("s,summary", optValue(summary), "Print only average latency.");
+ }
+};
+
+uint64_t current_time()
+{
+ Duration t(now());
+ return t;
+}
+
+class Listener : public MessageListener
+{
+ private:
+ Session session;
+ SubscriptionManager subscriptions;
+ uint counter;
+ const uint limit;
+ std::string queue;
+ Message request;
+ double total, min, max;
+ bool summary;
+
+ public:
+ Listener(Session& session, uint limit, bool summary);
+ void start(uint size);
+ void received(Message& message);
+};
+
+Listener::Listener(Session& s, uint l, bool summary_) :
+ session(s), subscriptions(s), counter(0), limit(l),
+ queue(session.getId().getName()), total(),
+ min(std::numeric_limits<double>::max()), max(), summary(summary_)
+{}
+
+void Listener::start(uint size)
+{
+ session.queueDeclare(arg::queue=queue, arg::exclusive=true, arg::autoDelete=true);
+ request.getDeliveryProperties().setRoutingKey(queue);
+ subscriptions.setAcceptMode(1/*not-required*/);
+ subscriptions.setFlowControl(SubscriptionManager::UNLIMITED, SubscriptionManager::UNLIMITED, false);
+ subscriptions.subscribe(*this, queue);
+
+ request.getDeliveryProperties().setTimestamp(current_time());
+ if (size) request.setData(std::string(size, 'X'));
+ async(session).messageTransfer(arg::content=request);
+ subscriptions.run();
+}
+
+void Listener::received(Message& response)
+{
+ //extract timestamp and compute latency:
+ uint64_t sentAt = response.getDeliveryProperties().getTimestamp();
+ uint64_t receivedAt = current_time();
+
+ double latency = ((double) (receivedAt - sentAt)) / TIME_MSEC;
+ if (!summary) cout << "Latency: " << latency << "ms" << endl;
+ min = std::min(latency, min);
+ max = std::max(latency, max);
+ total += latency;
+
+ if (++counter < limit) {
+ request.getDeliveryProperties().setTimestamp(current_time());
+ async(session).messageTransfer(arg::content=request);
+ } else {
+ subscriptions.cancel(queue);
+ if (summary) cout << min << " " << max << " " << total/limit << endl;
+ else cout << "min: " << min << " max: " << max << " average: " << total/limit << endl;
+ }
+}
+
+int main(int argc, char** argv)
+{
+ Args opts;
+ opts.parse(argc, argv);
+
+ if (opts.help) {
+ std::cout << opts << std::endl;
+ return 0;
+ }
+
+ Connection connection;
+ try {
+ connection.open(opts);
+ Session session = connection.newSession();
+ Listener listener(session, opts.count, opts.summary);
+ listener.start(opts.size);
+
+ connection.close();
+ return 0;
+ } catch(const std::exception& error) {
+ std::cout << error.what() << std::endl;
+ }
+ return 1;
+}
+
+