Changed callback arguments to varargs and renamed a method.

This commit is contained in:
akwizgran
2011-10-06 11:13:19 +01:00
parent 11b571fd8f
commit f8ca06f79d
2 changed files with 14 additions and 14 deletions

View File

@@ -4,13 +4,13 @@ import java.util.Map;
public interface TransportCallback {
void setLocalTransports(Map<String, String> transports);
void setLocalProperties(Map<String, String> properties);
void setConfig(Map<String, String> config);
void showMessage(String message);
void showMessage(String... message);
boolean showConfirmationMessage(String message);
boolean showConfirmationMessage(String... message);
int showChoice(String message, String[] choices);
int showChoice(String[] choices, String... message);
}

View File

@@ -99,8 +99,8 @@ public class RemovableDrivePluginTest extends TestCase {
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String.class)),
with(any(String[].class)));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String.class)));
will(returnValue(-1)); // The user cancelled the choice
}});
@@ -136,8 +136,8 @@ public class RemovableDrivePluginTest extends TestCase {
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String.class)),
with(any(String[].class)));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String.class)));
will(returnValue(0)); // The user chose drive1 but it doesn't exist
}});
@@ -175,8 +175,8 @@ public class RemovableDrivePluginTest extends TestCase {
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String.class)),
with(any(String[].class)));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String.class)));
will(returnValue(0)); // The user chose drive1 but it's not a dir
}});
@@ -214,8 +214,8 @@ public class RemovableDrivePluginTest extends TestCase {
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String.class)),
with(any(String[].class)));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String.class)));
will(returnValue(0)); // The user chose drive1
}});
@@ -256,8 +256,8 @@ public class RemovableDrivePluginTest extends TestCase {
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String.class)),
with(any(String[].class)));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String.class)));
will(returnValue(0)); // The user chose drive1
oneOf(callback).showMessage(with(any(String.class)));
}});