App { public static void main(String[] args) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext.xml"); PersonDao dao = context.getBean(PersonDao.class); Person peter = new Person("Peter", "Sagan"); Person nasta = new Person("Nasta", "Kuzminova"); dao.save(peter); dao.save(nasta); System.out.println("Count Person records: " + dao.count()); List<Person> persons = (List<Person>) dao.findAll(); for (Person person : persons) { System.out.println(person); } System.out.println("Find by surname 'Sagan': " + dao.findBySurname("Sagan")); nasta.setName("Barbora"); nasta.setSurname("Spotakova"); dao.save(nasta); System.out.println("Find by id 2: " + dao.findOne(2L)); dao.delete(2L); System.out.println("Count Person records: " + dao.count()); context.close(); }  static void main(String[] args);  }
@Test public void test() { String[] args = {}; App.main(args); }