From a421f94909a1f98095dd707002b4cdf3c084d815 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 18 Aug 2008 02:54:03 +0000 Subject: [PATCH] A couple more test cases for Bootstrap --- .../java/org/jboss/netty/bootstrap/BootstrapTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/jboss/netty/bootstrap/BootstrapTest.java b/src/test/java/org/jboss/netty/bootstrap/BootstrapTest.java index bdd11079cf..b696b23d74 100644 --- a/src/test/java/org/jboss/netty/bootstrap/BootstrapTest.java +++ b/src/test/java/org/jboss/netty/bootstrap/BootstrapTest.java @@ -61,7 +61,10 @@ public class BootstrapTest { @Test public void shouldNotAllowFactoryToChangeMoreThanOnce() { Bootstrap b = new Bootstrap(); - b.setFactory(createMock(ChannelFactory.class)); + ChannelFactory f = createMock(ChannelFactory.class); + b.setFactory(f); + assertSame(f, b.getFactory()); + try { b.setFactory(createMock(ChannelFactory.class)); fail(); @@ -220,9 +223,10 @@ public class BootstrapTest { Bootstrap b = new Bootstrap(); b.setOption("s", "x"); - assertEquals("x", b.getOptions().get("s")); + assertEquals("x", b.getOption("s")); b.setOption("s", null); + assertNull(b.getOption("s")); assertTrue(b.getOptions().isEmpty()); } }