use of org.opennms.netmgt.provision.persist.requisition.Requisition in project opennms by OpenNMS.
the class FasterFilesystemForeignSourceRepositoryTest method testGetRequisition.
@Test
public void testGetRequisition() throws Exception {
FileSystemBuilder bldr = new FileSystemBuilder("target", "testGetForeignSource");
File fsDir = bldr.dir("foreignSource").file("test.xml", fs("test")).file("noreq.xml", fs("noreq")).pop();
File reqDir = bldr.dir("requisitions").file("test.xml", req("test")).file("pending.xml", req("pending")).pop();
FasterFilesystemForeignSourceRepository repo = repo(fsDir, reqDir);
Requisition testReq = repo.getRequisition("test");
assertEquals("test", testReq.getForeignSource());
RequisitionNode node = testReq.getNode("1234");
assertNotNull(node);
assertEquals("node1", node.getNodeLabel());
}
use of org.opennms.netmgt.provision.persist.requisition.Requisition in project opennms by OpenNMS.
the class MockForeignSourceRepositoryTest method testGetRequisition.
@Test
public void testGetRequisition() throws Exception {
Requisition requisition = createRequisition();
ForeignSource foreignSource = createForeignSource(m_defaultForeignSourceName);
assertRequisitionsMatch("foreign sources must match", m_foreignSourceRepository.getRequisition(m_defaultForeignSourceName), m_foreignSourceRepository.getRequisition(foreignSource));
assertRequisitionsMatch("foreign source is expected one", requisition, m_foreignSourceRepository.getRequisition(foreignSource));
}
use of org.opennms.netmgt.provision.persist.requisition.Requisition in project opennms by OpenNMS.
the class CachingForeignSourceRepositoryTest method testRequisition.
@Test
public void testRequisition() throws Exception {
createRequisition();
Requisition r = m_foreignSourceRepository.getRequisition(m_defaultForeignSourceName);
TestVisitor v = new TestVisitor();
r.visit(v);
assertEquals("number of nodes visited", 2, v.getNodeReqs().size());
assertEquals("node name matches", "apknd", v.getNodeReqs().get(0).getNodeLabel());
}
use of org.opennms.netmgt.provision.persist.requisition.Requisition in project opennms by OpenNMS.
the class FilesystemForeignSourceRepositoryTest method testGetRequisition.
@Test
public void testGetRequisition() throws Exception {
Requisition requisition = createRequisition();
ForeignSource foreignSource = createForeignSource(m_defaultForeignSourceName);
assertRequisitionsMatch("requisitions must match", m_foreignSourceRepository.getRequisition(m_defaultForeignSourceName), m_foreignSourceRepository.getRequisition(foreignSource));
assertRequisitionsMatch("foreign source is the expected one", requisition, m_foreignSourceRepository.getRequisition(foreignSource));
}
use of org.opennms.netmgt.provision.persist.requisition.Requisition in project opennms by OpenNMS.
the class FilesystemForeignSourceRepositoryTest method testRequisition.
@Test
public void testRequisition() throws Exception {
createRequisition();
Requisition r = m_foreignSourceRepository.getRequisition(m_defaultForeignSourceName);
TestVisitor v = new TestVisitor();
r.visit(v);
assertEquals("number of nodes visited", 2, v.getNodeReqs().size());
assertEquals("node name matches", "apknd", v.getNodeReqs().get(0).getNodeLabel());
m_foreignSourceRepository.delete(r);
r = m_foreignSourceRepository.getRequisition(m_defaultForeignSourceName);
assertNull(r);
}
Aggregations