Skip to content

Commit

Permalink
[Release-1.5.0] fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
paynie committed Apr 13, 2018
1 parent 0016a32 commit c3ecfb0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void testUpdateIntSparseToIntDense() throws Exception {

@Test
public void testUpdateIntDenseToIntSparse() throws Exception {
ServerSparseIntRow serverSparseIntRow = new ServerSparseIntRow(rowId, startCol, endCol);
ServerSparseIntRow serverSparseIntRow = new ServerSparseIntRow(rowId, startCol, endCol, 0);
ByteBuf buf = Unpooled.buffer(16);
buf.writeInt(3);
buf.writeInt(0);
Expand All @@ -111,7 +111,7 @@ public void testUpdateIntDenseToIntSparse() throws Exception {

@Test
public void testUpdateIntSparseToIntSparse() throws Exception {
ServerSparseIntRow serverSparseIntRow = new ServerSparseIntRow(rowId, startCol, endCol);
ServerSparseIntRow serverSparseIntRow = new ServerSparseIntRow(rowId, startCol, endCol, 0);
ByteBuf buf = Unpooled.buffer(16);
buf.writeInt(3);
buf.writeInt(0);
Expand Down Expand Up @@ -162,7 +162,7 @@ public void testUpdateDoubleSparseToDoubleDense() throws Exception {
@Test
public void testUpdateDoubleDenseToDoubleSparse() throws Exception {
ServerSparseDoubleRow serverSparseDoubleRow =
new ServerSparseDoubleRow(rowId, startCol, endCol);
new ServerSparseDoubleRow(rowId, startCol, endCol, 0);
ByteBuf buf = Unpooled.buffer(16);
buf.writeInt(3);
buf.writeDouble(0.00);
Expand All @@ -179,7 +179,7 @@ public void testUpdateDoubleDenseToDoubleSparse() throws Exception {
@Test
public void testUpdateDoubleSparseToDoubleSparse() throws Exception {
ServerSparseDoubleRow serverSparseDoubleRow =
new ServerSparseDoubleRow(rowId, startCol, endCol);
new ServerSparseDoubleRow(rowId, startCol, endCol, 0);
ByteBuf buf = Unpooled.buffer(16);
buf.writeInt(3);
buf.writeInt(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void setUp() throws Exception {
endCol = 10;
rowType = RowType.T_DOUBLE_DENSE;
partitionKey = new PartitionKey(partitionId, matrixId, startRow, startCol, endRow, endCol);
serverPartition = new ServerPartition(partitionKey, rowType);
serverPartition = new ServerPartition(partitionKey, rowType, 0.0);
serverPartition.init();
}

Expand Down Expand Up @@ -192,7 +192,7 @@ public void testWriteTo() throws Exception {
DataInputStream in = new DataInputStream(new FileInputStream("data"));
PartitionKey partitionKeyNew = new PartitionKey(2, 1, 1, 2, 8, 10);
ServerPartition serverPartitionNew =
new ServerPartition(partitionKeyNew, RowType.T_DOUBLE_DENSE);
new ServerPartition(partitionKeyNew, RowType.T_DOUBLE_DENSE, 0.0);
serverPartitionNew.init();
assertNotEquals(((ServerDenseDoubleRow) serverPartition.getRow(6)).getData(),
((ServerDenseDoubleRow) serverPartitionNew.getRow(6)).getData());
Expand Down Expand Up @@ -242,7 +242,7 @@ public void testDeserialize() throws Exception {
serverPartition.serialize(buf);
PartitionKey partitionKeyNew = new PartitionKey(2, 1, 1, 2, 8, 10);
ServerPartition serverPartitionNew =
new ServerPartition(partitionKeyNew, RowType.T_DOUBLE_DENSE);
new ServerPartition(partitionKeyNew, RowType.T_DOUBLE_DENSE, 0.0);
assertNotEquals(serverPartition.getPartitionKey().getPartitionId(),
serverPartitionNew.getPartitionKey().getPartitionId());
serverPartitionNew.deserialize(buf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setUp() throws Exception {
rowId = 0;
startCol = 0;
endCol = 3;
serverSparseDoubleRow = new ServerSparseDoubleRow(rowId, startCol, endCol);
serverSparseDoubleRow = new ServerSparseDoubleRow(rowId, startCol, endCol, 0);
}

@After
Expand Down Expand Up @@ -91,7 +91,7 @@ public void testReadFrom() throws Exception {
out.close();
DataInputStream in = new DataInputStream(new FileInputStream("data"));
ServerSparseDoubleRow newServerSparseDoubleRow =
new ServerSparseDoubleRow(rowId, startCol, endCol);
new ServerSparseDoubleRow(rowId, startCol, endCol, 0);
newServerSparseDoubleRow.readFrom(in);
in.close();

Expand All @@ -111,7 +111,7 @@ public void testGetRowType() throws Exception {

@Test
public void testUpdate() throws Exception {
serverSparseDoubleRow = new ServerSparseDoubleRow(rowId, startCol, endCol);
serverSparseDoubleRow = new ServerSparseDoubleRow(rowId, startCol, endCol, 0);
ByteBuf buf = Unpooled.buffer(4 + 8 * 3);
buf.writeInt(3);
buf.writeDouble(0.00);
Expand All @@ -124,7 +124,7 @@ public void testUpdate() throws Exception {
assertEquals(serverSparseDoubleRow.getData().get(1), newValue1, 0.000);
assertEquals(serverSparseDoubleRow.getData().get(2), -1, 0.000);

serverSparseDoubleRow = new ServerSparseDoubleRow(rowId, startCol, endCol);
serverSparseDoubleRow = new ServerSparseDoubleRow(rowId, startCol, endCol, 0);
buf = Unpooled.buffer(4 + 2 * 12);
buf.writeInt(2);
LOG.info(buf);
Expand Down

0 comments on commit c3ecfb0

Please sign in to comment.