/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.redis.connection.jedis;
import static org.junit.Assert.*;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.data.redis.connection.RedisPipelineException;
import org.springframework.test.annotation.IfProfileValue;
/**
* @author Jennifer Hickey
* @author Christoph Strobl
*/
public class JedisConnectionPipelineTxIntegrationTests extends JedisConnectionTransactionIntegrationTests {
@Ignore("Jedis issue: Pipeline tries to return String instead of List<String>")
@Test
public void testGetConfig() {}
@Test(expected = RedisPipelineException.class)
public void exceptionExecuteNative() throws Exception {
connection.execute("set", "foo");
connection.execute("ZadD", getClass() + "#foo\t0.90\titem");
getResults();
}
@Test(expected = RedisPipelineException.class)
@IfProfileValue(name = "redisVersion", value = "2.6+")
public void testRestoreBadData() {
super.testRestoreBadData();
}
@Test(expected = RedisPipelineException.class)
@IfProfileValue(name = "redisVersion", value = "2.6+")
public void testRestoreExistingKey() {
super.testRestoreExistingKey();
}
protected void initConnection() {
connection.openPipeline();
connection.multi();
}
@SuppressWarnings("unchecked")
protected List<Object> getResults() {
assertNull(connection.exec());
List<Object> pipelined = connection.closePipeline();
// We expect only the results of exec to be in the closed pipeline
assertEquals(1, pipelined.size());
List<Object> txResults = (List<Object>) pipelined.get(0);
// Return exec results and this test should behave exactly like its superclass
return txResults;
}
@Override
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-268
public void testListClientsContainsAtLeastOneElement() {
super.testListClientsContainsAtLeastOneElement();
}
}