@Test public void testService() throws RemotingException { mockChannel = mock(Channel.class); given(mockChannel.getAttribute("telnet.service")).willReturn("com.alibaba.dubbo.rpc.protocol.dubbo.support.DemoService"); String result = count.telnet(mockChannel, ""); assertEquals("com.alibaba.dubbo.rpc.protocol.dubbo.support.DemoService", result); }
@Override public String telnet(Channel channel, String message) { if (message.length() > 0) { return "Unsupported parameter " + message + " for pwd."; } String service = (String) channel.getAttribute(ChangeTelnetHandler.SERVICE_KEY); StringBuilder buf = new StringBuilder(); if (service == null || service.length() == 0) { buf.append("/"); } else { buf.append(service); } return buf.toString(); }
CurrentTelnetHandler implements TelnetHandler { @Override public String telnet(Channel channel, String message) { if (message.length() > 0) { return "Unsupported parameter " + message + " for pwd."; } String service = (String) channel.getAttribute(ChangeTelnetHandler.SERVICE_KEY); StringBuilder buf = new StringBuilder(); if (service == null || service.length() == 0) { buf.append("/"); } else { buf.append(service); } return buf.toString(); } }
CurrentTelnetHandler implements TelnetHandler { @Override public String telnet(Channel channel, String message) { if (message.length() > 0) { return "Unsupported parameter " + message + " for pwd."; } String service = (String) channel.getAttribute(ChangeTelnetHandler.SERVICE_KEY); StringBuilder buf = new StringBuilder(); if (service == null || service.length() == 0) { buf.append("/"); } else { buf.append(service); } return buf.toString(); }  }
CurrentTelnetHandler implements TelnetHandler { @Override public String telnet(Channel channel, String message) { if (message.length() > 0) { return "Unsupported parameter " + message + " for pwd."; } String service = (String) channel.getAttribute(ChangeTelnetHandler.SERVICE_KEY); StringBuilder buf = new StringBuilder(); if (service == null || service.length() == 0) { buf.append("/"); } else { buf.append(service); } return buf.toString(); }  @Override String telnet(Channel channel, String message); }
CurrentTelnetHandler implements TelnetHandler { @Override public String telnet(Channel channel, String message) { if (message.length() > 0) { return "Unsupported parameter " + message + " for pwd."; } String service = (String) channel.getAttribute(ChangeTelnetHandler.SERVICE_KEY); StringBuilder buf = new StringBuilder(); if (service == null || service.length() == 0) { buf.append("/"); } else { buf.append(service); } return buf.toString(); }  @Override String telnet(Channel channel, String message);  }