use of org.apache.phoenix.schema.tuple.EncodedColumnQualiferCellsList in project phoenix by apache.
the class EncodedColumnQualifierCellsListTest method testAddAll.
@Test
public void testAddAll() throws Exception {
EncodedColumnQualiferCellsList list1 = new EncodedColumnQualiferCellsList(11, 16, FOUR_BYTE_QUALIFIERS);
populateList(list1);
EncodedColumnQualiferCellsList list2 = new EncodedColumnQualiferCellsList(11, 16, FOUR_BYTE_QUALIFIERS);
populateList(list2);
/*
* Note that we don't care about equality of the element being added with the element already
* present at the index.
*/
assertTrue(list1.addAll(list2));
}
use of org.apache.phoenix.schema.tuple.EncodedColumnQualiferCellsList in project phoenix by apache.
the class EncodedColumnQualifierCellsListTest method testRemoveAll.
@Test
public void testRemoveAll() throws Exception {
EncodedColumnQualiferCellsList list1 = new EncodedColumnQualiferCellsList(11, 16, FOUR_BYTE_QUALIFIERS);
populateList(list1);
ArrayList<Cell> list2 = new ArrayList<>();
populateList(list2);
assertTrue(list1.removeAll(list2));
assertTrue(list1.isEmpty());
assertFalse(list2.isEmpty());
}
use of org.apache.phoenix.schema.tuple.EncodedColumnQualiferCellsList in project phoenix by apache.
the class EncodedColumnQualifierCellsListTest method testIndexOf.
@Test
public void testIndexOf() throws Exception {
EncodedColumnQualiferCellsList list = new EncodedColumnQualiferCellsList(11, 16, FOUR_BYTE_QUALIFIERS);
Cell[] cells = new Cell[7];
populateListAndArray(list, cells);
for (int i = 0; i < cells.length; i++) {
assertEquals(i, list.indexOf(cells[i]));
}
}
use of org.apache.phoenix.schema.tuple.EncodedColumnQualiferCellsList in project phoenix by apache.
the class EncodedColumnQualifierCellsListTest method testSetNull.
@Test
public void testSetNull() throws Exception {
EncodedColumnQualiferCellsList list = new EncodedColumnQualiferCellsList(11, 16, FOUR_BYTE_QUALIFIERS);
try {
list.add(null);
fail("Adding null elements to the list is not allowed");
} catch (NullPointerException expected) {
}
}
use of org.apache.phoenix.schema.tuple.EncodedColumnQualiferCellsList in project phoenix by apache.
the class EncodedColumnQualifierCellsListTest method testContains.
@Test
public void testContains() throws Exception {
EncodedColumnQualiferCellsList list = new EncodedColumnQualiferCellsList(11, 16, FOUR_BYTE_QUALIFIERS);
Cell[] cells = new Cell[7];
populateListAndArray(list, cells);
for (Cell c : cells) {
assertTrue(list.contains(c));
}
assertFalse(list.contains(KeyValue.createFirstOnRow(row, cf, FOUR_BYTE_QUALIFIERS.encode(13))));
}
Aggregations