JBoss hornetq SVN: r11513 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-11 21:41:45 -0400 (Tue, 11 Oct 2011)
New Revision: 11513
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
fix on tests
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-10-12 01:21:25 UTC (rev 11512)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-10-12 01:41:45 UTC (rev 11513)
@@ -1284,7 +1284,7 @@
durable,
0,
System.currentTimeMillis(),
- (byte)1);
+ (byte)4);
message.getBodyBuffer().writeString(s);
return message;
}
13 years, 2 months
JBoss hornetq SVN: r11511 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/client/impl and 16 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-11 12:49:46 -0400 (Tue, 11 Oct 2011)
New Revision: 11511
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/Pair.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/TopologyMember.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalRecord.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompSession.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java
Log:
encapsulating Pair access
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/Pair.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/Pair.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/Pair.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -33,9 +33,9 @@
this.b = b;
}
- public A a;
+ private A a;
- public B b;
+ private B b;
private int hash = -1;
@@ -81,4 +81,26 @@
{
return "Pair[a=" + a + ", b=" + b + "]";
}
+
+ public void setA(A a)
+ {
+ hash = -1;
+ this.a = a;
+ }
+
+ public A getA()
+ {
+ return a;
+ }
+
+ public void setB(B b)
+ {
+ hash = -1;
+ this.b = b;
+ }
+
+ public B getB()
+ {
+ return b;
+ }
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -513,7 +513,7 @@
Pair<TransportConfiguration, TransportConfiguration> pair = topologyArray[pos];
- return pair.a;
+ return pair.getA();
}
else
{
@@ -1329,19 +1329,19 @@
log.debug("NodeUp " + this + "::nodeID=" + nodeID + ", connectorPair=" + connectorPair, new Exception("trace"));
}
- TopologyMember member = new TopologyMember(connectorPair.a, connectorPair.b);
+ TopologyMember member = new TopologyMember(connectorPair.getA(), connectorPair.getB());
if (topology.updateMember(uniqueEventID, nodeID, member))
{
TopologyMember actMember = topology.getMember(nodeID);
- if (actMember != null && actMember.getConnector().a != null && actMember.getConnector().b != null)
+ if (actMember != null && actMember.getConnector().getA() != null && actMember.getConnector().getB() != null)
{
for (ClientSessionFactory factory : factories)
{
- ((ClientSessionFactoryInternal)factory).setBackupConnector(actMember.getConnector().a,
- actMember.getConnector().b);
+ ((ClientSessionFactoryInternal)factory).setBackupConnector(actMember.getConnector().getA(),
+ actMember.getConnector().getB());
}
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/TopologyMember.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/TopologyMember.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/TopologyMember.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -43,22 +43,22 @@
public TransportConfiguration getA()
{
- return connector.a;
+ return connector.getA();
}
public TransportConfiguration getB()
{
- return connector.b;
+ return connector.getB();
}
public void setB(final TransportConfiguration param)
{
- connector.b = param;
+ connector.setB(param);
}
public void setA(final TransportConfiguration param)
{
- connector.a = param;
+ connector.setA(param);
}
/**
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -66,7 +66,7 @@
Pair<String, AddressSettings> setting = parser.parseAddressSettings(node);
- addressSettingsRepository.addMatch(setting.a, setting.b);
+ addressSettingsRepository.addMatch(setting.getA(), setting.getB());
}
@Override
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -603,7 +603,7 @@
for (int i = 0; i < list.getLength(); i++)
{
Pair<String, Set<Role>> securityItem = parseSecurityRoles(list.item(i));
- config.getSecurityRoles().put(securityItem.a, securityItem.b);
+ config.getSecurityRoles().put(securityItem.getA(), securityItem.getB());
}
}
}
@@ -643,7 +643,7 @@
for (int i = 0; i < list.getLength(); i++)
{
Pair<String, AddressSettings> addressSettings = parseAddressSettings(list.item(i));
- config.getAddressesSettings().put(addressSettings.a, addressSettings.b);
+ config.getAddressesSettings().put(addressSettings.getA(), addressSettings.getB());
}
}
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -231,18 +231,18 @@
for (Map.Entry<Pair<URL, Deployer>, DeployInfo> entry : deployed.entrySet())
{
Pair<URL, Deployer> pair = entry.getKey();
- if (!fileExists(pair.a))
+ if (!fileExists(pair.getA()))
{
try
{
Deployer deployer = entry.getValue().deployer;
- FileDeploymentManager.log.debug("Undeploying " + deployer + " with url " + pair.a);
- deployer.undeploy(pair.a);
+ FileDeploymentManager.log.debug("Undeploying " + deployer + " with url " + pair.getA());
+ deployer.undeploy(pair.getA());
toRemove.add(pair);
}
catch (Exception e)
{
- FileDeploymentManager.log.error("Error undeploying " + pair.a, e);
+ FileDeploymentManager.log.error("Error undeploying " + pair.getA(), e);
}
}
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -88,7 +88,7 @@
public void deploy(final Node node) throws Exception
{
Pair<String, Set<Role>> securityMatch = parser.parseSecurityRoles(node);
- securityRepository.addMatch(securityMatch.a, securityMatch.b);
+ securityRepository.addMatch(securityMatch.getA(), securityMatch.getB());
}
/**
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -143,8 +143,8 @@
filesToRename.writeInt(renames.size());
for (Pair<String, String> rename : renames)
{
- filesToRename.writeUTF(rename.a);
- filesToRename.writeUTF(rename.b);
+ filesToRename.writeUTF(rename.getA());
+ filesToRename.writeUTF(rename.getB());
}
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -3094,14 +3094,14 @@
for (Pair<String, String> rename : renames)
{
- SequentialFile fileTmp = fileFactory.createSequentialFile(rename.a, 1);
- SequentialFile fileTo = fileFactory.createSequentialFile(rename.b, 1);
+ SequentialFile fileTmp = fileFactory.createSequentialFile(rename.getA(), 1);
+ SequentialFile fileTo = fileFactory.createSequentialFile(rename.getB(), 1);
// We should do the rename only if the tmp file still exist, or else we could
// delete a valid file depending on where the crash occured during the control file delete
if (fileTmp.exists())
{
fileTo.delete();
- fileTmp.renameTo(rename.b);
+ fileTmp.renameTo(rename.getB());
}
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalRecord.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalRecord.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/JournalRecord.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -68,8 +68,8 @@
{
for (Pair<JournalFile, Integer> updFile : updateFiles)
{
- file.incNegCount(updFile.a);
- updFile.a.decSize(updFile.b);
+ file.incNegCount(updFile.getA());
+ updFile.getA().decSize(updFile.getB());
}
}
}
@@ -85,7 +85,7 @@
for (Pair<JournalFile, Integer> update : updateFiles)
{
- buffer.append(", update=" + update.a.getFile().getFileName());
+ buffer.append(", update=" + update.getA().getFile().getFileName());
}
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -81,7 +81,7 @@
Pair<Map<Long, Set<PagePosition>>, Set<Long>> cursorACKs = PrintPages.loadCursorACKs(arg[1]);
- Set<Long> pgTXs = cursorACKs.b;
+ Set<Long> pgTXs = cursorACKs.getB();
ScheduledExecutorService scheduled = Executors.newScheduledThreadPool(1);
final ExecutorService executor = Executors.newFixedThreadPool(10);
@@ -133,7 +133,7 @@
boolean acked = false;
- Set<PagePosition> positions = cursorACKs.a.get(q[i]);
+ Set<PagePosition> positions = cursorACKs.getA().get(q[i]);
if (positions != null)
{
acked = positions.contains(posCheck);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -198,8 +198,8 @@
{
for (Pair<Long, Integer> incElement : loadList)
{
- value.addAndGet(incElement.b);
- incrementRecords.add(incElement.a);
+ value.addAndGet(incElement.getB());
+ incrementRecords.add(incElement.getA());
}
loadList.clear();
loadList = null;
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -160,7 +160,7 @@
// This is to make sure deliveries that were touched before the commit arrived will be delivered
for (Pair<PageSubscription, PagePosition> pos : lateDeliveries)
{
- pos.a.redeliver(pos.b);
+ pos.getA().redeliver(pos.getB());
}
lateDeliveries.clear();
}
@@ -262,7 +262,7 @@
{
for (Pair<PageSubscription, PagePosition> pos : lateDeliveries)
{
- pos.a.lateDeliveryRollback(pos.b);
+ pos.getA().lateDeliveryRollback(pos.getB());
}
lateDeliveries = null;
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -88,9 +88,9 @@
{
if (count < cacheSize)
{
- ByteArrayHolder bah = new ByteArrayHolder(id.a);
+ ByteArrayHolder bah = new ByteArrayHolder(id.getA());
- Pair<ByteArrayHolder, Long> pair = new Pair<ByteArrayHolder, Long>(bah, id.b);
+ Pair<ByteArrayHolder, Long> pair = new Pair<ByteArrayHolder, Long>(bah, id.getB());
cache.put(bah, ids.size());
@@ -104,7 +104,7 @@
txID = storageManager.generateUniqueID();
}
- storageManager.deleteDuplicateIDTransactional(txID, id.b);
+ storageManager.deleteDuplicateIDTransactional(txID, id.getB());
}
count++;
@@ -139,11 +139,11 @@
{
id = ids.get(posUsed.intValue());
- if (id.a.equals(bah))
+ if (id.getA().equals(bah))
{
- id.a = null;
- storageManager.deleteDuplicateID(id.b);
- id.b = null;
+ id.setA(null);
+ storageManager.deleteDuplicateID(id.getB());
+ id.setB(null);
}
}
}
@@ -205,19 +205,19 @@
id = ids.get(pos);
// The id here might be null if it was explicit deleted
- if (id.a != null)
+ if (id.getA() != null)
{
- cache.remove(id.a);
+ cache.remove(id.getA());
// Record already exists - we delete the old one and add the new one
// Note we can't use update since journal update doesn't let older records get
// reclaimed
- if (id.b != null)
+ if (id.getB() != null)
{
try
{
- storageManager.deleteDuplicateID(id.b);
+ storageManager.deleteDuplicateID(id.getB());
}
catch (Exception e)
{
@@ -226,11 +226,11 @@
}
}
- id.a = holder;
+ id.setA(holder);
// The recordID could be negative if the duplicateCache is configured to not persist,
// -1 would mean null on this case
- id.b = recordID >= 0 ? recordID : null;
+ id.setB(recordID >= 0 ? recordID : null);
holder.pos = pos;
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -99,19 +99,19 @@
buffer.writeString(nodeID);
if (!exit)
{
- if (pair.a != null)
+ if (pair.getA() != null)
{
buffer.writeBoolean(true);
- pair.a.encode(buffer);
+ pair.getA().encode(buffer);
}
else
{
buffer.writeBoolean(false);
}
- if (pair.b != null)
+ if (pair.getB() != null)
{
buffer.writeBoolean(true);
- pair.b.encode(buffer);
+ pair.getB().encode(buffer);
}
else
{
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -113,19 +113,19 @@
buffer.writeLong(uniqueEventID);
if (!exit)
{
- if (pair.a != null)
+ if (pair.getA() != null)
{
buffer.writeBoolean(true);
- pair.a.encode(buffer);
+ pair.getA().encode(buffer);
}
else
{
buffer.writeBoolean(false);
}
- if (pair.b != null)
+ if (pair.getB() != null)
{
buffer.writeBoolean(true);
- pair.b.encode(buffer);
+ pair.getB().encode(buffer);
}
else
{
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompSession.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -205,8 +205,8 @@
if (pair != null)
{
- long consumerID = pair.a;
- int credits = pair.b;
+ long consumerID = pair.getA();
+ int credits = pair.getB();
if (this.consumerCredits != -1)
{
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -520,11 +520,11 @@
log.debug(this + "::NodeAnnounced, backup=" + backup + nodeID + connectorPair);
}
- TopologyMember newMember = new TopologyMember(connectorPair.a, connectorPair.b);
+ TopologyMember newMember = new TopologyMember(connectorPair.getA(), connectorPair.getB());
newMember.setUniqueEventID(uniqueEventID);
if (backup)
{
- topology.updateBackup(nodeID, new TopologyMember(connectorPair.a, connectorPair.b));
+ topology.updateBackup(nodeID, new TopologyMember(connectorPair.getA(), connectorPair.getB()));
}
else
{
@@ -541,8 +541,8 @@
sf.sendNodeAnnounce(localMember.getUniqueEventID(),
manager.getNodeId(),
false,
- localMember.getConnector().a,
- localMember.getConnector().b);
+ localMember.getConnector().getA(),
+ localMember.getConnector().getB());
// sf.sendNodeAnnounce(System.currentTimeMillis(),
// manager.getNodeId(),
@@ -743,7 +743,7 @@
}
// if the node is more than 1 hop away, we do not create a bridge for direct cluster connection
- if (allowDirectConnectionsOnly && !allowableConnections.contains(connectorPair.a))
+ if (allowDirectConnectionsOnly && !allowableConnections.contains(connectorPair.getA()))
{
return;
}
@@ -755,7 +755,7 @@
return;
}
/*we dont create bridges to backups*/
- if (connectorPair.a == null)
+ if (connectorPair.getA() == null)
{
if (isTrace)
{
@@ -801,7 +801,7 @@
queue = server.createQueue(queueName, queueName, null, true, false);
}
- createNewRecord(eventUID, nodeID, connectorPair.a, queueName, queue, true);
+ createNewRecord(eventUID, nodeID, connectorPair.getA(), queueName, queue, true);
}
else
{
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -1607,8 +1607,8 @@
{
log.info("Deleting pending large message as it wasn't completed:" + msgToDelete);
LargeServerMessage msg = storageManager.createLargeMessage();
- msg.setMessageID(msgToDelete.b);
- msg.setPendingRecordID(msgToDelete.a);
+ msg.setMessageID(msgToDelete.getB());
+ msg.setPendingRecordID(msgToDelete.getA());
msg.setDurable(true);
msg.deleteFile();
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -1239,7 +1239,7 @@
Pair<UUID, AtomicLong> value = targetAddressInfos.get(SimpleString.toSimpleString(address));
if (value != null)
{
- return value.a.toString();
+ return value.getA().toString();
}
else
{
@@ -1265,8 +1265,8 @@
producerInfo.put("connectionID", this.getConnectionID().toString());
producerInfo.put("sessionID", this.getName());
producerInfo.put("destination", entry.getKey().toString());
- producerInfo.put("lastUUIDSent", entry.getValue().a);
- producerInfo.put("msgSent", entry.getValue().b.longValue());
+ producerInfo.put("lastUUIDSent", entry.getValue().getA());
+ producerInfo.put("msgSent", entry.getValue().getB().longValue());
array.put(producerInfo);
}
}
@@ -1411,8 +1411,8 @@
}
else
{
- value.a = msg.getUserID();
- value.b.incrementAndGet();
+ value.setA(msg.getUserID());
+ value.getB().incrementAndGet();
}
routingContext.clear();
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -296,8 +296,8 @@
{
Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
.toString());
- clientID = pair.a;
- subName = pair.b;
+ clientID = pair.getA();
+ subName = pair.getB();
}
String filter = queue.getFilter() != null ? queue.getFilter() : null;
@@ -330,8 +330,8 @@
{
Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
.toString());
- clientID = pair.a;
- subName = pair.b;
+ clientID = pair.getA();
+ subName = pair.getB();
}
String filter = queue.getFilter() != null ? queue.getFilter() : null;
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -78,12 +78,12 @@
{
for (Pair<TransportConfiguration, TransportConfiguration> pair : configs)
{
- encode(buffer, pair.a);
- boolean backup = (pair.b != null);
+ encode(buffer, pair.getA());
+ boolean backup = (pair.getB() != null);
buffer.writeBoolean(backup);
if (backup)
{
- encode(buffer, pair.b);
+ encode(buffer, pair.getB());
}
}
}
@@ -122,11 +122,11 @@
{
for (Pair<TransportConfiguration, TransportConfiguration> pair : configs)
{
- size += getEncodeSize(pair.a);
+ size += getEncodeSize(pair.getA());
size += DataConstants.SIZE_BOOLEAN; // whether there is a backup config
- if (pair.b != null)
+ if (pair.getB() != null)
{
- size += getEncodeSize(pair.b);
+ size += getEncodeSize(pair.getB());
}
}
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -438,14 +438,14 @@
public void nodeUP(final long uniqueEventID, String nodeID, Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean last)
{
- if (connectorPair.a != null && !liveNode.contains(connectorPair.a.getName()))
+ if (connectorPair.getA() != null && !liveNode.contains(connectorPair.getA().getName()))
{
- liveNode.add(connectorPair.a.getName());
+ liveNode.add(connectorPair.getA().getName());
latch.countDown();
}
- if (connectorPair.b != null && !backupNode.contains(connectorPair.b.getName()))
+ if (connectorPair.getB() != null && !backupNode.contains(connectorPair.getB().getName()))
{
- backupNode.add(connectorPair.b.getName());
+ backupNode.add(connectorPair.getB().getName());
latch.countDown();
}
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -236,14 +236,14 @@
Pair<TransportConfiguration, TransportConfiguration> connectorPair,
boolean last)
{
- if (connectorPair.a != null && !liveNode.contains(connectorPair.a.getName()))
+ if (connectorPair.getA() != null && !liveNode.contains(connectorPair.getA().getName()))
{
- liveNode.add(connectorPair.a.getName());
+ liveNode.add(connectorPair.getA().getName());
latch.countDown();
}
- if (connectorPair.b != null && !backupNode.contains(connectorPair.b.getName()))
+ if (connectorPair.getB() != null && !backupNode.contains(connectorPair.getB().getName()))
{
- backupNode.add(connectorPair.b.getName());
+ backupNode.add(connectorPair.getB().getName());
latch.countDown();
}
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -300,14 +300,14 @@
Pair<TransportConfiguration, TransportConfiguration> connectorPair,
boolean last)
{
- if (connectorPair.a != null && !liveNode.contains(connectorPair.a.getName()))
+ if (connectorPair.getA() != null && !liveNode.contains(connectorPair.getA().getName()))
{
- liveNode.add(connectorPair.a.getName());
+ liveNode.add(connectorPair.getA().getName());
latch.countDown();
}
- if (connectorPair.b != null && !backupNode.contains(connectorPair.b.getName()))
+ if (connectorPair.getB() != null && !backupNode.contains(connectorPair.getB().getName()))
{
- backupNode.add(connectorPair.b.getName());
+ backupNode.add(connectorPair.getB().getName());
latch.countDown();
}
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -125,8 +125,8 @@
for (Pair<String, String> rename : renamesRead)
{
Pair<String, String> original = iterRename.next();
- Assert.assertEquals(original.a, rename.a);
- Assert.assertEquals(original.b, rename.b);
+ Assert.assertEquals(original.getA(), rename.getA());
+ Assert.assertEquals(original.getB(), rename.getB());
}
Assert.assertFalse(iterNewFiles.hasNext());
@@ -720,20 +720,20 @@
{
if (postXA)
{
- prepare(tx.a, new SimpleEncoding(10, (byte)0));
+ prepare(tx.getA(), new SimpleEncoding(10, (byte)0));
}
- if (tx.a % 2 == 0)
+ if (tx.getA() % 2 == 0)
{
- commit(tx.a);
+ commit(tx.getA());
if (deleteTransactRecords)
{
- delete(tx.b);
+ delete(tx.getB());
}
}
else
{
- rollback(tx.a);
+ rollback(tx.getA());
}
}
}
@@ -762,20 +762,20 @@
{
if (postXA)
{
- prepare(tx.a, new SimpleEncoding(10, (byte)0));
+ prepare(tx.getA(), new SimpleEncoding(10, (byte)0));
}
- if (tx.a % 2 == 0)
+ if (tx.getA() % 2 == 0)
{
- commit(tx.a);
+ commit(tx.getA());
if (deleteTransactRecords)
{
- delete(tx.b);
+ delete(tx.getB());
}
}
else
{
- rollback(tx.a);
+ rollback(tx.getA());
}
}
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java 2011-10-11 16:49:21 UTC (rev 11510)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java 2011-10-11 16:49:46 UTC (rev 11511)
@@ -100,10 +100,10 @@
assertNotNull(decodedConfigs);
assertEquals(2, decodedConfigs.size());
- assertEquivalent(connectorConfigs.get(0).a, decodedConfigs.get(0).a);
- assertEquivalent(connectorConfigs.get(0).b, decodedConfigs.get(0).b);
- assertEquivalent(connectorConfigs.get(1).a, decodedConfigs.get(1).a);
- assertNull(decodedConfigs.get(1).b);
+ assertEquivalent(connectorConfigs.get(0).getA(), decodedConfigs.get(0).getA());
+ assertEquivalent(connectorConfigs.get(0).getB(), decodedConfigs.get(0).getB());
+ assertEquivalent(connectorConfigs.get(1).getA(), decodedConfigs.get(1).getA());
+ assertNull(decodedConfigs.get(1).getB());
}
// decoded TransportConfiguration have parameter values as String instead of primitive type
13 years, 2 months
JBoss hornetq SVN: r11510 - in branches/Branch_2_2_AS7: src/main/org/hornetq/core/client/impl and 16 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-11 12:49:21 -0400 (Tue, 11 Oct 2011)
New Revision: 11510
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/Pair.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/TopologyMember.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalRecord.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/PrintPages.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompSession.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java
Log:
encapsulating Pair access
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/Pair.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/Pair.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/api/core/Pair.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -33,9 +33,9 @@
this.b = b;
}
- public A a;
+ private A a;
- public B b;
+ private B b;
private int hash = -1;
@@ -81,4 +81,26 @@
{
return "Pair[a=" + a + ", b=" + b + "]";
}
+
+ public void setA(A a)
+ {
+ hash = -1;
+ this.a = a;
+ }
+
+ public A getA()
+ {
+ return a;
+ }
+
+ public void setB(B b)
+ {
+ hash = -1;
+ this.b = b;
+ }
+
+ public B getB()
+ {
+ return b;
+ }
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -513,7 +513,7 @@
Pair<TransportConfiguration, TransportConfiguration> pair = topologyArray[pos];
- return pair.a;
+ return pair.getA();
}
else
{
@@ -1329,19 +1329,19 @@
log.debug("NodeUp " + this + "::nodeID=" + nodeID + ", connectorPair=" + connectorPair, new Exception("trace"));
}
- TopologyMember member = new TopologyMember(connectorPair.a, connectorPair.b);
+ TopologyMember member = new TopologyMember(connectorPair.getA(), connectorPair.getB());
if (topology.updateMember(uniqueEventID, nodeID, member))
{
TopologyMember actMember = topology.getMember(nodeID);
- if (actMember != null && actMember.getConnector().a != null && actMember.getConnector().b != null)
+ if (actMember != null && actMember.getConnector().getA() != null && actMember.getConnector().getB() != null)
{
for (ClientSessionFactory factory : factories)
{
- ((ClientSessionFactoryInternal)factory).setBackupConnector(actMember.getConnector().a,
- actMember.getConnector().b);
+ ((ClientSessionFactoryInternal)factory).setBackupConnector(actMember.getConnector().getA(),
+ actMember.getConnector().getB());
}
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/TopologyMember.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/TopologyMember.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/TopologyMember.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -43,22 +43,22 @@
public TransportConfiguration getA()
{
- return connector.a;
+ return connector.getA();
}
public TransportConfiguration getB()
{
- return connector.b;
+ return connector.getB();
}
public void setB(final TransportConfiguration param)
{
- connector.b = param;
+ connector.setB(param);
}
public void setA(final TransportConfiguration param)
{
- connector.a = param;
+ connector.setA(param);
}
/**
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -66,7 +66,7 @@
Pair<String, AddressSettings> setting = parser.parseAddressSettings(node);
- addressSettingsRepository.addMatch(setting.a, setting.b);
+ addressSettingsRepository.addMatch(setting.getA(), setting.getB());
}
@Override
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -603,7 +603,7 @@
for (int i = 0; i < list.getLength(); i++)
{
Pair<String, Set<Role>> securityItem = parseSecurityRoles(list.item(i));
- config.getSecurityRoles().put(securityItem.a, securityItem.b);
+ config.getSecurityRoles().put(securityItem.getA(), securityItem.getB());
}
}
}
@@ -643,7 +643,7 @@
for (int i = 0; i < list.getLength(); i++)
{
Pair<String, AddressSettings> addressSettings = parseAddressSettings(list.item(i));
- config.getAddressesSettings().put(addressSettings.a, addressSettings.b);
+ config.getAddressesSettings().put(addressSettings.getA(), addressSettings.getB());
}
}
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/FileDeploymentManager.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -231,18 +231,18 @@
for (Map.Entry<Pair<URL, Deployer>, DeployInfo> entry : deployed.entrySet())
{
Pair<URL, Deployer> pair = entry.getKey();
- if (!fileExists(pair.a))
+ if (!fileExists(pair.getA()))
{
try
{
Deployer deployer = entry.getValue().deployer;
- FileDeploymentManager.log.debug("Undeploying " + deployer + " with url " + pair.a);
- deployer.undeploy(pair.a);
+ FileDeploymentManager.log.debug("Undeploying " + deployer + " with url " + pair.getA());
+ deployer.undeploy(pair.getA());
toRemove.add(pair);
}
catch (Exception e)
{
- FileDeploymentManager.log.error("Error undeploying " + pair.a, e);
+ FileDeploymentManager.log.error("Error undeploying " + pair.getA(), e);
}
}
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/deployers/impl/SecurityDeployer.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -88,7 +88,7 @@
public void deploy(final Node node) throws Exception
{
Pair<String, Set<Role>> securityMatch = parser.parseSecurityRoles(node);
- securityRepository.addMatch(securityMatch.a, securityMatch.b);
+ securityRepository.addMatch(securityMatch.getA(), securityMatch.getB());
}
/**
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/AbstractJournalUpdateTask.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -143,8 +143,8 @@
filesToRename.writeInt(renames.size());
for (Pair<String, String> rename : renames)
{
- filesToRename.writeUTF(rename.a);
- filesToRename.writeUTF(rename.b);
+ filesToRename.writeUTF(rename.getA());
+ filesToRename.writeUTF(rename.getB());
}
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -3094,14 +3094,14 @@
for (Pair<String, String> rename : renames)
{
- SequentialFile fileTmp = fileFactory.createSequentialFile(rename.a, 1);
- SequentialFile fileTo = fileFactory.createSequentialFile(rename.b, 1);
+ SequentialFile fileTmp = fileFactory.createSequentialFile(rename.getA(), 1);
+ SequentialFile fileTo = fileFactory.createSequentialFile(rename.getB(), 1);
// We should do the rename only if the tmp file still exist, or else we could
// delete a valid file depending on where the crash occured during the control file delete
if (fileTmp.exists())
{
fileTo.delete();
- fileTmp.renameTo(rename.b);
+ fileTmp.renameTo(rename.getB());
}
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalRecord.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalRecord.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/journal/impl/JournalRecord.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -68,8 +68,8 @@
{
for (Pair<JournalFile, Integer> updFile : updateFiles)
{
- file.incNegCount(updFile.a);
- updFile.a.decSize(updFile.b);
+ file.incNegCount(updFile.getA());
+ updFile.getA().decSize(updFile.getB());
}
}
}
@@ -85,7 +85,7 @@
for (Pair<JournalFile, Integer> update : updateFiles)
{
- buffer.append(", update=" + update.a.getFile().getFileName());
+ buffer.append(", update=" + update.getA().getFile().getFileName());
}
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/PrintPages.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/PrintPages.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/PrintPages.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -81,7 +81,7 @@
Pair<Map<Long, Set<PagePosition>>, Set<Long>> cursorACKs = PrintPages.loadCursorACKs(arg[1]);
- Set<Long> pgTXs = cursorACKs.b;
+ Set<Long> pgTXs = cursorACKs.getB();
ScheduledExecutorService scheduled = Executors.newScheduledThreadPool(1);
final ExecutorService executor = Executors.newFixedThreadPool(10);
@@ -133,7 +133,7 @@
boolean acked = false;
- Set<PagePosition> positions = cursorACKs.a.get(q[i]);
+ Set<PagePosition> positions = cursorACKs.getA().get(q[i]);
if (positions != null)
{
acked = positions.contains(posCheck);
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -198,8 +198,8 @@
{
for (Pair<Long, Integer> incElement : loadList)
{
- value.addAndGet(incElement.b);
- incrementRecords.add(incElement.a);
+ value.addAndGet(incElement.getB());
+ incrementRecords.add(incElement.getA());
}
loadList.clear();
loadList = null;
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -160,7 +160,7 @@
// This is to make sure deliveries that were touched before the commit arrived will be delivered
for (Pair<PageSubscription, PagePosition> pos : lateDeliveries)
{
- pos.a.redeliver(pos.b);
+ pos.getA().redeliver(pos.getB());
}
lateDeliveries.clear();
}
@@ -262,7 +262,7 @@
{
for (Pair<PageSubscription, PagePosition> pos : lateDeliveries)
{
- pos.a.lateDeliveryRollback(pos.b);
+ pos.getA().lateDeliveryRollback(pos.getB());
}
lateDeliveries = null;
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -88,9 +88,9 @@
{
if (count < cacheSize)
{
- ByteArrayHolder bah = new ByteArrayHolder(id.a);
+ ByteArrayHolder bah = new ByteArrayHolder(id.getA());
- Pair<ByteArrayHolder, Long> pair = new Pair<ByteArrayHolder, Long>(bah, id.b);
+ Pair<ByteArrayHolder, Long> pair = new Pair<ByteArrayHolder, Long>(bah, id.getB());
cache.put(bah, ids.size());
@@ -104,7 +104,7 @@
txID = storageManager.generateUniqueID();
}
- storageManager.deleteDuplicateIDTransactional(txID, id.b);
+ storageManager.deleteDuplicateIDTransactional(txID, id.getB());
}
count++;
@@ -139,11 +139,11 @@
{
id = ids.get(posUsed.intValue());
- if (id.a.equals(bah))
+ if (id.getA().equals(bah))
{
- id.a = null;
- storageManager.deleteDuplicateID(id.b);
- id.b = null;
+ id.setA(null);
+ storageManager.deleteDuplicateID(id.getB());
+ id.setB(null);
}
}
}
@@ -205,19 +205,19 @@
id = ids.get(pos);
// The id here might be null if it was explicit deleted
- if (id.a != null)
+ if (id.getA() != null)
{
- cache.remove(id.a);
+ cache.remove(id.getA());
// Record already exists - we delete the old one and add the new one
// Note we can't use update since journal update doesn't let older records get
// reclaimed
- if (id.b != null)
+ if (id.getB() != null)
{
try
{
- storageManager.deleteDuplicateID(id.b);
+ storageManager.deleteDuplicateID(id.getB());
}
catch (Exception e)
{
@@ -226,11 +226,11 @@
}
}
- id.a = holder;
+ id.setA(holder);
// The recordID could be negative if the duplicateCache is configured to not persist,
// -1 would mean null on this case
- id.b = recordID >= 0 ? recordID : null;
+ id.setB(recordID >= 0 ? recordID : null);
holder.pos = pos;
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -99,19 +99,19 @@
buffer.writeString(nodeID);
if (!exit)
{
- if (pair.a != null)
+ if (pair.getA() != null)
{
buffer.writeBoolean(true);
- pair.a.encode(buffer);
+ pair.getA().encode(buffer);
}
else
{
buffer.writeBoolean(false);
}
- if (pair.b != null)
+ if (pair.getB() != null)
{
buffer.writeBoolean(true);
- pair.b.encode(buffer);
+ pair.getB().encode(buffer);
}
else
{
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -113,19 +113,19 @@
buffer.writeLong(uniqueEventID);
if (!exit)
{
- if (pair.a != null)
+ if (pair.getA() != null)
{
buffer.writeBoolean(true);
- pair.a.encode(buffer);
+ pair.getA().encode(buffer);
}
else
{
buffer.writeBoolean(false);
}
- if (pair.b != null)
+ if (pair.getB() != null)
{
buffer.writeBoolean(true);
- pair.b.encode(buffer);
+ pair.getB().encode(buffer);
}
else
{
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompSession.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -205,8 +205,8 @@
if (pair != null)
{
- long consumerID = pair.a;
- int credits = pair.b;
+ long consumerID = pair.getA();
+ int credits = pair.getB();
if (this.consumerCredits != -1)
{
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -520,11 +520,11 @@
log.debug(this + "::NodeAnnounced, backup=" + backup + nodeID + connectorPair);
}
- TopologyMember newMember = new TopologyMember(connectorPair.a, connectorPair.b);
+ TopologyMember newMember = new TopologyMember(connectorPair.getA(), connectorPair.getB());
newMember.setUniqueEventID(uniqueEventID);
if (backup)
{
- topology.updateBackup(nodeID, new TopologyMember(connectorPair.a, connectorPair.b));
+ topology.updateBackup(nodeID, new TopologyMember(connectorPair.getA(), connectorPair.getB()));
}
else
{
@@ -541,8 +541,8 @@
sf.sendNodeAnnounce(localMember.getUniqueEventID(),
manager.getNodeId(),
false,
- localMember.getConnector().a,
- localMember.getConnector().b);
+ localMember.getConnector().getA(),
+ localMember.getConnector().getB());
// sf.sendNodeAnnounce(System.currentTimeMillis(),
// manager.getNodeId(),
@@ -743,7 +743,7 @@
}
// if the node is more than 1 hop away, we do not create a bridge for direct cluster connection
- if (allowDirectConnectionsOnly && !allowableConnections.contains(connectorPair.a))
+ if (allowDirectConnectionsOnly && !allowableConnections.contains(connectorPair.getA()))
{
return;
}
@@ -755,7 +755,7 @@
return;
}
/*we dont create bridges to backups*/
- if (connectorPair.a == null)
+ if (connectorPair.getA() == null)
{
if (isTrace)
{
@@ -801,7 +801,7 @@
queue = server.createQueue(queueName, queueName, null, true, false);
}
- createNewRecord(eventUID, nodeID, connectorPair.a, queueName, queue, true);
+ createNewRecord(eventUID, nodeID, connectorPair.getA(), queueName, queue, true);
}
else
{
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -1607,8 +1607,8 @@
{
log.info("Deleting pending large message as it wasn't completed:" + msgToDelete);
LargeServerMessage msg = storageManager.createLargeMessage();
- msg.setMessageID(msgToDelete.b);
- msg.setPendingRecordID(msgToDelete.a);
+ msg.setMessageID(msgToDelete.getB());
+ msg.setPendingRecordID(msgToDelete.getA());
msg.setDurable(true);
msg.deleteFile();
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -1239,7 +1239,7 @@
Pair<UUID, AtomicLong> value = targetAddressInfos.get(SimpleString.toSimpleString(address));
if (value != null)
{
- return value.a.toString();
+ return value.getA().toString();
}
else
{
@@ -1265,8 +1265,8 @@
producerInfo.put("connectionID", this.getConnectionID().toString());
producerInfo.put("sessionID", this.getName());
producerInfo.put("destination", entry.getKey().toString());
- producerInfo.put("lastUUIDSent", entry.getValue().a);
- producerInfo.put("msgSent", entry.getValue().b.longValue());
+ producerInfo.put("lastUUIDSent", entry.getValue().getA());
+ producerInfo.put("msgSent", entry.getValue().getB().longValue());
array.put(producerInfo);
}
}
@@ -1411,8 +1411,8 @@
}
else
{
- value.a = msg.getUserID();
- value.b.incrementAndGet();
+ value.setA(msg.getUserID());
+ value.getB().incrementAndGet();
}
routingContext.clear();
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -296,8 +296,8 @@
{
Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
.toString());
- clientID = pair.a;
- subName = pair.b;
+ clientID = pair.getA();
+ subName = pair.getB();
}
String filter = queue.getFilter() != null ? queue.getFilter() : null;
@@ -330,8 +330,8 @@
{
Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
.toString());
- clientID = pair.a;
- subName = pair.b;
+ clientID = pair.getA();
+ subName = pair.getB();
}
String filter = queue.getFilter() != null ? queue.getFilter() : null;
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/jms/server/config/impl/TransportConfigurationEncodingSupport.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -78,12 +78,12 @@
{
for (Pair<TransportConfiguration, TransportConfiguration> pair : configs)
{
- encode(buffer, pair.a);
- boolean backup = (pair.b != null);
+ encode(buffer, pair.getA());
+ boolean backup = (pair.getB() != null);
buffer.writeBoolean(backup);
if (backup)
{
- encode(buffer, pair.b);
+ encode(buffer, pair.getB());
}
}
}
@@ -122,11 +122,11 @@
{
for (Pair<TransportConfiguration, TransportConfiguration> pair : configs)
{
- size += getEncodeSize(pair.a);
+ size += getEncodeSize(pair.getA());
size += DataConstants.SIZE_BOOLEAN; // whether there is a backup config
- if (pair.b != null)
+ if (pair.getB() != null)
{
- size += getEncodeSize(pair.b);
+ size += getEncodeSize(pair.getB());
}
}
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -438,14 +438,14 @@
public void nodeUP(final long uniqueEventID, String nodeID, Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean last)
{
- if (connectorPair.a != null && !liveNode.contains(connectorPair.a.getName()))
+ if (connectorPair.getA() != null && !liveNode.contains(connectorPair.getA().getName()))
{
- liveNode.add(connectorPair.a.getName());
+ liveNode.add(connectorPair.getA().getName());
latch.countDown();
}
- if (connectorPair.b != null && !backupNode.contains(connectorPair.b.getName()))
+ if (connectorPair.getB() != null && !backupNode.contains(connectorPair.getB().getName()))
{
- backupNode.add(connectorPair.b.getName());
+ backupNode.add(connectorPair.getB().getName());
latch.countDown();
}
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -236,14 +236,14 @@
Pair<TransportConfiguration, TransportConfiguration> connectorPair,
boolean last)
{
- if (connectorPair.a != null && !liveNode.contains(connectorPair.a.getName()))
+ if (connectorPair.getA() != null && !liveNode.contains(connectorPair.getA().getName()))
{
- liveNode.add(connectorPair.a.getName());
+ liveNode.add(connectorPair.getA().getName());
latch.countDown();
}
- if (connectorPair.b != null && !backupNode.contains(connectorPair.b.getName()))
+ if (connectorPair.getB() != null && !backupNode.contains(connectorPair.getB().getName()))
{
- backupNode.add(connectorPair.b.getName());
+ backupNode.add(connectorPair.getB().getName());
latch.countDown();
}
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -300,14 +300,14 @@
Pair<TransportConfiguration, TransportConfiguration> connectorPair,
boolean last)
{
- if (connectorPair.a != null && !liveNode.contains(connectorPair.a.getName()))
+ if (connectorPair.getA() != null && !liveNode.contains(connectorPair.getA().getName()))
{
- liveNode.add(connectorPair.a.getName());
+ liveNode.add(connectorPair.getA().getName());
latch.countDown();
}
- if (connectorPair.b != null && !backupNode.contains(connectorPair.b.getName()))
+ if (connectorPair.getB() != null && !backupNode.contains(connectorPair.getB().getName()))
{
- backupNode.add(connectorPair.b.getName());
+ backupNode.add(connectorPair.getB().getName());
latch.countDown();
}
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -125,8 +125,8 @@
for (Pair<String, String> rename : renamesRead)
{
Pair<String, String> original = iterRename.next();
- Assert.assertEquals(original.a, rename.a);
- Assert.assertEquals(original.b, rename.b);
+ Assert.assertEquals(original.getA(), rename.getA());
+ Assert.assertEquals(original.getB(), rename.getB());
}
Assert.assertFalse(iterNewFiles.hasNext());
@@ -720,20 +720,20 @@
{
if (postXA)
{
- prepare(tx.a, new SimpleEncoding(10, (byte)0));
+ prepare(tx.getA(), new SimpleEncoding(10, (byte)0));
}
- if (tx.a % 2 == 0)
+ if (tx.getA() % 2 == 0)
{
- commit(tx.a);
+ commit(tx.getA());
if (deleteTransactRecords)
{
- delete(tx.b);
+ delete(tx.getB());
}
}
else
{
- rollback(tx.a);
+ rollback(tx.getA());
}
}
}
@@ -762,20 +762,20 @@
{
if (postXA)
{
- prepare(tx.a, new SimpleEncoding(10, (byte)0));
+ prepare(tx.getA(), new SimpleEncoding(10, (byte)0));
}
- if (tx.a % 2 == 0)
+ if (tx.getA() % 2 == 0)
{
- commit(tx.a);
+ commit(tx.getA());
if (deleteTransactRecords)
{
- delete(tx.b);
+ delete(tx.getB());
}
}
else
{
- rollback(tx.a);
+ rollback(tx.getA());
}
}
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java 2011-10-11 01:35:33 UTC (rev 11509)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/persistence/TransportConfigurationEncodingSupportTest.java 2011-10-11 16:49:21 UTC (rev 11510)
@@ -100,10 +100,10 @@
assertNotNull(decodedConfigs);
assertEquals(2, decodedConfigs.size());
- assertEquivalent(connectorConfigs.get(0).a, decodedConfigs.get(0).a);
- assertEquivalent(connectorConfigs.get(0).b, decodedConfigs.get(0).b);
- assertEquivalent(connectorConfigs.get(1).a, decodedConfigs.get(1).a);
- assertNull(decodedConfigs.get(1).b);
+ assertEquivalent(connectorConfigs.get(0).getA(), decodedConfigs.get(0).getA());
+ assertEquivalent(connectorConfigs.get(0).getB(), decodedConfigs.get(0).getB());
+ assertEquivalent(connectorConfigs.get(1).getA(), decodedConfigs.get(1).getA());
+ assertNull(decodedConfigs.get(1).getB());
}
// decoded TransportConfiguration have parameter values as String instead of primitive type
13 years, 2 months
JBoss hornetq SVN: r11509 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/client and 4 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-10 21:35:33 -0400 (Mon, 10 Oct 2011)
New Revision: 11509
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/ServiceTestBase.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
removing duplicate method on testsuite
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -2097,6 +2097,7 @@
}
}
+
/** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
* utility class, as it would be a door to load anything you like in a safe VM.
* For that reason any class trying to do a privileged block should do with the AccessController directly.
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -82,7 +82,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -116,7 +116,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -150,7 +150,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -188,7 +188,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -228,7 +228,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
session.close();
@@ -293,7 +293,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -65,7 +65,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -95,7 +95,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(5000);
@@ -132,7 +132,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
final CountDownLatch latch = new CountDownLatch(2);
TestHandler handler = new TestHandler(latch, clientSession);
@@ -189,7 +189,7 @@
clientSession.createQueue(dla, dlq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -223,7 +223,7 @@
server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -258,7 +258,7 @@
for (int i = 0; i < NUM_MESSAGES; i++)
{
- ClientMessage tm = createTextMessage("Message:" + i, clientSession);
+ ClientMessage tm = createTextMessage(clientSession, "Message:" + i);
producer.send(tm);
}
@@ -339,7 +339,7 @@
clientSession.createQueue(deadLetterAdress, deadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
producer.send(clientMessage);
clientSession.start();
@@ -381,7 +381,7 @@
clientSession.createQueue(deadLetterAdress, deadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
producer.send(clientMessage);
clientSession.start();
@@ -430,7 +430,7 @@
clientSession.createQueue(specificDeadLetterAddress, specificDeadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
producer.send(clientMessage);
clientSession.start();
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -53,7 +53,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -84,7 +84,7 @@
clientSession.createQueue(ea, eq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -136,7 +136,7 @@
clientSession.createQueue(ea, eq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
clientSession.start();
@@ -167,7 +167,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < NUM_MESSAGES; i++)
{
- ClientMessage tm = createTextMessage("Message:" + i, clientSession);
+ ClientMessage tm = createTextMessage(clientSession, "Message:" + i);
tm.setExpiration(expiration);
producer.send(tm);
}
@@ -212,7 +212,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -241,7 +241,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -279,7 +279,7 @@
clientSession.createQueue(specificExpiryAddress, specificExpiryQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -75,7 +75,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -64,7 +64,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
clientProducer.send(message);
}
CountDownLatch latch = new CountDownLatch(numMessages);
@@ -91,7 +91,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
clientProducer.send(message);
clientProducer2.send(message);
clientProducer3.send(message);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -99,7 +99,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
clientProducer.send(message);
}
@@ -131,7 +131,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -174,7 +174,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -222,7 +222,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -283,7 +283,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -358,7 +358,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -419,7 +419,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -493,7 +493,7 @@
int numMessages = 4;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -74,7 +74,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -135,7 +135,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
@@ -237,7 +237,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -325,7 +325,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -72,7 +72,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = createTextMessage(session, Integer.toString(i));
m.setPriority((byte)i);
producer.send(m);
}
@@ -114,7 +114,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = createTextMessage(session, Integer.toString(i));
m.setPriority((byte)i);
producer.send(m);
}
@@ -153,28 +153,28 @@
// 3 7
// 3 3
// 1 9
- messages[0] = createTextMessage("a", session);
+ messages[0] = createTextMessage(session, "a");
messages[0].setPriority((byte)0);
- messages[1] = createTextMessage("b", session);
+ messages[1] = createTextMessage(session, "b");
messages[1].setPriority((byte)0);
- messages[2] = createTextMessage("c", session);
+ messages[2] = createTextMessage(session, "c");
messages[2].setPriority((byte)0);
- messages[3] = createTextMessage("d", session);
+ messages[3] = createTextMessage(session, "d");
messages[3].setPriority((byte)7);
- messages[4] = createTextMessage("e", session);
+ messages[4] = createTextMessage(session, "e");
messages[4].setPriority((byte)7);
- messages[5] = createTextMessage("f", session);
+ messages[5] = createTextMessage(session, "f");
messages[5].setPriority((byte)7);
- messages[6] = createTextMessage("g", session);
+ messages[6] = createTextMessage(session, "g");
messages[6].setPriority((byte)3);
- messages[7] = createTextMessage("h", session);
+ messages[7] = createTextMessage(session, "h");
messages[7].setPriority((byte)3);
- messages[8] = createTextMessage("i", session);
+ messages[8] = createTextMessage(session, "i");
messages[8].setPriority((byte)3);
- messages[9] = createTextMessage("j", session);
+ messages[9] = createTextMessage(session, "j");
messages[9].setPriority((byte)9);
for (int i = 0; i < 10; i++)
@@ -222,7 +222,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = createTextMessage(session, Integer.toString(i));
m.setPriority((byte)i);
producer.send(m);
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -51,7 +51,7 @@
SimpleString dlq = new SimpleString("DLQ1");
clientSession.createQueue(dla, dlq, null, false);
ClientProducer producer = clientSession.createProducer(address);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(dlq);
ClientMessage m = clientConsumer.receive(500);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -77,7 +77,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -124,7 +124,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("x"), i);
producer.send(message);
}
@@ -172,7 +172,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
if (i % 2 == 0)
{
message.putStringProperty(new SimpleString("color"), new SimpleString("RED"));
@@ -210,7 +210,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -248,7 +248,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("x"), i);
producer.send(message);
}
@@ -303,7 +303,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -338,7 +338,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -247,7 +247,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -74,7 +74,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -118,7 +118,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -165,7 +165,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -255,7 +255,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -353,7 +353,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -455,7 +455,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -572,7 +572,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -625,7 +625,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -666,7 +666,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -49,8 +49,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -74,8 +74,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -107,8 +107,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -148,8 +148,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -177,8 +177,8 @@
clientSession.createQueue(addressAB, queueName1, null, false);
clientSession.createQueue(addressAC, queueName2, null, false);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -209,8 +209,8 @@
clientSession.deleteQueue(queueName1);
// the wildcard binding should still exist
Assert.assertEquals(server.getPostOffice().getBindingsForAddress(addressAB).getBindings().size(), 1);
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -259,15 +259,15 @@
ClientProducer producer = clientSession.createProducer();
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(addressAB, createTextMessage("m1", clientSession));
- producer.send(addressAC, createTextMessage("m2", clientSession));
- producer.send(addressAD, createTextMessage("m3", clientSession));
- producer.send(addressAE, createTextMessage("m4", clientSession));
- producer.send(addressAF, createTextMessage("m5", clientSession));
- producer.send(addressAG, createTextMessage("m6", clientSession));
- producer.send(addressAH, createTextMessage("m7", clientSession));
- producer.send(addressAJ, createTextMessage("m8", clientSession));
- producer.send(addressAK, createTextMessage("m9", clientSession));
+ producer.send(addressAB, createTextMessage(clientSession, "m1"));
+ producer.send(addressAC, createTextMessage(clientSession, "m2"));
+ producer.send(addressAD, createTextMessage(clientSession, "m3"));
+ producer.send(addressAE, createTextMessage(clientSession, "m4"));
+ producer.send(addressAF, createTextMessage(clientSession, "m5"));
+ producer.send(addressAG, createTextMessage(clientSession, "m6"));
+ producer.send(addressAH, createTextMessage(clientSession, "m7"));
+ producer.send(addressAJ, createTextMessage(clientSession, "m8"));
+ producer.send(addressAK, createTextMessage(clientSession, "m9"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
@@ -356,15 +356,15 @@
ClientProducer producer = clientSession.createProducer();
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(addressAB, createTextMessage("m1", clientSession));
- producer.send(addressAC, createTextMessage("m2", clientSession));
- producer.send(addressAD, createTextMessage("m3", clientSession));
- producer.send(addressAE, createTextMessage("m4", clientSession));
- producer.send(addressAF, createTextMessage("m5", clientSession));
- producer.send(addressAG, createTextMessage("m6", clientSession));
- producer.send(addressAH, createTextMessage("m7", clientSession));
- producer.send(addressAJ, createTextMessage("m8", clientSession));
- producer.send(addressAK, createTextMessage("m9", clientSession));
+ producer.send(addressAB, createTextMessage(clientSession, "m1"));
+ producer.send(addressAC, createTextMessage(clientSession, "m2"));
+ producer.send(addressAD, createTextMessage(clientSession, "m3"));
+ producer.send(addressAE, createTextMessage(clientSession, "m4"));
+ producer.send(addressAF, createTextMessage(clientSession, "m5"));
+ producer.send(addressAG, createTextMessage(clientSession, "m6"));
+ producer.send(addressAH, createTextMessage(clientSession, "m7"));
+ producer.send(addressAJ, createTextMessage(clientSession, "m8"));
+ producer.send(addressAK, createTextMessage(clientSession, "m9"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
@@ -433,8 +433,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -462,8 +462,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -492,8 +492,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -521,8 +521,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -550,8 +550,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -575,8 +575,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -602,8 +602,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m2", m.getBodyBuffer().readString());
@@ -627,8 +627,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m2", m.getBodyBuffer().readString());
@@ -652,8 +652,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -677,8 +677,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -702,8 +702,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -730,8 +730,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -59,7 +59,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
}
@@ -80,10 +80,10 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
- m = createTextMessage("m" + i, clientSession);
+ m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer2.send(m);
}
@@ -99,7 +99,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0)
{
m.setExpiration(expiration);
@@ -119,7 +119,7 @@
long expiration = System.currentTimeMillis() + 1000;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
}
@@ -151,7 +151,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
}
@@ -190,7 +190,7 @@
long sendMessagesUntil = System.currentTimeMillis() + 2000;
do
{
- ClientMessage m = createTextMessage("m" + numMessages++, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + numMessages++);
m.setExpiration(expiration);
producer.send(m);
Thread.sleep(100);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -55,13 +55,13 @@
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
clientSessionXa.start(xid, XAResource.TMNOFLAGS);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -94,22 +94,22 @@
ClientConsumer consumer = clientSessionXa.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSessionXa.start(xid, XAResource.TMNOFLAGS);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -50,10 +50,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -70,13 +70,13 @@
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -97,10 +97,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
clientSession.start();
@@ -119,10 +119,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
clientSession.start();
@@ -146,17 +146,17 @@
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
clientSession.start();
producer.send(m1);
@@ -198,10 +198,10 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -218,13 +218,13 @@
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -250,13 +250,13 @@
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -295,7 +295,7 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
producer.send(m1);
clientSessionTxReceives.start();
@@ -315,17 +315,17 @@
ClientProducer producer = clientSessionTxSends.createProducer(address);
ClientConsumer consumer = clientSessionTxSends.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -346,22 +346,22 @@
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
producer.send(m1);
@@ -384,22 +384,22 @@
ClientProducer producer = clientSessionTxSends.createProducer(address);
ClientConsumer consumer = clientSessionTxSends.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
producer.send(m1);
@@ -423,22 +423,22 @@
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSession.start();
@@ -479,22 +479,22 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSessionTxReceives.start();
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -76,7 +76,7 @@
session.createQueue(CoreClientOverSSLTest.QUEUE, CoreClientOverSSLTest.QUEUE, false);
ClientProducer producer = session.createProducer(CoreClientOverSSLTest.QUEUE);
- ClientMessage message = createTextMessage(text, session);
+ ClientMessage message = createTextMessage(session, text);
producer.send(message);
ClientConsumer consumer = session.createConsumer(CoreClientOverSSLTest.QUEUE);
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -131,10 +131,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
clientSession.setTransactionTimeout(1);
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
@@ -162,10 +162,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -232,14 +232,14 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
- ClientMessage m5 = createTextMessage("m5", clientSession);
- ClientMessage m6 = createTextMessage("m6", clientSession);
- ClientMessage m7 = createTextMessage("m7", clientSession);
- ClientMessage m8 = createTextMessage("m8", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
+ ClientMessage m7 = createTextMessage(clientSession, "m7");
+ ClientMessage m8 = createTextMessage(clientSession, "m8");
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -312,14 +312,14 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
- ClientMessage m5 = createTextMessage("m5", clientSession);
- ClientMessage m6 = createTextMessage("m6", clientSession);
- ClientMessage m7 = createTextMessage("m7", clientSession);
- ClientMessage m8 = createTextMessage("m8", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
+ ClientMessage m7 = createTextMessage(clientSession, "m7");
+ ClientMessage m8 = createTextMessage(clientSession, "m8");
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -387,10 +387,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
clientProducer.send(m2);
@@ -455,7 +455,7 @@
for (int i = 0; i < messages.length; i++)
{
- messages[i] = createTextMessage("m" + i, clientSession);
+ messages[i] = createTextMessage(clientSession, "m" + i);
}
for (int i = 0; i < clientSessions.length; i++)
{
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -49,7 +49,6 @@
import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.client.HornetQBytesMessage;
-import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.spi.core.security.HornetQSecurityManagerImpl;
import org.hornetq.utils.UUIDGenerator;
@@ -601,29 +600,12 @@
return (ClientSessionFactoryImpl)locator.createSessionFactory();
}
-
- protected ClientMessage createTextMessage(final ClientSession session, final String s)
- {
- return createTextMessage(session, s, true);
- }
-
public String getTextMessage(final ClientMessage m)
{
m.getBodyBuffer().resetReaderIndex();
return m.getBodyBuffer().readString();
}
- protected ClientMessage createTextMessage(final ClientSession session, final String s, final boolean durable)
- {
- ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- message.getBodyBuffer().writeString(s);
- return message;
- }
-
protected ClientMessage createBytesMessage(final ClientSession session, final byte[] b, final boolean durable)
{
ClientMessage message = session.createMessage(HornetQBytesMessage.TYPE,
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-10-11 01:35:10 UTC (rev 11508)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-10-11 01:35:33 UTC (rev 11509)
@@ -1272,18 +1272,19 @@
return (size / alignment + (size % alignment != 0 ? 1 : 0)) * alignment;
}
- protected ClientMessage createTextMessage(final String s, final ClientSession clientSession)
+ protected ClientMessage createTextMessage(final ClientSession session, final String s)
{
- return createTextMessage(s, true, clientSession);
+ return createTextMessage(session, s, true);
}
- protected ClientMessage createTextMessage(final String s, final boolean durable, final ClientSession clientSession)
+
+ protected ClientMessage createTextMessage(final ClientSession session, final String s, final boolean durable)
{
- ClientMessage message = clientSession.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)4);
+ ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
+ durable,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
message.getBodyBuffer().writeString(s);
return message;
}
13 years, 2 months
JBoss hornetq SVN: r11508 - in branches/Branch_2_2_AS7: tests/src/org/hornetq/tests/integration/client and 4 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-10 21:35:10 -0400 (Mon, 10 Oct 2011)
New Revision: 11508
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/ServiceTestBase.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
removing duplicate method on testsuite
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -2097,6 +2097,7 @@
}
}
+
/** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
* utility class, as it would be a door to load anything you like in a safe VM.
* For that reason any class trying to do a privileged block should do with the AccessController directly.
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -82,7 +82,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -116,7 +116,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -150,7 +150,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -188,7 +188,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -228,7 +228,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
session.close();
@@ -293,7 +293,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -65,7 +65,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -95,7 +95,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(5000);
@@ -132,7 +132,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
final CountDownLatch latch = new CountDownLatch(2);
TestHandler handler = new TestHandler(latch, clientSession);
@@ -189,7 +189,7 @@
clientSession.createQueue(dla, dlq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -223,7 +223,7 @@
server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -258,7 +258,7 @@
for (int i = 0; i < NUM_MESSAGES; i++)
{
- ClientMessage tm = createTextMessage("Message:" + i, clientSession);
+ ClientMessage tm = createTextMessage(clientSession, "Message:" + i);
producer.send(tm);
}
@@ -339,7 +339,7 @@
clientSession.createQueue(deadLetterAdress, deadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
producer.send(clientMessage);
clientSession.start();
@@ -381,7 +381,7 @@
clientSession.createQueue(deadLetterAdress, deadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
producer.send(clientMessage);
clientSession.start();
@@ -430,7 +430,7 @@
clientSession.createQueue(specificDeadLetterAddress, specificDeadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
producer.send(clientMessage);
clientSession.start();
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -53,7 +53,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -84,7 +84,7 @@
clientSession.createQueue(ea, eq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -136,7 +136,7 @@
clientSession.createQueue(ea, eq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
clientSession.start();
@@ -167,7 +167,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < NUM_MESSAGES; i++)
{
- ClientMessage tm = createTextMessage("Message:" + i, clientSession);
+ ClientMessage tm = createTextMessage(clientSession, "Message:" + i);
tm.setExpiration(expiration);
producer.send(tm);
}
@@ -212,7 +212,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -241,7 +241,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -279,7 +279,7 @@
clientSession.createQueue(specificExpiryAddress, specificExpiryQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
+ ClientMessage clientMessage = createTextMessage(clientSession, "heyho!");
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -75,7 +75,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -64,7 +64,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
clientProducer.send(message);
}
CountDownLatch latch = new CountDownLatch(numMessages);
@@ -91,7 +91,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
clientProducer.send(message);
clientProducer2.send(message);
clientProducer3.send(message);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -99,7 +99,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
clientProducer.send(message);
}
@@ -131,7 +131,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -174,7 +174,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -222,7 +222,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -283,7 +283,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -358,7 +358,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -419,7 +419,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -493,7 +493,7 @@
int numMessages = 4;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -74,7 +74,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -135,7 +135,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
@@ -237,7 +237,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -325,7 +325,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -72,7 +72,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = createTextMessage(session, Integer.toString(i));
m.setPriority((byte)i);
producer.send(m);
}
@@ -114,7 +114,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = createTextMessage(session, Integer.toString(i));
m.setPriority((byte)i);
producer.send(m);
}
@@ -153,28 +153,28 @@
// 3 7
// 3 3
// 1 9
- messages[0] = createTextMessage("a", session);
+ messages[0] = createTextMessage(session, "a");
messages[0].setPriority((byte)0);
- messages[1] = createTextMessage("b", session);
+ messages[1] = createTextMessage(session, "b");
messages[1].setPriority((byte)0);
- messages[2] = createTextMessage("c", session);
+ messages[2] = createTextMessage(session, "c");
messages[2].setPriority((byte)0);
- messages[3] = createTextMessage("d", session);
+ messages[3] = createTextMessage(session, "d");
messages[3].setPriority((byte)7);
- messages[4] = createTextMessage("e", session);
+ messages[4] = createTextMessage(session, "e");
messages[4].setPriority((byte)7);
- messages[5] = createTextMessage("f", session);
+ messages[5] = createTextMessage(session, "f");
messages[5].setPriority((byte)7);
- messages[6] = createTextMessage("g", session);
+ messages[6] = createTextMessage(session, "g");
messages[6].setPriority((byte)3);
- messages[7] = createTextMessage("h", session);
+ messages[7] = createTextMessage(session, "h");
messages[7].setPriority((byte)3);
- messages[8] = createTextMessage("i", session);
+ messages[8] = createTextMessage(session, "i");
messages[8].setPriority((byte)3);
- messages[9] = createTextMessage("j", session);
+ messages[9] = createTextMessage(session, "j");
messages[9].setPriority((byte)9);
for (int i = 0; i < 10; i++)
@@ -222,7 +222,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = createTextMessage(session, Integer.toString(i));
m.setPriority((byte)i);
producer.send(m);
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -51,7 +51,7 @@
SimpleString dlq = new SimpleString("DLQ1");
clientSession.createQueue(dla, dlq, null, false);
ClientProducer producer = clientSession.createProducer(address);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(createTextMessage(clientSession, "heyho!"));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(dlq);
ClientMessage m = clientConsumer.receive(500);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -77,7 +77,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -124,7 +124,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("x"), i);
producer.send(message);
}
@@ -172,7 +172,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
if (i % 2 == 0)
{
message.putStringProperty(new SimpleString("color"), new SimpleString("RED"));
@@ -210,7 +210,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -248,7 +248,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("x"), i);
producer.send(message);
}
@@ -303,7 +303,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
@@ -338,7 +338,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -247,7 +247,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
producer.send(message);
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -74,7 +74,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -118,7 +118,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -165,7 +165,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -255,7 +255,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -353,7 +353,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -455,7 +455,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -572,7 +572,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -625,7 +625,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -666,7 +666,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = createTextMessage(session, "m" + i);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -49,8 +49,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -74,8 +74,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -107,8 +107,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -148,8 +148,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -177,8 +177,8 @@
clientSession.createQueue(addressAB, queueName1, null, false);
clientSession.createQueue(addressAC, queueName2, null, false);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -209,8 +209,8 @@
clientSession.deleteQueue(queueName1);
// the wildcard binding should still exist
Assert.assertEquals(server.getPostOffice().getBindingsForAddress(addressAB).getBindings().size(), 1);
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -259,15 +259,15 @@
ClientProducer producer = clientSession.createProducer();
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(addressAB, createTextMessage("m1", clientSession));
- producer.send(addressAC, createTextMessage("m2", clientSession));
- producer.send(addressAD, createTextMessage("m3", clientSession));
- producer.send(addressAE, createTextMessage("m4", clientSession));
- producer.send(addressAF, createTextMessage("m5", clientSession));
- producer.send(addressAG, createTextMessage("m6", clientSession));
- producer.send(addressAH, createTextMessage("m7", clientSession));
- producer.send(addressAJ, createTextMessage("m8", clientSession));
- producer.send(addressAK, createTextMessage("m9", clientSession));
+ producer.send(addressAB, createTextMessage(clientSession, "m1"));
+ producer.send(addressAC, createTextMessage(clientSession, "m2"));
+ producer.send(addressAD, createTextMessage(clientSession, "m3"));
+ producer.send(addressAE, createTextMessage(clientSession, "m4"));
+ producer.send(addressAF, createTextMessage(clientSession, "m5"));
+ producer.send(addressAG, createTextMessage(clientSession, "m6"));
+ producer.send(addressAH, createTextMessage(clientSession, "m7"));
+ producer.send(addressAJ, createTextMessage(clientSession, "m8"));
+ producer.send(addressAK, createTextMessage(clientSession, "m9"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
@@ -356,15 +356,15 @@
ClientProducer producer = clientSession.createProducer();
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(addressAB, createTextMessage("m1", clientSession));
- producer.send(addressAC, createTextMessage("m2", clientSession));
- producer.send(addressAD, createTextMessage("m3", clientSession));
- producer.send(addressAE, createTextMessage("m4", clientSession));
- producer.send(addressAF, createTextMessage("m5", clientSession));
- producer.send(addressAG, createTextMessage("m6", clientSession));
- producer.send(addressAH, createTextMessage("m7", clientSession));
- producer.send(addressAJ, createTextMessage("m8", clientSession));
- producer.send(addressAK, createTextMessage("m9", clientSession));
+ producer.send(addressAB, createTextMessage(clientSession, "m1"));
+ producer.send(addressAC, createTextMessage(clientSession, "m2"));
+ producer.send(addressAD, createTextMessage(clientSession, "m3"));
+ producer.send(addressAE, createTextMessage(clientSession, "m4"));
+ producer.send(addressAF, createTextMessage(clientSession, "m5"));
+ producer.send(addressAG, createTextMessage(clientSession, "m6"));
+ producer.send(addressAH, createTextMessage(clientSession, "m7"));
+ producer.send(addressAJ, createTextMessage(clientSession, "m8"));
+ producer.send(addressAK, createTextMessage(clientSession, "m9"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
@@ -433,8 +433,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -462,8 +462,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -492,8 +492,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -521,8 +521,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -550,8 +550,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -575,8 +575,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -602,8 +602,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m2", m.getBodyBuffer().readString());
@@ -627,8 +627,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m2", m.getBodyBuffer().readString());
@@ -652,8 +652,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -677,8 +677,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -702,8 +702,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -730,8 +730,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(createTextMessage(clientSession, "m1"));
+ producer2.send(createTextMessage(clientSession, "m2"));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -59,7 +59,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
}
@@ -80,10 +80,10 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
- m = createTextMessage("m" + i, clientSession);
+ m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer2.send(m);
}
@@ -99,7 +99,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
if (i % 2 == 0)
{
m.setExpiration(expiration);
@@ -119,7 +119,7 @@
long expiration = System.currentTimeMillis() + 1000;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
}
@@ -151,7 +151,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + i);
m.setExpiration(expiration);
producer.send(m);
}
@@ -190,7 +190,7 @@
long sendMessagesUntil = System.currentTimeMillis() + 2000;
do
{
- ClientMessage m = createTextMessage("m" + numMessages++, clientSession);
+ ClientMessage m = createTextMessage(clientSession, "m" + numMessages++);
m.setExpiration(expiration);
producer.send(m);
Thread.sleep(100);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -55,13 +55,13 @@
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
clientSessionXa.start(xid, XAResource.TMNOFLAGS);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -94,22 +94,22 @@
ClientConsumer consumer = clientSessionXa.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSessionXa.start(xid, XAResource.TMNOFLAGS);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -50,10 +50,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -70,13 +70,13 @@
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -97,10 +97,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
clientSession.start();
@@ -119,10 +119,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
clientSession.start();
@@ -146,17 +146,17 @@
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
clientSession.start();
producer.send(m1);
@@ -198,10 +198,10 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -218,13 +218,13 @@
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -250,13 +250,13 @@
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -295,7 +295,7 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
producer.send(m1);
clientSessionTxReceives.start();
@@ -315,17 +315,17 @@
ClientProducer producer = clientSessionTxSends.createProducer(address);
ClientConsumer consumer = clientSessionTxSends.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -346,22 +346,22 @@
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
producer.send(m1);
@@ -384,22 +384,22 @@
ClientProducer producer = clientSessionTxSends.createProducer(address);
ClientConsumer consumer = clientSessionTxSends.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
producer.send(m1);
@@ -423,22 +423,22 @@
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSession.start();
@@ -479,22 +479,22 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSessionTxReceives.start();
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -76,7 +76,7 @@
session.createQueue(CoreClientOverSSLTest.QUEUE, CoreClientOverSSLTest.QUEUE, false);
ClientProducer producer = session.createProducer(CoreClientOverSSLTest.QUEUE);
- ClientMessage message = createTextMessage(text, session);
+ ClientMessage message = createTextMessage(session, text);
producer.send(message);
ClientConsumer consumer = session.createConsumer(CoreClientOverSSLTest.QUEUE);
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -131,10 +131,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
clientSession.setTransactionTimeout(1);
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
@@ -162,10 +162,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -232,14 +232,14 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
- ClientMessage m5 = createTextMessage("m5", clientSession);
- ClientMessage m6 = createTextMessage("m6", clientSession);
- ClientMessage m7 = createTextMessage("m7", clientSession);
- ClientMessage m8 = createTextMessage("m8", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
+ ClientMessage m7 = createTextMessage(clientSession, "m7");
+ ClientMessage m8 = createTextMessage(clientSession, "m8");
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -312,14 +312,14 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
- ClientMessage m5 = createTextMessage("m5", clientSession);
- ClientMessage m6 = createTextMessage("m6", clientSession);
- ClientMessage m7 = createTextMessage("m7", clientSession);
- ClientMessage m8 = createTextMessage("m8", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
+ ClientMessage m5 = createTextMessage(clientSession, "m5");
+ ClientMessage m6 = createTextMessage(clientSession, "m6");
+ ClientMessage m7 = createTextMessage(clientSession, "m7");
+ ClientMessage m8 = createTextMessage(clientSession, "m8");
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -387,10 +387,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m3 = createTextMessage(clientSession, "m3");
+ ClientMessage m4 = createTextMessage(clientSession, "m4");
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
clientProducer.send(m2);
@@ -455,7 +455,7 @@
for (int i = 0; i < messages.length; i++)
{
- messages[i] = createTextMessage("m" + i, clientSession);
+ messages[i] = createTextMessage(clientSession, "m" + i);
}
for (int i = 0; i < clientSessions.length; i++)
{
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -49,7 +49,6 @@
import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.client.HornetQBytesMessage;
-import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.spi.core.security.HornetQSecurityManagerImpl;
import org.hornetq.utils.UUIDGenerator;
@@ -601,29 +600,12 @@
return (ClientSessionFactoryImpl)locator.createSessionFactory();
}
-
- protected ClientMessage createTextMessage(final ClientSession session, final String s)
- {
- return createTextMessage(session, s, true);
- }
-
public String getTextMessage(final ClientMessage m)
{
m.getBodyBuffer().resetReaderIndex();
return m.getBodyBuffer().readString();
}
- protected ClientMessage createTextMessage(final ClientSession session, final String s, final boolean durable)
- {
- ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- message.getBodyBuffer().writeString(s);
- return message;
- }
-
protected ClientMessage createBytesMessage(final ClientSession session, final byte[] b, final boolean durable)
{
ClientMessage message = session.createMessage(HornetQBytesMessage.TYPE,
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-10-11 00:47:48 UTC (rev 11507)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-10-11 01:35:10 UTC (rev 11508)
@@ -1272,18 +1272,19 @@
return (size / alignment + (size % alignment != 0 ? 1 : 0)) * alignment;
}
- protected ClientMessage createTextMessage(final String s, final ClientSession clientSession)
+ protected ClientMessage createTextMessage(final ClientSession session, final String s)
{
- return createTextMessage(s, true, clientSession);
+ return createTextMessage(session, s, true);
}
- protected ClientMessage createTextMessage(final String s, final boolean durable, final ClientSession clientSession)
+
+ protected ClientMessage createTextMessage(final ClientSession session, final String s, final boolean durable)
{
- ClientMessage message = clientSession.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)4);
+ ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
+ durable,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
message.getBodyBuffer().writeString(s);
return message;
}
13 years, 2 months
JBoss hornetq SVN: r11507 - in branches/Branch_2_2_AS7: src/main/org/hornetq/core/remoting/impl/ssl and 5 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-10 20:47:48 -0400 (Mon, 10 Oct 2011)
New Revision: 11507
Removed:
branches/Branch_2_2_AS7/src/main/org/hornetq/utils/ClassloadingUtil.java
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/logging/Logger.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/utils/XMLUtil.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
Log:
removing ClassLoadUtil for security reasons
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/logging/Logger.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/logging/Logger.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/logging/Logger.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -13,13 +13,14 @@
package org.hornetq.core.logging;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.hornetq.core.logging.impl.JULLogDelegateFactory;
import org.hornetq.spi.core.logging.LogDelegate;
import org.hornetq.spi.core.logging.LogDelegateFactory;
-import org.hornetq.utils.ClassloadingUtil;
/**
*
@@ -81,7 +82,7 @@
if (className != null)
{
- delegateFactory = (LogDelegateFactory) ClassloadingUtil.safeInitNewInstance(className);
+ delegateFactory = (LogDelegateFactory) safeInitNewInstance(className);
}
else
{
@@ -200,5 +201,47 @@
{
delegate.trace(message, t);
}
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ * @param className
+ * @return
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = this.getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
+
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -18,8 +18,10 @@
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
+import java.security.AccessController;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
+import java.security.PrivilegedAction;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
@@ -30,8 +32,6 @@
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
-import org.hornetq.utils.ClassloadingUtil;
-
/**
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*
@@ -187,7 +187,7 @@
}
else
{
- URL url = ClassloadingUtil.findResource(storePath);
+ URL url = findResource(storePath);
if (url != null)
{
return url;
@@ -197,6 +197,41 @@
throw new Exception("Failed to find a store at " + storePath);
}
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static URL findResource(final String resourceName)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<URL>()
+ {
+ public URL run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+ }
+ catch (Throwable t)
+ {
+ }
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ return null;
+
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+
+ return null;
+ }
+ });
+ }
+
+
// Inner classes -------------------------------------------------
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -52,7 +52,6 @@
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
-import org.hornetq.utils.ClassloadingUtil;
import org.hornetq.utils.ConfigurationHelper;
import org.hornetq.utils.HornetQThreadFactory;
@@ -122,7 +121,7 @@
{
try
{
- interceptors.add((Interceptor) ClassloadingUtil.safeInitNewInstance(interceptorClass));
+ interceptors.add((Interceptor) safeInitNewInstance(interceptorClass));
}
catch (Exception e)
{
@@ -640,5 +639,45 @@
}
}
}
+
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
}
\ No newline at end of file
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -121,7 +121,6 @@
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.spi.core.security.HornetQSecurityManager;
-import org.hornetq.utils.ClassloadingUtil;
import org.hornetq.utils.ExecutorFactory;
import org.hornetq.utils.HornetQThreadFactory;
import org.hornetq.utils.OrderedExecutorFactory;
@@ -1754,7 +1753,7 @@
private Object instantiateInstance(final String className)
{
- return ClassloadingUtil.safeInitNewInstance(className);
+ return safeInitNewInstance(className);
}
private static ClassLoader getThisClassLoader()
@@ -2098,5 +2097,43 @@
}
}
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -14,6 +14,8 @@
package org.hornetq.jms.bridge.impl;
import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
@@ -54,7 +56,6 @@
import org.hornetq.jms.bridge.QualityOfServiceMode;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.jms.client.HornetQSession;
-import org.hornetq.utils.ClassloadingUtil;
/**
*
@@ -943,7 +944,7 @@
{
try
{
- Object o = ClassloadingUtil.safeInitNewInstance(transactionManagerLocatorClass);
+ Object o = safeInitNewInstance(transactionManagerLocatorClass);
Method m = o.getClass().getMethod(transactionManagerLocatorMethod);
tm = (TransactionManager)m.invoke(o);
}
@@ -2002,4 +2003,44 @@
}
}
}
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
}
Deleted: branches/Branch_2_2_AS7/src/main/org/hornetq/utils/ClassloadingUtil.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/utils/ClassloadingUtil.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/utils/ClassloadingUtil.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -1,79 +0,0 @@
-package org.hornetq.utils;
-
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
-* A ClassloadingUtil *
-* @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
-*/
-
-public class ClassloadingUtil
-{
- public static Object safeInitNewInstance(final String className)
- {
- return AccessController.doPrivileged(new PrivilegedAction<Object>()
- {
- public Object run()
- {
- ClassLoader loader = ClassloadingUtil.class.getClassLoader();
- try
- {
- Class<?> clazz = loader.loadClass(className);
- return clazz.newInstance();
- }
- catch (Throwable t)
- {
- try
- {
- loader = Thread.currentThread().getContextClassLoader();
- if (loader != null)
- return loader.loadClass(className).newInstance();
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- }
-
- throw new IllegalArgumentException("Could not find class " + className);
- }
- }
- });
- }
-
- public static URL findResource(final String resourceName)
- {
- return AccessController.doPrivileged(new PrivilegedAction<URL>()
- {
- public URL run()
- {
- ClassLoader loader = ClassloadingUtil.class.getClassLoader();
- try
- {
- URL resource = loader.getResource(resourceName);
- if (resource != null)
- return resource;
- }
- catch (Throwable t)
- {
- }
-
- loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
- return null;
-
- URL resource = loader.getResource(resourceName);
- if (resource != null)
- return resource;
-
- return null;
- }
- });
- }
-
-}
-
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/utils/XMLUtil.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/utils/XMLUtil.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/utils/XMLUtil.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -18,6 +18,8 @@
import java.io.StringReader;
import java.lang.reflect.Method;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.List;
@@ -481,7 +483,7 @@
{
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- Schema schema = factory.newSchema(ClassloadingUtil.findResource(schemaFile));
+ Schema schema = factory.newSchema(findResource(schemaFile));
Validator validator = schema.newValidator();
// validate the DOM tree
@@ -529,6 +531,40 @@
return nodes;
}
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static URL findResource(final String resourceName)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<URL>()
+ {
+ public URL run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+ }
+ catch (Throwable t)
+ {
+ }
+
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ return null;
+
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+
+ return null;
+ }
+ });
+ }
+
// Inner classes --------------------------------------------------------------------------------
}
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-11 00:40:11 UTC (rev 11506)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-11 00:47:48 UTC (rev 11507)
@@ -31,7 +31,7 @@
{
private static final Logger log = Logger.getLogger(NIOJournalImplTest.class);
- protected String journalDir = System.getProperty("user.home") + "/journal-test";
+ protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") + "/journal-test";
@Override
protected SequentialFileFactory getFileFactory() throws Exception
13 years, 2 months
JBoss hornetq SVN: r11506 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/remoting/impl/ssl and 5 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-10 20:40:11 -0400 (Mon, 10 Oct 2011)
New Revision: 11506
Removed:
branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
Log:
removing ClassLoadUtil for security reasons
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -13,13 +13,14 @@
package org.hornetq.core.logging;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.hornetq.core.logging.impl.JULLogDelegateFactory;
import org.hornetq.spi.core.logging.LogDelegate;
import org.hornetq.spi.core.logging.LogDelegateFactory;
-import org.hornetq.utils.ClassloadingUtil;
/**
*
@@ -81,7 +82,7 @@
if (className != null)
{
- delegateFactory = (LogDelegateFactory) ClassloadingUtil.safeInitNewInstance(className);
+ delegateFactory = (LogDelegateFactory) safeInitNewInstance(className);
}
else
{
@@ -200,5 +201,47 @@
{
delegate.trace(message, t);
}
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ * @param className
+ * @return
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = this.getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
+
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/impl/ssl/SSLSupport.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -18,8 +18,10 @@
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
+import java.security.AccessController;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
+import java.security.PrivilegedAction;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
@@ -30,8 +32,6 @@
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
-import org.hornetq.utils.ClassloadingUtil;
-
/**
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*
@@ -187,7 +187,7 @@
}
else
{
- URL url = ClassloadingUtil.findResource(storePath);
+ URL url = findResource(storePath);
if (url != null)
{
return url;
@@ -197,6 +197,41 @@
throw new Exception("Failed to find a store at " + storePath);
}
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static URL findResource(final String resourceName)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<URL>()
+ {
+ public URL run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+ }
+ catch (Throwable t)
+ {
+ }
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ return null;
+
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+
+ return null;
+ }
+ });
+ }
+
+
// Inner classes -------------------------------------------------
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -52,7 +52,6 @@
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
-import org.hornetq.utils.ClassloadingUtil;
import org.hornetq.utils.ConfigurationHelper;
import org.hornetq.utils.HornetQThreadFactory;
@@ -122,7 +121,7 @@
{
try
{
- interceptors.add((Interceptor) ClassloadingUtil.safeInitNewInstance(interceptorClass));
+ interceptors.add((Interceptor) safeInitNewInstance(interceptorClass));
}
catch (Exception e)
{
@@ -640,5 +639,45 @@
}
}
}
+
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
}
\ No newline at end of file
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -121,7 +121,6 @@
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.spi.core.security.HornetQSecurityManager;
-import org.hornetq.utils.ClassloadingUtil;
import org.hornetq.utils.ExecutorFactory;
import org.hornetq.utils.HornetQThreadFactory;
import org.hornetq.utils.OrderedExecutorFactory;
@@ -1754,7 +1753,7 @@
private Object instantiateInstance(final String className)
{
- return ClassloadingUtil.safeInitNewInstance(className);
+ return safeInitNewInstance(className);
}
private static ClassLoader getThisClassLoader()
@@ -2098,5 +2097,43 @@
}
}
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -14,6 +14,8 @@
package org.hornetq.jms.bridge.impl;
import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
@@ -54,7 +56,6 @@
import org.hornetq.jms.bridge.QualityOfServiceMode;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.jms.client.HornetQSession;
-import org.hornetq.utils.ClassloadingUtil;
/**
*
@@ -943,7 +944,7 @@
{
try
{
- Object o = ClassloadingUtil.safeInitNewInstance(transactionManagerLocatorClass);
+ Object o = safeInitNewInstance(transactionManagerLocatorClass);
Method m = o.getClass().getMethod(transactionManagerLocatorMethod);
tm = (TransactionManager)m.invoke(o);
}
@@ -2002,4 +2003,44 @@
}
}
}
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+
}
Deleted: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -1,79 +0,0 @@
-package org.hornetq.utils;
-
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
-* A ClassloadingUtil *
-* @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
-*/
-
-public class ClassloadingUtil
-{
- public static Object safeInitNewInstance(final String className)
- {
- return AccessController.doPrivileged(new PrivilegedAction<Object>()
- {
- public Object run()
- {
- ClassLoader loader = ClassloadingUtil.class.getClassLoader();
- try
- {
- Class<?> clazz = loader.loadClass(className);
- return clazz.newInstance();
- }
- catch (Throwable t)
- {
- try
- {
- loader = Thread.currentThread().getContextClassLoader();
- if (loader != null)
- return loader.loadClass(className).newInstance();
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- }
-
- throw new IllegalArgumentException("Could not find class " + className);
- }
- }
- });
- }
-
- public static URL findResource(final String resourceName)
- {
- return AccessController.doPrivileged(new PrivilegedAction<URL>()
- {
- public URL run()
- {
- ClassLoader loader = ClassloadingUtil.class.getClassLoader();
- try
- {
- URL resource = loader.getResource(resourceName);
- if (resource != null)
- return resource;
- }
- catch (Throwable t)
- {
- }
-
- loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
- return null;
-
- URL resource = loader.getResource(resourceName);
- if (resource != null)
- return resource;
-
- return null;
- }
- });
- }
-
-}
-
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/XMLUtil.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -18,6 +18,8 @@
import java.io.StringReader;
import java.lang.reflect.Method;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.List;
@@ -481,7 +483,7 @@
{
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- Schema schema = factory.newSchema(ClassloadingUtil.findResource(schemaFile));
+ Schema schema = factory.newSchema(findResource(schemaFile));
Validator validator = schema.newValidator();
// validate the DOM tree
@@ -529,6 +531,40 @@
return nodes;
}
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static URL findResource(final String resourceName)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<URL>()
+ {
+ public URL run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+ }
+ catch (Throwable t)
+ {
+ }
+
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ return null;
+
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+
+ return null;
+ }
+ });
+ }
+
// Inner classes --------------------------------------------------------------------------------
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-10 16:40:42 UTC (rev 11505)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-11 00:40:11 UTC (rev 11506)
@@ -31,7 +31,7 @@
{
private static final Logger log = Logger.getLogger(NIOJournalImplTest.class);
- protected String journalDir = System.getProperty("user.home") + "/journal-test";
+ protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") + "/journal-test";
@Override
protected SequentialFileFactory getFileFactory() throws Exception
13 years, 2 months
JBoss hornetq SVN: r11505 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-10 12:40:42 -0400 (Mon, 10 Oct 2011)
New Revision: 11505
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
Log:
I see dead imports!
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-10-10 14:50:09 UTC (rev 11504)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-10-10 16:40:42 UTC (rev 11505)
@@ -25,10 +25,9 @@
import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.ClientProducer;
-import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.ClientSession.BindingQuery;
import org.hornetq.api.core.client.SendAcknowledgementHandler;
import org.hornetq.api.core.client.SessionFailureListener;
-import org.hornetq.api.core.client.ClientSession.BindingQuery;
import org.hornetq.api.core.management.NotificationType;
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
import org.hornetq.core.client.impl.ClientSessionInternal;
@@ -47,7 +46,6 @@
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.utils.ConcurrentHashSet;
import org.hornetq.utils.Future;
import org.hornetq.utils.TypedProperties;
import org.hornetq.utils.UUID;
13 years, 2 months
JBoss hornetq SVN: r11504 - branches/STOMP11/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-10-10 10:50:09 -0400 (Mon, 10 Oct 2011)
New Revision: 11504
Modified:
branches/STOMP11/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java
Log:
synchronize on server message as its buffer cannot be read concurrently.
Modified: branches/STOMP11/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java
===================================================================
--- branches/STOMP11/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java 2011-10-10 13:35:57 UTC (rev 11503)
+++ branches/STOMP11/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java 2011-10-10 14:50:09 UTC (rev 11504)
@@ -322,6 +322,10 @@
{
frame.addHeader(Stomp.Headers.Message.SUBSCRIPTION, subscription.getID());
}
+
+ synchronized(serverMessage)
+ {
+
HornetQBuffer buffer = serverMessage.getBodyBuffer();
int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer.writerIndex()
@@ -352,6 +356,7 @@
serverMessage.getBodyBuffer().resetReaderIndex();
StompUtils.copyStandardHeadersFromMessageToFrame(serverMessage, frame, deliveryCount);
+ }
return frame;
13 years, 2 months
JBoss hornetq SVN: r11503 - in branches/HORNETQ-720_Replication: hornetq-core/src/main/java/org/hornetq/core/server/impl and 5 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-10-10 09:35:57 -0400 (Mon, 10 Oct 2011)
New Revision: 11503
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalBase.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
Log:
HORNETQ-720 JournalWrapper to always manipulate files through wrapped JournalImpl
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -26,7 +26,6 @@
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.TransactionFailureCallback;
import org.hornetq.core.journal.impl.JournalFile;
-import org.hornetq.core.journal.impl.JournalFilesRepository;
import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.persistence.OperationContext;
@@ -616,13 +615,6 @@
throw new UnsupportedOperationException();
}
- @Override
- public JournalFilesRepository getFilesRepository()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
public int getFileSize()
{
return localJournal.getFileSize();
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -317,6 +317,11 @@
}
filesReservedForSync.clear();
+ for (Journal j : journals)
+ {
+ if (j instanceof FileWrapperJournal)
+ j.stop();
+ }
pageManager.stop();
// Storage needs to be the last to stop
@@ -363,7 +368,6 @@
"Backup node can't connect to the live node as the data differs");
}
}
-
}
/**
@@ -411,8 +415,9 @@
}
// files should be already in place.
filesReservedForSync.remove(jc);
- getJournal(jc.typeByte).stop();
registerJournal(jc.typeByte, journal);
+ journal.stop();
+ journal.start();
journal.loadInternalOnly();
}
finally
@@ -540,23 +545,23 @@
return;
}
-
final Journal journal = journalsHolder.get(packet.getJournalContentType());
synchronized (this)
{
if (!started)
return;
- Map<Long, JournalSyncFile> mapToFill = filesReservedForSync.get(packet.getJournalContentType());
+ Map<Long, JournalSyncFile> mapToFill = filesReservedForSync.get(packet.getJournalContentType());
log.info("Journal " + packet.getJournalContentType() + ". Reserving fileIDs for synchronization: " +
Arrays.toString(packet.getFileIds()));
- for (Entry<Long, JournalFile> entry : journal.createFilesForBackupSync(packet.getFileIds()).entrySet())
- {
- mapToFill.put(entry.getKey(), new JournalSyncFile(entry.getValue()));
+ for (Entry<Long, JournalFile> entry : journal.createFilesForBackupSync(packet.getFileIds()).entrySet())
+ {
+ mapToFill.put(entry.getKey(), new JournalSyncFile(entry.getValue()));
+ }
+ FileWrapperJournal syncJournal = new FileWrapperJournal(journal);
+ registerJournal(packet.getJournalContentType().typeByte, syncJournal);
}
- registerJournal(packet.getJournalContentType().typeByte, new FileWrapperJournal(journal));
- }
- }
+ }
private void handleLargeMessageEnd(final ReplicationLargeMessageEndMessage packet)
{
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -470,8 +470,8 @@
{
SequentialFile file = jf.getFile().copy();
try {
- log.info("Replication: sending " + jf + " (size=" + file.size() + ") to backup. " + file);
- sendLargeFile(content, null, jf.getFileID(), file, Long.MAX_VALUE);
+ log.info("Replication: sending " + jf + " (size=" + file.size() + ") to backup. " + file);
+ sendLargeFile(content, null, jf.getFileID(), file, Long.MAX_VALUE);
}
finally
{
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -215,8 +215,8 @@
private final Map<String, ServerSession> sessions = new ConcurrentHashMap<String, ServerSession>();
private final Object initialiseLock = new Object();
-
private boolean initialised;
+ private final Object startUpLock = new Object();
/**
* Only applicable to 'remote backup servers'. If this flag is false the backup may not become
@@ -602,8 +602,6 @@
serverLocator.close();
replicationEndpoint.stop();
- if (!started)
- return;
if (!isRemoteBackupUpToDate())
{
/*
@@ -614,16 +612,20 @@
}
configuration.setBackup(false);
- storageManager.start();
+ synchronized (startUpLock)
+ {
+ if (!started)
+ return;
+ storageManager.start();
+ initialisePart2();
+ clusterManager.activate();
+ }
- initialisePart2();
- clusterManager.activate();
-
}
catch (Exception e)
{
- if (e instanceof InterruptedException && !started)
- // do not log errors if the server is being stopped.
+ if ((e instanceof InterruptedException || e instanceof IllegalStateException) && !started)
+ // do not log these errors if the server is being stopped.
return;
log.error("Failure in initialisation", e);
e.printStackTrace();
@@ -796,6 +798,9 @@
synchronized (this)
{
+ synchronized (startUpLock)
+ {
+
// Stop the deployers
if (configuration.isFileDeploymentEnabled())
{
@@ -917,6 +922,8 @@
started = false;
initialised = false;
+ }
+
// to display in the log message
SimpleString tempNodeID = getNodeID();
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -17,7 +17,6 @@
import java.util.Map;
import org.hornetq.core.journal.impl.JournalFile;
-import org.hornetq.core.journal.impl.JournalFilesRepository;
import org.hornetq.core.server.HornetQComponent;
/**
@@ -181,7 +180,5 @@
SequentialFileFactory getFileFactory();
- JournalFilesRepository getFilesRepository();
-
int getFileSize();
}
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -15,7 +15,6 @@
import org.hornetq.core.journal.LoaderCallback;
import org.hornetq.core.journal.PreparedTransactionInfo;
import org.hornetq.core.journal.RecordInfo;
-import org.hornetq.core.journal.SequentialFile;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.TransactionFailureCallback;
import org.hornetq.core.journal.impl.dataformat.JournalAddRecord;
@@ -34,9 +33,10 @@
public class FileWrapperJournal extends JournalBase implements Journal
{
private final ReentrantLock lockAppend = new ReentrantLock();
- // private final ReadWriteLock journalLock = new ReentrantReadWriteLock();
private final ConcurrentMap<Long, AtomicInteger> transactions = new ConcurrentHashMap<Long, AtomicInteger>();
+ private final JournalImpl journal;
+ protected volatile JournalFile currentFile;
/**
* @param journal
@@ -44,24 +44,21 @@
*/
public FileWrapperJournal(Journal journal) throws Exception
{
- super(journal.getFileFactory(), journal.getFilesRepository(), journal.getFileSize());
- setUpCurrentFile(JournalImpl.SIZE_HEADER);
+ super(journal.getFileFactory().isSupportsCallbacks(), journal.getFileSize());
+ this.journal = (JournalImpl)journal;
+ currentFile = this.journal.setUpCurrentFile(JournalImpl.SIZE_HEADER);
}
@Override
public void start() throws Exception
{
- throw new HornetQException(HornetQException.UNSUPPORTED_PACKET);
+ throw new UnsupportedOperationException();
}
@Override
public void stop() throws Exception
{
- SequentialFile seqFile = currentFile.getFile();
- long pos = seqFile.position();
- seqFile.close();
- seqFile.open();
- seqFile.position(pos);
+ currentFile.getFile().close();
}
@Override
@@ -97,7 +94,7 @@
{
callback.storeLineUp();
}
- switchFileIfNecessary(encoder.getEncodeSize());
+ currentFile = journal.switchFileIfNecessary(encoder.getEncodeSize());
encoder.setFileID(currentFile.getRecordID());
if (callback != null)
@@ -312,9 +309,4 @@
throw new UnsupportedOperationException();
}
- @Override
- public JournalFilesRepository getFilesRepository()
- {
- throw new UnsupportedOperationException();
- }
}
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalBase.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalBase.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalBase.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -3,34 +3,25 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.core.journal.EncodingSupport;
import org.hornetq.core.journal.IOCompletion;
-import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.impl.dataformat.ByteArrayEncoding;
import org.hornetq.core.logging.Logger;
abstract class JournalBase
{
- protected final JournalFilesRepository filesRepository;
- protected final SequentialFileFactory fileFactory;
- protected volatile JournalFile currentFile;
protected final int fileSize;
+ private final boolean supportsCallback;
private static final Logger log = Logger.getLogger(JournalBase.class);
private static final boolean trace = log.isTraceEnabled();
- public JournalBase(SequentialFileFactory fileFactory, JournalFilesRepository journalFilesRepository, int fileSize)
+ public JournalBase(boolean supportsCallback, int fileSize)
{
if (fileSize < JournalImpl.MIN_FILE_SIZE)
{
throw new IllegalArgumentException("File size cannot be less than " + JournalImpl.MIN_FILE_SIZE + " bytes");
}
- if (fileSize % fileFactory.getAlignment() != 0)
- {
- throw new IllegalArgumentException("Invalid journal-file-size " + fileSize + ", It should be multiple of " +
- fileFactory.getAlignment());
- }
- this.fileFactory = fileFactory;
- this.filesRepository = journalFilesRepository;
+ this.supportsCallback = supportsCallback;
this.fileSize = fileSize;
}
@@ -198,56 +189,11 @@
}
}
- /**
- * @param size
- * @throws Exception
- */
- protected void switchFileIfNecessary(int size) throws Exception
- {
- // We take into account the fileID used on the Header
- if (size > fileSize - currentFile.getFile().calculateBlockStart(JournalImpl.SIZE_HEADER))
- {
- throw new IllegalArgumentException("Record is too large to store " + size);
- }
-
- if (!currentFile.getFile().fits(size))
- {
- moveNextFile(true);
-
- // The same check needs to be done at the new file also
- if (!currentFile.getFile().fits(size))
- {
- // Sanity check, this should never happen
- throw new IllegalStateException("Invalid logic on buffer allocation");
- }
- }
- }
-
abstract void scheduleReclaim();
- // You need to guarantee lock.acquire() before calling this method
- protected void moveNextFile(final boolean scheduleReclaim) throws Exception
- {
- filesRepository.closeFile(currentFile);
-
- currentFile = filesRepository.openFile();
-
- if (scheduleReclaim)
- {
- scheduleReclaim();
- }
-
- if (trace)
- {
- log.info("moveNextFile: " + currentFile);
- }
-
- fileFactory.activateBuffer(currentFile.getFile());
- }
-
protected SyncIOCompletion getSyncCallback(final boolean sync)
{
- if (fileFactory.isSupportsCallbacks())
+ if (supportsCallback)
{
if (sync)
{
@@ -279,38 +225,6 @@
}
}
- /**
- * @param lastDataPos
- * @throws Exception
- */
- protected void setUpCurrentFile(int lastDataPos) throws Exception
- {
- // Create any more files we need
-
- filesRepository.ensureMinFiles();
-
- // The current file is the last one that has data
-
- currentFile = filesRepository.pollLastDataFile();
-
- if (currentFile != null)
- {
- currentFile.getFile().open();
-
- currentFile.getFile().position(currentFile.getFile().calculateBlockStart(lastDataPos));
- }
- else
- {
- currentFile = filesRepository.getFreeFile();
-
- filesRepository.openFile(currentFile, true);
- }
-
- fileFactory.activateBuffer(currentFile.getFile());
-
- filesRepository.pushOpenedFile();
- }
-
public int getFileSize()
{
return fileSize;
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -15,7 +15,6 @@
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -177,6 +176,9 @@
private final float compactPercentage;
private final int compactMinFiles;
+ private final JournalFilesRepository filesRepository;
+ private final SequentialFileFactory fileFactory;
+ private volatile JournalFile currentFile;
// Compacting may replace this structure
private final ConcurrentMap<Long, JournalRecord> records = new ConcurrentHashMap<Long, JournalRecord>();
@@ -223,8 +225,12 @@
final String fileExtension,
final int maxAIO)
{
- super(fileFactory, new JournalFilesRepository(fileFactory, filePrefix, fileExtension, 0, maxAIO, fileSize,
- minFiles), fileSize);
+ super(fileFactory.isSupportsCallbacks(), fileSize);
+ if (fileSize % fileFactory.getAlignment() != 0)
+ {
+ throw new IllegalArgumentException("Invalid journal-file-size " + fileSize + ", It should be multiple of " +
+ fileFactory.getAlignment());
+ }
if (minFiles < 2)
{
throw new IllegalArgumentException("minFiles cannot be less than 2");
@@ -242,7 +248,10 @@
{
this.compactPercentage = compactPercentage / 100f;
}
+ this.fileFactory = fileFactory;
+ this.filesRepository =
+ new JournalFilesRepository(fileFactory, filePrefix, fileExtension, 0, maxAIO, fileSize, minFiles);
this.compactMinFiles = compactMinFiles;
this.minFiles = minFiles;
this.userVersion = 0;
@@ -1706,6 +1715,7 @@
filesRepository.clear();
transactions.clear();
+ currentFile = null;
final Map<Long, TransactionHolder> loadTransactions = new LinkedHashMap<Long, TransactionHolder>();
@@ -2366,13 +2376,16 @@
public synchronized void stop() throws Exception
{
- JournalImpl.trace("Stopping the journal");
-
if (state == JournalState.STOPPED)
{
throw new IllegalStateException("Journal is already stopped");
}
+ JournalImpl.trace("Stopping the journal " + this);
+
+ journalLock.writeLock().lock();
+ try
+ {
lockAppend.lock();
try
@@ -2412,7 +2425,12 @@
finally
{
lockAppend.unlock();
+ }
}
+ finally
+ {
+ journalLock.writeLock().unlock();
+ }
}
public int getNumberOfRecords()
@@ -3018,7 +3036,6 @@
try
{
Map<Long, JournalFile> map = new HashMap<Long, JournalFile>();
- log.info("Reserving fileIDs before synchronization: " + Arrays.toString(fileIds));
long maxID = -1;
for (long id : fileIds)
{
@@ -3040,9 +3057,84 @@
return fileFactory;
}
- @Override
- public JournalFilesRepository getFilesRepository()
+ /**
+ * @param lastDataPos
+ * @return
+ * @throws Exception
+ */
+ protected JournalFile setUpCurrentFile(int lastDataPos) throws Exception
{
- return filesRepository;
+ // Create any more files we need
+
+ filesRepository.ensureMinFiles();
+
+ // The current file is the last one that has data
+
+ currentFile = filesRepository.pollLastDataFile();
+ if (currentFile != null)
+ {
+ if (!currentFile.getFile().isOpen())
+ currentFile.getFile().open();
+
+ currentFile.getFile().position(currentFile.getFile().calculateBlockStart(lastDataPos));
+ }
+ else
+ {
+ currentFile = filesRepository.getFreeFile();
+
+ filesRepository.openFile(currentFile, true);
+ }
+
+ fileFactory.activateBuffer(currentFile.getFile());
+
+ filesRepository.pushOpenedFile();
+ return currentFile;
}
+
+ /**
+ * @param size
+ * @return
+ * @throws Exception
+ */
+ protected JournalFile switchFileIfNecessary(int size) throws Exception
+ {
+ // We take into account the fileID used on the Header
+ if (size > fileSize - currentFile.getFile().calculateBlockStart(JournalImpl.SIZE_HEADER))
+ {
+ throw new IllegalArgumentException("Record is too large to store " + size);
+ }
+
+ if (!currentFile.getFile().fits(size))
+ {
+ moveNextFile(true);
+
+ // The same check needs to be done at the new file also
+ if (!currentFile.getFile().fits(size))
+ {
+ // Sanity check, this should never happen
+ throw new IllegalStateException("Invalid logic on buffer allocation");
+ }
+ }
+ return currentFile;
+ }
+
+ /** You need to guarantee lock.acquire() before calling this method! */
+ private void moveNextFile(final boolean scheduleReclaim) throws Exception
+ {
+ filesRepository.closeFile(currentFile);
+
+ currentFile = filesRepository.openFile();
+
+ if (scheduleReclaim)
+ {
+ scheduleReclaim();
+ }
+
+ if (trace)
+ {
+ log.info("moveNextFile: " + currentFile);
+ }
+
+ fileFactory.activateBuffer(currentFile.getFile());
+ }
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -45,8 +45,7 @@
public void testNodeID() throws Exception
{
- backupServer.start();
- waitForComponent(backupServer, 5);
+ startBackupFinishSyncing();
assertTrue("must be running", backupServer.isStarted());
assertEquals("backup and live should have the same nodeID", liveServer.getServer().getNodeID(),
backupServer.getServer().getNodeID());
@@ -113,8 +112,8 @@
protected void startBackupFinishSyncing() throws Exception
{
- backupServer.start();
syncDelay.deliverUpToDateMsg();
+ backupServer.start();
waitForBackup(sessionFactory, BACKUP_WAIT_TIME, true);
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -41,9 +41,9 @@
public void deliverUpToDateMsg()
{
+ live.removeInterceptor(this);
if (backup.isStarted())
handler.deliver();
- live.removeInterceptor(this);
}
public BackupSyncDelay(TestableServer backup, TestableServer live)
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-10-10 13:35:23 UTC (rev 11502)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-10-10 13:35:57 UTC (rev 11503)
@@ -54,7 +54,6 @@
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.TransactionFailureCallback;
import org.hornetq.core.journal.impl.JournalFile;
-import org.hornetq.core.journal.impl.JournalFilesRepository;
import org.hornetq.core.paging.PagedMessage;
import org.hornetq.core.paging.PagingManager;
import org.hornetq.core.paging.PagingStore;
@@ -891,12 +890,6 @@
}
@Override
- public JournalFilesRepository getFilesRepository()
- {
- return null;
- }
-
- @Override
public int getFileSize()
{
return 0;
13 years, 2 months