[Pkg-libvirt-commits] [SCM] Libguestfs Debian packaging branch, experimental, updated. debian/1%1.21.40-1
Richard W.M. Jones
rjones at redhat.com
Sat Jun 1 11:04:27 UTC 2013
The following commit has been merged in the experimental branch:
commit 02fbf566e88624f581ab67b1cc818f36e1dfdc33
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Wed May 1 08:36:16 2013 +0100
java: Standardize Java test numbering.
diff --git a/java/Makefile.am b/java/Makefile.am
index aba192b..9a20160 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -38,10 +38,11 @@ java_sources = \
java_tests = \
Bindtests.java \
- t/GuestFS005Load.java \
- t/GuestFS010Basic.java \
- t/GuestFS080OptArgs.java \
- t/GuestFS400Events.java
+ t/GuestFS020Create.java \
+ t/GuestFS070OptArgs.java \
+ t/GuestFS100Launch.java \
+ t/GuestFS410CloseEvent.java \
+ t/GuestFS420LogMessages.java
EXTRA_DIST = \
$(java_sources) \
diff --git a/java/t/GuestFS005Load.java b/java/t/GuestFS020Create.java
similarity index 97%
rename from java/t/GuestFS005Load.java
rename to java/t/GuestFS020Create.java
index 23f1611..f902d62 100644
--- a/java/t/GuestFS005Load.java
+++ b/java/t/GuestFS020Create.java
@@ -18,7 +18,7 @@
import com.redhat.et.libguestfs.*;
-public class GuestFS005Load {
+public class GuestFS020Create {
public static void main (String[] argv)
{
try {
diff --git a/java/t/GuestFS080OptArgs.java b/java/t/GuestFS070OptArgs.java
similarity index 98%
copy from java/t/GuestFS080OptArgs.java
copy to java/t/GuestFS070OptArgs.java
index 417d0ad..a1af95f 100644
--- a/java/t/GuestFS080OptArgs.java
+++ b/java/t/GuestFS070OptArgs.java
@@ -20,7 +20,7 @@ import java.io.*;
import java.util.HashMap;
import com.redhat.et.libguestfs.*;
-public class GuestFS080OptArgs
+public class GuestFS070OptArgs
{
public static void main (String[] argv)
{
diff --git a/java/t/GuestFS010Basic.java b/java/t/GuestFS100Launch.java
similarity index 98%
rename from java/t/GuestFS010Basic.java
rename to java/t/GuestFS100Launch.java
index f7fd320..ed1d29d 100644
--- a/java/t/GuestFS010Basic.java
+++ b/java/t/GuestFS100Launch.java
@@ -20,7 +20,7 @@ import java.io.*;
import java.util.Map;
import com.redhat.et.libguestfs.*;
-public class GuestFS010Basic
+public class GuestFS100Launch
{
public static void main (String[] argv)
{
diff --git a/java/t/GuestFS080OptArgs.java b/java/t/GuestFS410CloseEvent.java
similarity index 55%
rename from java/t/GuestFS080OptArgs.java
rename to java/t/GuestFS410CloseEvent.java
index 417d0ad..a5fba2e 100644
--- a/java/t/GuestFS080OptArgs.java
+++ b/java/t/GuestFS410CloseEvent.java
@@ -1,5 +1,5 @@
/* libguestfs Java bindings
- * Copyright (C) 2011 Red Hat Inc.
+ * Copyright (C) 2013 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,40 +20,36 @@ import java.io.*;
import java.util.HashMap;
import com.redhat.et.libguestfs.*;
-public class GuestFS080OptArgs
+public class GuestFS410CloseEvent
{
- public static void main (String[] argv)
+ static class CloseInvoked implements EventCallback
{
- try {
- GuestFS g = new GuestFS ();
+ private int close_invoked = 0;
- g.add_drive ("/dev/null");
+ public void event (long event, int eh, String buffer, long[] array)
+ {
+ close_invoked++;
+ }
- HashMap<String,Object> optargs;
+ public int getCloseInvoked ()
+ {
+ return close_invoked;
+ }
+ }
- optargs = new HashMap<String,Object>() {
- {
- put ("readonly", Boolean.TRUE);
- }
- };
- g.add_drive ("/dev/null", optargs);
+ public static void main (String[] argv)
+ {
+ try {
+ GuestFS g = new GuestFS ();
- optargs = new HashMap<String,Object>() {
- {
- put ("readonly", Boolean.TRUE);
- put ("format", "raw");
- }
- };
- g.add_drive ("/dev/null", optargs);
+ // Check that the close event is invoked.
+ CloseInvoked ci = new CloseInvoked ();
+ g.set_event_callback (ci, GuestFS.EVENT_CLOSE);
- optargs = new HashMap<String,Object>() {
- {
- put ("readonly", Boolean.TRUE);
- put ("format", "raw");
- put ("iface", "virtio");
- }
- };
- g.add_drive ("/dev/null", optargs);
+ // Close the handle.
+ assert ci.getCloseInvoked() == 0;
+ g.close ();
+ assert ci.getCloseInvoked() == 1;
}
catch (Exception exn) {
System.err.println (exn);
diff --git a/java/t/GuestFS400Events.java b/java/t/GuestFS420LogMessages.java
similarity index 74%
rename from java/t/GuestFS400Events.java
rename to java/t/GuestFS420LogMessages.java
index 98236d8..3ff7d9c 100644
--- a/java/t/GuestFS400Events.java
+++ b/java/t/GuestFS420LogMessages.java
@@ -20,10 +20,12 @@ import java.io.*;
import java.util.HashMap;
import com.redhat.et.libguestfs.*;
-public class GuestFS400Events
+public class GuestFS420LogMessages
{
- static class PrintEvent implements EventCallback
+ static class LogEvent implements EventCallback
{
+ private int log_invoked = 0;
+
public void event (long event, int eh, String buffer, long[] array)
{
String msg = "event=" + GuestFS.eventToString (event) + " " +
@@ -40,22 +42,13 @@ public class GuestFS400Events
}
System.out.println ("java event logged: " + msg);
- }
- }
-
- static class CloseInvoked extends PrintEvent
- {
- private int close_invoked = 0;
- public void event (long event, int eh, String buffer, long[] array)
- {
- super.event (event, eh, buffer, array);
- close_invoked++;
+ log_invoked++;
}
- public int getCloseInvoked ()
+ public int getLogInvoked ()
{
- return close_invoked;
+ return log_invoked;
}
}
@@ -66,14 +59,11 @@ public class GuestFS400Events
// Grab all messages into an event handler that just
// prints each event.
- g.set_event_callback (new PrintEvent (),
+ LogEvent le = new LogEvent ();
+ g.set_event_callback (le,
GuestFS.EVENT_APPLIANCE|GuestFS.EVENT_LIBRARY|
GuestFS.EVENT_TRACE);
- // Check that the close event is invoked.
- CloseInvoked ci = new CloseInvoked ();
- g.set_event_callback (ci, GuestFS.EVENT_CLOSE);
-
// Now make sure we see some messages.
g.set_trace (true);
g.set_verbose (true);
@@ -82,10 +72,8 @@ public class GuestFS400Events
g.add_drive_ro ("/dev/null");
g.set_autosync (true);
- // Close the handle.
- assert ci.getCloseInvoked() == 0;
g.close ();
- assert ci.getCloseInvoked() == 1;
+ assert le.getLogInvoked() > 0;
}
catch (Exception exn) {
System.err.println (exn);
--
Libguestfs Debian packaging
More information about the Pkg-libvirt-commits
mailing list