comparison src/test/alice/jungle/core/operations/NetworkPutAttributeOperationTest.java @ 74:19e278488b42

Added NetworkPutAttributeOperation
author one
date Tue, 15 Oct 2013 14:38:46 +0900
parents
children 0055d917c796
comparison
equal deleted inserted replaced
73:9ab7d515e076 74:19e278488b42
1 package test.alice.jungle.core.operations;
2
3 import java.io.IOException;
4 import java.nio.ByteBuffer;
5
6 import org.msgpack.MessagePack;
7 import org.msgpack.type.Value;
8
9 import alice.jungle.operations.NetworkAppendChildAtOperation;
10 import alice.jungle.operations.NetworkPutAttributeOperation;
11 import junit.framework.TestCase;
12
13 public class NetworkPutAttributeOperationTest extends TestCase {
14
15 public void testMsgpackConvert() throws IOException {
16 ByteBuffer value = ByteBuffer.allocate(16);
17 value.put( "fuga".getBytes());
18 NetworkPutAttributeOperation op = new NetworkPutAttributeOperation("hoge", value);
19 MessagePack msgpack = new MessagePack();
20 Value v = msgpack.unconvert(op);
21 NetworkPutAttributeOperation mOp = msgpack.convert(v, NetworkPutAttributeOperation.class);
22 // NodeOperation mOp = msgpack.convert(v, NodeOperation.class);
23 assertEquals(op.getCommand(), mOp.getCommand());
24 System.out.println(new String(op.getValue().array()));
25 assert((new String(op.getValue().array())).equals(new String(mOp.getValue().array())));
26 }
27
28 }