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

[Libguestfs] [PATCH 6/6] java: Add a test of g.list_filesystems (a function that returns a Map).



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
>From 1aa95f3af2b4a55176eca9e8995304da8dfe0b05 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones redhat com>
Date: Wed, 2 Mar 2011 05:11:10 +0000
Subject: [PATCH 6/6] java: Add a test of g.list_filesystems (a function that returns a Map).

---
 java/t/GuestFS010Basic.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/java/t/GuestFS010Basic.java b/java/t/GuestFS010Basic.java
index 137fad3..84b96f8 100644
--- a/java/t/GuestFS010Basic.java
+++ b/java/t/GuestFS010Basic.java
@@ -17,6 +17,7 @@
  */
 
 import java.io.*;
+import java.util.Map;
 import com.redhat.et.libguestfs.*;
 
 public class GuestFS010Basic
@@ -45,6 +46,15 @@ public class GuestFS010Basic
             assert lvs[0].equals ("/dev/VG/LV1");
             assert lvs[1].equals ("/dev/VG/LV2");
 
+            g.mkfs ("ext2", "/dev/VG/LV1");
+
+            Map<String,String> m = g.list_filesystems ();
+            assert m.containsKey ("/dev/VG/LV1");
+            assert m.size () == 2;
+
+            assert m.get ("/dev/VG/LV1").equals ("ext2");
+            assert m.get ("/dev/VG/LV2").equals ("unknown");
+
             g.close ();
 
             File f2 = new File ("test.img");
-- 
1.7.4


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