use of org.opennms.protocols.wmi.WmiManager in project opennms by OpenNMS.
the class WmiManagerTest method testClose.
/**
* Test that a normal, standard close functions properly.
*
* Test method for {@link org.opennms.protocols.wmi.WmiManager#close()}.
*
* @throws WmiException if there is unexpected behavior.
*/
public final void testClose() throws WmiException {
// Set up WMI mock client.
// 1) Expect a call to connect()
// 2) Expect a call to disconnect()
m_WmiMock.connect("127.0.0.1", "Administrator", "password", WmiParams.WMI_DEFAULT_NAMESPACE);
m_WmiMock.disconnect();
replay(m_WmiMock);
// Create a manager.
WmiManager wmiManager = new WmiManager("127.0.0.1", "Administrator", "password");
// Initialize
wmiManager.init(m_WmiMock);
// Disconnect
wmiManager.close();
verify(m_WmiMock);
reset(m_WmiMock);
}
Aggregations