From c3ecfb0852bec2082a69d61dc051950c0f1715a4 Mon Sep 17 00:00:00 2001 From: paynie Date: Fri, 13 Apr 2018 17:27:34 +0800 Subject: [PATCH] [Release-1.5.0] fix ut --- .../angel/ps/impl/matrix/DefaultRowUpdaterTest.java | 8 ++++---- .../tencent/angel/ps/impl/matrix/ServerPartitionTest.java | 6 +++--- .../angel/ps/impl/matrix/ServerSparseDoubleRowTest.java | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/DefaultRowUpdaterTest.java b/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/DefaultRowUpdaterTest.java index 13dd1a143..88bdf4dad 100644 --- a/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/DefaultRowUpdaterTest.java +++ b/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/DefaultRowUpdaterTest.java @@ -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); @@ -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); @@ -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); @@ -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); diff --git a/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerPartitionTest.java b/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerPartitionTest.java index 6417a6cfd..048d9e7a6 100644 --- a/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerPartitionTest.java +++ b/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerPartitionTest.java @@ -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(); } @@ -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()); @@ -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); diff --git a/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerSparseDoubleRowTest.java b/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerSparseDoubleRowTest.java index b49059861..d56a43373 100644 --- a/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerSparseDoubleRowTest.java +++ b/angel-ps/core/src/test/java/com/tencent/angel/ps/impl/matrix/ServerSparseDoubleRowTest.java @@ -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 @@ -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(); @@ -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); @@ -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);