Search in sources :

Example 6 with JdbcDataCollection

use of org.opennms.netmgt.config.jdbc.JdbcDataCollection in project opennms by OpenNMS.

the class JdbcCollectorTest method canCollectEmptyCollection.

@Test
public void canCollectEmptyCollection() throws Exception {
    JdbcDataCollection collection = new JdbcDataCollection();
    CollectionSet collectionSet = collect(collection);
    assertEquals(CollectionStatus.SUCCEEDED, collectionSet.getStatus());
    assertEquals(0, CollectionSetUtils.getAttributesByName(collectionSet).size());
}
Also used : JdbcDataCollection(org.opennms.netmgt.config.jdbc.JdbcDataCollection) CollectionSet(org.opennms.netmgt.collection.api.CollectionSet) Test(org.junit.Test)

Aggregations

JdbcDataCollection (org.opennms.netmgt.config.jdbc.JdbcDataCollection)6 ResultSet (java.sql.ResultSet)3 Test (org.junit.Test)3 CollectionSet (org.opennms.netmgt.collection.api.CollectionSet)3 JdbcColumn (org.opennms.netmgt.config.jdbc.JdbcColumn)3 JdbcQuery (org.opennms.netmgt.config.jdbc.JdbcQuery)3 ImmutableMap (com.google.common.collect.ImmutableMap)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 HashMap (java.util.HashMap)1 JdbcAgentState (org.opennms.netmgt.collectd.jdbc.JdbcAgentState)1 AttributeType (org.opennms.netmgt.collection.api.AttributeType)1 IndexStorageStrategy (org.opennms.netmgt.collection.support.IndexStorageStrategy)1 PersistAllSelectorStrategy (org.opennms.netmgt.collection.support.PersistAllSelectorStrategy)1 CollectionSetBuilder (org.opennms.netmgt.collection.support.builder.CollectionSetBuilder)1 DeferredGenericTypeResource (org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource)1 NodeLevelResource (org.opennms.netmgt.collection.support.builder.NodeLevelResource)1 Resource (org.opennms.netmgt.collection.support.builder.Resource)1 ResourceTypesDao (org.opennms.netmgt.config.api.ResourceTypesDao)1