@Test public void getErrorAfterConnectionReset() throws Exception { class TestConnection extends Connection { public TestConnection() { super("localhost", 6379); } protected boolean sendCommand(Command cmd, byte[]... args) { return super.sendCommand(cmd, args); } } TestConnection conn = new TestConnection(); try { conn.sendCommand(Command.HMSET, new byte[1024 * 1024 + 1][0]); fail("Should throw exception"); } catch (JedisConnectionException jce) { assertEquals("ERR Protocol error: invalid multibulk length", jce.getMessage()); } }
@Test public void getErrorAfterConnectionReset() throws Exception { class TestConnection extends Connection { public TestConnection() { super("localhost", 6379); } @Override protected Connection sendCommand(ProtocolCommand cmd, byte[]... args) { return super.sendCommand(cmd, args); } } TestConnection conn = new TestConnection(); try { conn.sendCommand(Command.HMSET, new byte[1024 * 1024 + 1][0]); fail("Should throw exception"); } catch (JedisConnectionException jce) { assertEquals("ERR Protocol error: invalid multibulk length", jce.getMessage()); } }
@Before public void setUp() throws Exception { client = new Connection(); }
public Connection sendCommand(final Protocol.Command cmd, final byte[]... args) { return super.sendCommand(cmd, args); }