@Test public void testGetNonexistant() { TestTransaction tx1 = new TestTransaction(env); Set<String> rss = Collections.singleton("foo"); Set<Bytes> rowSet = Collections.singleton(Bytes.of("foo")); Set<Column> colSet = Collections.singleton(new Column("a", "b")); Assert.assertEquals(0, tx1.get(Bytes.of("foo"), colSet).size()); Assert.assertEquals(0, tx1.gets("foo", colSet).size()); Assert.assertEquals(0, tx1.get(rowSet, colSet).size()); Assert.assertEquals(0, tx1.gets(rss, colSet).size()); }
@Test public void testEmptyInputs() { TestTransaction tx1 = new TestTransaction(env); Set<Bytes> rowSet = Collections.singleton(Bytes.of("foo")); Set<Column> colSet = Collections.singleton(new Column("a", "b")); Set<Bytes> emptyRowSet = Collections.emptySet(); Set<Column> emptyColSet = Collections.emptySet(); Set<RowColumn> emptyRowColSet = Collections.emptySet(); Assert.assertEquals(0, tx1.get(Bytes.of("foo"), emptyColSet).size()); Assert.assertEquals(0, tx1.get(emptyRowSet, emptyColSet).size()); Assert.assertEquals(0, tx1.get(emptyRowSet, colSet).size()); Assert.assertEquals(0, tx1.get(rowSet, emptyColSet).size()); Assert.assertEquals(0, tx1.get(rowSet, emptyColSet).size()); Assert.assertEquals(0, tx1.get(emptyRowColSet).size()); Set<String> erss = Collections.emptySet(); Set<String> rss = Collections.singleton("foo"); Assert.assertEquals(0, tx1.gets("foo", emptyColSet).size()); Assert.assertEquals(0, tx1.gets(erss, emptyColSet).size()); Assert.assertEquals(0, tx1.gets(erss, colSet).size()); Assert.assertEquals(0, tx1.gets(rss, emptyColSet).size()); Assert.assertEquals(0, tx1.gets(rss, emptyColSet).size()); Assert.assertEquals(0, tx1.gets(emptyRowColSet).size()); }