/**
* Created by mh on 12.07.13.
*/
public class Asserts {
public static void assertCommand(ShellClient client, String command, String... expected) throws RemoteException, ShellException {
CollectingOutput out = new CollectingOutput();
client.evaluate(command, out);
assertEquals("command: "+join("\n",out.iterator()),expected.length, IteratorUtil.count(out.iterator()));
Iterator<String> it = out.iterator();
for (String s : expected) {
String output = it.next().trim();
if (s.isEmpty()) continue;
assertEquals(output+" should contain "+s,true,output.contains(s));
}