OpenNMS API 1.2.3

org.opennms.netmgt.poller.pollables
Class PollablesTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.opennms.netmgt.poller.pollables.PollablesTest
All Implemented Interfaces:
junit.framework.Test

public class PollablesTest
extends junit.framework.TestCase

Represents a PollablesTest

Author:
brozow

Nested Class Summary
(package private) static class PollablesTest.InitCause
           
private  class PollablesTest.MockPollConfig
           
 
Field Summary
private  EventAnticipator m_anticipator
           
private  MockDatabase m_db
           
private  MockEventIpcManager m_eventMgr
           
private  int m_lockCount
           
private  MockNetwork m_mockNetwork
           
private  PollableNetwork m_network
           
private  OutageAnticipator m_outageAnticipator
           
private  MockPollContext m_pollContext
           
private  MockPollerConfig m_pollerConfig
           
private  MockScheduler m_scheduler
           
private  MockTimer m_timer
           
private  MockInterface mDot1
           
private  MockService mDot1Icmp
           
private  MockService mDot1Smtp
           
private  MockInterface mDot2
           
private  MockService mDot2Icmp
           
private  MockService mDot2Smtp
           
private  MockInterface mDot3
           
private  MockService mDot3Http
           
private  MockService mDot3Icmp
           
private  MockNode mNode1
           
private  MockNode mNode2
           
private  PollableInterface pDot1
           
private  PollableService pDot1Icmp
           
private  PollableService pDot1Smtp
           
private  PollableInterface pDot2
           
private  PollableService pDot2Icmp
           
private  PollableService pDot2Smtp
           
private  PollableInterface pDot3
           
private  PollableService pDot3Http
           
private  PollableService pDot3Icmp
           
private  PollableNode pNode1
           
private  PollableNode pNode2
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
PollablesTest()
           
 
Method Summary
private  void anticipateDown(MockElement element)
           
private  void anticipateResponsive(MockElement element)
           
private  void anticipateUnresponsive(MockElement element)
           
private  void anticipateUp(MockElement element)
           
private  void assertChanged(PollableElement elem)
           
private  void assertDeleted(PollableInterface iface)
           
private  void assertDeleted(PollableNode node)
           
private  void assertDeleted(PollableService svc)
           
private  void assertDown(PollableElement elem)
           
private  void assertNoPoll(MockElement elem)
           
private  void assertNotDeleted(PollableInterface iface)
           
private  void assertNotDeleted(PollableNode node)
           
private  void assertNotDeleted(PollableService svc)
           
private  void assertPoll(MockService svc)
           
private  void assertTime(long time)
           
private  void assertUnchanged(PollableElement elem)
           
private  void assertUp(PollableElement elem)
           
private  void assignPollableMembers(PollableNetwork pNetwork)
           
private static PollableNetwork createPollableNetwork(DbConnectionFactory db, ScheduleTimer scheduler, PollerConfig pollerConfig, PollOutagesConfig pollOutageConfig, PollContext pollContext)
           
static void main(java.lang.String[] args)
           
private  void resetAnticipated()
           
protected  void setUp()
           
protected  void tearDown()
           
 void testCause()
           
 void testComputeScheduledOutageTime()
           
 void testCreateInterface()
           
 void testCreateNode()
           
 void testCreateService()
           
 void testDeleteInterface()
           
 void testDeleteNode()
           
 void testDeleteService()
           
 void testDeleteServiceStatus()
           
 void testDowntimeDelete()
           
 void testDowntimeInterval()
           
 void testFindMemberWithDescendent()
           
 void testIfOutage()
           
 void testIndependentOutageEventsUpSeparately()
           
 void testIndependentOutageEventsUpTogether()
           
 void testInterfaceEvent()
           
 void testInterfaceStatus()
           
 void testLingeringSvcDownOnIfUp()
           
 void testLingeringSvcDownOnNodeUp()
           
 void testLoadIndependentOutageEventsUpSeparately()
           
 void testLoadIndependentOutageEventsUpTogether()
           
 void testLoadInterface()
           
 void testLoadNode()
           
 void testLoadService()
           
 void testLock()
           
 void testLockTimeout()
           
 void testMidnightOutageBug1122()
           
 void testNodeEvent()
           
 void testNodeProcessingDisabled()
           
 void testPollAllUp()
           
 void testPollIfDownCritSvcUndefSvcDown()
           
 void testPollIfDownCritSvcUndefSvcDownNoPoll()
           
 void testPollIfDownCritSvcUp()
           
 void testPollIfDownNonCritSvcUp()
           
 void testPollIfUpCritSvcDownPoll()
           
 void testPollIfUpCritSvcUndefSvcDown()
           
 void testPollIfUpCritSvcUndefSvcDownNoPoll()
           
 void testPollIfUpNonCritSvcDown()
           
 void testPollNode()
           
 void testPollService()
           
 void testPollUnresponsive()
           
 void testPollUnresponsiveWithOutage()
           
 void testPropagateUnresponsive()
           
 void testReparentInterface()
           
 void testReparentOutages()
           
 void testReparentStatusChanges()
           
 void testSchedule()
           
 void testScheduleAdjust()
           
 void testScheduledOutage()
           
 void testServiceEvent()
           
 void testStatus()
           
 void testSvcOutage()
           
 void testVisit()
           
