use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testCreateDummy.
@Test
public void testCreateDummy() {
Selection selectionRet = NavajoFactory.getInstance().createDummySelection();
Assert.assertEquals("___DUMMY_ELEMENT___", selectionRet.getValue());
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testIsSelectedWithObject3.
@Test
public void testIsSelectedWithObject3() {
Selection selectionRet = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", Boolean.valueOf(true));
selectionRet.setValue("1");
Assert.assertTrue(selectionRet.isSelected());
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testGetName.
@Test
public void testGetName() {
Selection selectionRet = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", true);
Assert.assertEquals(selectionRet.getName(), "firstselection");
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestProperty method tesGetAllSelections.
@Test
public void tesGetAllSelections() {
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.getAllSelections().iterator();
int count = 3;
Set<String> set = new HashSet<>();
while (iter.hasNext()) {
Selection s = iter.next();
set.add(s.getName());
if ((s.getName().equals("firstselection") || s.getName().equals("thirdselection") || s.getName().equals("secondselection")))
count--;
}
Assert.assertEquals(3, set.size());
Assert.assertEquals(0, count);
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestProperty method tesGetSelection.
@Test
public void tesGetSelection() {
Property testSelectionProp = NavajoFactory.getInstance().createProperty(testDoc, "testselectionproperty", "+", "mydesc", Property.DIR_IN);
Selection s = NavajoFactory.getInstance().createSelection(testDoc, "myselection", "0", true);
testSelectionProp.addSelection(s);
Selection s1 = testSelectionProp.getSelection("myselection");
Assert.assertNotNull(s1);
Assert.assertEquals(s1.getName(), s.getName());
Assert.assertEquals(s1.isSelected(), s.isSelected());
Assert.assertEquals(s1.getValue(), s.getValue());
s1 = testSelectionProp.getSelection("myselection2");
Assert.assertNotNull(s1);
Assert.assertEquals(Selection.DUMMY_SELECTION, s1.getName());
}
Aggregations