### Question:
NsclientPlugin extends AbstractPlugin { public boolean isProtocolSupported(InetAddress address) { throw new UnsupportedOperationException( "Undirected TCP checking not " + "supported"); }  String getProtocolName(); boolean isProtocolSupported(InetAddress address); boolean isProtocolSupported(InetAddress address, Map<String, Object> qualifiers);  }### Answer:
@Test public void testPluginSuccess() throws Exception { startServer("None&1", "NSClient++ 0.3.8.75 2010-05-27"); NsclientPlugin plugin = new NsclientPlugin(); Map<String, Object> qualifiers = new HashMap<String, Object>(); qualifiers.put("port", getServer().getLocalPort()); Assert.assertTrue(plugin.isProtocolSupported(getServer().getInetAddress(), qualifiers)); stopServer(); }
@Test public void testPluginFail() throws Exception { startServer("None&1", "ERROR: I don't know what you mean"); NsclientPlugin plugin = new NsclientPlugin(); Map<String, Object> qualifiers = new HashMap<String, Object>(); qualifiers.put("port", getServer().getLocalPort()); Assert.assertFalse(plugin.isProtocolSupported(getServer().getInetAddress(), qualifiers)); stopServer(); }