[libvirt-java] [PATCH 14/65] test: ensure the Device.listCapabilities method works

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Claudio Bley <cbley@xxxxxxxxxx>
---
 src/test/java/org/libvirt/TestJavaBindings.java |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java
index a25c4f3..0123e6a 100644
--- a/src/test/java/org/libvirt/TestJavaBindings.java
+++ b/src/test/java/org/libvirt/TestJavaBindings.java
@@ -46,6 +46,20 @@ public final class TestJavaBindings extends TestCase {
         assertTrue("conn.isSecure", conn.isSecure() == 1);        
     }
 
+    /*
+     * Excercise the listCapabilities method of the Device class.
+     */
+    public void testDeviceListCapabilities() throws Exception {
+        Device dev = this.conn.deviceLookupByName("computer");
+        String[] caps = dev.listCapabilities();
+
+        // check that all caps are non-empty strings
+        for (String c: caps) {
+            assertNotNull("capability is null", c);
+            assertFalse("capability is empty", c.isEmpty());
+        }
+    }
+
     public void testNodeInfo() throws Exception {
         NodeInfo nodeInfo = conn.nodeInfo();
         assertEquals("nodeInfo.model", "i686", nodeInfo.model);
-- 
1.7.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]