/**
* Test method for {@link org.openspp.dao.impl.RouteGroupDAOImpl#addOrUpdateRouteGroup(org.openspp.dto.RouteGroup)}.
*/
@Test
public void testAddOrUpdateRouteGroup() {
RouteGroup rg = new RouteGroup() ;
rg.setRouteGroupName("rgtest_rg1") ;
rg.setOrganizationName("rgtest1") ;
rg.setInService(true) ;
rg.setPriority((short)10) ;
ArrayList<RouteRecord> routeRecordList = new ArrayList<RouteRecord>() ;
//Add 2 route records, alternatively NAPTRs could also be added
RouteRecord rr1 = new RouteRecord() ;
rr1.setOrganizationName("rgtest1") ;
rr1.setRouteRecordName("rgtest_rr1") ;
rr1.setPriority(Short.valueOf("5")) ;
routeRecordList.add(rr1) ;
RouteRecord rr2 = new RouteRecord() ;
rr2.setOrganizationName("rgtest1") ;
rr2.setRouteRecordName("rgtest_rr2") ;
rr2.setPriority(Short.valueOf("6")) ;
routeRecordList.add(rr2) ;
// set RouteRecords
rg.setRouteRecordList(routeRecordList) ;
// Add one or more Destination Group Names
ArrayList<String> destGrpList = new ArrayList<String>() ;
destGrpList.add("rgtest_dg1") ;
rg.setDestGrpNameList(destGrpList) ;
dao.addOrUpdateRouteGroup(rg) ;
System.out.println("testAddOrUpdateRouteGroup->"+rg);
rg.setPriority((short)20) ;
dao.addOrUpdateRouteGroup(rg) ;
}