private  void verifyAnticipated()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_network

private PollableNetwork m_network

m_pollContext

private MockPollContext m_pollContext

m_mockNetwork

private MockNetwork m_mockNetwork

m_db

private MockDatabase m_db

m_anticipator

private EventAnticipator m_anticipator

m_eventMgr

private MockEventIpcManager m_eventMgr

mNode1

private MockNode mNode1

mDot1

private MockInterface mDot1

mDot2

private MockInterface mDot2

mNode2

private MockNode mNode2

mDot1Smtp

private MockService mDot1Smtp

mDot1Icmp

private MockService mDot1Icmp

mDot2Smtp

private MockService mDot2Smtp

mDot2Icmp

private MockService mDot2Icmp

mDot3

private MockInterface mDot3

mDot3Http

private MockService mDot3Http

mDot3Icmp

private MockService mDot3Icmp

pNode1

private PollableNode pNode1

pDot1

private PollableInterface pDot1

pDot1Smtp

private PollableService pDot1Smtp

pDot1Icmp

private PollableService pDot1Icmp

pDot2

private PollableInterface pDot2

pDot2Smtp

private PollableService pDot2Smtp

pDot2Icmp

private PollableService pDot2Icmp

pNode2

private PollableNode pNode2

pDot3

private PollableInterface pDot3

pDot3Http

private PollableService pDot3Http

pDot3Icmp

private PollableService pDot3Icmp

m_outageAnticipator

private OutageAnticipator m_outageAnticipator

m_pollerConfig

private MockPollerConfig m_pollerConfig

m_scheduler

private MockScheduler m_scheduler

m_timer

private MockTimer m_timer

m_lockCount

private int m_lockCount
Constructor Detail

PollablesTest

public PollablesTest()
Method Detail

main

public static void main(java.lang.String[] args)

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

assignPollableMembers

private void assignPollableMembers(PollableNetwork pNetwork)
                            throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

createPollableNetwork

private static PollableNetwork createPollableNetwork(DbConnectionFactory db,
                                                     ScheduleTimer scheduler,
                                                     PollerConfig pollerConfig,
                                                     PollOutagesConfig pollOutageConfig,
                                                     PollContext pollContext)
                                              throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

tearDown

protected void tearDown()
                 throws java.lang.Exception
Throws:
java.lang.Exception

testCreateNode

public void testCreateNode()

testCreateInterface

public void testCreateInterface()
                         throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

testCreateService

public void testCreateService()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testVisit

public void testVisit()

testDeleteService

public void testDeleteService()

assertDeleted

private void assertDeleted(PollableService svc)

assertNotDeleted

private void assertNotDeleted(PollableService svc)

assertDeleted

private void assertDeleted(PollableInterface iface)

assertNotDeleted

private void assertNotDeleted(PollableInterface iface)

assertDeleted

private void assertDeleted(PollableNode node)

assertNotDeleted

private void assertNotDeleted(PollableNode node)

testDeleteInterface

public void testDeleteInterface()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testDeleteNode

public void testDeleteNode()
                    throws java.lang.Exception
Throws:
java.lang.Exception

testDeleteServiceStatus

public void testDeleteServiceStatus()

testDowntimeDelete

public void testDowntimeDelete()

testReparentInterface

public void testReparentInterface()

testReparentOutages

public void testReparentOutages()

testReparentStatusChanges

public void testReparentStatusChanges()

testStatus

public void testStatus()
                throws java.lang.Exception
