Search in sources :

Example 6 with OnmsAccessPointCollection

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"));
}
Also used : OnmsAccessPointCollection(org.opennms.netmgt.model.OnmsAccessPointCollection) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

OnmsAccessPointCollection (org.opennms.netmgt.model.OnmsAccessPointCollection)6 Transactional (org.springframework.transaction.annotation.Transactional)3 IOException (java.io.IOException)2 InetAddress (java.net.InetAddress)2 Map (java.util.Map)2 ParameterMap (org.opennms.core.utils.ParameterMap)2 OnmsAccessPoint (org.opennms.netmgt.model.OnmsAccessPoint)2 SnmpAgentConfig (org.opennms.netmgt.snmp.SnmpAgentConfig)2 SnmpInstId (org.opennms.netmgt.snmp.SnmpInstId)2 SnmpObjId (org.opennms.netmgt.snmp.SnmpObjId)2 SnmpValue (org.opennms.netmgt.snmp.SnmpValue)2 HashSet (java.util.HashSet)1 Callable (java.util.concurrent.Callable)1 ExecutionException (java.util.concurrent.ExecutionException)1 Future (java.util.concurrent.Future)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 Test (org.junit.Test)1 CriteriaBuilder (org.opennms.core.criteria.CriteriaBuilder)1 AccessPointPoller (org.opennms.netmgt.accesspointmonitor.poller.AccessPointPoller)1