提交 0224f93d 编写于 作者: S shroman 提交者: dongeforever

Removed author info and formatted.

上级 07b3f41b
...@@ -14,31 +14,25 @@ ...@@ -14,31 +14,25 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.rocketmq.common; package org.apache.rocketmq.common;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageDecoder;
import org.junit.Test;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageDecoder;
import org.junit.Test;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
/**
* Created by liuzhendong on 16/12/21.
*/
public class MessageEncodeDecodeTest { public class MessageEncodeDecodeTest {
@Test @Test
public void testEncodeDecodeSingle() throws Exception{ public void testEncodeDecodeSingle() throws Exception {
Message message = new Message("topic", "body".getBytes()); Message message = new Message("topic", "body".getBytes());
message.setFlag(12); message.setFlag(12);
message.putUserProperty("key","value"); message.putUserProperty("key", "value");
byte[] bytes = MessageDecoder.encodeMessage(message); byte[] bytes = MessageDecoder.encodeMessage(message);
ByteBuffer buffer = ByteBuffer.allocate(bytes.length); ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
buffer.put(bytes); buffer.put(bytes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册