activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [01/17] activemq-artemis git commit: ARTEMIS-1009 Pure Message Encoding. [Forced Update!]
Date Sun, 05 Mar 2017 16:50:02 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/artemis-1009 4ade9b212 -> 0a7eee6f5 (forced update)


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FakeStorageManager.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FakeStorageManager.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FakeStorageManager.java
index c3670c5..67cfe18 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FakeStorageManager.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FakeStorageManager.java
@@ -19,8 +19,8 @@ package org.apache.activemq.artemis.tests.integration.server;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 
 public class FakeStorageManager extends NullStorageManager {
 
@@ -29,12 +29,12 @@ public class FakeStorageManager extends NullStorageManager {
    List<Long> ackIds = new ArrayList<>();
 
    @Override
-   public void storeMessage(final ServerMessage message) throws Exception {
+   public void storeMessage(final Message message) throws Exception {
       messageIds.add(message.getMessageID());
    }
 
    @Override
-   public void storeMessageTransactional(final long txID, final ServerMessage message) throws Exception {
+   public void storeMessageTransactional(final long txID, final Message message) throws Exception {
       messageIds.add(message.getMessageID());
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
index cba3008..ec49ece 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
@@ -425,7 +425,7 @@ public class ScaleDownTest extends ClusterTestBase {
 
       while (!servers[0].getPagingManager().getPageStore(new SimpleString(addressName)).isPaging()) {
          for (int i = 0; i < CHUNK_SIZE; i++) {
-            Message message = session.createMessage(true);
+            ClientMessage message = session.createMessage(true);
             message.getBodyBuffer().writeBytes(new byte[1024]);
             producer.send(message);
             messageCount++;
@@ -463,7 +463,7 @@ public class ScaleDownTest extends ClusterTestBase {
 
       while (!servers[0].getPagingManager().getPageStore(new SimpleString(addressName)).isPaging()) {
          for (int i = 0; i < CHUNK_SIZE; i++) {
-            Message message = session.createMessage(true);
+            ClientMessage message = session.createMessage(true);
             message.getBodyBuffer().writeBytes(new byte[1024]);
             message.putIntProperty("order", i);
             producer.send(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java
index 89f7a60..141a6b8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java
@@ -27,6 +27,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQConnectionTimedOutException;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
 import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
@@ -41,7 +42,6 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.utils.RandomUtil;
@@ -127,7 +127,7 @@ public class CoreClientOverOneWaySSLTest extends ActiveMQTestBase {
       ClientConsumer consumer = addClientConsumer(session.createConsumer(CoreClientOverOneWaySSLTest.QUEUE));
       session.start();
 
-      Message m = consumer.receive(1000);
+      ClientMessage m = consumer.receive(1000);
       Assert.assertNotNull(m);
       Assert.assertEquals(text, m.getBodyBuffer().readString());
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
index 772e44d..11b3b0b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java
@@ -26,7 +26,6 @@ import io.netty.handler.ssl.SslHandler;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
 import org.apache.activemq.artemis.api.core.Interceptor;
-import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
@@ -151,7 +150,7 @@ public class CoreClientOverTwoWaySSLTest extends ActiveMQTestBase {
       ClientConsumer consumer = session.createConsumer(CoreClientOverTwoWaySSLTest.QUEUE);
       session.start();
 
-      Message m = consumer.receive(1000);
+      ClientMessage m = consumer.receive(1000);
       Assert.assertNotNull(m);
       Assert.assertEquals(text, m.getBodyBuffer().readString());
    }
@@ -189,7 +188,7 @@ public class CoreClientOverTwoWaySSLTest extends ActiveMQTestBase {
       ClientConsumer consumer = session.createConsumer(CoreClientOverTwoWaySSLTest.QUEUE);
       session.start();
 
-      Message m = consumer.receive(1000);
+      ClientMessage m = consumer.receive(1000);
       Assert.assertNotNull(m);
       Assert.assertEquals(text, m.getBodyBuffer().readString());
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/storage/PersistMultiThreadTest.java
----------------------------------------------------------------------
diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/storage/PersistMultiThreadTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/storage/PersistMultiThreadTest.java
index 0ee92e9..0c4dbf5 100644
--- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/storage/PersistMultiThreadTest.java
+++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/storage/PersistMultiThreadTest.java
@@ -26,7 +26,9 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.paging.PagingManager;
 import org.apache.activemq.artemis.core.paging.PagingStore;
 import org.apache.activemq.artemis.core.paging.cursor.PageCursorProvider;
@@ -37,8 +39,6 @@ import org.apache.activemq.artemis.core.replication.ReplicationManager;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.JournalType;
 import org.apache.activemq.artemis.core.server.RouteContextList;
-import org.apache.activemq.artemis.core.server.ServerMessage;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.Transaction;
@@ -188,8 +188,9 @@ public class PersistMultiThreadTest extends ActiveMQTestBase {
       }
 
       private void storeMessage(long txID, long id) throws Exception {
-         ServerMessage message = new ServerMessageImpl(id, 10 * 1024);
-         message.setPagingStore(fakePagingStore);
+         Message message = new CoreMessage(id, 10 * 1024);
+         // TODO-now: fix this
+         message.setContext(fakePagingStore);
 
          message.getBodyBuffer().writeBytes(new byte[104]);
          message.putStringProperty("hello", "" + id);
@@ -248,6 +249,26 @@ public class PersistMultiThreadTest extends ActiveMQTestBase {
    class FakePagingStore implements PagingStore {
 
       @Override
+      public void durableDown(Message message, int durableCount) {
+
+      }
+
+      @Override
+      public void durableUp(Message message, int durableCount) {
+
+      }
+
+      @Override
+      public void nonDurableUp(Message message, int nonDurableCoun) {
+
+      }
+
+      @Override
+      public void nonDurableDown(Message message, int nonDurableCoun) {
+
+      }
+
+      @Override
       public SimpleString getAddress() {
          return null;
       }
@@ -328,7 +349,7 @@ public class PersistMultiThreadTest extends ActiveMQTestBase {
       }
 
       @Override
-      public boolean page(ServerMessage message,
+      public boolean page(Message message,
                           Transaction tx,
                           RouteContextList listCtx,
                           ReentrantReadWriteLock.ReadLock readLock) throws Exception {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java
index d902d3c..61c8d30 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java
@@ -25,9 +25,12 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.filter.Filter;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.paging.cursor.PageCache;
 import org.apache.activemq.artemis.core.paging.cursor.PageCursorProvider;
 import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
@@ -39,10 +42,7 @@ import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContex
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.RoutingContext;
-import org.apache.activemq.artemis.api.core.RoutingType;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.RoutingContextImpl;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.Transaction;
 import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl;
@@ -147,7 +147,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
       PageSubscription cursorEven = createNonPersistentCursor(new Filter() {
 
          @Override
-         public boolean match(ServerMessage message) {
+         public boolean match(Message message) {
             Boolean property = message.getBooleanProperty("even");
             if (property == null) {
                return false;
@@ -166,7 +166,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
       PageSubscription cursorOdd = createNonPersistentCursor(new Filter() {
 
          @Override
-         public boolean match(ServerMessage message) {
+         public boolean match(Message message) {
             Boolean property = message.getBooleanProperty("even");
             if (property == null) {
                return false;
@@ -382,7 +382,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
 
          ActiveMQBuffer buffer = RandomUtil.randomBuffer(messageSize, i + 1L);
 
-         ServerMessage msg = new ServerMessageImpl(i, buffer.writerIndex());
+         Message msg = new CoreMessage(i, buffer.writerIndex());
          msg.putIntProperty("key", i);
 
          msg.getBodyBuffer().writeBytes(buffer, 0, buffer.writerIndex());
@@ -415,7 +415,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
 
             ActiveMQBuffer buffer = RandomUtil.randomBuffer(messageSize, i + 1L);
 
-            ServerMessage msg = new ServerMessageImpl(i, buffer.writerIndex());
+            Message msg = new CoreMessage(i, buffer.writerIndex());
             msg.putIntProperty("key", i);
 
             msg.getBodyBuffer().writeBytes(buffer, 0, buffer.writerIndex());
@@ -445,7 +445,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
 
             ActiveMQBuffer buffer = RandomUtil.randomBuffer(messageSize, i + 1L);
 
-            ServerMessage msg = new ServerMessageImpl(i, buffer.writerIndex());
+            Message msg = new CoreMessage(i, buffer.writerIndex());
             msg.putIntProperty("key", i + 1);
 
             msg.getBodyBuffer().writeBytes(buffer, 0, buffer.writerIndex());
@@ -530,7 +530,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
                      //System.out.println("Sending " + count);
                      ActiveMQBuffer buffer = RandomUtil.randomBuffer(messageSize, count);
 
-                     ServerMessage msg = new ServerMessageImpl(i, buffer.writerIndex());
+                     Message msg = new CoreMessage(i, buffer.writerIndex());
                      msg.putIntProperty("key", count++);
 
                      msg.getBodyBuffer().writeBytes(buffer, 0, buffer.writerIndex());
@@ -666,7 +666,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
 
    }
 
-   private int tstProperty(ServerMessage msg) {
+   private int tstProperty(Message msg) {
       return msg.getIntProperty("key").intValue();
    }
 
@@ -747,7 +747,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
             System.out.println("Paged " + i);
          ActiveMQBuffer buffer = RandomUtil.randomBuffer(messageSize, i + 1L);
 
-         ServerMessage msg = new ServerMessageImpl(i, buffer.writerIndex());
+         Message msg = new CoreMessage(i, buffer.writerIndex());
          msg.putIntProperty("key", i);
          // to be used on tests that are validating filters
          msg.putBooleanProperty("even", i % 2 == 0);
@@ -850,7 +850,7 @@ public class PageCursorStressTest extends ActiveMQTestBase {
 
       for (int i = start; i < start + NUM_MESSAGES; i++) {
          ActiveMQBuffer buffer = RandomUtil.randomBuffer(messageSize, i + 1L);
-         ServerMessage msg = new ServerMessageImpl(storage.generateID(), buffer.writerIndex());
+         Message msg = new CoreMessage(storage.generateID(), buffer.writerIndex());
          msg.getBodyBuffer().writeBytes(buffer, 0, buffer.writerIndex());
          msg.putIntProperty("key", i);
          pageStore.page(msg, ctx.getTransaction(), ctx.getContextListing(ADDRESS), lock);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
index 34ce7ac..6d73cfd 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java
@@ -19,12 +19,12 @@ package org.apache.activemq.artemis.tests.timing.core.server.impl;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.server.HandleStatus;
 import org.apache.activemq.artemis.core.server.MessageReference;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.QueueConfig;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.QueueImpl;
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
 import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeConsumer;
@@ -138,9 +138,9 @@ public class QueueConcurrentTest extends ActiveMQTestBase {
          long start = System.currentTimeMillis();
 
          while (System.currentTimeMillis() - start < testTime) {
-            ServerMessage message = generateMessage(i);
+            Message message = generateMessage(i);
 
-            MessageReference ref = message.createReference(queue);
+            MessageReference ref = MessageReference.Factory.createReference(message, queue);
 
             queue.addTail(ref, false);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/unit-tests/pom.xml b/tests/unit-tests/pom.xml
index 32ca63b..803bf39 100644
--- a/tests/unit-tests/pom.xml
+++ b/tests/unit-tests/pom.xml
@@ -54,6 +54,12 @@
       </dependency>
       <dependency>
          <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-amqp-protocol</artifactId>
+         <version>${project.version}</version>
+         <scope>test</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
          <artifactId>artemis-jms-server</artifactId>
          <version>${project.version}</version>
       </dependency>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java
index d1536d4..39507aa 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java
@@ -2426,7 +2426,7 @@ public abstract class JournalImplTestUnit extends JournalImplTestBase {
    }
 
    @Test
-   public void testTransactionChangesNotVisibleOutsideTX() throws Exception {
+   public void testTransactionChangesNotVisibleOutsideTXtestTransactionChangesNotVisibleOutsideTX() throws Exception {
       setup(10, 10 * 1024, true);
       createJournal();
       startJournal();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
index 252b0eb..e88097a 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java
@@ -21,11 +21,12 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.ICoreMessage;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.client.impl.ClientMessageImpl;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionSendMessage;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.utils.RandomUtil;
 import org.junit.Assert;
@@ -46,9 +47,9 @@ public class MessageImplTest extends ActiveMQTestBase {
          final long expiration = RandomUtil.randomLong();
          final long timestamp = RandomUtil.randomLong();
          final byte priority = RandomUtil.randomByte();
-         Message message1 = new ClientMessageImpl(type, durable, expiration, timestamp, priority, 100);
+         ICoreMessage message1 = new ClientMessageImpl(type, durable, expiration, timestamp, priority, 100);
 
-         Message message = message1;
+         ICoreMessage message = message1;
 
          Assert.assertEquals(type, message.getType());
          Assert.assertEquals(durable, message.isDurable());
@@ -63,7 +64,7 @@ public class MessageImplTest extends ActiveMQTestBase {
          final byte priority2 = RandomUtil.randomByte();
 
          message.setAddress(destination);
-         Assert.assertEquals(destination, message.getAddress());
+         Assert.assertEquals(destination, message.getAddressSimpleString());
 
          message.setDurable(durable2);
          Assert.assertEquals(durable2, message.isDurable());
@@ -232,10 +233,9 @@ public class MessageImplTest extends ActiveMQTestBase {
 
    private void internalMessageCopy() throws Exception {
       final long RUNS = 2;
-      final ServerMessageImpl msg = new ServerMessageImpl(123, 18);
+      final CoreMessage msg = new CoreMessage(123, 18);
 
       msg.setMessageID(RandomUtil.randomLong());
-      msg.encodeMessageIDToBuffer();
       msg.setAddress(new SimpleString("Batatantkashf aksjfh aksfjh askfdjh askjfh "));
 
       final AtomicInteger errors = new AtomicInteger(0);
@@ -257,7 +257,7 @@ public class MessageImplTest extends ActiveMQTestBase {
 
             for (int i = 0; i < RUNS; i++) {
                try {
-                  ServerMessageImpl newMsg = (ServerMessageImpl) msg.copy();
+                  Message newMsg = msg.copy();
                } catch (Throwable e) {
                   e.printStackTrace();
                   errors.incrementAndGet();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
index d6e0f72..847e8b7 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java
@@ -17,23 +17,26 @@
 package org.apache.activemq.artemis.tests.unit.core.paging.impl;
 
 import java.nio.ByteBuffer;
-import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.ICoreMessage;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.io.SequentialFile;
 import org.apache.activemq.artemis.core.io.SequentialFileFactory;
 import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
+import org.apache.activemq.artemis.core.message.impl.CoreMessagePersister;
 import org.apache.activemq.artemis.core.paging.PagedMessage;
 import org.apache.activemq.artemis.core.paging.impl.Page;
 import org.apache.activemq.artemis.core.paging.impl.PagedMessageImpl;
 import org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
-import org.apache.activemq.artemis.core.server.ServerMessage;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
+import org.apache.activemq.artemis.core.protocol.core.impl.CoreProtocolManagerFactory;
+import org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessagePersister;
+import org.apache.activemq.artemis.spi.core.protocol.MessagePersister;
 import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
 public class PageTest extends ActiveMQTestBase {
@@ -47,6 +50,12 @@ public class PageTest extends ActiveMQTestBase {
 
    // Public --------------------------------------------------------
 
+   @Before
+   public void registerProtocols() {
+      MessagePersister.registerPersister(CoreProtocolManagerFactory.ID, CoreMessagePersister.getInstance());
+      MessagePersister.registerPersister((byte)2, AMQPMessagePersister.getInstance());
+   }
+
    @Test
    public void testPageWithNIO() throws Exception {
       recreateDirectory(getTestDir());
@@ -64,6 +73,11 @@ public class PageTest extends ActiveMQTestBase {
       testAdd(new FakeSequentialFileFactory(1, false), 10);
    }
 
+   @Test
+   public void testAddCore() throws Exception {
+      testAdd(new NIOSequentialFileFactory(getTestDirfile(), 1), 1);
+   }
+
    /**
     * Validate if everything we add is recovered
     */
@@ -89,7 +103,7 @@ public class PageTest extends ActiveMQTestBase {
 
       SimpleString simpleDestination = new SimpleString("Test");
 
-      ArrayList<ActiveMQBuffer> buffers = addPageElements(simpleDestination, impl, numberOfElements);
+      addPageElements(simpleDestination, impl, numberOfElements);
 
       impl.sync();
       impl.close();
@@ -105,9 +119,7 @@ public class PageTest extends ActiveMQTestBase {
       Assert.assertEquals(numberOfElements, impl.getNumberOfMessages());
 
       for (int i = 0; i < msgs.size(); i++) {
-         Assert.assertEquals(simpleDestination, msgs.get(i).getMessage().getAddress());
-
-         ActiveMQTestBase.assertEqualsByteArrays(buffers.get(i).toByteBuffer().array(), msgs.get(i).getMessage().getBodyBuffer().toByteBuffer().array());
+         Assert.assertEquals(simpleDestination, msgs.get(i).getMessage().getAddressSimpleString());
       }
 
       impl.delete(null);
@@ -130,7 +142,7 @@ public class PageTest extends ActiveMQTestBase {
 
       SimpleString simpleDestination = new SimpleString("Test");
 
-      ArrayList<ActiveMQBuffer> buffers = addPageElements(simpleDestination, impl, numberOfElements);
+      addPageElements(simpleDestination, impl, numberOfElements);
 
       impl.sync();
 
@@ -170,9 +182,7 @@ public class PageTest extends ActiveMQTestBase {
       Assert.assertEquals(numberOfElements, impl.getNumberOfMessages());
 
       for (int i = 0; i < msgs.size(); i++) {
-         Assert.assertEquals(simpleDestination, msgs.get(i).getMessage().getAddress());
-
-         ActiveMQTestBase.assertEqualsByteArrays(buffers.get(i).toByteBuffer().array(), msgs.get(i).getMessage().getBodyBuffer().toByteBuffer().array());
+         Assert.assertEquals(simpleDestination, msgs.get(i).getMessage().getAddressSimpleString());
       }
 
       impl.delete(null);
@@ -190,29 +200,25 @@ public class PageTest extends ActiveMQTestBase {
     * @return
     * @throws Exception
     */
-   protected ArrayList<ActiveMQBuffer> addPageElements(final SimpleString simpleDestination,
+   protected void addPageElements(final SimpleString simpleDestination,
                                                        final Page page,
                                                        final int numberOfElements) throws Exception {
-      ArrayList<ActiveMQBuffer> buffers = new ArrayList<>();
 
       int initialNumberOfMessages = page.getNumberOfMessages();
 
       for (int i = 0; i < numberOfElements; i++) {
-         ServerMessage msg = new ServerMessageImpl(i, 100);
+         ICoreMessage msg = new CoreMessage().initBuffer(100);
 
          for (int j = 0; j < 10; j++) {
             msg.getBodyBuffer().writeByte((byte) 'b');
          }
 
-         buffers.add(msg.getBodyBuffer());
-
          msg.setAddress(simpleDestination);
 
          page.write(new PagedMessageImpl(msg, new long[0]));
 
          Assert.assertEquals(initialNumberOfMessages + i + 1, page.getNumberOfMessages());
       }
-      return buffers;
    }
 
    // Package protected ---------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
index 10b9a06..60f7a15 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java
@@ -22,7 +22,9 @@ import java.util.List;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
 
+import org.apache.activemq.artemis.api.core.ICoreMessage;
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.paging.PagedMessage;
 import org.apache.activemq.artemis.core.paging.PagingStore;
 import org.apache.activemq.artemis.core.paging.impl.Page;
@@ -30,9 +32,7 @@ import org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl;
 import org.apache.activemq.artemis.core.paging.impl.PagingStoreFactoryNIO;
 import org.apache.activemq.artemis.core.persistence.StorageManager;
 import org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.RoutingContextImpl;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
@@ -63,7 +63,7 @@ public class PagingManagerImplTest extends ActiveMQTestBase {
 
       PagingStore store = managerImpl.getPageStore(new SimpleString("simple-test"));
 
-      ServerMessage msg = createMessage(1L, new SimpleString("simple-test"), createRandomBuffer(10));
+      ICoreMessage msg = createMessage(1L, new SimpleString("simple-test"), createRandomBuffer(10));
 
       final RoutingContextImpl ctx = new RoutingContextImpl(null);
       Assert.assertFalse(store.page(msg, ctx.getTransaction(), ctx.getContextListing(store.getStoreName()), lock));
@@ -82,7 +82,7 @@ public class PagingManagerImplTest extends ActiveMQTestBase {
 
       Assert.assertEquals(1, msgs.size());
 
-      ActiveMQTestBase.assertEqualsByteArrays(msg.getBodyBuffer().writerIndex(), msg.getBodyBuffer().toByteBuffer().array(), msgs.get(0).getMessage().getBodyBuffer().toByteBuffer().array());
+      ActiveMQTestBase.assertEqualsByteArrays(msg.getBodyBuffer().writerIndex(), msg.getBodyBuffer().toByteBuffer().array(), (msgs.get(0).getMessage()).toCore().getBodyBuffer().toByteBuffer().array());
 
       Assert.assertTrue(store.isPaging());
 
@@ -104,10 +104,10 @@ public class PagingManagerImplTest extends ActiveMQTestBase {
       pageDirDir.mkdirs();
    }
 
-   protected ServerMessage createMessage(final long messageId,
-                                         final SimpleString destination,
-                                         final ByteBuffer buffer) {
-      ServerMessage msg = new ServerMessageImpl(messageId, 200);
+   protected ICoreMessage createMessage(final long messageId,
+                                        final SimpleString destination,
+                                        final ByteBuffer buffer) {
+      ICoreMessage msg = new CoreMessage(messageId, 200);
 
       msg.setAddress(destination);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
index 923e719..af58a53 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
@@ -33,10 +33,12 @@ import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.io.SequentialFile;
 import org.apache.activemq.artemis.core.io.SequentialFileFactory;
 import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.paging.PageTransactionInfo;
 import org.apache.activemq.artemis.core.paging.PagedMessage;
 import org.apache.activemq.artemis.core.paging.PagingManager;
@@ -49,10 +51,8 @@ import org.apache.activemq.artemis.core.paging.impl.PageTransactionInfoImpl;
 import org.apache.activemq.artemis.core.paging.impl.PagingStoreImpl;
 import org.apache.activemq.artemis.core.persistence.StorageManager;
 import org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.files.FileStoreMonitor;
 import org.apache.activemq.artemis.core.server.impl.RoutingContextImpl;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
@@ -152,7 +152,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
       buffers.add(buffer);
       SimpleString destination = new SimpleString("test");
 
-      ServerMessage msg = createMessage(1, storeImpl, destination, buffer);
+      Message msg = createMessage(1, storeImpl, destination, buffer);
 
       Assert.assertTrue(storeImpl.isPaging());
 
@@ -197,7 +197,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
 
          buffers.add(buffer);
 
-         ServerMessage msg = createMessage(i, storeImpl, destination, buffer);
+         Message msg = createMessage(i, storeImpl, destination, buffer);
          final RoutingContextImpl ctx = new RoutingContextImpl(null);
          Assert.assertTrue(storeImpl.page(msg, ctx.getTransaction(), ctx.getContextListing(storeImpl.getStoreName()), lock));
 
@@ -224,7 +224,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
 
       for (int i = 0; i < numMessages; i++) {
          ActiveMQBuffer horn1 = buffers.get(i);
-         ActiveMQBuffer horn2 = msg.get(i).getMessage().getBodyBuffer();
+         ActiveMQBuffer horn2 = msg.get(i).getMessage().toCore().getBodyBuffer();
          horn1.resetReaderIndex();
          horn2.resetReaderIndex();
          for (int j = 0; j < horn1.writerIndex(); j++) {
@@ -263,7 +263,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
             store.forceAnotherPage();
          }
 
-         ServerMessage msg = createMessage(i, store, destination, buffer);
+         Message msg = createMessage(i, store, destination, buffer);
 
          final RoutingContextImpl ctx = new RoutingContextImpl(null);
          Assert.assertTrue(store.page(msg, ctx.getTransaction(), ctx.getContextListing(store.getStoreName()), lock));
@@ -290,7 +290,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
 
          for (int i = 0; i < 5; i++) {
             Assert.assertEquals(sequence++, msg.get(i).getMessage().getMessageID());
-            ActiveMQTestBase.assertEqualsBuffers(18, buffers.get(pageNr * 5 + i), msg.get(i).getMessage().getBodyBuffer());
+            ActiveMQTestBase.assertEqualsBuffers(18, buffers.get(pageNr * 5 + i), msg.get(i).getMessage().toCore().getBodyBuffer());
          }
       }
 
@@ -298,7 +298,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
 
       Assert.assertTrue(store.isPaging());
 
-      ServerMessage msg = createMessage(1, store, destination, buffers.get(0));
+      Message msg = createMessage(1, store, destination, buffers.get(0));
 
       final RoutingContextImpl ctx = new RoutingContextImpl(null);
       Assert.assertTrue(store.page(msg, ctx.getTransaction(), ctx.getContextListing(store.getStoreName()), lock));
@@ -341,7 +341,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
 
       Assert.assertEquals(1L, msgs.get(0).getMessage().getMessageID());
 
-      ActiveMQTestBase.assertEqualsBuffers(18, buffers.get(0), msgs.get(0).getMessage().getBodyBuffer());
+      ActiveMQTestBase.assertEqualsBuffers(18, buffers.get(0), msgs.get(0).getMessage().toCore().getBodyBuffer());
 
       Assert.assertEquals(1, store.getNumberOfPages());
 
@@ -374,7 +374,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
 
       final CountDownLatch latchStart = new CountDownLatch(numberOfThreads);
 
-      final ConcurrentHashMap<Long, ServerMessage> buffers = new ConcurrentHashMap<>();
+      final ConcurrentHashMap<Long, Message> buffers = new ConcurrentHashMap<>();
 
       final ArrayList<Page> readPages = new ArrayList<>();
 
@@ -408,7 +408,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
                   // Each thread will Keep paging until all the messages are depaged.
                   // This is possible because the depage thread is not actually reading the pages.
                   // Just using the internal API to remove it from the page file system
-                  ServerMessage msg = createMessage(id, storeImpl, destination, createRandomBuffer(id, 5));
+                  Message msg = createMessage(id, storeImpl, destination, createRandomBuffer(id, 5));
                   final RoutingContextImpl ctx2 = new RoutingContextImpl(null);
                   if (storeImpl.page(msg, ctx2.getTransaction(), ctx2.getContextListing(storeImpl.getStoreName()), lock)) {
                      buffers.put(id, msg);
@@ -477,7 +477,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
          throw consumer.e;
       }
 
-      final ConcurrentMap<Long, ServerMessage> buffers2 = new ConcurrentHashMap<>();
+      final ConcurrentMap<Long, Message> buffers2 = new ConcurrentHashMap<>();
 
       for (Page page : readPages) {
          page.open();
@@ -485,14 +485,14 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
          page.close();
 
          for (PagedMessage msg : msgs) {
-            long id = msg.getMessage().getBodyBuffer().readLong();
-            msg.getMessage().getBodyBuffer().resetReaderIndex();
+            long id = msg.getMessage().toCore().getBodyBuffer().readLong();
+            msg.getMessage().toCore().getBodyBuffer().resetReaderIndex();
 
-            ServerMessage msgWritten = buffers.remove(id);
+            Message msgWritten = buffers.remove(id);
             buffers2.put(id, msg.getMessage());
             Assert.assertNotNull(msgWritten);
-            Assert.assertEquals(msg.getMessage().getAddress(), msgWritten.getAddress());
-            ActiveMQTestBase.assertEqualsBuffers(10, msgWritten.getBodyBuffer(), msg.getMessage().getBodyBuffer());
+            Assert.assertEquals(msg.getMessage().getAddress(), msgWritten.getAddressSimpleString());
+            ActiveMQTestBase.assertEqualsBuffers(10, msgWritten.toCore().getBodyBuffer(), msg.getMessage().toCore().getBodyBuffer());
          }
       }
 
@@ -522,7 +522,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
       Assert.assertEquals(numberOfPages, storeImpl2.getNumberOfPages());
 
       long lastMessageId = messageIdGenerator.incrementAndGet();
-      ServerMessage lastMsg = createMessage(lastMessageId, storeImpl, destination, createRandomBuffer(lastMessageId, 5));
+      Message lastMsg = createMessage(lastMessageId, storeImpl, destination, createRandomBuffer(lastMessageId, 5));
 
       storeImpl2.forceAnotherPage();
 
@@ -547,11 +547,11 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
 
          for (PagedMessage msg : msgs) {
 
-            long id = msg.getMessage().getBodyBuffer().readLong();
-            ServerMessage msgWritten = buffers2.remove(id);
+            long id = msg.getMessage().toCore().getBodyBuffer().readLong();
+            Message msgWritten = buffers2.remove(id);
             Assert.assertNotNull(msgWritten);
-            Assert.assertEquals(msg.getMessage().getAddress(), msgWritten.getAddress());
-            ActiveMQTestBase.assertEqualsByteArrays(msgWritten.getBodyBuffer().writerIndex(), msgWritten.getBodyBuffer().toByteBuffer().array(), msg.getMessage().getBodyBuffer().toByteBuffer().array());
+            Assert.assertEquals(msg.getMessage().getAddress(), msgWritten.getAddressSimpleString());
+            ActiveMQTestBase.assertEqualsByteArrays(msgWritten.toCore().getBodyBuffer().writerIndex(), msgWritten.toCore().getBodyBuffer().toByteBuffer().array(), msg.getMessage().toCore().getBodyBuffer().toByteBuffer().array());
          }
       }
 
@@ -560,8 +560,8 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
       lastPage.close();
       Assert.assertEquals(1, lastMessages.size());
 
-      lastMessages.get(0).getMessage().getBodyBuffer().resetReaderIndex();
-      Assert.assertEquals(lastMessages.get(0).getMessage().getBodyBuffer().readLong(), lastMessageId);
+      lastMessages.get(0).getMessage().toCore().getBodyBuffer().resetReaderIndex();
+      Assert.assertEquals(lastMessages.get(0).getMessage().toCore().getBodyBuffer().readLong(), lastMessageId);
 
       Assert.assertEquals(0, buffers2.size());
 
@@ -643,7 +643,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
                   // Each thread will Keep paging until all the messages are depaged.
                   // This is possible because the depage thread is not actually reading the pages.
                   // Just using the internal API to remove it from the page file system
-                  ServerMessage msg = createMessage(i, store, destination, createRandomBuffer(i, 1024));
+                  Message msg = createMessage(i, store, destination, createRandomBuffer(i, 1024));
                   msg.putLongProperty("count", i);
 
                   final RoutingContextImpl ctx2 = new RoutingContextImpl(null);
@@ -681,7 +681,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
                      List<PagedMessage> messages = page.read(new NullStorageManager());
 
                      for (PagedMessage pgmsg : messages) {
-                        ServerMessage msg = pgmsg.getMessage();
+                        Message msg = pgmsg.getMessage();
 
                         Assert.assertEquals(msgsRead++, msg.getMessageID());
 
@@ -739,15 +739,15 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
       };
    }
 
-   private ServerMessage createMessage(final long id,
+   private CoreMessage createMessage(final long id,
                                        final PagingStore store,
                                        final SimpleString destination,
                                        final ActiveMQBuffer buffer) {
-      ServerMessage msg = new ServerMessageImpl(id, 50 + buffer.capacity());
+      CoreMessage msg = new CoreMessage(id, 50 + buffer.capacity());
 
       msg.setAddress(destination);
 
-      msg.setPagingStore(store);
+      msg.setContext(store);
 
       msg.getBodyBuffer().resetReaderIndex();
       msg.getBodyBuffer().resetWriterIndex();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
index 8cc138d..830e61f 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java
@@ -22,8 +22,10 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.filter.Filter;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.BindingType;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
@@ -31,10 +33,8 @@ import org.apache.activemq.artemis.core.postoffice.impl.BindingsImpl;
 import org.apache.activemq.artemis.core.server.Bindable;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.RoutingContext;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.RefsOperation;
 import org.apache.activemq.artemis.core.server.impl.RoutingContextImpl;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.transaction.Transaction;
 import org.apache.activemq.artemis.core.transaction.TransactionOperation;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
@@ -91,9 +91,9 @@ public class BindingsImplTest extends ActiveMQTestBase {
 
       for (int i = 0; i < 100; i++) {
          if (route) {
-            bind.route(new ServerMessageImpl(i, 100), new RoutingContextImpl(new FakeTransaction()));
+            bind.route(new CoreMessage(i, 100), new RoutingContextImpl(new FakeTransaction()));
          } else {
-            bind.redistribute(new ServerMessageImpl(i, 100), queue, new RoutingContextImpl(new FakeTransaction()));
+            bind.redistribute(new CoreMessage(i, 100), queue, new RoutingContextImpl(new FakeTransaction()));
          }
       }
    }
@@ -273,7 +273,7 @@ public class BindingsImplTest extends ActiveMQTestBase {
        * @see org.apache.activemq.artemis.core.filter.Filter#match(org.apache.activemq.artemis.core.server.ServerMessage)
        */
       @Override
-      public boolean match(final ServerMessage message) {
+      public boolean match(final Message message) {
          return false;
       }
 
@@ -372,12 +372,12 @@ public class BindingsImplTest extends ActiveMQTestBase {
       }
 
       @Override
-      public boolean isHighAcceptPriority(final ServerMessage message) {
+      public boolean isHighAcceptPriority(final Message message) {
          return false;
       }
 
       @Override
-      public void route(final ServerMessage message, final RoutingContext context) throws Exception {
+      public void route(final Message message, final RoutingContext context) throws Exception {
 
       }
 
@@ -395,7 +395,7 @@ public class BindingsImplTest extends ActiveMQTestBase {
       }
 
       @Override
-      public void routeWithAck(ServerMessage message, RoutingContext context) {
+      public void routeWithAck(Message message, RoutingContext context) {
 
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/FakeQueue.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/FakeQueue.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/FakeQueue.java
index 8171e39..66bdddb 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/FakeQueue.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/FakeQueue.java
@@ -22,6 +22,8 @@ import java.util.Set;
 import java.util.concurrent.Executor;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
@@ -30,7 +32,6 @@ import org.apache.activemq.artemis.core.server.MessageReference;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.RoutingContext;
 import org.apache.activemq.artemis.api.core.RoutingType;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.AckReason;
 import org.apache.activemq.artemis.core.transaction.Transaction;
 import org.apache.activemq.artemis.utils.LinkedListIterator;
@@ -539,18 +540,18 @@ public class FakeQueue implements Queue {
    }
 
    @Override
-   public void route(final ServerMessage message, final RoutingContext context) throws Exception {
+   public void route(final Message message, final RoutingContext context) throws Exception {
       // no-op
 
    }
 
    @Override
-   public void routeWithAck(ServerMessage message, RoutingContext context) {
+   public void routeWithAck(Message message, RoutingContext context) {
 
    }
 
    @Override
-   public boolean hasMatchingConsumer(final ServerMessage message) {
+   public boolean hasMatchingConsumer(final Message message) {
       // no-op
       return false;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
index 3718afb..b74a4c0 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java
@@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.unit.core.postoffice.impl;
 import java.util.ArrayList;
 import java.util.Collection;
 
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.postoffice.Binding;
@@ -29,7 +30,6 @@ import org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager;
 import org.apache.activemq.artemis.core.server.Bindable;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.RoutingContext;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Test;
@@ -132,7 +132,7 @@ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase {
       }
 
       @Override
-      public boolean isHighAcceptPriority(ServerMessage message) {
+      public boolean isHighAcceptPriority(Message message) {
          return false;
       }
 
@@ -152,7 +152,7 @@ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase {
       }
 
       @Override
-      public void route(ServerMessage message, RoutingContext context) throws Exception {
+      public void route(Message message, RoutingContext context) throws Exception {
       }
 
       @Override
@@ -170,7 +170,7 @@ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase {
       }
 
       @Override
-      public void routeWithAck(ServerMessage message, RoutingContext context) {
+      public void routeWithAck(Message message, RoutingContext context) {
 
       }
    }
@@ -204,14 +204,14 @@ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase {
       }
 
       @Override
-      public boolean redistribute(ServerMessage message,
+      public boolean redistribute(Message message,
                                   Queue originatingQueue,
                                   RoutingContext context) throws Exception {
          return false;
       }
 
       @Override
-      public void route(ServerMessage message, RoutingContext context) throws Exception {
+      public void route(Message message, RoutingContext context) throws Exception {
          System.out.println("routing message: " + message);
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
index 804429f..78179a8 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java
@@ -25,6 +25,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientProducer;
@@ -40,7 +41,6 @@ import org.apache.activemq.artemis.core.server.Consumer;
 import org.apache.activemq.artemis.core.server.HandleStatus;
 import org.apache.activemq.artemis.core.server.MessageReference;
 import org.apache.activemq.artemis.core.server.Queue;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.QueueImpl;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeConsumer;
@@ -157,7 +157,7 @@ public class QueueImplTest extends ActiveMQTestBase {
 
       Filter filter = new Filter() {
          @Override
-         public boolean match(final ServerMessage message) {
+         public boolean match(final Message message) {
             return false;
          }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeFilter.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeFilter.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeFilter.java
index 9d7f0e1..8f394e2 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeFilter.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeFilter.java
@@ -16,9 +16,10 @@
  */
 package org.apache.activemq.artemis.tests.unit.core.server.impl.fakes;
 
+
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.filter.Filter;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 
 public class FakeFilter implements Filter {
 
@@ -36,9 +37,9 @@ public class FakeFilter implements Filter {
    }
 
    @Override
-   public boolean match(final ServerMessage message) {
+   public boolean match(final Message message) {
       if (headerName != null) {
-         Object value = message.getObjectProperty(new SimpleString(headerName));
+         Object value = message.getObjectProperty(headerName);
 
          if (value instanceof SimpleString) {
             value = ((SimpleString) value).toString();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeJournalLoader.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeJournalLoader.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeJournalLoader.java
index 547d669..a84d2d0 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeJournalLoader.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeJournalLoader.java
@@ -20,6 +20,7 @@ import javax.transaction.xa.Xid;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.journal.Journal;
@@ -29,7 +30,6 @@ import org.apache.activemq.artemis.core.persistence.QueueBindingInfo;
 import org.apache.activemq.artemis.core.persistence.impl.PageCountPending;
 import org.apache.activemq.artemis.core.persistence.impl.journal.AddMessageRecord;
 import org.apache.activemq.artemis.core.server.MessageReference;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.JournalLoader;
 import org.apache.activemq.artemis.core.transaction.ResourceManager;
 import org.apache.activemq.artemis.core.transaction.Transaction;
@@ -37,7 +37,7 @@ import org.apache.activemq.artemis.core.transaction.Transaction;
 public class FakeJournalLoader implements JournalLoader {
 
    @Override
-   public void handleNoMessageReferences(Map<Long, ServerMessage> messages) {
+   public void handleNoMessageReferences(Map<Long, Message> messages) {
    }
 
    @Override
@@ -69,7 +69,7 @@ public class FakeJournalLoader implements JournalLoader {
    }
 
    @Override
-   public void handlePreparedSendMessage(ServerMessage message, Transaction tx, long queueID) {
+   public void handlePreparedSendMessage(Message message, Transaction tx, long queueID) {
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
index 6602df5..109a336 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
@@ -35,7 +36,6 @@ import org.apache.activemq.artemis.core.server.MessageReference;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.RoutingContext;
 import org.apache.activemq.artemis.api.core.RoutingType;
-import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.server.impl.MessageReferenceImpl;
 import org.apache.activemq.artemis.core.transaction.Transaction;
@@ -173,14 +173,14 @@ public class FakePostOffice implements PostOffice {
    }
 
    @Override
-   public Pair<RoutingContext, ServerMessage> redistribute(final ServerMessage message,
-                                                           final Queue originatingQueue,
-                                                           final Transaction tx) throws Exception {
+   public Pair<RoutingContext, Message> redistribute(final Message message,
+                                                     final Queue originatingQueue,
+                                                     final Transaction tx) throws Exception {
       return null;
    }
 
    @Override
-   public MessageReference reroute(final ServerMessage message,
+   public MessageReference reroute(final Message message,
                                    final Queue queue,
                                    final Transaction tx) throws Exception {
       message.incrementRefCount();
@@ -188,14 +188,14 @@ public class FakePostOffice implements PostOffice {
    }
 
    @Override
-   public RoutingStatus route(ServerMessage message,
+   public RoutingStatus route(Message message,
                               Transaction tx,
                               boolean direct) throws Exception {
       return RoutingStatus.OK;
    }
 
    @Override
-   public RoutingStatus route(ServerMessage message,
+   public RoutingStatus route(Message message,
                               Transaction tx,
                               boolean direct,
                               boolean rejectDuplicates) throws Exception {
@@ -203,12 +203,12 @@ public class FakePostOffice implements PostOffice {
    }
 
    @Override
-   public RoutingStatus route(ServerMessage message, RoutingContext context, boolean direct) throws Exception {
+   public RoutingStatus route(Message message, RoutingContext context, boolean direct) throws Exception {
       return null;
    }
 
    @Override
-   public RoutingStatus route(ServerMessage message,
+   public RoutingStatus route(Message message,
                               RoutingContext context,
                               boolean direct,
                               boolean rejectDuplicates) throws Exception {
@@ -216,11 +216,11 @@ public class FakePostOffice implements PostOffice {
    }
 
    @Override
-   public void processRoute(ServerMessage message, RoutingContext context, boolean direct) throws Exception {
+   public void processRoute(Message message, RoutingContext context, boolean direct) throws Exception {
    }
 
    @Override
-   public RoutingStatus route(ServerMessage message, boolean direct) throws Exception {
+   public RoutingStatus route(Message message, boolean direct) throws Exception {
       return RoutingStatus.OK;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java
index 500a81f..d1012a6 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java
@@ -19,11 +19,12 @@ package org.apache.activemq.artemis.tests.unit.util;
 import java.util.Collection;
 import java.util.Map;
 
+import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.paging.PageTransactionInfo;
 import org.apache.activemq.artemis.core.paging.PagingManager;
 import org.apache.activemq.artemis.core.paging.PagingStore;
-import org.apache.activemq.artemis.core.server.ServerMessage;
+
 import org.apache.activemq.artemis.core.server.files.FileStoreMonitor;
 
 public final class FakePagingManager implements PagingManager {
@@ -64,11 +65,11 @@ public final class FakePagingManager implements PagingManager {
       return false;
    }
 
-   public boolean page(final ServerMessage message, final boolean duplicateDetection) throws Exception {
+   public boolean page(final Message message, final boolean duplicateDetection) throws Exception {
       return false;
    }
 
-   public boolean page(final ServerMessage message,
+   public boolean page(final Message message,
                        final long transactionId,
                        final boolean duplicateDetection) throws Exception {
       return false;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java
index 3fa2df8..2b5205e 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java
@@ -16,8 +16,8 @@
  */
 package org.apache.activemq.artemis.tests.unit.util;
 
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.server.impl.MessageReferenceImpl;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
 import org.apache.activemq.artemis.utils.MemorySize;
 import org.junit.Assert;
@@ -30,7 +30,7 @@ public class MemorySizeTest extends Assert {
       UnitTestLogger.LOGGER.info("Server message size is " + MemorySize.calculateSize(new MemorySize.ObjectFactory() {
          @Override
          public Object createObject() {
-            return new ServerMessageImpl(1, 1000);
+            return new CoreMessage(1, 1000);
          }
       }));
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4894015d/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
index b07f5bf..570c791 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UTF8Test.java
@@ -44,7 +44,7 @@ public class UTF8Test extends ActiveMQTestBase {
 
       String str = new String(bytes);
 
-      UTF8Util.saveUTF(buffer, str);
+      UTF8Util.saveUTF(buffer.byteBuf(), str);
 
       String newStr = UTF8Util.readUTF(buffer);
 
@@ -72,7 +72,7 @@ public class UTF8Test extends ActiveMQTestBase {
    }
 
    private void testValidateUTFOnDataInputStream(final String str, final ActiveMQBuffer wrap) throws Exception {
-      UTF8Util.saveUTF(wrap, str);
+      UTF8Util.saveUTF(wrap.byteBuf(), str);
 
       DataInputStream data = new DataInputStream(new ByteArrayInputStream(wrap.toByteBuffer().array()));
 
@@ -106,7 +106,7 @@ public class UTF8Test extends ActiveMQTestBase {
       ActiveMQBuffer buffer = ActiveMQBuffers.fixedBuffer(0xffff + 4);
 
       try {
-         UTF8Util.saveUTF(buffer, str);
+         UTF8Util.saveUTF(buffer.byteBuf(), str);
          Assert.fail("String is too big, supposed to throw an exception");
       } catch (Exception ignored) {
       }
@@ -122,7 +122,7 @@ public class UTF8Test extends ActiveMQTestBase {
       str = new String(chars);
 
       try {
-         UTF8Util.saveUTF(buffer, str);
+         UTF8Util.saveUTF(buffer.byteBuf(), str);
          Assert.fail("Encoded String is too big, supposed to throw an exception");
       } catch (Exception ignored) {
       }
@@ -138,7 +138,7 @@ public class UTF8Test extends ActiveMQTestBase {
 
       str = new String(chars);
 
-      UTF8Util.saveUTF(buffer, str);
+      UTF8Util.saveUTF(buffer.byteBuf(), str);
 
       Assert.assertEquals(0xffff + DataConstants.SIZE_SHORT, buffer.writerIndex());
 


Mime
View raw message