@Test
public void testDirJvmView() throws Exception {

	assertTrue(gateway.getBindings().containsKey(target));
	// Initial case, empty contents
	command.execute("d", new BufferedReader(new StringReader(createDirJvmViewCommand(null))), writer);
	JvmViewRet result = convertResponseJvmView(sWriter.toString());
	sWriter.getBuffer().setLength(0);
	assertEquals(new HashSet<String>(), result.names);
	// Initial case, non-empty contents
	gateway.getDefaultJVMView().addSingleImport("com.example.Class1");
	gateway.getDefaultJVMView().addSingleImport("com.another.Class2");
	command.execute("d", new BufferedReader(new StringReader(createDirJvmViewCommand(null))), writer);
	result = convertResponseJvmView(sWriter.toString());
	sWriter.getBuffer().setLength(0);
	String sequenceID = result.sequenceId;
	assertEquals(new HashSet<String>(Arrays.asList("Class1", "Class2")), result.names);
	// Read again with sequence # we just received
	command.execute("d", new BufferedReader(new StringReader(createDirJvmViewCommand(sequenceID))), writer);
	result = convertResponseJvmView(sWriter.toString());
	sWriter.getBuffer().setLength(0);
	assertNull(result);
	// Add another with sequence # we received
	gateway.getDefaultJVMView().addSingleImport("com.third.Class3");
	command.execute("d", new BufferedReader(new StringReader(createDirJvmViewCommand(sequenceID))), writer);
	result = convertResponseJvmView(sWriter.toString());
	sWriter.getBuffer().setLength(0);
	assertEquals(new HashSet<String>(Arrays.asList("Class1", "Class2", "Class3")), result.names);
}