rhmessaging commits: r2222 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-07-25 15:33:12 -0400 (Fri, 25 Jul 2008)
New Revision: 2222
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added Route(bridge) to model
Added durable/autoDel/exclusivity to Queue summary properties
Added Add + Remove queue actions to summary actions
Added useSsl + durable to Link properties
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-07-25 19:26:39 UTC (rev 2221)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-07-25 19:33:12 UTC (rev 2222)
@@ -29,6 +29,7 @@
CuminConnection(self)
CuminSession(self)
CuminLink(self)
+ CuminRoute(self)
CuminStore(self)
CuminJournal(self)
@@ -140,6 +141,9 @@
return self.title
else:
return self.name
+
+ def get_modifier(self, session):
+ pass
def invoke(self, object, args={}):
invoc = CuminActionInvocation(self, object)
@@ -178,6 +182,9 @@
def get_description(self, session):
verb = self.action.get_title(session)
+ modifier = self.action.get_modifier(session)
+ if modifier:
+ verb = verb + modifier
if self.object:
cls = self.action.cumin_model.get_class_by_object(self.object)
@@ -557,12 +564,15 @@
prop = CuminProperty(self, "durable")
prop.title = "Durable?"
+ prop.summary = True
prop = CuminProperty(self, "autoDelete")
prop.title = "Auto Delete?"
+ prop.summary = True
prop = CuminProperty(self, "exclusive")
prop.title = "Exclusive?"
+ prop.summary = True
stat = CuminStat(self, "consumerCount")
stat.title = "Consumers"
@@ -712,6 +722,12 @@
action = self.Purge(self, "purge")
action.summary = True
+
+ action = self.Remove(self, "remove")
+ action.summary = True
+
+ action = self.Add(self, "add")
+ action.summary = True
def get_title(self, session):
return "Queue"
@@ -721,12 +737,12 @@
def show_object(self, session, queue):
frame = self.cumin_model.show_main(session)
- frame = frame.show_broker(session, queue.vhost.broker.registration)
- return frame.show_queue(session, queue)
+ return frame.show_broker(session, queue.vhost.broker.registration)
class Purge(CuminAction):
def show(self, session, queue):
frame = self.cumin_class.show_object(session, queue)
+ frame = frame.show_queue(session, queue)
return frame.show_purge(session)
def get_title(self, session):
@@ -735,6 +751,67 @@
def do_invoke(self, queue, args, completion):
queue.purge(self.cumin_model.data, completion)
+ class Remove(CuminAction):
+ def show(self, session, queue):
+ frame = self.cumin_class.show_object(session, queue)
+ frame = frame.show_queue(session, queue)
+ return frame.show_remove(session)
+
+ def get_title(self, session):
+ return "Remove"
+
+ def do_invoke(self, queue, args, completion):
+ # once qpid management supports queue_delete
+ # replace the rest of this method with
+ #queue.delete(self.cumin_model.data, completion)
+
+ reg = queue.vhost.broker.registration
+ conn = self.cumin_model.data.getConnectionByRegistration(reg)
+ for sess in conn.mconn.sessions:
+ if conn.mconn.sessions[sess].name == conn.getSessionId():
+ #this is management session
+ msess = conn.mconn.sessions[sess]
+ msess.queue_delete(queue=queue.name)
+ break
+
+ #sess = conn.mconn.session(str(uuid4()))
+ #sess.queue_delete(queue=queue.name)
+ completion("OK")
+
+ class Add(CuminAction):
+ def get_title(self, session):
+ return "Add New Queue"
+
+ def get_modifier(self, session):
+ return " to "
+
+ def show(self, session, queue):
+ frame = self.cumin_class.show_object(session, queue)
+ return frame.show_queue_add(session)
+
+ def do_invoke(self, reg, args, completion):
+ conn = self.cumin_model.data.getConnectionByRegistration(reg)
+ for sess in conn.mconn.sessions:
+ if conn.mconn.sessions[sess].name == conn.getSessionId():
+ #this is management session
+ msess = conn.mconn.sessions[sess]
+ msess.queue_declare(queue=args['queue'],
+ exclusive=(args['exclusive'] == "exclusive"),
+ durable=(args['durable'] == "durable"),
+ auto_delete=(args['auto_delete'] == "autodel"))
+
+ # optionally bind to exchanges
+ exchange_keys = args['exchange_keys']
+ for exchange_name in exchange_keys:
+ msess.exchange_bind(queue=args['queue'],
+ exchange=exchange_name,
+ binding_key=exchange_keys[exchange_name])
+
+ break
+
+
+ completion("OK")
+
class CuminExchange(RemoteClass):
def __init__(self, model):
super(CuminExchange, self).__init__(model, "exchange",
@@ -787,10 +864,12 @@
stat.unit = "message"
stat.category = "io"
+ action = self.Add(self, "add")
+ action.summary = True
+
def show_object(self, session, exchange):
frame = self.cumin_model.show_main(session)
- frame = frame.show_broker(exchange.vhost.broker.registration)
- return frame.show_queue(session, exchange)
+ return frame.show_broker(session, exchange.vhost.broker.registration)
def get_title(self, session):
return "Exchange"
@@ -806,6 +885,25 @@
else:
return "Default Exchange"
+ class Add(CuminAction):
+ def get_title(self, session):
+ return "Add New Exchange"
+
+ def show(self, session, exchange):
+ frame = self.cumin_class.show_object(session, exchange)
+ return frame.show_exchange_add(session)
+
+ def do_invoke(self, reg, exchange, completion):
+ conn = self.cumin_model.data.getConnectionByRegistration(reg)
+ for sess in conn.mconn.sessions:
+ if conn.mconn.sessions[sess].name == conn.getSessionId():
+ #this is management session
+ msess = conn.mconn.sessions[sess]
+ msess.exchange_declare(exchange=exchange.name,
+ type=exchange.type)
+
+ completion("OK")
+
class CuminBinding(RemoteClass):
def __init__(self, model):
super(CuminBinding, self).__init__(model, "binding",
@@ -824,6 +922,20 @@
def get_object_name(self, binding):
return ""
+class CuminRoute(RemoteClass):
+ def __init__(self, model):
+ super(CuminRoute, self).__init__(model, "route",
+ Bridge, BridgeStats)
+
+ prop = CuminProperty(self, "routeKey")
+ prop.title = "Route Key"
+
+ def get_title(self, session):
+ return "Route"
+
+ def get_object_name(self, route):
+ return route.src
+
class CuminConnection(RemoteClass):
def __init__(self, model):
super(CuminConnection, self).__init__(model, "connection",
@@ -976,11 +1088,11 @@
def __init__(self, model):
super(CuminLink, self).__init__(model, "link", Link, LinkStats)
- prop = CuminProperty(self, "address")
- prop.title = "Peer Address"
+ prop = CuminProperty(self, "useSsl")
+ prop.title = "Use SSL"
- prop = CuminProperty(self, "authIdentity")
- prop.title = "Auth. Identity"
+ prop = CuminProperty(self, "durable")
+ prop.title = "Durable"
stat = CuminStat(self, "closing")
stat.title = "Closing Down"
@@ -1008,6 +1120,9 @@
def get_title(self, session):
return "Broker Link"
+ def get_object_name(self, link):
+ return "%s:%d" % (link.host, link.port)
+
class CuminStore(RemoteClass):
def __init__(self, model):
super(CuminStore, self).__init__(model, "store", Store, StoreStats)
16 years, 5 months
rhmessaging commits: r2221 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-07-25 15:26:39 -0400 (Fri, 25 Jul 2008)
New Revision: 2221
Modified:
mgmt/trunk/cumin/python/cumin/exchange.py
mgmt/trunk/cumin/python/cumin/exchange.strings
Log:
Added Add Exchange
Modified: mgmt/trunk/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.py 2008-07-25 19:23:16 UTC (rev 2220)
+++ mgmt/trunk/cumin/python/cumin/exchange.py 2008-07-25 19:26:39 UTC (rev 2221)
@@ -68,6 +68,11 @@
def get_args(self, session):
reg = self.frame.get_object(session)
return (reg.getDefaultVhost(),)
+
+ def render_add_exchange_url(self, session, vhost):
+ branch = session.branch()
+ self.frame.show_exchange_add(branch)
+ return branch.marshal()
def render_title(self, session, vhost):
return "Exchanges %s" % fmt_count(vhost.exchanges.count())
@@ -165,6 +170,10 @@
view = ExchangeView(app, "view")
self.add_mode(view)
self.set_view_mode(view)
+
+ remove = ExchangeRemove(app, "remove")
+ self.add_mode(remove)
+ self.set_remove_mode(remove)
def render_title(self, session, exchange):
if exchange.name:
@@ -172,6 +181,32 @@
else:
return "Default Exchange"
+class ExchangeRemove(CuminConfirmForm):
+ def get_args(self, session):
+ return self.frame.get_args(session)
+
+ def process_cancel(self, session, reg):
+ branch = session.branch()
+ self.frame.show_view(branch)
+ self.page.set_redirect_url(session, branch.marshal())
+
+ def process_submit(self, session, reg):
+ action = self.app.model.broker_registration.remove
+ action.invoke(reg)
+
+ branch = session.branch()
+ self.page.show_main(branch).show_view(branch)
+ self.page.set_redirect_url(session, branch.marshal())
+
+ def render_title(self, session, exchange):
+ return "Remove Exchange '%s'" % exchange.name
+
+ def render_submit_content(self, session, exchange):
+ return "Yes, Remove Exchange '%s'" % exchange.name
+
+ def render_cancel_content(self, session, reg):
+ return "No, Cancel"
+
class ExchangeStatus(CuminStatus):
def render_messages_received(self, session, exchange):
return self.app.model.exchange.msgReceives.rate_html(exchange)
@@ -239,13 +274,13 @@
if binding.queue:
return binding.queue.name
-class ExchangeForm(CuminForm):
+class ExchangeForm(CuminFieldForm):
def __init__(self, app, name):
super(ExchangeForm, self).__init__(app, name)
- self.exchange_name = TextInput(app, "exchange_name", self)
- self.add_child(self.exchange_name)
-
+ self.exchange_name = ExchangeNameField(app, "exchange_name", self)
+ self.add_field(self.exchange_name)
+
self.type = Parameter(app, "type")
self.type.default = "direct"
self.add_parameter(self.type)
@@ -264,46 +299,50 @@
self.fanout.set_parameter(self.type)
self.fanout.set_value("fanout")
self.add_child(self.fanout)
+
+ self.xml = RadioInput(app, "xml", self)
+ self.xml.set_parameter(self.type)
+ self.xml.set_value("xml")
+ self.add_child(self.xml)
+
+ def render_direct_id(self, session, *args):
+ return self.direct.path
+
+ def render_topic_id(self, session, *args):
+ return self.topic.path
+
+ def render_fanout_id(self, session, *args):
+ return self.fanout.path
- def validate(self, session):
- error = None
+ def render_xml_id(self, session, *args):
+ return self.xml.path
- name = self.exchange_name.get(session)
-
- if name == "":
- error = EmptyInputError(exchange_name)
- self.exchange_name.add_error(session, error)
- elif " " in name:
- error = FormError("""
- The exchange name is invalid; allowed characters are
- letters, digits, ".", and "_"
- """)
- self.exchange_name.add_error(session, error)
-
- return error is None
-
class ExchangeAdd(ExchangeForm):
def get_args(self, session):
return self.frame.frame.get_args(session)
- def process_cancel(self, session, vhost):
+ def process_cancel(self, session):
branch = session.branch()
- self.page.show_broker(branch, vhost.get_broker()).show_view(branch)
+ self.frame.show_view(branch)
self.page.set_redirect_url(session, branch.marshal())
- def process_submit(self, session, vhost):
- if self.validate(session):
+ def process_submit(self, session):
+ errors = self.validate(session)
+
+ if errors:
+ pass
+ else:
+ reg = self.frame.get_object(session)
exchange = Exchange()
exchange.name = self.exchange_name.get(session)
exchange.type = self.type.get(session)
+
+ action = self.app.model.exchange.add
+ action.invoke(reg, exchange)
- vhost.addExchange(exchange)
-
- branch = session.branch()
- self.page.show_exchange(branch, exchange).show_view(branch)
- self.page.set_redirect_url(session, branch.marshal())
-
- def render_title(self, session, vhost):
+ self.process_cancel(session)
+
+ def render_title(self, session):
return "Add Exchange"
class ExchangeEdit(ExchangeForm):
Modified: mgmt/trunk/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.strings 2008-07-25 19:23:16 UTC (rev 2220)
+++ mgmt/trunk/cumin/python/cumin/exchange.strings 2008-07-25 19:26:39 UTC (rev 2221)
@@ -46,8 +46,12 @@
}
[ExchangeSet.html]
+
+<ul class="actions">
+ <li><a class="nav" href="{add_exchange_url}">Add New Exchange</a></li>
+ </ul>
+
<div class="rfloat">{phase}</div>
-
{unit}
<table class="mobjects">
@@ -72,27 +76,30 @@
<h1>{title}</h1>
</div>
<div class="body">
- <span class="legend">Name</span>
- <fieldset>
<div class="field">{exchange_name}</div>
- </fieldset>
+ <div style="clear:right;">
<span class="legend">Type</span>
<fieldset>
<div class="field">
{direct}
- <em>Direct:</em> Route messages to queues by queue name
+ <label for="{direct_id}"><em>Direct:</em> Route messages to queues by queue name</label>
</div>
<div class="field">
{topic}
- <em>Topic:</em> Route messages to queues by topic keyword match
+ <label for="{topic_id}"><em>Topic:</em> Route messages to queues by topic keyword match</label>
</div>
<div class="field">
{fanout}
- <em>Fan Out:</em> Lorem ipsum gloria dei ipso facto ad nauseum
+ <label for="{fanout_id}"><em>Fan Out:</em> Route message to all queues attached to this exchange</label>
</div>
+ <div class="field">
+ {xml}
+ <label for="{xml_id}"><em>XML:</em> Route message to queues based on XML content of the message</label>
+ </div>
</fieldset>
-
+ </div>
+
{hidden_inputs}
</div>
<div class="foot">
@@ -101,7 +108,7 @@
{cancel}
</div>
</form>
-<script defer="defer">
+<script type="text/javascript" defer="defer">
(function() {
// elements[0] is a fieldset, at least in firefox
var elem = wooly.doc().elembyid("{id}").node.elements[1];
@@ -152,7 +159,7 @@
</tr>
</table>
</div>
-<script>
+<script type="text/javascript">
cumin.objectListeners["{id}"] = updateExchangeStatus
</script>
16 years, 5 months
rhmessaging commits: r2220 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-07-25 15:23:16 -0400 (Fri, 25 Jul 2008)
New Revision: 2220
Modified:
mgmt/trunk/cumin/python/cumin/broker.py
mgmt/trunk/cumin/python/cumin/broker.strings
Log:
Moved PeerSet to brokerlink.py
Added Add/Remove Queue
Added Add Exchange
Added Peer Mode
Modified: mgmt/trunk/cumin/python/cumin/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.py 2008-07-25 19:13:11 UTC (rev 2219)
+++ mgmt/trunk/cumin/python/cumin/broker.py 2008-07-25 19:23:16 UTC (rev 2220)
@@ -8,6 +8,7 @@
from virtualhost import *
from queue import *
from exchange import *
+from brokerlink import *
from client import *
from widgets import *
from parameters import *
@@ -121,72 +122,6 @@
return link
-class PeerSet(CuminTable):
- def __init__(self, app, name):
- super(PeerSet, self).__init__(app, name)
-
- col = self.AddressColumn(app, "addr")
- self.add_column(col)
-
- col = self.StateColumn(app, "state")
- self.add_column(col)
-
- col = self.LastErrorColumn(app, "last_error")
- self.add_column(col)
-
- #col = self.FromPeerColumn(app, "from_peer")
- #self.add_column(col)
-
- #col = self.ToPeerColumn(app, "to_peer")
- #self.add_column(col)
-
- def get_args(self, session):
- reg = self.frame.get_object(session)
- return (reg.getDefaultVhost(),)
-
- def render_title(self, session, vhost):
- count = self.get_item_count(session, vhost)
- return "Linked Brokers %s" % fmt_count(count)
-
- def render_sql_where(self, session, vhost):
- return "where v.id = %(vhost_id)r"
-
- def get_sql_values(self, session, vhost):
- return {"vhost_id": vhost.id}
-
- class AddressColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "Address"
-
- def render_content(self, session, data):
- return "%s:%i" % (data["host"], data["port"])
-
- def get_orderby_sql(self, session):
- dir = self.parent.is_reversed(session) and "desc" or "asc"
- return "order by host, port %s" % dir
-
- class StateColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "State"
-
- class LastErrorColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "Last Error"
-
- class FromPeerColumn(NullSortColumn, FreshDataOnlyColumn):
- def render_title(self, session, data):
- return "Bytes from Broker"
-
- def render_value(self, session, value):
- return fmt_rate(value)
-
- class ToPeerColumn(NullSortColumn, FreshDataOnlyColumn):
- def render_title(self, session, data):
- return "Bytes to Broker"
-
- def render_value(self, session, value):
- return fmt_rate(value)
-
class BrokerFrame(CuminFrame):
def __init__(self, app, name):
super(BrokerFrame, self).__init__(app, name)
@@ -211,10 +146,22 @@
self.__queues_purge = QueueSetPurge(app, "queuespurge")
self.add_mode(self.__queues_purge)
+
+ self.__queues_remove = QueueSetRemove(app, "queuesremove")
+ self.add_mode(self.__queues_remove)
+
+ self.__queue_add = QueueAdd(app, "queueadd")
+ self.add_mode(self.__queue_add)
self.__exchange = ExchangeFrame(app, "exchange")
self.add_mode(self.__exchange)
+ self.__peer = PeerFrame(app, "peer")
+ self.add_mode(self.__peer)
+
+ self.__exchange_add = ExchangeAdd(app, "exchangeadd")
+ self.add_mode(self.__exchange_add)
+
self.__conn = ConnectionFrame(app, "conn")
self.add_mode(self.__conn)
@@ -229,12 +176,27 @@
def show_queues_purge(self, session):
self.page.set_current_frame(session, self.__queues_purge)
return self.show_mode(session, self.__queues_purge)
+
+ def show_queues_remove(self, session):
+ self.page.set_current_frame(session, self.__queues_remove)
+ return self.show_mode(session, self.__queues_remove)
+
+ def show_queue_add(self, session):
+ return self.show_mode(session, self.__queue_add)
def show_exchange(self, session, exchange):
self.__exchange.set_object(session, exchange)
self.page.set_current_frame(session, self.__exchange)
return self.show_mode(session, self.__exchange)
+ def show_peer(self, session, peer):
+ self.__peer.set_object(session, peer)
+ self.page.set_current_frame(session, self.__peer)
+ return self.show_mode(session, self.__peer)
+
+ def show_exchange_add(self, session):
+ return self.show_mode(session, self.__exchange_add)
+
def show_connection(self, session, conn):
self.__conn.set_object(session, conn)
self.page.set_current_frame(session, self.__conn)
Modified: mgmt/trunk/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.strings 2008-07-25 19:13:11 UTC (rev 2219)
+++ mgmt/trunk/cumin/python/cumin/broker.strings 2008-07-25 19:23:16 UTC (rev 2220)
@@ -36,30 +36,9 @@
</thead>
<tbody>{items}</tbody>
</table>
- {hidden_inputs}
+ <div>{hidden_inputs}</div>
</form>
-[PeerSet.sql]
-select
- l.id,
- l.host,
- l.port,
- c.state,
- c.last_error
-from link as l
-join vhost as v on v.id = l.vhost_id
-left outer join link_stats as c on c.id = l.stats_curr_id
-left outer join link_stats as p on p.id = l.stats_prev_id
-{sql_where}
-{sql_orderby}
-{sql_limit}
-
-[PeerSet.count_sql]
-select count(*)
-from link as l
-join vhost as v on v.id = l.vhost_id
-{sql_where}
-
[BrokerView.javascript]
function updateBroker(data) {
var model = data.objectify();
@@ -68,7 +47,7 @@
}
[BrokerView.html]
-<script>
+<script type="text/javascript">
{script}
</script>
@@ -83,7 +62,7 @@
The broker at this address is currently unavailable. This page will
reload in <span id="timer_count">10</span> <span id="timer_word">seconds</span>.
</div>
-<script>
+<script type="text/javascript">
var secs = 10
function updateTimer() {
@@ -217,7 +196,7 @@
{cancel}
</div>
</form>
-<script defer="defer">
+<script type="text/javascript" defer="defer">
(function() {
var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
@@ -248,6 +227,6 @@
[BrokerGroupInputSet.item_html]
<div class="field">
- <input type="checkbox" name="{name}" value="{item_value}" tabindex="{tab_index}" {item_checked_attr}/>
- {item_content}
+ <input type="checkbox" id="{id}" name="{name}" value="{item_value}" tabindex="{tab_index}" {item_checked_attr}/>
+ <label for="{id}">{item_content}</label>
</div>
16 years, 5 months
rhmessaging commits: r2219 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-07-25 15:13:11 -0400 (Fri, 25 Jul 2008)
New Revision: 2219
Modified:
mgmt/trunk/cumin/python/cumin/page.py
Log:
Returned a class of "none" for xhtml validation
Modified: mgmt/trunk/cumin/python/cumin/page.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.py 2008-07-25 16:41:52 UTC (rev 2218)
+++ mgmt/trunk/cumin/python/cumin/page.py 2008-07-25 19:13:11 UTC (rev 2219)
@@ -208,6 +208,8 @@
def render_class(self, session):
if self.parent.selection.get(session) == self.name:
return "selected"
+ else:
+ return "none"
class MessagingTab(Tab):
def render_content(self, session):
16 years, 5 months
rhmessaging commits: r2217 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2008-07-25 11:52:21 -0400 (Fri, 25 Jul 2008)
New Revision: 2217
Modified:
store/trunk/cpp/tests/OrderingTest.cpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
Log:
Change dequeue() to get() inline with changes to qpid trunk.
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2008-07-24 20:32:10 UTC (rev 2216)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2008-07-25 15:52:21 UTC (rev 2217)
@@ -77,7 +77,7 @@
bool pop()
{
- boost::intrusive_ptr<Message> msg = queue->dequeue().payload;
+ boost::intrusive_ptr<Message> msg = queue->get().payload;
if (msg) {
queue->dequeue(0, msg);
BOOST_CHECK_EQUAL(ids.front(), msg->getProperties<MessageProperties>()->getMessageId());
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2008-07-24 20:32:10 UTC (rev 2216)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2008-07-25 15:52:21 UTC (rev 2217)
@@ -291,7 +291,7 @@
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
BOOST_CHECK_EQUAL((u_int32_t) 1, queue->getMessageCount());
- boost::intrusive_ptr<Message> msg = queue->dequeue().payload;
+ boost::intrusive_ptr<Message> msg = queue->get().payload;
BOOST_CHECK_EQUAL(exchange, msg->getExchangeName());
BOOST_CHECK_EQUAL(routingKey, msg->getRoutingKey());
@@ -420,7 +420,7 @@
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
BOOST_CHECK_EQUAL((u_int32_t) 1, queue->getMessageCount());
- boost::intrusive_ptr<Message> msg = queue->dequeue().payload;
+ boost::intrusive_ptr<Message> msg = queue->get().payload;
//check headers
BOOST_CHECK_EQUAL(exchange, msg->getExchangeName());
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2008-07-24 20:32:10 UTC (rev 2216)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2008-07-25 15:52:21 UTC (rev 2217)
@@ -151,7 +151,7 @@
BOOST_REQUIRE(queue);
BOOST_CHECK_EQUAL(size, queue->getMessageCount());
if (size > 0) {
- boost::intrusive_ptr<Message> msg = queue->dequeue().payload;
+ boost::intrusive_ptr<Message> msg = queue->get().payload;
BOOST_REQUIRE(msg);
BOOST_CHECK_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
}
@@ -165,7 +165,7 @@
boost::intrusive_ptr<Message> msgA = createMessage("Message", "exchange", "routing_key");
queueA->deliver(msgA);
- boost::intrusive_ptr<Message> msgB = queueA->dequeue().payload;
+ boost::intrusive_ptr<Message> msgB = queueA->get().payload;
BOOST_REQUIRE(msgB);
//move the message from one queue to the other as a transaction
std::auto_ptr<TransactionContext> txn = store->begin();
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-07-24 20:32:10 UTC (rev 2216)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-07-25 15:52:21 UTC (rev 2217)
@@ -282,7 +282,7 @@
void swap(TPCTransactionContext* txn, Queue::shared_ptr& from, Queue::shared_ptr& to)
{
- msg1 = from->dequeue().payload;//just dequeues in memory
+ msg1 = from->get().payload;//just dequeues in memory
//move the message from one queue to the other as part of a
//distributed transaction
to->enqueue(txn, msg1);//note: need to enqueue it first to avoid message being deleted
@@ -291,7 +291,7 @@
void dequeue(TPCTransactionContext* txn, Queue::shared_ptr& queue)
{
- msg2 = queue->dequeue().payload;//just dequeues in memory
+ msg2 = queue->get().payload;//just dequeues in memory
queue->dequeue(txn, msg2);
}
@@ -369,7 +369,7 @@
BOOST_REQUIRE(queue);
BOOST_CHECK_EQUAL(size, queue->getMessageCount());
if (size > 0) {
- boost::intrusive_ptr<Message> msg = queue->dequeue().payload;
+ boost::intrusive_ptr<Message> msg = queue->get().payload;
BOOST_REQUIRE(msg);
BOOST_CHECK_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
}
16 years, 5 months
rhmessaging commits: r2216 - in store/branches/mrg-1.0/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-07-24 16:32:10 -0400 (Thu, 24 Jul 2008)
New Revision: 2216
Modified:
store/branches/mrg-1.0/cpp/lib/BdbMessageStore.cpp
store/branches/mrg-1.0/cpp/lib/jrnl/jdir.cpp
Log:
Backport from trunk checkin r2215, but excluding new tests: Possible fix for BZ456272: "Broker fails to create journal directory - File already exists". Removed check for existence of dir at time of creation in class jdir, and handled EEXIST error instead.
Modified: store/branches/mrg-1.0/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/branches/mrg-1.0/cpp/lib/BdbMessageStore.cpp 2008-07-24 20:07:07 UTC (rev 2215)
+++ store/branches/mrg-1.0/cpp/lib/BdbMessageStore.cpp 2008-07-24 20:32:10 UTC (rev 2216)
@@ -1454,14 +1454,12 @@
string BdbMessageStore::getJrnlDir(const char* queueName) //for exmaple /var/rhm/ + queueDir/
{
std::stringstream dir;
- dir << getJrnlBaseDir();
- dir << std::setw(4);
- dir << std::setfill('0');
+ dir << getJrnlBaseDir() << std::hex << std::setfill('0') << std::setw(4);
u_int32_t count = 0;
for (u_int32_t i = 0; i < strlen(queueName); i++) {
count += queueName[i];
}
- dir << (count % 20);
+ dir << (count % 29); // Use a prime number for better distribution across dirs
dir << "/" << queueName << "/";
return dir.str();
}
Modified: store/branches/mrg-1.0/cpp/lib/jrnl/jdir.cpp
===================================================================
--- store/branches/mrg-1.0/cpp/lib/jrnl/jdir.cpp 2008-07-24 20:07:07 UTC (rev 2215)
+++ store/branches/mrg-1.0/cpp/lib/jrnl/jdir.cpp 2008-07-24 20:32:10 UTC (rev 2216)
@@ -81,9 +81,9 @@
if (!exists(parent_dir))
create_dir(parent_dir);
}
- if (!exists(dirname))
+ if (::mkdir(dirname.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
{
- if (::mkdir(dirname.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
+ if (errno != EEXIST) // Dir exists, ignore
{
std::ostringstream oss;
oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
16 years, 5 months
rhmessaging commits: r2215 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-07-24 16:07:07 -0400 (Thu, 24 Jul 2008)
New Revision: 2215
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/jrnl/jdir.cpp
store/trunk/cpp/tests/jrnl/_ut_jdir.cpp
Log:
Possible fix for BZ456272: "Broker fails to create journal directory - File already exists". Removed check for existence of dir at time of creation in class jdir, and handled EEXIST error instead. Also corrected some jdir tests, added additional tests containing double '/' chars in path.
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-07-24 08:51:22 UTC (rev 2214)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-07-24 20:07:07 UTC (rev 2215)
@@ -358,6 +358,7 @@
localFileSizeSblks = (u_int32_t) value->get<int>() * JRNL_RMGR_PAGE_SIZE;
{
+ // TODO: Is this mutex necessary?
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
string("JournalData"), defJournalGetEventsTimeout,
@@ -1490,14 +1491,12 @@
string BdbMessageStore::getJrnlDir(const char* queueName) //for exmaple /var/rhm/ + queueDir/
{
std::stringstream dir;
- dir << getJrnlBaseDir();
- dir << std::setw(4);
- dir << std::setfill('0');
+ dir << getJrnlBaseDir() << std::hex << std::setfill('0') << std::setw(4);
u_int32_t count = 0;
for (u_int32_t i = 0; i < strlen(queueName); i++) {
count += queueName[i];
}
- dir << (count % 20);
+ dir << (count % 29); // Use a prime number for better distribution across dirs
dir << "/" << queueName << "/";
return dir.str();
}
Modified: store/trunk/cpp/lib/jrnl/jdir.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jdir.cpp 2008-07-24 08:51:22 UTC (rev 2214)
+++ store/trunk/cpp/lib/jrnl/jdir.cpp 2008-07-24 20:07:07 UTC (rev 2215)
@@ -81,9 +81,9 @@
if (!exists(parent_dir))
create_dir(parent_dir);
}
- if (!exists(dirname))
+ if (::mkdir(dirname.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
{
- if (::mkdir(dirname.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
+ if (errno != EEXIST) // Dir exists, ignore
{
std::ostringstream oss;
oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
Modified: store/trunk/cpp/tests/jrnl/_ut_jdir.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_jdir.cpp 2008-07-24 08:51:22 UTC (rev 2214)
+++ store/trunk/cpp/tests/jrnl/_ut_jdir.cpp 2008-07-24 20:07:07 UTC (rev 2215)
@@ -274,7 +274,7 @@
BOOST_CHECK(jdir::is_dir(test_dir + "/E/F/G/H"));
dir1.delete_dir();
BOOST_CHECK(!jdir::exists(test_dir + "/E/F/G/H")); // only H deleted, E/F/G remain
- BOOST_CHECK(jdir::exists(test_dir + "/E"));
+ BOOST_CHECK(jdir::exists(test_dir + "/E/F/G"));
jdir::delete_dir(test_dir + "/E"); // delete remaining dirs
BOOST_CHECK(!jdir::exists(test_dir + "/E"));
@@ -284,51 +284,70 @@
BOOST_CHECK(jdir::is_dir(test_dir + "/F/G/H/I/"));
dir2.delete_dir();
BOOST_CHECK(!jdir::exists(test_dir + "/F/G/H/I/"));
- BOOST_CHECK(jdir::exists(test_dir + "/F"));
+ BOOST_CHECK(jdir::exists(test_dir + "/F/G/H/"));
jdir::delete_dir(test_dir + "/F");
BOOST_CHECK(!jdir::exists(test_dir + "/F"));
+
+ check_dir_not_existing(test_dir + "/G");
+ jdir dir3(test_dir + "/G/H//I//J", "test_base"); // extra '/' in path
+ dir3.create_dir();
+ BOOST_CHECK(jdir::is_dir(test_dir + "/G/H//I//J"));
+ dir3.delete_dir();
+ BOOST_CHECK(!jdir::exists(test_dir + "/G/H//I//J"));
+ BOOST_CHECK(jdir::exists(test_dir + "/G/H//I"));
+ jdir::delete_dir(test_dir + "/F");
+ BOOST_CHECK(!jdir::exists(test_dir + "/F"));
// Use static fn
- check_dir_not_existing(test_dir + "/G");
- jdir::create_dir(test_dir + "/G/H/I/J");
- BOOST_CHECK(jdir::is_dir(test_dir + "/G/H/I/J"));
- jdir::delete_dir(test_dir + "/G/H/I/J");
- BOOST_CHECK(!jdir::exists(test_dir + "/G/H/I/J"));
- BOOST_CHECK(jdir::exists(test_dir + "/G"));
- jdir::delete_dir(test_dir + "/G");
- BOOST_CHECK(!jdir::exists(test_dir + "/G"));
-
check_dir_not_existing(test_dir + "/H");
- jdir::create_dir(test_dir + "/H/I/J/K/");
- BOOST_CHECK(jdir::is_dir(test_dir + "/H/I/J/K/"));
- jdir::delete_dir(test_dir + "/H/I/J/K/");
- BOOST_CHECK(!jdir::exists(test_dir + "/H/I/J/K/"));
- BOOST_CHECK(jdir::exists(test_dir + "/H"));
+ jdir::create_dir(test_dir + "/H/I/J/K");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/H/I/J/K"));
+ jdir::delete_dir(test_dir + "/H/I/J/K");
+ BOOST_CHECK(!jdir::exists(test_dir + "/H/I/J/K")); // only J deleted, H/I/J remain
+ BOOST_CHECK(jdir::exists(test_dir + "/H/I/J"));
jdir::delete_dir(test_dir + "/H");
BOOST_CHECK(!jdir::exists(test_dir + "/H"));
-
- // Non-empty dirs
+
check_dir_not_existing(test_dir + "/I");
- jdir::create_dir(test_dir + "/I/J/K1/L1");
- jdir::create_dir(test_dir + "/I/J/K1/L2");
- jdir::create_dir(test_dir + "/I/J/K1/L3");
- jdir::create_dir(test_dir + "/I/J/K1/L4");
- create_file(test_dir + "/I/J/K1/L4/test_file_1.txt"); // mode 644 (default)
- create_file(test_dir + "/I/J/K1/L4/test_file_2.txt", S_IRWXU | S_IRWXG | S_IRWXO); // mode 777
- create_file(test_dir + "/I/J/K1/L4/test_file_3.txt", S_IRUSR | S_IRGRP | S_IROTH); // mode 444
- create_file(test_dir + "/I/J/K1/L4/test_file_4.txt", 0); // mode 000 (no permissions)
- jdir::create_dir(test_dir + "/I/J/K2");
- jdir::create_dir(test_dir + "/I/J/K3/L5");
- jdir::create_dir(test_dir + "/I/J/K3/L6");
- BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K1/L1"));
- BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K1/L2"));
- BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K1/L3"));
- BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K1/L4"));
- BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K2"));
- BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K3/L5"));
- BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K3/L6"));
+ jdir::create_dir(test_dir + "/I/J/K/L/"); // trailing '/'
+ BOOST_CHECK(jdir::is_dir(test_dir + "/I/J/K/L/"));
+ jdir::delete_dir(test_dir + "/I/J/K/L/");
+ BOOST_CHECK(!jdir::exists(test_dir + "/I/J/K/L/"));
+ BOOST_CHECK(jdir::exists(test_dir + "/I/J/K/"));
jdir::delete_dir(test_dir + "/I");
BOOST_CHECK(!jdir::exists(test_dir + "/I"));
+
+ check_dir_not_existing(test_dir + "//J");
+ jdir::create_dir(test_dir + "//J//K//L//M"); // extra '/' in path
+ BOOST_CHECK(jdir::is_dir(test_dir + "//J//K//L//M"));
+ jdir::delete_dir(test_dir + "//J//K//L//M");
+ BOOST_CHECK(!jdir::exists(test_dir + "//J//K//L//M"));
+ BOOST_CHECK(jdir::exists(test_dir + "//J//K//L"));
+ jdir::delete_dir(test_dir + "//J");
+ BOOST_CHECK(!jdir::exists(test_dir + "//J"));
+
+ // Non-empty dirs
+ check_dir_not_existing(test_dir + "/K");
+ jdir::create_dir(test_dir + "/K/L/M1/N1");
+ jdir::create_dir(test_dir + "/K/L/M1/N2");
+ jdir::create_dir(test_dir + "/K/L/M1/N3");
+ jdir::create_dir(test_dir + "/K/L/M1/N4");
+ create_file(test_dir + "/K/L/M1/N4/test_file_1.txt"); // mode 644 (default)
+ create_file(test_dir + "/K/L/M1/N4/test_file_2.txt", S_IRWXU | S_IRWXG | S_IRWXO); // mode 777
+ create_file(test_dir + "/K/L/M1/N4/test_file_3.txt", S_IRUSR | S_IRGRP | S_IROTH); // mode 444
+ create_file(test_dir + "/K/L/M1/N4/test_file_4.txt", 0); // mode 000 (no permissions)
+ jdir::create_dir(test_dir + "/K/L/M2");
+ jdir::create_dir(test_dir + "/K/L/M3/N5");
+ jdir::create_dir(test_dir + "/K/L/M3/N6");
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N1"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N2"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N3"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M1/N4"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M2"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M3/N5"));
+ BOOST_CHECK(jdir::is_dir(test_dir + "/K/L/M3/N6"));
+ jdir::delete_dir(test_dir + "/K");
+ BOOST_CHECK(!jdir::exists(test_dir + "/K"));
cout << "ok" << endl;
}
16 years, 5 months
rhmessaging commits: r2214 - in store/branches/java/broker-queue-refactor/java/bdbstore: lib and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: marnie(a)apache.org
Date: 2008-07-24 04:51:22 -0400 (Thu, 24 Jul 2008)
New Revision: 2214
Added:
store/branches/java/broker-queue-refactor/java/bdbstore/lib/
store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-collections-3.2.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-configuration-1.2.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-lang-2.2.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/geronimo-jms_1.1_spec-1.0.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/je-3.3.62.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/junit-3.8.1.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/log4j-1.2.12.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/mina-core-1.0.1.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/org.apache.felix.framework-1.0.0.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/org.osgi.core-1.0.0.jar
store/branches/java/broker-queue-refactor/java/bdbstore/lib/slf4j-log4j12-1.4.0.jar
Log:
Adding lib dir to go with ant build, including all jaras required except Qpid jars
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-collections-3.2.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-collections-3.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-configuration-1.2.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-configuration-1.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-lang-2.2.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/commons-lang-2.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/geronimo-jms_1.1_spec-1.0.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/geronimo-jms_1.1_spec-1.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/je-3.3.62.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/je-3.3.62.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/junit-3.8.1.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/junit-3.8.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/log4j-1.2.12.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/log4j-1.2.12.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/mina-core-1.0.1.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/mina-core-1.0.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/org.apache.felix.framework-1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/org.apache.felix.framework-1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/org.osgi.core-1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/org.osgi.core-1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: store/branches/java/broker-queue-refactor/java/bdbstore/lib/slf4j-log4j12-1.4.0.jar
===================================================================
(Binary files differ)
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/lib/slf4j-log4j12-1.4.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 5 months
rhmessaging commits: r2213 - store/branches/java/broker-queue-refactor/java/bdbstore.
by rhmessaging-commits@lists.jboss.org
Author: marnie(a)apache.org
Date: 2008-07-24 04:47:02 -0400 (Thu, 24 Jul 2008)
New Revision: 2213
Added:
store/branches/java/broker-queue-refactor/java/bdbstore/build.xml
Log:
ant build file for bdb
Added: store/branches/java/broker-queue-refactor/java/bdbstore/build.xml
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/build.xml (rev 0)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/build.xml 2008-07-24 08:47:02 UTC (rev 2213)
@@ -0,0 +1,108 @@
+<!--
+ - Simple Build file for BDBStore
+ -->
+<project name="BDBStore" default="compile">
+
+ <property name="src.dir" location="src/main/java"/>
+ <property name="src.test.dir" location="src/test/java"/>
+ <property name="build.dir" location="build"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="build.classes" location="build/classes"/>
+ <property name="build.test.classes" location="build/test/classes"/>
+
+ <path id="class.path">
+ <fileset dir="lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ </path>
+
+ <path id="test.class.path">
+ <path refid="class.path"/>
+ <pathelement path="${build.classes}"/>
+ </path>
+
+ <target name="init">
+ <mkdir dir="build/classes"/>
+ <mkdir dir="build/test/classes"/>
+ </target>
+
+ <target name="clean" description="remove build artifacts">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="${src.dir}"
+ destdir="${build.classes}"
+ classpathref="class.path"/>
+ </target>
+
+ <target name="compile-tests" depends="init,compile">
+ <javac srcdir="${src.test.dir}"
+ destdir="${build.test.classes}"
+ classpathref="test.class.path"/>
+ </target>
+
+ <target name="jar" depends="compile">
+ <jar destfile="build/qpid-bdbstore.jar" basedir="build/classes"/>
+ </target>
+
+
+ <target name="test" depends="compile, compile-tests">
+
+ </target>
+
+
+ <target name="teststuff" depends="build,compile-tests" if="module.test.src.exists"
+ unless="${dontruntest}" description="execute unit tests">
+
+ <delete file="${module.failed}"/>
+
+ <junit fork="${test.fork}" maxmemory="${test.mem}" reloading="no"
+ haltonfailure="${haltonfailure}" haltonerror="${haltonerror}"
+ failureproperty="test.failures" printsummary="on" timeout="600000" >
+
+ <sysproperty key="amqj.logging.level" value="${amqj.logging.level}"/>
+ <sysproperty key="root.logging.level" value="${root.logging.level}"/>
+ <sysproperty key="log4j.configuration" value="${log4j.configuration}"/>
+ <sysproperty key="java.naming.factory.initial" value="${java.naming.factory.initial}"/>
+ <sysproperty key="java.naming.provider.url" value="${java.naming.provider.url}"/>
+ <sysproperty key="broker" value="${broker}"/>
+ <sysproperty key="broker.clean" value="${broker.clean}"/>
+ <sysproperty key="broker.version" value="${broker.version}"/>
+ <sysproperty key="broker.ready" value="${broker.ready}" />
+ <sysproperty key="test.excludes" value="${test.excludes}"/>
+ <sysproperty key="test.excludesfile" value="${test.excludesfile}"/>
+ <sysproperty key="max_prefetch" value ="${max_prefetch}"/>
+ <sysproperty key="example.plugin.target" value="${project.root}/build/lib/plugins"/>
+ <sysproperty key="QPID_EXAMPLE_HOME" value="${project.root}/broker"/>
+ <sysproperty key="QPID_HOME" value="${project.root}/broker"/>
+
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+
+ <classpath refid="module.test.path"/>
+
+ <batchtest fork="${test.fork}" todir="${module.results}">
+ <fileset dir="${module.test.src}" excludes="${module.test.excludes}">
+ <include name="**/${test}.java"/>
+ </fileset>
+ </batchtest>
+ </junit>
+
+ <antcall target="touch-failed"/>
+
+ <condition property="failed">
+ <and>
+ <isfalse value="${test.failures.ignore}"/>
+ <available file="${module.failed}"/>
+ </and>
+ </condition>
+
+ <fail if="failed" message="TEST SUITE FAILED"/>
+
+ </target>
+
+ <target name="release" depends="compile, jar"/>
+
+
+</project>
Property changes on: store/branches/java/broker-queue-refactor/java/bdbstore/build.xml
___________________________________________________________________
Name: svn:eol-style
+ native
16 years, 5 months
rhmessaging commits: r2212 - store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb.
by rhmessaging-commits@lists.jboss.org
Author: marnie(a)apache.org
Date: 2008-07-24 04:46:22 -0400 (Thu, 24 Jul 2008)
New Revision: 2212
Modified:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
Log:
Removed call to getOrCreateTransaction as it was leaving a hanging transaction, after discussion with Rob.
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-07-23 19:00:33 UTC (rev 2211)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-07-24 08:46:22 UTC (rev 2212)
@@ -1123,7 +1123,8 @@
_log.debug("public void storeMessageMetaData(StoreContext context = " + context + ", Long messageId = "
+ messageId + ", MessageMetaData messageMetaData = " + messageMetaData + "): called");
}
- getOrCreateTransaction(context);
+ //This call breaking tests - not sure where the txn it creates should be committed ??
+ //getOrCreateTransaction(context);
Transaction tx = (Transaction) context.getPayload();
DatabaseEntry key = new DatabaseEntry();
EntryBinding keyBinding = TupleBinding.getPrimitiveBinding(Long.class);
16 years, 5 months