Throws:
java.lang.Exception

testInterfaceStatus

public void testInterfaceStatus()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testFindMemberWithDescendent

public void testFindMemberWithDescendent()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testPropagateUnresponsive

public void testPropagateUnresponsive()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testPollUnresponsive

public void testPollUnresponsive()

testPollUnresponsiveWithOutage

public void testPollUnresponsiveWithOutage()

testPollService

public void testPollService()
                     throws java.lang.Exception
Throws:
java.lang.Exception

testPollAllUp

public void testPollAllUp()
                   throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfUpNonCritSvcDown

public void testPollIfUpNonCritSvcDown()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfUpCritSvcDownPoll

public void testPollIfUpCritSvcDownPoll()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfDownNonCritSvcUp

public void testPollIfDownNonCritSvcUp()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfDownCritSvcUp

public void testPollIfDownCritSvcUp()
                             throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfUpCritSvcUndefSvcDown

public void testPollIfUpCritSvcUndefSvcDown()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfDownCritSvcUndefSvcDown

public void testPollIfDownCritSvcUndefSvcDown()
                                       throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfUpCritSvcUndefSvcDownNoPoll

public void testPollIfUpCritSvcUndefSvcDownNoPoll()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testPollIfDownCritSvcUndefSvcDownNoPoll

public void testPollIfDownCritSvcUndefSvcDownNoPoll()
                                             throws java.lang.Exception
Throws:
java.lang.Exception

testPollNode

public void testPollNode()
                  throws java.lang.Exception
Throws:
java.lang.Exception

testNodeProcessingDisabled

public void testNodeProcessingDisabled()

testServiceEvent

public void testServiceEvent()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testInterfaceEvent

public void testInterfaceEvent()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testNodeEvent

public void testNodeEvent()
                   throws java.lang.Exception
Throws:
java.lang.Exception

testLingeringSvcDownOnIfUp

public void testLingeringSvcDownOnIfUp()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testLingeringSvcDownOnNodeUp

public void testLingeringSvcDownOnNodeUp()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testSvcOutage

public void testSvcOutage()

testIfOutage

public void testIfOutage()

testCause

public void testCause()

testIndependentOutageEventsUpTogether

public void testIndependentOutageEventsUpTogether()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testIndependentOutageEventsUpSeparately

public void testIndependentOutageEventsUpSeparately()
                                             throws java.lang.Exception
Throws:
java.lang.Exception

testDowntimeInterval

public void testDowntimeInterval()

testSchedule

public void testSchedule()

testScheduleAdjust

public void testScheduleAdjust()

testComputeScheduledOutageTime

public void testComputeScheduledOutageTime()

testScheduledOutage

public void testScheduledOutage()

testMidnightOutageBug1122

public void testMidnightOutageBug1122()
                               throws java.text.ParseException
Throws:
java.text.ParseException

testLoadService

public void testLoadService()
                     throws java.lang.Exception
Throws:
java.lang.Exception

testLoadInterface

public void testLoadInterface()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testLoadNode

public void testLoadNode()
                  throws java.lang.Exception
Throws:
java.lang.Exception

testLoadIndependentOutageEventsUpTogether

public void testLoadIndependentOutageEventsUpTogether()
                                               throws java.lang.Exception
Throws:
java.lang.Exception

testLoadIndependentOutageEventsUpSeparately

public void testLoadIndependentOutageEventsUpSeparately()
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

testLock

public void testLock()
              throws java.lang.Exception
Throws:
java.lang.Exception

testLockTimeout

public void testLockTimeout()
                     throws java.lang.Exception
Throws:
java.lang.Exception

assertTime

private void assertTime(long time)

verifyAnticipated

private void verifyAnticipated()

resetAnticipated

private void resetAnticipated()

anticipateUp

private void anticipateUp(MockElement element)

anticipateDown

private void anticipateDown(MockElement element)

anticipateUnresponsive

private void anticipateUnresponsive(MockElement element)

anticipateResponsive

private void anticipateResponsive(MockElement element)

assertPoll

private void assertPoll(MockService svc)

assertNoPoll

private void assertNoPoll(MockElement elem)

assertChanged

private void assertChanged(PollableElement elem)

assertUnchanged

private void assertUnchanged(PollableElement elem)

assertUp

private void assertUp(PollableElement elem)

assertDown

private void assertDown(PollableElement elem)

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.