/** * tests {@link SimilarityMatrixRowWrapperMapper} */ @Test public void testSimilarityMatrixRowWrapperMapper() throws Exception { Mapper<IntWritable,VectorWritable,VarIntWritable,VectorOrPrefWritable>.Context context = EasyMock.createMock(Mapper.Context.class); context.write(EasyMock.eq(new VarIntWritable(12)), vectorOfVectorOrPrefWritableMatches(MathHelper.elem(34, 0.5), MathHelper.elem(56, 0.7))); EasyMock.replay(context); RandomAccessSparseVector vector = new RandomAccessSparseVector(Integer.MAX_VALUE, 100); vector.set(12, 1.0); vector.set(34, 0.5); vector.set(56, 0.7); new SimilarityMatrixRowWrapperMapper().map(new IntWritable(12), new VectorWritable(vector), context); EasyMock.verify(context); }