|
31 | 31 | import redis.clients.jedis.Pipeline; |
32 | 32 | import redis.clients.jedis.Response; |
33 | 33 | import redis.clients.jedis.Tuple; |
| 34 | +import redis.clients.jedis.exceptions.JedisBatchOperationException; |
34 | 35 | import redis.clients.jedis.exceptions.JedisDataException; |
35 | 36 | import redis.clients.jedis.util.SafeEncoder; |
36 | 37 |
|
@@ -191,7 +192,7 @@ public void pipelineResponseWithoutData() { |
191 | 192 | assertNull(score.get()); |
192 | 193 | } |
193 | 194 |
|
194 | | - @Test(expected = JedisDataException.class) |
| 195 | + @Test(expected = JedisBatchOperationException.class) |
195 | 196 | public void pipelineResponseWithinPipeline() { |
196 | 197 | jedis.set("string", "foo"); |
197 | 198 |
|
@@ -308,27 +309,27 @@ public void multiWithSync() { |
308 | 309 | assertEquals("world", r3.get()); |
309 | 310 | } |
310 | 311 |
|
311 | | - @Test(expected = JedisDataException.class) |
312 | | - public void pipelineExecShoudThrowJedisDataExceptionWhenNotInMulti() { |
| 312 | + @Test(expected = JedisBatchOperationException.class) |
| 313 | + public void pipelineExecShoudThrowBatchExceptionWhenNotInMulti() { |
313 | 314 | Pipeline pipeline = jedis.pipelined(); |
314 | 315 | pipeline.exec(); |
315 | 316 | } |
316 | 317 |
|
317 | | - @Test(expected = JedisDataException.class) |
318 | | - public void pipelineDiscardShoudThrowJedisDataExceptionWhenNotInMulti() { |
| 318 | + @Test(expected = JedisBatchOperationException.class) |
| 319 | + public void pipelineDiscardShoudThrowBatchExceptionWhenNotInMulti() { |
319 | 320 | Pipeline pipeline = jedis.pipelined(); |
320 | 321 | pipeline.discard(); |
321 | 322 | } |
322 | 323 |
|
323 | | - @Test(expected = JedisDataException.class) |
324 | | - public void pipelineMultiShoudThrowJedisDataExceptionWhenAlreadyInMulti() { |
| 324 | + @Test(expected = JedisBatchOperationException.class) |
| 325 | + public void pipelineMultiShoudThrowBatchExceptionWhenAlreadyInMulti() { |
325 | 326 | Pipeline pipeline = jedis.pipelined(); |
326 | 327 | pipeline.multi(); |
327 | 328 | pipeline.set("foo", "3"); |
328 | 329 | pipeline.multi(); |
329 | 330 | } |
330 | 331 |
|
331 | | - @Test(expected = JedisDataException.class) |
| 332 | + @Test(expected = JedisBatchOperationException.class) |
332 | 333 | public void testJedisThowExceptionWhenInPipeline() { |
333 | 334 | Pipeline pipeline = jedis.pipelined(); |
334 | 335 | pipeline.set("foo", "3"); |
@@ -636,7 +637,7 @@ public void testCloseableWithMulti() throws IOException { |
636 | 637 | try { |
637 | 638 | pipeline.exec(); |
638 | 639 | fail("close should discard transaction"); |
639 | | - } catch (JedisDataException e) { |
| 640 | + } catch (JedisBatchOperationException e) { |
640 | 641 | assertTrue(e.getMessage().contains("EXEC without MULTI")); |
641 | 642 | // pass |
642 | 643 | } |
|
0 commit comments