use of org.opennms.netmgt.model.OnmsAccessPointCollection in project opennms by OpenNMS.
the class AccessPointDaoTest method testFindByPackage.
@Test
@Transactional
public void testFindByPackage() {
addNewAccessPoint("ap1", AP1_MAC, "package1");
addNewAccessPoint("ap2", AP2_MAC, "package1");
addNewAccessPoint("ap3", AP3_MAC, "package2");
OnmsAccessPointCollection apsInPkg = m_accessPointDao.findByPackage("package1");
assertEquals("There should be two APs in the package.", 2, apsInPkg.size());
List<String> unqPkgNames = m_accessPointDao.findDistinctPackagesLike("%ack%");
assertEquals(2, unqPkgNames.size());
assertEquals(true, unqPkgNames.contains("package1"));
assertEquals(true, unqPkgNames.contains("package2"));
}
Aggregations