use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestProperty method tesGetAllSelectedSelections.
@Test
public void tesGetAllSelectedSelections() {
Property testSelectionProp = NavajoFactory.getInstance().createProperty(testDoc, "testselectionproperty", "+", "", Property.DIR_IN);
Selection s1 = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", true);
Selection s2 = NavajoFactory.getInstance().createSelection(testDoc, "secondselection", "1", false);
Selection s3 = NavajoFactory.getInstance().createSelection(testDoc, "thirdselection", "2", true);
testSelectionProp.addSelection(s1);
testSelectionProp.addSelection(s2);
testSelectionProp.addSelection(s3);
Iterator<Selection> iter = testSelectionProp.getAllSelectedSelections().iterator();
int count = 0;
while (iter.hasNext()) {
Selection s = iter.next();
count++;
Assert.assertTrue((s.getName().equals("firstselection") || s.getName().equals("thirdselection")));
Assert.assertTrue(!s.getName().equals("secondselection"));
}
Assert.assertEquals(2, count);
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestProperty method tesAddSelection.
@Test
public void tesAddSelection() {
Property testSelectionProp = NavajoFactory.getInstance().createProperty(testDoc, "testselectionproperty", "+", "", Property.DIR_IN);
Selection s1 = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", true);
testSelectionProp.addSelection(s1);
Selection s2 = testSelectionProp.getSelection("firstselection");
Assert.assertNotNull(s2);
Assert.assertEquals(s2.isSelected(), s1.isSelected());
Assert.assertEquals(s2.getName(), s1.getName());
Assert.assertEquals(s2.getValue(), s1.getValue());
Selection s3 = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "1", false);
testSelectionProp.addSelection(s3);
s2 = testSelectionProp.getSelection("firstselection");
Assert.assertNotNull(s2);
Assert.assertEquals(s2.isSelected(), s3.isSelected());
Assert.assertEquals(s2.getName(), s3.getName());
Assert.assertEquals(s2.getValue(), s3.getValue());
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testGetValue.
@Test
public void testGetValue() {
Selection selectionRet = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", true);
Assert.assertEquals(selectionRet.getValue(), "0");
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testIsSelectedWithInteger1.
@Test
public void testIsSelectedWithInteger1() {
Selection selectionRet = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", 0);
selectionRet.setValue("1");
Assert.assertTrue(!selectionRet.isSelected());
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testIsSelectedWithObject2.
@Test
public void testIsSelectedWithObject2() {
Selection selectionRet = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", Integer.valueOf(11));
selectionRet.setValue("1");
Assert.assertTrue(selectionRet.isSelected());
}
Aggregations