use of org.springframework.core.io.ClassPathResource in project opennms by OpenNMS.
the class ResourceDaoIntegrityIT method createResourceTree.
private void createResourceTree() throws IOException {
String fileAsString = IOUtils.toString(new ClassPathResource("resource-tree-files.txt").getInputStream());
String[] resourceTreeFiles = fileAsString.split("\\r?\\n");
// This should match the number of lines in the file
assertEquals(31829, resourceTreeFiles.length);
for (String resourceTreeFile : resourceTreeFiles) {
// Create the file and its parent directories in the temporary folder
File entry = new File(m_tempFolder.getRoot(), resourceTreeFile);
entry.getParentFile().mkdirs();
assertTrue("Failed to create " + entry, entry.createNewFile());
}
}
use of org.springframework.core.io.ClassPathResource in project opennms by OpenNMS.
the class CachingForeignSourceRepositoryTest method createRequisition.
private Requisition createRequisition() throws Exception {
Requisition r = m_foreignSourceRepository.importResourceRequisition(new ClassPathResource("/requisition-test.xml"));
m_foreignSourceRepository.save(r);
m_foreignSourceRepository.flush();
return r;
}
use of org.springframework.core.io.ClassPathResource in project opennms by OpenNMS.
the class DefaultParameterConversionServiceTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
Resource resource = new ClassPathResource("/opennms-reports-testdata.xml");
m_dao = new DefaultOnmsReportConfigDao();
m_dao.setConfigResource(resource);
m_dao.afterPropertiesSet();
m_conversionService = new DefaultParameterConversionService();
}
use of org.springframework.core.io.ClassPathResource in project opennms by OpenNMS.
the class QueueingForeignSourceRepositoryTest method createRequisition.
private Requisition createRequisition() throws Exception {
Requisition r = m_foreignSourceRepository.importResourceRequisition(new ClassPathResource("/requisition-test.xml"));
m_foreignSourceRepository.save(r);
m_foreignSourceRepository.flush();
return r;
}
use of org.springframework.core.io.ClassPathResource in project opennms by OpenNMS.
the class MockSnmpStrategyTest method setUp.
@Before
public void setUp() throws Exception {
m_strategy = new MockSnmpStrategy();
MockSnmpStrategy.setDataForAddress(new SnmpAgentAddress(m_agentAddress, m_agentPort), new ClassPathResource("loadSnmpDataTest.properties"));
m_oldProperty = System.getProperty("org.opennms.snmp.strategyClass");
System.setProperty("org.opennms.snmp.strategyClass", m_strategy.getClass().getName());
}
Aggregations