You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2007/02/14 21:02:22 UTC

svn commit: r507672 [16/16] - in /incubator/qpid/branches/qpid.0-9: gentools/src/org/apache/qpid/gentools/ gentools/templ.java/ gentools/templ.net/ java/ java/broker/ java/broker/bin/ java/broker/distribution/ java/broker/distribution/src/ java/broker/...

Modified: incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java Wed Feb 14 12:02:03 2007
@@ -51,7 +51,7 @@
         _factory.createControlConsumer().setMessageListener(this);
         _connection.start();
 
-        if(warmup > 0)
+        if (warmup > 0)
         {
             System.out.println("Runing warmup (" + warmup + " msgs)");
             long time = batch(warmup, consumerCount);
@@ -59,11 +59,14 @@
         }
 
         long[] times = new long[batches];
-        for(int i = 0; i < batches; i++)
+        for (int i = 0; i < batches; i++)
         {
-            if(i > 0) Thread.sleep(delay*1000);
+            if (i > 0)
+            {
+                Thread.sleep(delay * 1000);
+            }
             times[i] = batch(msgCount, consumerCount);
-            System.out.println("Batch " + (i+1) + " of " + batches + " completed in " + times[i] + " ms.");
+            System.out.println("Batch " + (i + 1) + " of " + batches + " completed in " + times[i] + " ms.");
         }
 
         long min = min(times);
