use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testIsSelected.
@Test
public void testIsSelected() {
Selection selectionRet1 = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", true);
Selection selectionRet2 = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", false);
Assert.assertTrue(selectionRet1.isSelected());
Assert.assertTrue(!selectionRet2.isSelected());
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testSetSelected.
@Test
public void testSetSelected() {
Selection selection = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", true);
boolean b1 = true;
selection.setSelected(b1);
Assert.assertEquals(selection.isSelected(), true);
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestSelection method testIsSelectedWithObject1.
@Test
public void testIsSelectedWithObject1() {
Selection selectionRet = NavajoFactory.getInstance().createSelection(testDoc, "firstselection", "0", Integer.valueOf(0));
selectionRet.setValue("1");
Assert.assertTrue(!selectionRet.isSelected());
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestProperty method tesGetSelectionByValue.
@Test
public void tesGetSelectionByValue() {
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.getSelectionByValue("0");
Assert.assertNotNull(s1);
Assert.assertEquals(s1.getName(), s.getName());
Assert.assertEquals(s1.isSelected(), s.isSelected());
Assert.assertEquals(s1.getValue(), s.getValue());
s1 = testSelectionProp.getSelectionByValue("1");
Assert.assertNotNull(s1);
Assert.assertEquals(Selection.DUMMY_SELECTION, s1.getName());
}
use of com.dexels.navajo.document.Selection in project navajo by Dexels.
the class TestProperty method tesSetSelected.
@Test
public void tesSetSelected() {
Property testSelectionProp1 = NavajoFactory.getInstance().createProperty(testDoc, "testselectionproperty", "1", "mydesc", Property.DIR_IN);
Property testSelectionProp2 = NavajoFactory.getInstance().createProperty(testDoc, "testselectionproperty", "+", "mydesc", Property.DIR_IN);
Selection s1 = NavajoFactory.getInstance().createSelection(testDoc, "myselection1", "0", false);
Selection s2 = NavajoFactory.getInstance().createSelection(testDoc, "myselection2", "1", false);
Selection s3 = NavajoFactory.getInstance().createSelection(testDoc, "myselection3", "2", true);
Selection s4 = NavajoFactory.getInstance().createSelection(testDoc, "myselection4", "3", false);
testSelectionProp1.addSelection(s1);
testSelectionProp1.addSelection(s2);
testSelectionProp1.addSelection(s3);
testSelectionProp1.addSelection(s4);
testSelectionProp1.setSelected("0");
Assert.assertEquals(true, s1.isSelected());
Assert.assertTrue(!s3.isSelected());
s1 = NavajoFactory.getInstance().createSelection(testDoc, "myselection1", "0", false);
s2 = NavajoFactory.getInstance().createSelection(testDoc, "myselection2", "1", false);
s3 = NavajoFactory.getInstance().createSelection(testDoc, "myselection3", "2", true);
s4 = NavajoFactory.getInstance().createSelection(testDoc, "myselection4", "3", false);
testSelectionProp2.addSelection(s1);
testSelectionProp2.addSelection(s2);
testSelectionProp2.addSelection(s3);
testSelectionProp2.addSelection(s4);
testSelectionProp2.setSelected("0");
Assert.assertEquals(true, s1.isSelected());
Assert.assertTrue(s3.isSelected());
}
Aggregations