Commit 1bc41ffcc38f7457e72dc1b08f172f77d81fa98c

  • avatar
  • Bryan Kearney <bkearney @red…at.com>
  • Thu Jun 24 14:03:22 CEST 2010
Add an isConnected method to connection provided by Luis Costa
AUTHORS
(1 / 0)
  
77Thomas Fricke <libvirt@thomasfricke.de>
88David Lively <dlively@virtualiron.com>
99Bryan Kearney <bkearney@redhat.com>
10Luis Carlos Moreira da Costa <tcljava@gmail.com>
  
130130 }
131131
132132 /**
133 * the native virConnectPtr.
133 * The native virConnectPtr.
134134 */
135135 protected ConnectionPointer VCP;
136136
15651565 processError();
15661566 return new Stream(this, sPtr);
15671567 }
1568
1569 /**
1570 * Verify the connect is active.
1571 *
1572 * @return boolean The true connected, or false not.
1573 * @throws LibvirtException
1574 */
1575 public boolean isConnected() throws LibvirtException {
1576 return ( ( VCP != null ) ? true : false );
1577 }
15681578}
  
5050 assertEquals("nodeInfo.threads", 2, nodeInfo.threads);
5151 // These are basically no-exception tests
5252 assertTrue("conn.getCellsFreeMemory", conn.getCellsFreeMemory(0, 10) > 0);
53 assertTrue("conn.isConnectd", conn.isConnected());
5354 // Test Hypervisor does not support this.
5455 // assertTrue("conn.getFreeMemory", conn.getFreeMemory() > 0);
5556 }
190190 public void testAccessAfterClose() throws Exception {
191191 Connect conn = new Connect("test:///default", false);
192192 conn.close();
193 assertTrue("conn.isConnected should be false", !conn.isConnected());
193194 try {
194195 conn.getHostName();
195196 } catch (LibvirtException e) {