@Test
public void selectWithDate() throws JIException, ParseException {
OCDocumentManager manager = app.getDocumentManager("СчетНаОплатуПокупателю");
Date date = (new SimpleDateFormat("yyyy")).parse("2009");
Date date2 = (new SimpleDateFormat("yyyy")).parse("2010");
OCDocumentSelection selection = manager.select(date, date2); // select all docs in 2009
Calendar cal = Calendar.getInstance();
while (selection.next()) {
Date selDate = selection.getDate();
//System.out.println(selDate);
cal.setTime(selDate);
int year = cal.get(Calendar.YEAR);
assertTrue(year == 2009);
}
selection = manager.select(date);
while (selection.next()) {
Date selDate = selection.getDate();
//System.out.println(selDate);
cal.setTime(selDate);
int year = cal.get(Calendar.YEAR);
assertTrue(year >= 2009);
}