@@ -131,7 +134,7 @@
     static long min(long[] times)
     {
         long min = times.length > 0 ? times[0] : 0;
-        for(int i = 0; i < times.length; i++)
+        for (int i = 0; i < times.length; i++)
         {
             min = Math.min(min, times[i]);
         }
@@ -141,7 +144,7 @@
     static long max(long[] times)
     {
         long max = times.length > 0 ? times[0] : 0;
-        for(int i = 0; i < times.length; i++)
+        for (int i = 0; i < times.length; i++)
         {
             max = Math.max(max, times[i]);
         }
@@ -151,14 +154,22 @@
     static long avg(long[] times, long min, long max)
     {
         long sum = 0;
-        for(int i = 0; i < times.length; i++)
+        for (int i = 0; i < times.length; i++)
         {
             sum += times[i];
         }
-        sum -= min;
-        sum -= max;
 
-        return (sum / (times.length - 2));
+        int adjustment = 0;
+
+        // Remove min and max if we have run enough batches.
+        if (times.length > 2)
+        {
+            sum -= min;
+            sum -= max;
+            adjustment = 2;
+        }
+
+        return (sum / (times.length - adjustment));
     }
 
     public static void main(String[] argv) throws Exception

Modified: incubator/qpid/branches/qpid.0-9/java/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/pom.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/pom.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/pom.xml Wed Feb 14 12:02:03 2007
@@ -46,6 +46,14 @@
             <name>Apache SNAPSHOT Repository</name>
             <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
         </snapshotRepository>
+
+	<!-- Qpid has a Wiki site, maven generated site not used. This is just so that it can be created locally for viewing the reports. -->
+        <site>
+          <id>Qpid_Site</id>
+          <name>Qpid Site</name>
+          <url>file:/temp</url>
+        </site>
+
     </distributionManagement>
 
     <inceptionYear>2006</inceptionYear>
@@ -65,6 +73,7 @@
             <archive>http://mail-archives.apache.org/mod_mbox/incubator-qpid-commits</archive>
         </mailingList>
     </mailingLists>
+
     <licenses>
         <license>
             <name>The Apache Software License, Version 2.0</name>
@@ -72,23 +81,33 @@
             <distribution>repo</distribution>
         </license>
     </licenses>
+
     <organization>
         <name>Apache Software Foundation</name>
         <url>http://www.apache.org/</url>
     </organization>
+
     <properties>
         <topDirectoryLocation>.</topDirectoryLocation>
 
-        <surefire.fork.mode>once</surefire.fork.mode>
+        <surefire.fork.mode>never</surefire.fork.mode>
         <surefire.format>brief</surefire.format>
         <surefire.usefile>false</surefire.usefile>
         <compile.forked>false</compile.forked>
         <java.source.version>1.5</java.source.version>
         <compile.flags>-Xlint:fallthrough,finally</compile.flags>
 
+	<!-- 
+          This should always point to a default minimal log4j configuration that all developers are happy with as a useable default. To use your own
+          log4j preferences set up an alternative in your settings.xml and avoid corrupting the default with private preferences.
+	  -->
+	<!--<log4j.configuration>file:/${topDirectoryLocation}/etc/log4j.xml</log4j.configuration>-->
+        <amqj.logging.level>warn</amqj.logging.level> <!-- This is referenced in the default log4j.xml -->
+
         <!--Versions for various plugins and features -->
         <antrun.version>1.2-SNAPSHOT</antrun.version>
-        <assembly.version>2.1</assembly.version>
+        <!--<assembly.version>2.2-SNAPSHOT</assembly.version>-->
+	<assembly.version>2.1</assembly.version>
         <cobertura.version>2.0</cobertura.version>
         <compiler.version>2.0.1</compiler.version>
         <dependency.plugin.version>1.0</dependency.plugin.version>
@@ -103,8 +122,6 @@
         <surefire-report.version>2.1-SNAPSHOT</surefire-report.version>
         <surefire.version>2.2</surefire.version>
 
-        <amqj.logging.level>warn</amqj.logging.level>
-
         <eclipse.workspace.dir>${basedir}/${topDirectoryLocation}/../workspace</eclipse.workspace.dir>
         <clover.license.pathname>/set/clover/license/path/here</clover.license.pathname>
     </properties>
@@ -115,6 +132,7 @@
         <module>client</module>
         <module>cluster</module>
         <module>systests</module>
+        <module>perftests</module>
         <module>management/eclipse-plugin</module>
     </modules>
 
@@ -124,6 +142,7 @@
                 <directory>src/main/java</directory>
                 <excludes>
                     <exclude>**/*.java</exclude>
+                    <exclude>**/log4j.properties</exclude>
                 </excludes>
             </resource>
             <resource>
@@ -146,6 +165,7 @@
                 </includes>
             </resource>
         </resources>
+
         <testResources>
             <testResource>
                 <directory>src/test/java</directory>
@@ -181,7 +201,6 @@
                             <artifactId>ant-nodeps</artifactId>
                             <version>1.6.5</version>
                         </dependency>
-
                     </dependencies>
 
                     <executions>
@@ -194,13 +213,13 @@
                               time, during the 'package' phase to capture the version of any resources added to jar files.
                               This svnversion command is always run in the top directory to accurately reflect the svnversion range accross all modules 
                               at the time of the build.
-                              The properties are placed into a file 'qpidversion.properties' in the target/classes directory of any child module that runs 
-                              this plugin.
+                              The properties are placed into a file 'qpidversion.properties' in the target/classes directory of any child module
+                              that runs this plugin.
                               The 'qpidversion.properties' file is loaded by the org.apache.qpid.common.QpidProperties class.
                               Be carefull of the possibility that the 'common' module may run this antrun plugin and recieve its own set of 
-                              qpidversion.properties and then the client or broker being built against an older version of the common library ending up with
-                              the wrong version information. This is unlikely to happen because the client or broker should pick up its own properties
-                              from the classpath first. If this happens it will be obvious because the productName property will be 
+                              qpidversion.properties and then the client or broker being built against an older version of the common library ending 
+                              up with the wrong version information. This is unlikely to happen because the client or broker should pick up its own 
+                              properties from the classpath first. If this happens it will be obvious because the productName property will be 
                               'Qpid Common Utilities'. If this is a problem then push this ant task down into the client and broker poms and remove it
                               from here.
                          -->
@@ -230,16 +249,19 @@
                         </execution>
                    </executions>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-jar-plugin</artifactId>
                     <version>${jar.version}</version>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-resources-plugin</artifactId>
                     <version>${resources.version}</version>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
@@ -250,6 +272,7 @@
                         <fork>${compile.forked}</fork>
                     </configuration>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
@@ -265,17 +288,23 @@
                         <argLine>-ea</argLine>
                         <systemproperties>
                             <property>
-                                <name>amqj.logging.level</name>
+			        <name>amqj.logging.level</name>
                                 <value>${amqj.logging.level}</value>
+				<!--
+				<name>log4j.configuration</name>
+				<value>${log4j.configuration}</value>
+				-->
                             </property>
                         </systemproperties>
                     </configuration>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-site-plugin</artifactId>
                     <version>${site.version}</version>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-eclipse-plugin</artifactId>
@@ -290,14 +319,16 @@
                         </projectnatures>
                     </configuration>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-idea-plugin</artifactId>
                     <configuration>
-                        <downloadSources>true</downloadSources>
+                        <!--downloadSources>true</downloadSources-->
                         <downloadJavadocs>true</downloadJavadocs>
                     </configuration>
                 </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-clover-plugin</artifactId>
@@ -316,9 +347,19 @@
                         </execution>
                     </executions>
                 </plugin>
+
+		<!-- The JUnit Toolkit maven2 plugin is in the process of being added to the maven repository. -->
+                <plugin>
+                    <groupId>uk.co.thebadgerset</groupId>
+                    <artifactId>junit-toolkit-maven-plugin</artifactId>
+                    <version>0.5-SNAPSHOT</version>
+		</plugin>
+
             </plugins>
         </pluginManagement>
+
         <defaultGoal>install</defaultGoal>
+
     </build>
 
     <dependencyManagement>
@@ -347,13 +388,6 @@
                 <groupId>commons-lang</groupId>
                 <artifactId>commons-lang</artifactId>
                 <version>2.1</version>
-                <exclusions>
-                    <!-- this seems to have a junit compile dependency -->
-                    <exclusion>
-                        <groupId>junit</groupId>
-                        <artifactId>junit</artifactId>
-                    </exclusion>
-                </exclusions>
             </dependency>
             <dependency>
                 <groupId>commons-logging</groupId>
@@ -405,18 +439,30 @@
                 <artifactId>backport-util-concurrent</artifactId>
                 <version>2.2</version>
             </dependency>
+
+            <!-- Test Dependencies -->
             <dependency>
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
                 <version>${junit.version}</version>
                 <scope>test</scope>
             </dependency>
+
             <dependency>
                 <groupId>org.easymock</groupId>
                 <artifactId>easymockclassextension</artifactId>
                 <version>2.2</version>
                 <scope>test</scope>
             </dependency>
+
+            <dependency>
+                <groupId>uk.co.thebadgerset</groupId>
+                <artifactId>junit-toolkit</artifactId>
+                <version>0.5-SNAPSHOT</version>
+                <scope>compile</scope>
+            </dependency>
+
+            <!-- Qpid Version Dependencies -->
             <dependency>
                 <groupId>org.apache.qpid</groupId>
                 <artifactId>qpid-common</artifactId>
@@ -430,6 +476,16 @@
             <dependency>
                 <groupId>org.apache.qpid</groupId>
                 <artifactId>qpid-broker</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.qpid</groupId>
+                <artifactId>qpid-perftests</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.qpid</groupId>
+                <artifactId>qpid-systests</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>

Propchange: incubator/qpid/branches/qpid.0-9/java/systests/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Feb 14 12:02:03 2007
@@ -1 +1,2 @@
 target
+qpid-systests.iml

Propchange: incubator/qpid/branches/qpid.0-9/java/systests/distribution/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Feb 14 12:02:03 2007
@@ -0,0 +1 @@
+target

Modified: incubator/qpid/branches/qpid.0-9/java/systests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/pom.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/systests/pom.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/pom.xml Wed Feb 14 12:02:03 2007
@@ -39,23 +39,20 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.qpid</groupId>
-            <artifactId>qpid-common</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.qpid</groupId>
             <artifactId>qpid-client</artifactId>
+            <type>jar</type>
         </dependency>
+
         <dependency>
             <groupId>org.apache.qpid</groupId>
             <artifactId>qpid-broker</artifactId>
+            <type>jar</type>
         </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-        </dependency>
+
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
+            <scope>compile</scope>
         </dependency>
     </dependencies>
 
@@ -65,26 +62,30 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <systemProperties>
-                        <property>
-                            <name>amqj.noAutoCreateVMBroker</name>
-                            <value>true</value>
-                        </property>
-                        <property>
-                            <name>amqj.logging.level</name>
-                            <value>${amqj.logging.level}</value>
-                        </property>
-                        <property>
-                            <name>log4j.debug</name>
-                            <value>true</value>
-                        </property>
-                         <property>
-                            <name>log4j.configuration</name>
-                            <value>file:///${basedir}/src/test/java/log4j.properties</value>
-                        </property>
-                    </systemProperties>
+                    <skip>true</skip>
                 </configuration>
             </plugin>
+
         </plugins>
+
+        <!-- Include source files in built jar -->
+        <resources>
+            <resource>
+                <targetPath>src/</targetPath>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.java</include>
+                </includes>
+            </resource>
+            <resource>
+                <targetPath>src/</targetPath>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>systests.log4j</include>
+                </includes>
+            </resource>
+        </resources>
     </build>
 </project>

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java Wed Feb 14 12:02:03 2007
@@ -22,11 +22,12 @@
 
 import junit.framework.TestCase;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicPublishBody;
+import org.apache.qpid.framing.MessageTransferBody;
 import org.apache.qpid.server.RequiredDeliveryException;
 import org.apache.qpid.server.queue.AMQMessage;
 import org.apache.qpid.server.store.TestableMemoryMessageStore;
 import org.apache.qpid.server.store.StoreContext;
+import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.txn.NonTransactionalContext;
 import org.apache.qpid.server.txn.TransactionalContext;
 
@@ -96,7 +97,8 @@
 
         Scenario(int messageCount, List<Long> acked, List<Long> unacked)
         {
-            TransactionalContext txnContext = new NonTransactionalContext(new TestableMemoryMessageStore(),
+            MessageStore messageStore = new TestableMemoryMessageStore();
+            TransactionalContext txnContext = new NonTransactionalContext(messageStore,
                                                                           _storeContext, null,
                                                                           new LinkedList<RequiredDeliveryException>(),
                                                                           new HashSet<Long>());
@@ -104,15 +106,36 @@
             {
                 long deliveryTag = i + 1;
                 // TODO: fix hardcoded protocol version data
-                TestMessage message = new TestMessage(deliveryTag, i, new BasicPublishBody((byte)8,
-                                                                                           (byte)0,
-                                                                                           BasicPublishBody.getClazz((byte)8,(byte)0),
-                                                                                           BasicPublishBody.getMethod((byte)8,(byte)0),
-                                                                                           null,
-                                                                                           false,
-                                                                                           false,
-                                                                                           null,
-                                                                                           0), txnContext);
+                TestMessage message = new TestMessage(deliveryTag, messageStore,
+                                    new MessageTransferBody(
+                                    (byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    null, // AMQShortString appId
+                                    null, // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    null, // AMQShortString exchange
+                                    0L, // long expiration
+                                    false, // boolean immediate
+                                    false, // boolean mandatory
+                                    null, // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    null, // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null), // AMQShortString userId
+                                    txnContext);
                 _map.add(deliveryTag, new UnacknowledgedMessage(null, message, null, deliveryTag));
             }
             _acked = acked;
@@ -174,9 +197,9 @@
         private final long _tag;
         private int _count;
 
-        TestMessage(long tag, long messageId, BasicPublishBody publishBody, TransactionalContext txnContext)
+        TestMessage(long tag, MessageStore store, MessageTransferBody  transferBody, TransactionalContext txnContext)
         {
-            super(messageId, publishBody, txnContext);
+            super(store, transferBody, txnContext);
             _tag = tag;
         }
 

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java Wed Feb 14 12:02:03 2007
@@ -40,6 +40,8 @@
 
 public class AbstractHeadersExchangeTestBase extends TestCase
 {
+    private static TransactionalContext txnContext = null;
+    
     private static final Logger _log = Logger.getLogger(AbstractHeadersExchangeTestBase.class);
 
     private final HeadersExchange exchange = new HeadersExchange();
@@ -92,7 +94,7 @@
     protected void route(Message m) throws AMQException
     {
         m.route(exchange);
-        m.routingComplete(_store, _storeContext, _handleFactory);
+//        m.routingComplete(_store, _storeContext, _handleFactory);
     }
 
     protected void routeAndTest(Message m, TestQueue... expected) throws AMQException
@@ -149,31 +151,55 @@
         return headers;
     }
 
-    static BasicPublishBody getPublishRequest(String id)
+    static MessageTransferBody getPublishRequest(String id)
     {
-        // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+        // AMQP version change: Hardwire the version to 0-9 (major=0, minor=9)
         // TODO: Establish some way to determine the version for the test.
-        BasicPublishBody request = new BasicPublishBody((byte)8, (byte)0,
-                                                       BasicPublishBody.getClazz((byte)8,(byte)0),
-                                                       BasicPublishBody.getMethod((byte)8,(byte)0),
-                                                       null,false,false,new AMQShortString(id),0);
+        MessageTransferBody request = new MessageTransferBody(
+                                    (byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    new AMQShortString(id), // AMQShortString appId
+                                    null, // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    null, // AMQShortString exchange
+                                    0L, // long expiration
+                                    false, // boolean immediate
+                                    false, // boolean mandatory
+                                    null, // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    null, // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null); // AMQShortString userId
         
         return request;
     }
 
-    static ContentHeaderBody getContentHeader(FieldTable headers)
-    {
-        ContentHeaderBody header = new ContentHeaderBody();
-        header.properties = getProperties(headers);
-        return header;
-    }
-
-    static BasicContentHeaderProperties getProperties(FieldTable headers)
-    {
-        BasicContentHeaderProperties properties = new BasicContentHeaderProperties();
-        properties.setHeaders(headers);
-        return properties;
-    }
+//     static ContentHeaderBody getContentHeader(FieldTable headers)
+//     {
+//         ContentHeaderBody header = new ContentHeaderBody();
+//         header.properties = getProperties(headers);
+//         return header;
+//     }
+// 
+//     static BasicContentHeaderProperties getProperties(FieldTable headers)
+//     {
+//         BasicContentHeaderProperties properties = new BasicContentHeaderProperties();
+//         properties.setHeaders(headers);
+//         return properties;
+//     }
 
     static class TestQueue extends AMQQueue
     {
@@ -211,19 +237,46 @@
                                                                          new LinkedList<RequiredDeliveryException>(),
                                                                          new HashSet<Long>());
 
-        Message(String id, String... headers) throws AMQException
-        {
-            this(id, getHeaders(headers));
-        }
-
-        Message(String id, FieldTable headers) throws AMQException
-        {
-            this(getPublishRequest(id), getContentHeader(headers), null);
-        }
+         Message(String id, String... headers) throws AMQException
+         {
+             this(new MessageTransferBody(
+                                    (byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    null, // AMQShortString appId
+                                    getHeaders(headers), // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    null, // AMQShortString exchange
+                                    0L, // long expiration
+                                    false, // boolean immediate
+                                    false, // boolean mandatory
+                                    new AMQShortString(id), // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    null, // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null)); // AMQShortString userId
+         }
+
+//         Message(String id, FieldTable headers) throws AMQException
+//         {
+//             this(getPublishRequest(id), getContentHeader(headers), null);
+//         }
 
-        private Message(BasicPublishBody publish, ContentHeaderBody header, List<ContentBody> bodies) throws AMQException
+        private Message(MessageTransferBody publish) throws AMQException
         {
-            super(_messageStore.getNewMessageId(), publish, _txnContext, header);
+            super(_messageStore, publish, _txnContext);
         }
 
         private Message(AMQMessage msg) throws AMQException
@@ -263,15 +316,15 @@
 
         private Object getKey()
         {
-            try
-            {
-                return getPublishBody().routingKey;
-            }
-            catch (AMQException e)
-            {
-                _log.error("Error getting routing key: " + e, e);
-                return null;
-            }
+//             try
+//             {
+                return getTransferBody().getRoutingKey();
+//             }
+//             catch (AMQException e)
+//             {
+//                 _log.error("Error getting routing key: " + e, e);
+//                 return null;
+//             }
         }
     }
 }

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java Wed Feb 14 12:02:03 2007
@@ -24,7 +24,7 @@
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.util.TestApplicationRegistry;
 import org.apache.qpid.server.util.NullApplicationRegistry;
-import org.apache.qpid.framing.BasicPublishBody;
+import org.apache.qpid.framing.MessageTransferBody;
 
 public class HeadersExchangeTest extends AbstractHeadersExchangeTestBase
 {
@@ -55,13 +55,13 @@
 
         Message m7 = new Message("Message7", "XXXXX");
 
-        BasicPublishBody pb7 = m7.getPublishBody();
-        pb7.mandatory = true;
+        MessageTransferBody mtb7 = m7.getTransferBody();
+        mtb7.mandatory = true;
         routeAndTest(m7,true);
 
         Message m8 = new Message("Message8", "F0000");
-        BasicPublishBody pb8 = m8.getPublishBody();
-        pb8.mandatory = true;
+        MessageTransferBody mtb8 = m8.getTransferBody();
+        mtb8.mandatory = true;
         routeAndTest(m8,false,q1);
 
 
@@ -88,10 +88,10 @@
         bindDefault("F0000");
         Message m1 = new Message("Message1", "XXXXX");
         Message m2 = new Message("Message2", "F0000");
-        BasicPublishBody pb1 = m1.getPublishBody();
-        pb1.mandatory = true;
-        BasicPublishBody pb2 = m2.getPublishBody();
-        pb2.mandatory = true;
+        MessageTransferBody mtb1 = m1.getTransferBody();
+        mtb1.mandatory = true;
+        MessageTransferBody mtb2 = m2.getTransferBody();
+        mtb2.mandatory = true;
         routeAndTest(m1,true);
     }
 

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java Wed Feb 14 12:02:03 2007
@@ -58,7 +58,7 @@
         assertTrue(channelCount == 1);
         AMQQueue queue = new org.apache.qpid.server.queue.AMQQueue(new AMQShortString("testQueue_" + System.currentTimeMillis()),
                                                             false, new AMQShortString("test"), true, _virtualHost);
-        AMQChannel channel = new AMQChannel(2, _messageStore, null);
+        AMQChannel channel = new AMQChannel(2, _protocolSession, _virtualHost.getMessageStore(), _virtualHost.getExchangeRegistry(), null/*methodListener*/);
         channel.setDefaultQueue(queue);
         _protocolSession.addChannel(channel);
         channelCount = _mbean.channels().size();
@@ -69,7 +69,7 @@
         assertTrue(_mbean.getMaximumNumberOfChannels() == 1000L);
 
         // check APIs
-        AMQChannel channel3 = new AMQChannel(3, _messageStore, null);
+        AMQChannel channel3 = new AMQChannel(3, _protocolSession, _virtualHost.getMessageStore(), _virtualHost.getExchangeRegistry(), null/*methodListener*/);
         channel3.setLocalTransactional();
         _protocolSession.addChannel(channel3);
         _mbean.rollbackTransactions(2);
@@ -89,27 +89,27 @@
         }
 
         // check if closing of session works
-        _protocolSession.addChannel(new AMQChannel(5, _messageStore, null));
+        _protocolSession.addChannel(new AMQChannel(5, _protocolSession, _virtualHost.getMessageStore(), _virtualHost.getExchangeRegistry(), null/*methodListener*/));
         _mbean.closeConnection();
-        try
-        {
+//         try
+//         {
             channelCount = _mbean.channels().size();
             assertTrue(channelCount == 0);
             // session is now closed so adding another channel should throw an exception
-            _protocolSession.addChannel(new AMQChannel(6, _messageStore, null));
+            _protocolSession.addChannel(new AMQChannel(6, _protocolSession, _virtualHost.getMessageStore(), _virtualHost.getExchangeRegistry(), null/*methodListener*/));
             fail();
-        }
-        catch(AMQException ex)
-        {
-            System.out.println("expected exception is thrown :" + ex.getMessage());
-        }
+//         }
+//         catch(AMQException ex)
+//         {
+//             System.out.println("expected exception is thrown :" + ex.getMessage());
+//         }
     }
     
     @Override
     protected void setUp() throws Exception
     {
         super.setUp();
-        _channel = new AMQChannel(1, _messageStore, null);
+        _channel = new AMQChannel(1, _protocolSession, _virtualHost.getMessageStore(), _virtualHost.getExchangeRegistry(), null/*methodListener*/);
         IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
         _virtualHost = appRegistry.getVirtualHostRegistry().getVirtualHost("test");
         _queueRegistry = _virtualHost.getQueueRegistry();

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java Wed Feb 14 12:02:03 2007
@@ -19,8 +19,7 @@
 
 import junit.framework.TestCase;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.MessageTransferBody;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.AMQChannel;
 import org.apache.qpid.server.RequiredDeliveryException;
@@ -78,7 +77,7 @@
         assertFalse(mgr.hasActiveSubscribers());
         assertTrue(_queueMBean.getActiveConsumerCount() == 0);
 
-        _channel = new AMQChannel(1, _messageStore, null);
+        _channel = new AMQChannel(1, _protocolSession, _virtualHost.getMessageStore(), _virtualHost.getExchangeRegistry(), null/*methodListener*/);
         _protocolSession = new MockProtocolSession(_messageStore);
         _protocolSession.addChannel(_channel);
 
@@ -150,7 +149,7 @@
         long id = msg.getMessageId();
         _queue.clearQueue(_storeContext);
         _queue.process(_storeContext, msg);
-        msg.routingComplete(_messageStore, _storeContext, new MessageHandleFactory());
+//        msg.routingComplete(_messageStore, _storeContext, new MessageHandleFactory());
         _queueMBean.viewMessageContent(id);
         try
         {
@@ -165,21 +164,38 @@
 
     private AMQMessage message(boolean immediate) throws AMQException
     {
-        // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+        // AMQP version change: Hardwire the version to 0-9 (major=0, minor=9)
         // TODO: Establish some way to determine the version for the test.
-        BasicPublishBody publish = new BasicPublishBody((byte)8,
-                                                        (byte)0,
-                                                        BasicPublishBody.getClazz((byte)8,(byte)0),
-                                                        BasicPublishBody.getMethod((byte)8,(byte)0),
-                                                        null,
-                                                        immediate,
-                                                        false,
-                                                        null,
-                                                        0);
+            MessageTransferBody publish = new MessageTransferBody(
+                                    (byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    null, // AMQShortString appId
+                                    null, // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    null, // AMQShortString exchange
+                                    0L, // long expiration
+                                    immediate, // boolean immediate
+                                    false, // boolean mandatory
+                                    null, // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    null, // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null); // AMQShortString userId
         
-        ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
-        contentHeaderBody.bodySize = 1000;   // in bytes
-        return new AMQMessage(_messageStore.getNewMessageId(), publish, _transactionalContext, contentHeaderBody);
+        return new AMQMessage(_messageStore, publish, _transactionalContext);
     }
 
     @Override
@@ -207,7 +223,7 @@
 
         for (int i = 0; i < messages.length; i++)
         {
-            messages[i].routingComplete(_messageStore, _storeContext, new MessageHandleFactory());
+//            messages[i].routingComplete(_messageStore, _storeContext, new MessageHandleFactory());
         }
     }
 }

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java Wed Feb 14 12:02:03 2007
@@ -23,9 +23,7 @@
 import junit.framework.TestCase;
 import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.MessageTransferBody;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.AMQChannel;
 import org.apache.qpid.server.RequiredDeliveryException;
@@ -48,6 +46,8 @@
  */
 public class AckTest extends TestCase
 {
+    private TransactionalContext txnContext = null;
+    
     private static final Logger _log = Logger.getLogger(AckTest.class);
 
     private SubscriptionImpl _subscription;
@@ -75,8 +75,8 @@
     {
         super.setUp();
         _messageStore = new TestableMemoryMessageStore();
-        _channel = new AMQChannel(5, _messageStore, null/*dont need exchange registry*/);
         _protocolSession = new MockProtocolSession(_messageStore);
+        _channel = new AMQChannel(5, _protocolSession, null/*MessageStore*/, null/*ExchangeRegistry*/, null/*methodListener*/);
         _protocolSession.addChannel(_channel);
         _subscriptionManager = new SubscriptionSet();
         _queue = new AMQQueue(new AMQShortString("myQ"), false, new AMQShortString("guest"), true, ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"), _subscriptionManager);
@@ -95,36 +95,47 @@
         MessageHandleFactory factory = new MessageHandleFactory();
         for (int i = 1; i <= count; i++)
         {
-            // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+            // AMQP version change: Hardwire the version to 0-9 (major=0, minor=9)
             // TODO: Establish some way to determine the version for the test.
-            BasicPublishBody publishBody = new BasicPublishBody((byte)8,
-                                                                (byte)0,
-                                                                BasicPublishBody.getClazz((byte)8,(byte)0),
-                                                                BasicPublishBody.getMethod((byte)8,(byte)0),
-                                                                new AMQShortString("someExchange"),
-                                                                false,
-                                                                false,
-                                                                new AMQShortString("rk"),
-                                                                0);
-            AMQMessage msg = new AMQMessage(_messageStore.getNewMessageId(), publishBody, txnContext);
+            MessageTransferBody publishBody = new MessageTransferBody(
+                                    (byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    null, // AMQShortString appId
+                                    null, // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    new AMQShortString("someExchange"), // AMQShortString exchange
+                                    0L, // long expiration
+                                    false, // boolean immediate
+                                    false, // boolean mandatory
+                                    null, // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    new AMQShortString("rk"), // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null); // AMQShortString userId
+            AMQMessage msg = new AMQMessage(_messageStore, publishBody, txnContext);
             if (persistent)
             {
-                BasicContentHeaderProperties b = new BasicContentHeaderProperties();
                 //This is DeliveryMode.PERSISTENT
-                b.setDeliveryMode((byte) 2);
-                ContentHeaderBody cb = new ContentHeaderBody();
-                cb.properties = b;
-                msg.setContentHeaderBody(cb);
-            }
-            else
-            {
-                msg.setContentHeaderBody(new ContentHeaderBody());
+                msg.setDeliveryMode((byte) 2);
             }
             // we increment the reference here since we are not delivering the messaging to any queues, which is where
             // the reference is normally incremented. The test is easier to construct if we have direct access to the
             // subscription
             msg.incrementReference();
-            msg.routingComplete(_messageStore, _storeContext, factory);
+//            msg.routingComplete(_messageStore, _storeContext, factory);
             // we manually send the message to the subscription
             _subscription.send(msg, _queue);
         }

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java Wed Feb 14 12:02:03 2007
@@ -20,8 +20,7 @@
  */
 package org.apache.qpid.server.queue;
 
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.MessageTransferBody;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.store.SkeletonMessageStore;
 import org.apache.qpid.server.store.StoreContext;
@@ -61,18 +60,36 @@
     {
         // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
         // TODO: Establish some way to determine the version for the test.
-        BasicPublishBody publish = new BasicPublishBody((byte)8,
-                                                        (byte)0,
-                                                        BasicPublishBody.getClazz((byte)8,(byte)0),
-                                                        BasicPublishBody.getMethod((byte)8,(byte)0),
-                                                        null,
-                                                        immediate,
-                                                        false,
-                                                        null,
-                                                        0);
+        MessageTransferBody publish = new MessageTransferBody(
+                                    (byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    null, // AMQShortString appId
+                                    null, // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    null, // AMQShortString exchange
+                                    0L, // long expiration
+                                    immediate, // boolean immediate
+                                    false, // boolean mandatory
+                                    null, // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    null, // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null); // AMQShortString userId
         
-        return new AMQMessage(_messageStore.getNewMessageId(), publish, _txnContext,
-                              new ContentHeaderBody());
+        return new AMQMessage(_messageStore, publish, _txnContext);
     }
 
 }

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java Wed Feb 14 12:02:03 2007
@@ -22,12 +22,16 @@
 
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQDataBlock;
+import org.apache.qpid.framing.AMQMethodBody;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.VersionSpecificRegistry;
+import org.apache.qpid.protocol.AMQMethodEvent;
+import org.apache.qpid.protocol.AMQMethodListener;
 import org.apache.qpid.server.AMQChannel;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.protocol.AMQProtocolSession;
+import org.apache.qpid.server.state.AMQStateManager;
 import org.apache.qpid.server.store.MessageStore;
 
 import javax.security.sasl.SaslServer;
@@ -162,16 +166,88 @@
 
     public byte getProtocolMajorVersion()
     {
-        return 8;  //To change body of implemented methods use File | Settings | File Templates.
+        return 0;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
     public byte getProtocolMinorVersion()
     {
-        return 0;  //To change body of implemented methods use File | Settings | File Templates.
+        return 9;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+    
+    public boolean isProtocolVersionEqual(byte major, byte minor)
+    {
+        return major == 0 && minor == 9;
+    }
+    
+    public void checkMethodBodyVersion(AMQMethodBody methodBody)
+    {
+
     }
 
     public VersionSpecificRegistry getRegistry()
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
+    
+    public long getConnectionId()
+    {
+        return 0L;
+    }
+    
+    public AMQStateManager getStateManager()
+    {
+        return null;
+    }
+    
+    public long getFrameMax()
+    {
+        return 0L;
+    }
+    
+    public void setFrameMax(long size)
+    {
+    
+    }
+    
+    public void closeChannelRequest(int channelId, int replyCode, AMQShortString replyText) throws AMQException
+    {
+    
+    }
+    
+    public void closeChannelResponse(int channelId, long requestId) throws AMQException
+    {
+    
+    }
+    
+    public void closeSessionRequest(int replyCode, AMQShortString replyText, int classId, int methodId) throws AMQException
+    {
+    
+    }
+
+    public void closeSessionRequest(int replyCode, AMQShortString replyText) throws AMQException
+    {
+    
+    }
+    
+    public  void closeSessionResponse(long requestId) throws AMQException
+    {
+    
+    }
+    
+    public long writeRequest(int channelNum, AMQMethodBody methodBody,
+                             AMQMethodListener methodListener)
+    {
+        return 0L;
+    }
+
+    public void writeResponse(int channelNum, long requestId, AMQMethodBody methodBody)
+    {
+    
+    }
+
+    public void writeResponse(AMQMethodEvent evt, AMQMethodBody response)
+    {
+    
+    }
+
 }

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java Wed Feb 14 12:02:03 2007
@@ -22,7 +22,6 @@
 
 import org.apache.commons.configuration.Configuration;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ContentBody;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.MessageMetaData;
@@ -87,7 +86,7 @@
         return _messageId.getAndIncrement();
     }
 
-    public void storeContentBodyChunk(StoreContext sc, Long messageId, int index, ContentBody contentBody, boolean lastContentBody) throws AMQException
+    public void storeContentChunk(StoreContext sc, Long messageId, int index, byte[] content, boolean lastContentBody) throws AMQException
     {
 
     }
@@ -102,7 +101,7 @@
         return null;
     }
 
-    public ContentBody getContentBodyChunk(Long messageId, int index) throws AMQException
+    public byte[] getContentChunk(Long messageId, int index) throws AMQException
     {
         return null;
     }
@@ -121,4 +120,15 @@
     {
 
     }
+    
+    public void storeContentBodyChunk(StoreContext context, Long messageId, int index, byte[] contentBody, boolean lastContentBody) throws AMQException
+    {
+    
+    }
+    
+    public byte[] getContentBodyChunk(Long messageId, int index) throws AMQException
+    {
+        return new byte[0];
+    }
+
 }

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java Wed Feb 14 12:02:03 2007
@@ -22,18 +22,18 @@
 
 import junit.framework.TestCase;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.MessageTransferBody;
 import org.apache.qpid.server.queue.AMQMessage;
 import org.apache.qpid.server.queue.MessageHandleFactory;
-import org.apache.qpid.server.txn.NonTransactionalContext;
+import org.apache.qpid.server.txn.TransactionalContext;
 
 /**
  * Tests that reference counting works correctly with AMQMessage and the message store
  */
 public class TestReferenceCounting extends TestCase
 {
+    private TransactionalContext txnContext = null;
+    
     private TestableMemoryMessageStore _store;
 
     private StoreContext _storeContext = new StoreContext();
@@ -49,53 +49,79 @@
      */
     public void testMessageGetsRemoved() throws AMQException
     {
-        createPersistentContentHeader();
         // TODO: fix hardcoded protocol version data
-        AMQMessage message = new AMQMessage(_store.getNewMessageId(), new BasicPublishBody((byte)8,
-                                                                                           (byte)0,
-                                                                                           BasicPublishBody.getClazz((byte)8,(byte)0),
-                                                                                           BasicPublishBody.getMethod((byte)8,(byte)0),
-                                                                                           null,
-                                                                                           false,
-                                                                                           false,
-                                                                                           null,
-                                                                                           0),
-                                            new NonTransactionalContext(_store, _storeContext, null, null, null),
-                                            createPersistentContentHeader());
+        AMQMessage message = new AMQMessage(_store, 
+            new MessageTransferBody((byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    null, // AMQShortString appId
+                                    null, // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    null, // AMQShortString exchange
+                                    0L, // long expiration
+                                    false, // boolean immediate
+                                    false, // boolean mandatory
+                                    null, // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    null, // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null), // AMQShortString userId
+            txnContext);
         message.incrementReference();
         // we call routing complete to set up the handle
-        message.routingComplete(_store, _storeContext, new MessageHandleFactory());
+//        message.routingComplete(_store, _storeContext, new MessageHandleFactory());
         assertTrue(_store.getMessageMetaDataMap().size() == 1);
         message.decrementReference(_storeContext);
         assertTrue(_store.getMessageMetaDataMap().size() == 0);
     }
 
-    private ContentHeaderBody createPersistentContentHeader()
-    {
-        ContentHeaderBody chb = new ContentHeaderBody();
-        BasicContentHeaderProperties bchp = new BasicContentHeaderProperties();
-        bchp.setDeliveryMode((byte)2);
-        chb.properties = bchp;
-        return chb;
-    }
-
     public void testMessageRemains() throws AMQException
     {
         // TODO: fix hardcoded protocol version data
-        AMQMessage message = new AMQMessage(_store.getNewMessageId(), new BasicPublishBody((byte)8,
-                                                                                           (byte)0,
-                                                                                           BasicPublishBody.getClazz((byte)8,(byte)0),
-                                                                                           BasicPublishBody.getMethod((byte)8,(byte)0),
-                                                                                           null,
-                                                                                           false,
-                                                                                           false,
-                                                                                           null,
-                                                                                           0),
-                                            new NonTransactionalContext(_store, _storeContext, null, null, null),
-                                            createPersistentContentHeader());
+        AMQMessage message = new AMQMessage(_store, 
+            new MessageTransferBody((byte)0,
+                                    (byte)9,
+                                    MessageTransferBody.getClazz((byte)0,(byte)9),
+                                    MessageTransferBody.getMethod((byte)0,(byte)9),
+                                    null, // AMQShortString appId
+                                    null, // FieldTable applicationHeaders
+                                    null, // Content body
+                                    null, // AMQShortString contentEncoding
+                                    null, // AMQShortString contentType
+                                    null, // AMQShortString correlationId
+                                    (short)0, // short deliveryMode
+                                    null, // AMQShortString destination
+                                    null, // AMQShortString exchange
+                                    0L, // long expiration
+                                    false, // boolean immediate
+                                    false, // boolean mandatory
+                                    null, // AMQShortString messageId
+                                    (short)0, // short priority
+                                    false, // boolean redelivered
+                                    null, // AMQShortString replyTo
+                                    null, // AMQShortString routingKey
+                                    null, // byte[] securityToken
+                                    0, // int ticket
+                                    0L, // long timestamp
+                                    null, // AMQShortString transactionId
+                                    0L, // long ttl
+                                    null), // AMQShortString userId
+            txnContext);
         message.incrementReference();
         // we call routing complete to set up the handle
-        message.routingComplete(_store, _storeContext, new MessageHandleFactory());
+//        message.routingComplete(_store, _storeContext, new MessageHandleFactory());
         assertTrue(_store.getMessageMetaDataMap().size() == 1);
         message.incrementReference();
         message.decrementReference(_storeContext);

Copied: incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java (from r501854, incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java?view=diff&rev=507672&p1=incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java&r1=501854&p2=incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java&r2=507672
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java Wed Feb 14 12:02:03 2007
@@ -21,7 +21,6 @@
 package org.apache.qpid.server.store;
 
 import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.framing.ContentBody;
 
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -35,7 +34,7 @@
     public TestableMemoryMessageStore()
     {
         _metaDataMap = new ConcurrentHashMap<Long, MessageMetaData>();
-        _contentBodyMap = new ConcurrentHashMap<Long, List<ContentBody>>();
+        _contentBodyMap = new ConcurrentHashMap<Long, List<byte[]>>();
     }
 
     public ConcurrentMap<Long, MessageMetaData> getMessageMetaDataMap()
@@ -43,7 +42,7 @@
         return _metaDataMap;
     }
 
-    public ConcurrentMap<Long, List<ContentBody>> getContentBodyMap()
+    public ConcurrentMap<Long, List<byte[]>> getContentBodyMap()
     {
         return _contentBodyMap;
     }

Modified: incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java Wed Feb 14 12:02:03 2007
@@ -7,9 +7,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -27,6 +27,9 @@
 import org.apache.qpid.framing.ContentHeaderBody;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.server.AMQChannel;
+import org.apache.qpid.server.RequiredDeliveryException;
+import org.apache.qpid.server.txn.TransactionalContext;
+import org.apache.qpid.server.txn.NonTransactionalContext;
 import org.apache.qpid.server.exchange.AbstractExchange;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.handler.OnCurrentThreadExecutor;
@@ -43,6 +46,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.LinkedList;
 
 public class SendPerfTest extends TimedRun
 {
@@ -101,13 +105,16 @@
         ContentHeaderBody header = new ContentHeaderBody();
         List<ContentBody> body = new ArrayList<ContentBody>();
         MessageStore messageStore = new SkeletonMessageStore();
+        // channel can be null since it is only used in ack processing which does not apply to this test
+        TransactionalContext txContext = new NonTransactionalContext(messageStore, null,
+                                                                     new LinkedList<RequiredDeliveryException>());
         body.add(new ContentBody());
+        MessageHandleFactory factory = new MessageHandleFactory();
         for (int i = 0; i < count; i++)
         {
-            for (AMQQueue q : queues)
-            {
-                q.deliver(new AMQMessage(messageStore, i, publish, header, body));
-            }
+            // this routes and delivers the message
+            AMQMessage msg = new AMQMessage(i, publish, txContext, header, queues, body, messageStore,
+                                            factory);
         }
     }
 

Modified: incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java Wed Feb 14 12:02:03 2007
@@ -7,9 +7,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,22 +20,19 @@
  */
 package org.apache.qpid.test.unit.ack;
 
+import junit.framework.TestCase;
 import org.apache.log4j.Logger;
 import org.apache.log4j.xml.DOMConfigurator;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
 import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.TestableMemoryMessageStore;
 import org.apache.qpid.server.util.TestApplicationRegistry;
-import org.apache.qpid.test.VMBrokerSetup;
 
 import javax.jms.*;
 
-import junit.framework.TestCase;
-
 public class DisconnectAndRedeliverTest extends TestCase
 {
     private static final Logger _logger = Logger.getLogger(DisconnectAndRedeliverTest.class);
@@ -55,12 +52,14 @@
     protected void setUp() throws Exception
     {
         super.setUp();
+        TransportConnection.createVMBroker(1);
         ApplicationRegistry.initialise(new TestApplicationRegistry(), 1);
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
+        TransportConnection.killAllVMBrokers();
     }
 
     /**
@@ -82,7 +81,7 @@
         ((AMQSession) consumerSession).declareExchangeSynch("amq.direct", "direct");
 
         Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "/test");
-                 
+
 
         Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         MessageProducer producer = producerSession.createProducer(queue);
@@ -149,7 +148,7 @@
         _logger.info("No messages redelivered as is expected");
         con.close();
 
-        _logger.info("Actually:" + store.getMessageMap().size());
+        _logger.info("Actually:" + store.getMessageMetaDataMap().size());
         //  assertTrue(store.getMessageMap().size() == 0);
     }
 
@@ -204,13 +203,13 @@
         assertNull(tm);
         _logger.info("No messages redelivered as is expected");
 
-        _logger.info("Actually:" + store.getMessageMap().size());
-        assertTrue(store.getMessageMap().size() == 0);
+        _logger.info("Actually:" + store.getMessageMetaDataMap().size());
+        assertTrue(store.getMessageMetaDataMap().size() == 0);
         con.close();
     }
 
     public static junit.framework.Test suite()
     {
-        return new VMBrokerSetup(new junit.framework.TestSuite(DisconnectAndRedeliverTest.class));
+        return new junit.framework.TestSuite(DisconnectAndRedeliverTest.class);
     }
 }