import static org.testng.Assert.assertTrue;
+import java.util.Iterator;
import java.util.NoSuchElementException;
import org.testng.annotations.BeforeClass;
public class VisibleColsIteratorTest
{
- ColumnSelection hiddenCols;
+ HiddenColumns hiddenCols;
- ColumnSelection hiddenColsAtStart;
+ HiddenColumns hiddenColsAtStart;
- @BeforeClass
+ @BeforeClass(groups = { "Functional" })
public void setup()
{
- hiddenCols = new ColumnSelection();
+ hiddenCols = new HiddenColumns();
hiddenCols.hideColumns(2, 4);
- hiddenColsAtStart = new ColumnSelection();
+ hiddenColsAtStart = new HiddenColumns();
hiddenColsAtStart.hideColumns(0, 2);
}
@Test(groups = { "Functional" })
public void testHasNextAndNextWithHidden()
{
- VisibleColsIterator it = new VisibleColsIterator(0, 6, hiddenCols);
+ Iterator<Integer> it = hiddenCols.getVisibleColsIterator(0, 6);
int count = 0;
while (it.hasNext())
{
@Test(groups = { "Functional" })
public void testHasNextAndNextNoHidden()
{
- VisibleColsIterator it2 = new VisibleColsIterator(0, 3,
- new ColumnSelection());
+ HiddenColumns test = new HiddenColumns();
+ Iterator<Integer> it2 = test.getVisibleColsIterator(0, 3);
int count = 0;
while (it2.hasNext())
{
@Test(groups = { "Functional" })
public void testHasNextAndNextStartHidden()
{
- VisibleColsIterator it3 = new VisibleColsIterator(0, 6,
- hiddenColsAtStart);
+ Iterator<Integer> it3 = hiddenColsAtStart.getVisibleColsIterator(0, 6);
int count = 0;
while (it3.hasNext())
{
@Test(groups = { "Functional" })
public void testHasNextAndNextEndHidden()
{
- VisibleColsIterator it4 = new VisibleColsIterator(0, 4, hiddenCols);
+ Iterator<Integer> it4 = hiddenCols.getVisibleColsIterator(0, 4);
int count = 0;
while (it4.hasNext())
{
expectedExceptions = { NoSuchElementException.class })
public void testLastNextWithHidden() throws NoSuchElementException
{
- VisibleColsIterator it = new VisibleColsIterator(0, 3, hiddenCols);
+ Iterator<Integer> it = hiddenCols.getVisibleColsIterator(0, 3);
while (it.hasNext())
{
it.next();
expectedExceptions = { NoSuchElementException.class })
public void testLastNextNoHidden() throws NoSuchElementException
{
- VisibleColsIterator it2 = new VisibleColsIterator(0, 3,
- new ColumnSelection());
+ HiddenColumns test = new HiddenColumns();
+ Iterator<Integer> it2 = test.getVisibleColsIterator(0, 3);
while (it2.hasNext())
{
it2.next();
expectedExceptions = { NoSuchElementException.class })
public void testLastNextStartHidden() throws NoSuchElementException
{
- VisibleColsIterator it3 = new VisibleColsIterator(0, 6,
- hiddenColsAtStart);
+ Iterator<Integer> it3 = hiddenColsAtStart.getVisibleColsIterator(0, 6);
while (it3.hasNext())
{
it3.next();
expectedExceptions = { NoSuchElementException.class })
public void testLastNextEndHidden() throws NoSuchElementException
{
- VisibleColsIterator it4 = new VisibleColsIterator(0, 4, hiddenCols);
+ Iterator<Integer> it4 = hiddenCols.getVisibleColsIterator(0, 4);
while (it4.hasNext())
{
it4.next();
expectedExceptions = { UnsupportedOperationException.class })
public void testRemove() throws UnsupportedOperationException
{
- VisibleColsIterator it = new VisibleColsIterator(0, 3, hiddenCols);
+ Iterator<Integer> it = hiddenCols.getVisibleColsIterator(0, 3);
it.remove();
}
}