*/
public class JvmOptionsCodecTest {
@Test
public void testNoNulls() throws Exception {
JvmOptions options = new JvmOptions("-version",
new JvmOptions.DebugOptions(true, false, ImmutableSet.of("one", "two")));
final StringWriter writer = new StringWriter();
JvmOptionsCodec.encode(options, new OutputSupplier<Writer>() {
@Override
public Writer getOutput() throws IOException {
return writer;
}
});
JvmOptions options1 = JvmOptionsCodec.decode(new InputSupplier<Reader>() {
@Override
public Reader getInput() throws IOException {
return new StringReader(writer.toString());
}
});
Assert.assertEquals(options.getExtraOptions(), options1.getExtraOptions());
Assert.assertEquals(options.getDebugOptions().doDebug(), options1.getDebugOptions().doDebug());
Assert.assertEquals(options.getDebugOptions().doSuspend(), options1.getDebugOptions().doSuspend());
Assert.assertEquals(options.getDebugOptions().getRunnables(), options1.getDebugOptions().getRunnables());
}