* Test method for {@link JavadocBlockParserUtil#setLocation(IrDocElement, IrLocation, IrLocation)}.
*/
@Test
public void testSetLocationLocation() {
{
IrDocElement elem = new IrDocText("text");
IrLocation start = new IrLocation(10, 2);
IrLocation stop = new IrLocation(20, 2);
JavadocBlockParserUtil.setLocation(elem, start, stop);
assertEquals(10, elem.getLocation().getStartPosition());
assertEquals(12, elem.getLocation().getLength());
}
{
IrDocElement elem = new IrDocText("text");
IrLocation start = new IrLocation(10, 2);
JavadocBlockParserUtil.setLocation(elem, start, start);
assertEquals(10, elem.getLocation().getStartPosition());
assertEquals(2, elem.getLocation().getLength());
}
{
IrDocElement elem = new IrDocText("text");
IrLocation fragment = new IrLocation(10, 2);
JavadocBlockParserUtil.setLocation(elem, null, fragment);
assertNull(elem.getLocation());
}
{
IrDocElement elem = new IrDocText("text");
IrLocation fragment = new IrLocation(10, 2);
JavadocBlockParserUtil.setLocation(elem, fragment, null);
assertNull(elem.getLocation());
}
}