DATACASS-385 - Migrate ticket references in test code to Spring Framework style.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -38,15 +38,10 @@ import com.datastax.driver.core.policies.SpeculativeExecutionPolicy;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author John Blum
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
*/
|
||||
public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldInitializeWithoutAnyOptions() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -58,11 +53,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getMetricsOptions().isJMXReportingEnabled()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldShutdownClusterInstance() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -72,11 +63,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(bean.getObject().isClosed()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-217">DATACASS-217</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-217
|
||||
public void shouldSetLZ4CompressionType() throws Exception {
|
||||
|
||||
CompressionType compressionType = CompressionType.LZ4;
|
||||
@@ -88,11 +75,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getProtocolOptions(bean).getCompression()).isEqualTo(Compression.LZ4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetSnappyCompressionType() throws Exception {
|
||||
|
||||
CompressionType compressionType = CompressionType.SNAPPY;
|
||||
@@ -104,11 +87,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getProtocolOptions().getCompression()).isEqualTo(Compression.SNAPPY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetPoolingOptions() throws Exception {
|
||||
|
||||
PoolingOptions poolingOptions = new PoolingOptions();
|
||||
@@ -120,11 +99,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getPoolingOptions()).isEqualTo(poolingOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetSocketOptions() throws Exception {
|
||||
|
||||
SocketOptions socketOptions = new SocketOptions();
|
||||
@@ -136,11 +111,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getSocketOptions()).isEqualTo(socketOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetQueryOptions() throws Exception {
|
||||
|
||||
QueryOptions queryOptions = new QueryOptions();
|
||||
@@ -152,11 +123,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getQueryOptions()).isEqualTo(queryOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void defaultQueryOptionsShouldHaveOwnObjectIdentity() throws Exception {
|
||||
|
||||
QueryOptions queryOptions = new QueryOptions();
|
||||
@@ -168,11 +135,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getQueryOptions()).isNotEqualTo(queryOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetAuthProvider() throws Exception {
|
||||
|
||||
AuthProvider authProvider = new PlainTextAuthProvider("x", "y");
|
||||
@@ -184,12 +147,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getProtocolOptions().getAuthProvider()).isEqualTo(authProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-263">DATACASS-263</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226, DATACASS-263
|
||||
public void shouldSetAuthenticationProvider() throws Exception {
|
||||
|
||||
AuthProvider authProvider = new PlainTextAuthProvider("x", "y");
|
||||
@@ -202,12 +160,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(result).isEqualTo(authProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-263">DATACASS-263</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226, DATACASS-263
|
||||
public void shouldSetAuthentication() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -221,11 +174,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(ReflectionTestUtils.getField(result, "password")).isEqualTo((Object) "password");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetLoadBalancingPolicy() throws Exception {
|
||||
|
||||
LoadBalancingPolicy loadBalancingPolicy = new RoundRobinPolicy();
|
||||
@@ -237,11 +186,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getPolicies().getLoadBalancingPolicy()).isEqualTo(loadBalancingPolicy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetReconnectionPolicy() throws Exception {
|
||||
|
||||
ReconnectionPolicy reconnectionPolicy = new ExponentialReconnectionPolicy(1, 2);
|
||||
@@ -253,11 +198,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getPolicies().getReconnectionPolicy()).isEqualTo(reconnectionPolicy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetProtocolVersion() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -268,11 +209,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
.contains(ProtocolVersion.V2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetSslOptions() throws Exception {
|
||||
|
||||
SSLOptions sslOptions = JdkSSLOptions.builder().build();
|
||||
@@ -285,11 +222,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getProtocolOptions().getSSLOptions()).isEqualTo(sslOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldDisableMetrics() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -299,11 +232,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getConfiguration(bean).getMetricsOptions().isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldDisableJmxReporting() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -325,10 +254,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
verify(mockClusterBuilderConfigurer, times(1)).configure(isA(Cluster.Builder.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-316">DATACASS-316</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-316
|
||||
public void shouldSetAddressTranslator() throws Exception {
|
||||
|
||||
AddressTranslator mockAddressTranslator = mock(AddressTranslator.class);
|
||||
@@ -340,10 +266,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getPolicies(bean).getAddressTranslator()).isEqualTo(mockAddressTranslator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-317">DATACASS-317</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-317
|
||||
public void shouldSetClusterNameWithBeanNameProperty() throws Exception {
|
||||
|
||||
final Cluster.Builder mockClusterBuilder = mock(Cluster.Builder.class);
|
||||
@@ -364,10 +287,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
verify(mockClusterBuilder, times(1)).withClusterName(eq("ABC"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-317">DATACASS-317</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-317
|
||||
public void shouldSetClusterNameWithClusterNameProperty() throws Exception {
|
||||
|
||||
final Cluster.Builder mockClusterBuilder = mock(Cluster.Builder.class);
|
||||
@@ -388,10 +308,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
verify(mockClusterBuilder, times(1)).withClusterName(eq("XYZ"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-319">DATACASS-319</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-319
|
||||
public void shouldSetMaxSchemaAgreementWaitSeconds() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -402,10 +319,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getProtocolOptions(bean).getMaxSchemaAgreementWaitSeconds()).isEqualTo(20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-320">DATACASS-320</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-320
|
||||
public void shouldSetSpeculativeExecutionPolicy() throws Exception {
|
||||
|
||||
SpeculativeExecutionPolicy mockSpeculativeExecutionPolicy = mock(SpeculativeExecutionPolicy.class);
|
||||
@@ -417,10 +331,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
|
||||
assertThat(getPolicies(bean).getSpeculativeExecutionPolicy()).isEqualTo(mockSpeculativeExecutionPolicy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-238">DATACASS-238</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-238
|
||||
public void shouldSetTimestampGenerator() throws Exception {
|
||||
|
||||
TimestampGenerator mockTimestampGenerator = mock(TimestampGenerator.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors
|
||||
* 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.
|
||||
@@ -24,6 +24,7 @@ import static org.mockito.Mockito.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -45,8 +46,6 @@ import com.datastax.driver.core.Session;
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.springframework.cassandra.config.CassandraCqlSessionFactoryBean
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-219>DATACASS-219</a>
|
||||
* @since 1.5.0
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
@@ -59,35 +58,28 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
|
||||
private CassandraCqlSessionFactoryBean factoryBean;
|
||||
|
||||
protected <T> List<T> asList(T... array) {
|
||||
return new ArrayList<T>(Arrays.asList(array));
|
||||
}
|
||||
|
||||
protected void assertNonNullEmptyCollection(Collection<?> collection) {
|
||||
assertThat(collection).isNotNull();
|
||||
assertThat(collection.isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
factoryBean = spy(new CassandraCqlSessionFactoryBean());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void cassandraCqlSessionFactoryBeanIsSingleton() {
|
||||
assertThat(factoryBean.isSingleton()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void objectTypeWhenSessionHasNotBeenInitializedIsSessionClass() {
|
||||
|
||||
assertThat(factoryBean.getObject()).isNull();
|
||||
assertThat(factoryBean.<Session> getObjectType()).isEqualTo(Session.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
@SuppressWarnings("unchecked")
|
||||
public void afterPropertiesSetInitializesSessionWithKeyspaceAndExecutesStartupScripts() throws Exception {
|
||||
List<String> expectedStartupScripts = asList("/path/to/schema.cql", "/path/to/data.cql");
|
||||
|
||||
List<String> expectedStartupScripts = Arrays.asList("/path/to/schema.cql", "/path/to/data.cql");
|
||||
|
||||
CqlOperations mockCqlOperations = mock(CqlOperations.class);
|
||||
|
||||
@@ -115,10 +107,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
verify(mockCqlOperations, times(1)).execute(eq(expectedStartupScripts.get(1)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void connectToSystemKeyspace() {
|
||||
when(mockCluster.connect()).thenReturn(mockSession);
|
||||
|
||||
when(mockCluster.connect()).thenReturn(mockSession);
|
||||
factoryBean.setCluster(mockCluster);
|
||||
|
||||
assertThat(factoryBean.connect(null)).isEqualTo(mockSession);
|
||||
@@ -127,10 +119,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
verify(mockCluster, never()).connect(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void connectToTargetKeyspace() {
|
||||
when(mockCluster.connect(eq("TestKeyspace"))).thenReturn(mockSession);
|
||||
|
||||
when(mockCluster.connect(eq("TestKeyspace"))).thenReturn(mockSession);
|
||||
factoryBean.setCluster(mockCluster);
|
||||
|
||||
assertThat(factoryBean.connect("TestKeyspace")).isEqualTo(mockSession);
|
||||
@@ -139,10 +131,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
verify(mockCluster, times(1)).connect(eq("TestKeyspace"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
@SuppressWarnings("unchecked")
|
||||
public void destroySessionAndExecutesShutdownScripts() throws Exception {
|
||||
List<String> expectedShutdownScripts = asList("/path/to/shutdown.cql");
|
||||
List<String> expectedShutdownScripts = Collections.singletonList("/path/to/shutdown.cql");
|
||||
|
||||
CqlOperations mockCqlOperations = mock(CqlOperations.class);
|
||||
|
||||
@@ -159,35 +151,42 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
inOrder.verify(mockSession, times(1)).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void isConnectedWithNullSessionIsFalse() {
|
||||
|
||||
assertThat(factoryBean.getObject()).isNull();
|
||||
assertThat(factoryBean.isConnected()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void isConnectedWithClosedSessionIsFalse() {
|
||||
doReturn(mockSession).when(factoryBean).getObject();
|
||||
|
||||
when(factoryBean.getObject()).thenReturn(mockSession);
|
||||
when(mockSession.isClosed()).thenReturn(true);
|
||||
|
||||
assertThat(factoryBean.isConnected()).isFalse();
|
||||
verify(mockSession, times(1)).isClosed();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void isConnectedWithOpenSessionIsTrue() {
|
||||
doReturn(mockSession).when(factoryBean).getObject();
|
||||
|
||||
when(factoryBean.getObject()).thenReturn(mockSession);
|
||||
when(mockSession.isClosed()).thenReturn(false);
|
||||
|
||||
assertThat(factoryBean.isConnected()).isTrue();
|
||||
verify(mockSession, times(1)).isClosed();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void setAndGetCluster() {
|
||||
|
||||
factoryBean.setCluster(mockCluster);
|
||||
|
||||
assertThat(factoryBean.getCluster()).isEqualTo(mockCluster);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void setClusterToNullThrowsIllegalArgumentException() {
|
||||
|
||||
try {
|
||||
@@ -199,7 +198,7 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void getClusterWhenUninitializedThrowsIllegalStateException() {
|
||||
|
||||
try {
|
||||
@@ -210,20 +209,19 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void setAndGetKeyspaceName() {
|
||||
|
||||
assertThat(factoryBean.getKeyspaceName()).isNull();
|
||||
|
||||
factoryBean.setKeyspaceName("TEST");
|
||||
|
||||
assertThat(factoryBean.getKeyspaceName()).isEqualTo("TEST");
|
||||
|
||||
factoryBean.setKeyspaceName(null);
|
||||
|
||||
assertThat(factoryBean.getKeyspaceName()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void getSessionWhenUninitializedThrowsIllegalStateException() {
|
||||
|
||||
assertThat(factoryBean.getObject()).isNull();
|
||||
@@ -237,26 +235,25 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void setAndGetStartupScripts() {
|
||||
|
||||
assertNonNullEmptyCollection(factoryBean.getStartupScripts());
|
||||
|
||||
List<String> expectedStartupScripts = asList("/path/to/schema.cql", "/path/to/data.cql");
|
||||
|
||||
List<String> expectedStartupScripts = Arrays.asList("/path/to/schema.cql", "/path/to/data.cql");
|
||||
factoryBean.setStartupScripts(expectedStartupScripts);
|
||||
|
||||
List<String> actualStartupScripts = factoryBean.getStartupScripts();
|
||||
|
||||
assertThat(actualStartupScripts).isNotSameAs(expectedStartupScripts).isEqualTo(expectedStartupScripts);
|
||||
|
||||
factoryBean.setStartupScripts(null);
|
||||
|
||||
assertNonNullEmptyCollection(factoryBean.getStartupScripts());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void startupScriptsAreImmutable() {
|
||||
List<String> startupScripts = asList("/path/to/startup.cql");
|
||||
|
||||
List<String> startupScripts = new ArrayList<String>(Collections.singletonList("/path/to/startup.cql"));
|
||||
|
||||
factoryBean.setStartupScripts(startupScripts);
|
||||
|
||||
@@ -282,29 +279,26 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
|
||||
@Test
|
||||
public void setAndGetShutdownScripts() {
|
||||
|
||||
assertNonNullEmptyCollection(factoryBean.getShutdownScripts());
|
||||
|
||||
List<String> expectedShutdownScripts = asList("/path/to/backup.cql", "/path/to/dropTables.cql");
|
||||
|
||||
List<String> expectedShutdownScripts = Arrays.asList("/path/to/backup.cql", "/path/to/dropTables.cql");
|
||||
factoryBean.setShutdownScripts(expectedShutdownScripts);
|
||||
|
||||
List<String> actualShutdownScripts = factoryBean.getShutdownScripts();
|
||||
|
||||
assertThat(actualShutdownScripts).isEqualTo(expectedShutdownScripts).isNotSameAs(expectedShutdownScripts);
|
||||
|
||||
factoryBean.setShutdownScripts(null);
|
||||
|
||||
assertNonNullEmptyCollection(factoryBean.getShutdownScripts());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-219
|
||||
public void shutdownScriptsAreImmutable() {
|
||||
List<String> shutdownScripts = asList("/path/to/shutdown.cql");
|
||||
|
||||
List<String> shutdownScripts = new ArrayList<String>(Collections.singletonList("/path/to/shutdown.cql"));
|
||||
factoryBean.setShutdownScripts(shutdownScripts);
|
||||
|
||||
List<String> actualShutdownScripts = factoryBean.getShutdownScripts();
|
||||
|
||||
assertThat(actualShutdownScripts).isEqualTo(shutdownScripts).isNotSameAs(shutdownScripts);
|
||||
|
||||
shutdownScripts.add("/path/to/corruptSession.cql");
|
||||
@@ -321,4 +315,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
|
||||
assertThat(actualShutdownScripts).hasSize(1);
|
||||
}
|
||||
}
|
||||
|
||||
private void assertNonNullEmptyCollection(Collection<?> collection) {
|
||||
|
||||
assertThat(collection).isNotNull();
|
||||
assertThat(collection.isEmpty()).isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -47,8 +47,6 @@ import com.datastax.driver.core.PoolingOptions;
|
||||
* @author David Webb
|
||||
* @author John Blum
|
||||
* @author Mark Paluch
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-176">DATACASS-176</a>
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class PoolingOptionsFactoryBeanUnitTests {
|
||||
@@ -63,7 +61,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
poolingOptionsFactoryBean = new PoolingOptionsFactoryBean();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACASS-176, DATACASS-298
|
||||
public void getObjectReturnsNullWhenNotInitialized() throws Exception {
|
||||
assertThat(poolingOptionsFactoryBean.getObject()).isNull();
|
||||
}
|
||||
@@ -79,11 +77,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
assertThat(poolingOptionsFactoryBean.isSingleton()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-344">DATACASS-344</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298, DATACASS-344
|
||||
public void setAndGetFactoryBeanProperties() {
|
||||
|
||||
poolingOptionsFactoryBean.setHeartbeatIntervalSeconds(15);
|
||||
@@ -113,10 +107,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
assertThat(poolingOptionsFactoryBean.getRemoteMinSimultaneousRequests()).isEqualTo(50);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void afterPropertiesSetInitializesLocalPoolingOptions() throws Exception {
|
||||
|
||||
PoolingOptionsFactoryBean poolingOptionsFactoryBean = new PoolingOptionsFactoryBean() {
|
||||
@@ -157,10 +148,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
verify(poolingOptionsSpy, never()).setNewConnectionThreshold(eq(HostDistance.REMOTE), anyInt());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void afterPropertiesSetInitializesRemotePoolingOptions() throws Exception {
|
||||
|
||||
PoolingOptionsFactoryBean poolingOptionsFactoryBean = new PoolingOptionsFactoryBean() {
|
||||
@@ -201,10 +189,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
verify(poolingOptionsSpy, never()).setNewConnectionThreshold(eq(HostDistance.REMOTE), eq(5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-344">DATACASS-344</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-344
|
||||
public void afterPropertiesSetInitializesMaxQueueSize() throws Exception {
|
||||
|
||||
Method setMaxQueueSize = ReflectionUtils.findMethod(PoolingOptions.class, "setMaxQueueSize", int.class);
|
||||
@@ -234,11 +219,8 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
* driver class type... {@link PoolingOptions}! The max values should be set before setting core values. Otherwise the
|
||||
* core values will be compared with the default max values which is 8. Same for other min-max properties pairs. This
|
||||
* test checks the same.
|
||||
*
|
||||
* @throws Exception Any unhandled scenarios will result in a test failure.
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-176">DATACASS-176</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-176
|
||||
public void afterPropertiesSetProperlySetsPoolingOptionsMaxBeforeMinProperties() throws Exception {
|
||||
|
||||
poolingOptionsFactoryBean = new PoolingOptionsFactoryBean() {
|
||||
@@ -283,10 +265,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
verify(poolingOptions).setNewConnectionThreshold(eq(HostDistance.REMOTE), eq(111));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-176">DATACASS-176</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-176
|
||||
public void newLocalHostDistancePoolingOptionsReturnsLocalHostDistancePoolingOptionsFactoryBeanSettings() {
|
||||
|
||||
poolingOptionsFactoryBean.setLocalCoreConnections(50);
|
||||
@@ -308,10 +287,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
assertThat(poolingOptions.getNewConnectionThreshold()).isEqualTo(100);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-176">DATACASS-176</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-176
|
||||
public void newLocalHostDistancePoolingOptionsReturnsRemoteHostDistancePoolingOptionsFactoryBeanSettings() {
|
||||
|
||||
poolingOptionsFactoryBean.setLocalCoreConnections(50);
|
||||
@@ -333,10 +309,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
assertThat(poolingOptions.getNewConnectionThreshold()).isEqualTo(40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-176">DATACASS-176</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-176
|
||||
public void configureLocalHostDistancePoolingOptionsCallsConfigureWithExpectedInstance() {
|
||||
|
||||
final PoolingOptionsFactoryBean.HostDistancePoolingOptions mockHostDistancePoolingOptions = mock(
|
||||
@@ -362,10 +335,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
|
||||
verify(mockHostDistancePoolingOptions).configure(same(poolingOptionsSpy));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-176">DATACASS-176</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-176
|
||||
public void configureRemoteHostDistancePoolingOptionsCallsConfigureWithExpectedInstance() {
|
||||
|
||||
final PoolingOptionsFactoryBean.HostDistancePoolingOptions mockHostDistancePoolingOptions = mock(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -45,15 +45,10 @@ import com.datastax.driver.core.policies.SpeculativeExecutionPolicy;
|
||||
* @author Mark Paluch
|
||||
* @author John Blum
|
||||
* @soundtrack Max Graham Feat Neev Kennedy - So Caught Up (Dns Project Remix)
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226"></a>
|
||||
*/
|
||||
public class AbstractClusterConfigurationUnitTests {
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldInitializeWithoutAnyOptions() throws Exception {
|
||||
|
||||
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
|
||||
@@ -68,11 +63,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getMetricsOptions().isJMXReportingEnabled()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetCompressionType() throws Exception {
|
||||
|
||||
final CompressionType compressionType = CompressionType.SNAPPY;
|
||||
@@ -88,11 +79,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getProtocolOptions().getCompression()).isEqualTo(Compression.SNAPPY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetPoolingOptions() throws Exception {
|
||||
|
||||
final PoolingOptions poolingOptions = new PoolingOptions();
|
||||
@@ -108,11 +95,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getPoolingOptions()).isEqualTo(poolingOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetSocketOptions() throws Exception {
|
||||
|
||||
final SocketOptions socketOptions = new SocketOptions();
|
||||
@@ -128,11 +111,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getSocketOptions()).isEqualTo(socketOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetQueryOptions() throws Exception {
|
||||
|
||||
final QueryOptions queryOptions = new QueryOptions();
|
||||
@@ -148,11 +127,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getQueryOptions()).isEqualTo(queryOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetAuthProvider() throws Exception {
|
||||
|
||||
final AuthProvider authProvider = new PlainTextAuthProvider("x", "y");
|
||||
@@ -168,11 +143,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getProtocolOptions().getAuthProvider()).isEqualTo(authProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetLoadBalancingPolicy() throws Exception {
|
||||
|
||||
final LoadBalancingPolicy loadBalancingPolicy = new RoundRobinPolicy();
|
||||
@@ -188,11 +159,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getPolicies().getLoadBalancingPolicy()).isEqualTo(loadBalancingPolicy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetReconnectionPolicy() throws Exception {
|
||||
|
||||
final ReconnectionPolicy reconnectionPolicy = new ExponentialReconnectionPolicy(1, 2);
|
||||
@@ -208,11 +175,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getPolicies().getReconnectionPolicy()).isEqualTo(reconnectionPolicy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetProtocolVersion() throws Exception {
|
||||
|
||||
AbstractClusterConfiguration clusterConfiguration = new AbstractClusterConfiguration() {
|
||||
@@ -227,11 +190,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
.contains(ProtocolVersion.V2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldDisableMetrics() throws Exception {
|
||||
|
||||
AbstractClusterConfiguration clusterConfiguration = new AbstractClusterConfiguration() {
|
||||
@@ -245,10 +204,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(getConfiguration(cluster).getMetricsOptions().isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetKeyspaceCreations() {
|
||||
|
||||
final List<CreateKeyspaceSpecification> specification = Collections
|
||||
@@ -263,10 +219,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(clusterConfiguration.cluster().getKeyspaceCreations()).isEqualTo(specification);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetKeyspaceDrops() {
|
||||
|
||||
final List<DropKeyspaceSpecification> specification = Collections
|
||||
@@ -281,10 +234,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(clusterConfiguration.cluster().getKeyspaceDrops()).isEqualTo(specification);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetStartupScripts() {
|
||||
|
||||
final List<String> scripts = Collections.singletonList("USE BLUE_METH; CREATE TABLE...");
|
||||
@@ -298,10 +248,7 @@ public class AbstractClusterConfigurationUnitTests {
|
||||
assertThat(clusterConfiguration.cluster().getStartupScripts()).isEqualTo(scripts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-226">DATACASS-226</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-226
|
||||
public void shouldSetShutdownScripts() {
|
||||
|
||||
final List<String> scripts = Collections.singletonList("USE BLUE_METH; DROP TABLE...");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors
|
||||
* 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.
|
||||
@@ -52,10 +52,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
|
||||
private CassandraCqlClusterParser parser = new CassandraCqlClusterParser();
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void resolveIdFromElement() {
|
||||
|
||||
when(mockElement.getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE))).thenReturn("test");
|
||||
@@ -64,10 +61,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(mockElement).getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void resolveIdUsingDefault() {
|
||||
|
||||
when(mockElement.getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE))).thenReturn("");
|
||||
@@ -76,10 +70,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(mockElement).getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void parseInternalCallsDoParseAndConstructsBeanDefinition() {
|
||||
|
||||
BeanDefinition mockContainingBeanDefinition = mock(BeanDefinition.class);
|
||||
@@ -171,10 +162,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(mockElement).getAttribute(eq("username"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void parseChildElementsWithLocalPoolingOptions() {
|
||||
|
||||
Element localPoolingOptionsElement = mock(Element.class);
|
||||
@@ -228,10 +216,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(localPoolingOptionsElement).getAttribute(eq("min-simultaneous-requests"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void parseChildElementsWithRemotePoolingOptions() {
|
||||
|
||||
Element localPoolingOptionsElement = mock(Element.class);
|
||||
@@ -285,10 +270,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(localPoolingOptionsElement).getAttribute(eq("min-simultaneous-requests"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-242">DATACASS-242</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-242
|
||||
public void parseChildElementsWithStartupAndShutdownScripts() {
|
||||
|
||||
Element mockStartupCqlOne = mock(Element.class, "MockStartupCqlOne");
|
||||
@@ -322,10 +304,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
assertThat(shutdownScripts).contains("DROP KEYSPACE test;", "DROP USER jblum;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void parseLocalPoolingOptionsProperlyConfiguresBeanDefinition() {
|
||||
|
||||
when(mockElement.getAttribute(eq("core-connections"))).thenReturn("50");
|
||||
@@ -362,10 +341,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(mockElement).getAttribute(eq("min-simultaneous-requests"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void parseRemotePoolingOptionsProperlyConfiguresBeanDefinition() {
|
||||
|
||||
when(mockElement.getAttribute(eq("core-connections"))).thenReturn("50");
|
||||
@@ -402,10 +378,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(mockElement).getAttribute(eq("min-simultaneous-requests"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void parseScript() {
|
||||
|
||||
when(mockElement.getTextContent()).thenReturn("CREATE TABLE schema.table;");
|
||||
@@ -413,10 +386,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(mockElement).getTextContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void newSocketOptionsBeanDefinitionIsProperlyInitialized() {
|
||||
|
||||
when(mockElement.getAttribute(eq("connect-timeout-millis"))).thenReturn("15000");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors
|
||||
* 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.
|
||||
@@ -36,10 +36,7 @@ public class ParsingUtilsUnitTests {
|
||||
|
||||
@Rule public ExpectedException exception = ExpectedException.none();
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addOptionalReferencePropertyUsesDefault() {
|
||||
|
||||
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
|
||||
@@ -51,10 +48,7 @@ public class ParsingUtilsUnitTests {
|
||||
assertThat(propertyValue.getBeanName()).isEqualTo("defaultBeanReference");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addOptionalReferencePropertyWithNoValueDoesReturnsWithoutAdding() {
|
||||
|
||||
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
|
||||
@@ -66,10 +60,7 @@ public class ParsingUtilsUnitTests {
|
||||
assertThat(beanDefinition.getPropertyValues().isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addOptionalValuePropertyUsesDefault() {
|
||||
|
||||
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
|
||||
@@ -80,10 +71,7 @@ public class ParsingUtilsUnitTests {
|
||||
assertThat(propertyValue).isEqualTo("defaultValue");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addOptionalValuePropertyWithNoValueDoesReturnsWithoutAdding() {
|
||||
|
||||
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
|
||||
@@ -95,10 +83,7 @@ public class ParsingUtilsUnitTests {
|
||||
assertThat(beanDefinition.getPropertyValues().isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addRequiredReferencePropertyIsSuccessful() {
|
||||
|
||||
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
|
||||
@@ -110,10 +95,7 @@ public class ParsingUtilsUnitTests {
|
||||
assertThat(propertyValue.getBeanName()).isEqualTo("reference");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addRequiredReferencePropertyWithNoReferenceFails() {
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
@@ -123,10 +105,7 @@ public class ParsingUtilsUnitTests {
|
||||
"defaultReference", true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addRequiredValuePropertyIsSuccessful() {
|
||||
|
||||
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
|
||||
@@ -137,10 +116,7 @@ public class ParsingUtilsUnitTests {
|
||||
assertThat(propertyValue).isEqualTo("value");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addRequiredValuePropertyWithNoValueFails() {
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
@@ -150,10 +126,7 @@ public class ParsingUtilsUnitTests {
|
||||
false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addPropertyThrowsIllegalArgumentExceptionForNullBuilder() {
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
@@ -162,10 +135,7 @@ public class ParsingUtilsUnitTests {
|
||||
ParsingUtils.addProperty(null, "propertyName", "value", "defaultValue", false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void addPropertyThrowsIllegalArgumentExceptionForNullPropertyName() {
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -20,6 +20,8 @@ import static org.assertj.core.api.Assertions.*;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import edu.umd.cs.mtc.MultithreadedTestCase;
|
||||
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
@@ -34,13 +36,10 @@ import org.mockito.runners.MockitoJUnitRunner;
|
||||
import com.datastax.driver.core.PreparedStatement;
|
||||
import com.datastax.driver.core.Session;
|
||||
|
||||
import edu.umd.cs.mtc.MultithreadedTestCase;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link CachedPreparedStatementCreator}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-253">DATACASS-253</a>
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class CachedPreparedStatementCreatorUnitTests {
|
||||
@@ -55,26 +54,17 @@ public class CachedPreparedStatementCreatorUnitTests {
|
||||
when(sessionMock.prepare(anyString())).thenReturn(preparedStatement);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-253
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-253
|
||||
public void shouldRejectEmptyCql() {
|
||||
new CachedPreparedStatementCreator("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-253
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-253
|
||||
public void shouldRejectNullCql() {
|
||||
new CachedPreparedStatementCreator(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-253
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-253
|
||||
public void shouldCreatePreparedStatement() {
|
||||
|
||||
CachedPreparedStatementCreator cachedPreparedStatementCreator = new CachedPreparedStatementCreator("my cql");
|
||||
@@ -85,10 +75,7 @@ public class CachedPreparedStatementCreatorUnitTests {
|
||||
verify(sessionMock).prepare("my cql");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-253
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-253
|
||||
public void shouldCacheCreatePreparedStatement() {
|
||||
|
||||
CachedPreparedStatementCreator cachedPreparedStatementCreator = new CachedPreparedStatementCreator("my cql");
|
||||
@@ -102,11 +89,7 @@ public class CachedPreparedStatementCreatorUnitTests {
|
||||
verify(sessionMock, times(1)).prepare("my cql");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-253
|
||||
* @throws Throwable
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-253
|
||||
public void concurrentAccessToCreateStatementShouldBeSynchronized() throws Throwable {
|
||||
|
||||
CreatePreparedStatementIsThreadSafe concurrentPrepareStatement = new CreatePreparedStatementIsThreadSafe(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -32,7 +32,6 @@ import org.junit.runners.Parameterized.Parameters;
|
||||
* Unit tests for {@link ConsistencyLevelResolver}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class ConsistencyLevelResolverUnitTests {
|
||||
@@ -80,10 +79,7 @@ public class ConsistencyLevelResolverUnitTests {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void shouldResolveCorrectly() {
|
||||
assertThat(ConsistencyLevelResolver.resolve(from)).isEqualTo(expected);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors
|
||||
* Copyright 2016-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.
|
||||
@@ -97,10 +97,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockSession, times(1)).execute(eq("test"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-304">DATACASS-304</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-304
|
||||
public void doExecuteInSessionCallbackTranslatesToCassandraException() {
|
||||
exception.expect(CassandraReadTimeoutException.class);
|
||||
exception.expectCause(org.hamcrest.Matchers.isA(ReadTimeoutException.class));
|
||||
@@ -113,10 +110,7 @@ public class CqlTemplateUnitTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-304">DATACASS-304</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-304
|
||||
public void doExecuteInSessionCallbackTranslatesToCassandraUncategorizedException() {
|
||||
|
||||
try {
|
||||
@@ -132,10 +126,7 @@ public class CqlTemplateUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-304">DATACASS-304</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-304
|
||||
public void doExecuteInSessionCallbackTranslatesToCassandraUncategorizedDataAccessException() {
|
||||
|
||||
try {
|
||||
@@ -191,10 +182,7 @@ public class CqlTemplateUnitTests {
|
||||
verifyZeroInteractions(mockResultSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void firstColumnToObjectReturnsColumnValue() {
|
||||
|
||||
final Row mockRow = mock(Row.class);
|
||||
@@ -226,10 +214,7 @@ public class CqlTemplateUnitTests {
|
||||
verifyZeroInteractions(mockColumnDefinition);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void firstColumnToObjectReturnsNull() {
|
||||
|
||||
Row mockRow = mock(Row.class);
|
||||
@@ -248,10 +233,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockIterator, never()).next();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOneIsSuccessful() {
|
||||
|
||||
ResultSet mockResultSet = mock(ResultSet.class);
|
||||
@@ -270,10 +252,7 @@ public class CqlTemplateUnitTests {
|
||||
verifyZeroInteractions(mockRow);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOneThrowsIncorrectResultSetSizeDataAccessExceptionWhenNoRowsFound() {
|
||||
|
||||
ResultSet mockResultSet = mock(ResultSet.class);
|
||||
@@ -294,10 +273,7 @@ public class CqlTemplateUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOneThrowsIncorrectResultSetSizeDataAccessExceptionWhenTooManyRowsFound() {
|
||||
|
||||
ResultSet mockResultSet = mock(ResultSet.class);
|
||||
@@ -320,10 +296,7 @@ public class CqlTemplateUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOnePassingNullResultSetThrowsIllegalArgumentException() {
|
||||
|
||||
RowMapper mockRowMapper = mock(RowMapper.class);
|
||||
@@ -336,10 +309,7 @@ public class CqlTemplateUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOneWithRequiredTypeIsSuccessful() {
|
||||
|
||||
ResultSet mockResultSet = mock(ResultSet.class);
|
||||
@@ -365,10 +335,7 @@ public class CqlTemplateUnitTests {
|
||||
verifyZeroInteractions(mockRow);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOneWithRequiredTypeThrowsIncorrectResultSetSizeDataAccessExceptionWhenNoRowsFound() {
|
||||
|
||||
ResultSet mockResultSet = mock(ResultSet.class);
|
||||
@@ -386,10 +353,7 @@ public class CqlTemplateUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOneWithRequiredTypeThrowsIncorrectResultSetSizeDataAccessExceptionWhenTooManyRowsFound() {
|
||||
|
||||
ResultSet mockResultSet = mock(ResultSet.class);
|
||||
@@ -411,20 +375,14 @@ public class CqlTemplateUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-286">DATACASS-286</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void processOneWithRequiredTypePassingNullResultSetThrowsIllegalArgumentException() {
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
|
||||
template.processOne(null, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addPreparedStatementOptionsShouldAddDriverQueryOptions() {
|
||||
|
||||
QueryOptions queryOptions = QueryOptions.builder() //
|
||||
@@ -438,10 +396,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockPreparedStatement).setRetryPolicy(FallthroughRetryPolicy.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addPreparedStatementOptionsShouldAddOurQueryOptions() {
|
||||
|
||||
QueryOptions queryOptions = QueryOptions.builder().retryPolicy(RetryPolicy.FALLTHROUGH).build();
|
||||
@@ -454,10 +409,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockPreparedStatement).setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addStatementQueryOptionsShouldAddDriverQueryOptions() {
|
||||
|
||||
QueryOptions queryOptions = QueryOptions.builder().consistencyLevel(ConsistencyLevel.EACH_QUORUM) //
|
||||
@@ -470,10 +422,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockStatement).setRetryPolicy(FallthroughRetryPolicy.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addStatementQueryOptionsShouldAddOurQueryOptions() {
|
||||
|
||||
QueryOptions queryOptions = QueryOptions.builder().retryPolicy(RetryPolicy.FALLTHROUGH).build();
|
||||
@@ -486,10 +435,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockStatement).setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addStatementQueryOptionsShouldNotAddOptions() {
|
||||
|
||||
QueryOptions queryOptions = QueryOptions.builder().build();
|
||||
@@ -499,10 +445,7 @@ public class CqlTemplateUnitTests {
|
||||
verifyZeroInteractions(mockStatement);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addStatementQueryOptionsShouldAddGenericQueryOptions() {
|
||||
|
||||
QueryOptions queryOptions = QueryOptions.builder() //
|
||||
@@ -518,10 +461,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockStatement).enableTracing();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addInsertWriteOptionsShouldAddDriverQueryOptions() {
|
||||
|
||||
WriteOptions writeOptions = WriteOptions.builder() //
|
||||
@@ -539,10 +479,7 @@ public class CqlTemplateUnitTests {
|
||||
verify(mockInsert).using(Mockito.any(Using.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void addUpdateWriteOptionsShouldAddDriverQueryOptions() {
|
||||
|
||||
WriteOptions writeOptions = WriteOptions.builder() //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -33,10 +33,7 @@ import com.datastax.driver.core.policies.LoggingRetryPolicy;
|
||||
*/
|
||||
public class QueryOptionsUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void buildQueryOptions() {
|
||||
|
||||
QueryOptions queryOptions = QueryOptions.builder() //
|
||||
@@ -56,10 +53,7 @@ public class QueryOptionsUnitTests {
|
||||
assertThat(queryOptions.getTracing()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void buildQueryOptionsWithDriverRetryPolicy() {
|
||||
|
||||
QueryOptions writeOptions = QueryOptions.builder() //
|
||||
@@ -70,10 +64,7 @@ public class QueryOptionsUnitTests {
|
||||
assertThat(writeOptions.getDriverRetryPolicy()).isInstanceOf(LoggingRetryPolicy.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void buildQueryOptionsWithRetryPolicy() {
|
||||
|
||||
QueryOptions writeOptions = QueryOptions.builder() //
|
||||
@@ -84,26 +75,17 @@ public class QueryOptionsUnitTests {
|
||||
assertThat(writeOptions.getDriverRetryPolicy()).isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void builderShouldRejectSettingOurAndDriverRetryPolicy() {
|
||||
QueryOptions.builder().retryPolicy(RetryPolicy.DEFAULT).retryPolicy(FallthroughRetryPolicy.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void builderShouldRejectSettingDriverAndOurRetryPolicy() {
|
||||
QueryOptions.builder().retryPolicy(FallthroughRetryPolicy.INSTANCE).retryPolicy(RetryPolicy.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void shouldRejectSettingOurAndDriverRetryPolicy() {
|
||||
|
||||
QueryOptions queryOptions = new QueryOptions();
|
||||
@@ -111,10 +93,7 @@ public class QueryOptionsUnitTests {
|
||||
queryOptions.setRetryPolicy(FallthroughRetryPolicy.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void shouldRejectSettingDriverAndOurRetryPolicy() {
|
||||
|
||||
QueryOptions queryOptions = new QueryOptions();
|
||||
@@ -122,10 +101,7 @@ public class QueryOptionsUnitTests {
|
||||
queryOptions.setRetryPolicy(RetryPolicy.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void shouldRejectSettingOurAndDriverConsistencyLevel() {
|
||||
|
||||
QueryOptions queryOptions = new QueryOptions();
|
||||
@@ -133,10 +109,7 @@ public class QueryOptionsUnitTests {
|
||||
queryOptions.setConsistencyLevel(ConsistencyLevel.ANY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void shouldRejectSettingDriverAndOurConsistencyLevel() {
|
||||
|
||||
QueryOptions queryOptions = new QueryOptions();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -30,10 +30,7 @@ import com.datastax.driver.core.policies.FallthroughRetryPolicy;
|
||||
*/
|
||||
public class WriteOptionsUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void buildWriteOptions() {
|
||||
|
||||
WriteOptions writeOptions = WriteOptions.builder() //
|
||||
@@ -54,10 +51,7 @@ public class WriteOptionsUnitTests {
|
||||
assertThat(writeOptions.getTracing()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void buildReadTimeoutOptionsWriteOptions() {
|
||||
|
||||
WriteOptions writeOptions = WriteOptions.builder().readTimeout(1, TimeUnit.MINUTES).build();
|
||||
@@ -67,10 +61,7 @@ public class WriteOptionsUnitTests {
|
||||
assertThat(writeOptions.getTracing()).isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void buildQueryOptionsWithDriverRetryPolicy() {
|
||||
|
||||
QueryOptions writeOptions = QueryOptions.builder().retryPolicy(FallthroughRetryPolicy.INSTANCE).build();
|
||||
@@ -79,10 +70,7 @@ public class WriteOptionsUnitTests {
|
||||
assertThat(writeOptions.getDriverRetryPolicy()).isEqualTo(FallthroughRetryPolicy.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void buildQueryOptionsWithRetryPolicy() {
|
||||
|
||||
QueryOptions writeOptions = QueryOptions.builder().retryPolicy(RetryPolicy.DOWNGRADING_CONSISTENCY).build();
|
||||
@@ -91,18 +79,12 @@ public class WriteOptionsUnitTests {
|
||||
assertThat(writeOptions.getDriverRetryPolicy()).isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void builderShouldRejectSettingOurAndDriverRetryPolicy() {
|
||||
WriteOptions.builder().retryPolicy(RetryPolicy.DEFAULT).retryPolicy(FallthroughRetryPolicy.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@Test(expected = IllegalStateException.class) // DATACASS-202
|
||||
public void builderShouldRejectSettingDriverAndOurRetryPolicy() {
|
||||
WriteOptions.builder().retryPolicy(FallthroughRetryPolicy.INSTANCE).retryPolicy(RetryPolicy.DEFAULT);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -37,7 +37,6 @@ import com.datastax.driver.core.TableMetadata;
|
||||
* Integration tests tests for {@link AlterTableCqlGenerator}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCreatingIntegrationTest {
|
||||
|
||||
@@ -48,10 +47,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
|
||||
session.execute("DROP TABLE IF EXISTS users;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAlterColumnType() {
|
||||
|
||||
session.execute(
|
||||
@@ -67,10 +63,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
|
||||
assertThat(column.getType()).isEqualTo(DataType.varint());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAlterListColumnType() {
|
||||
|
||||
session.execute(
|
||||
@@ -86,10 +79,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
|
||||
assertThat(column.getType()).isEqualTo((DataType) DataType.list(DataType.varchar()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddColumn() {
|
||||
|
||||
session.execute(
|
||||
@@ -105,10 +95,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
|
||||
assertThat(column.getType()).isEqualTo(DataType.varchar());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddListColumn() {
|
||||
|
||||
session.execute("CREATE TABLE users (user_name varchar PRIMARY KEY);");
|
||||
@@ -123,10 +110,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
|
||||
assertThat(column.getType()).isEqualTo((DataType) DataType.list(DataType.ascii()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableDropColumn() {
|
||||
|
||||
session.execute("CREATE TABLE addamsFamily (name varchar PRIMARY KEY, gender varchar);");
|
||||
@@ -138,10 +122,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
|
||||
assertThat(getTableMetadata("addamsfamily").getColumn("gender")).isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableRenameColumn() {
|
||||
|
||||
session.execute("CREATE TABLE addamsFamily (name varchar PRIMARY KEY, firstname varchar);");
|
||||
@@ -154,10 +135,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
|
||||
assertThat(getTableMetadata("addamsfamily").getColumn("newname")).isNotNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddCaching() {
|
||||
|
||||
session.execute("CREATE TABLE users (user_name varchar PRIMARY KEY);");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -37,10 +37,7 @@ import com.datastax.driver.core.DataType;
|
||||
*/
|
||||
public class AlterTableCqlGeneratorUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAlterColumnType() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").alter("lastKnownLocation",
|
||||
@@ -49,10 +46,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily ALTER lastknownlocation TYPE uuid;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAlterListColumnType() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").alter("lastKnownLocation",
|
||||
@@ -61,10 +55,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily ALTER lastknownlocation TYPE list<ascii>;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddColumn() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").add("gravesite",
|
||||
@@ -73,10 +64,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily ADD gravesite varchar;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddListColumn() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("users").add("top_places",
|
||||
@@ -85,10 +73,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TABLE users ADD top_places list<ascii>;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableDropColumn() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").drop("gender");
|
||||
@@ -96,10 +81,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily DROP gender;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableRenameColumn() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").rename("firstname", "lastname");
|
||||
@@ -107,10 +89,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily RENAME firstname TO lastname;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddCommentAndTableOption() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily")
|
||||
@@ -120,10 +99,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
"ALTER TABLE addamsfamily WITH read_repair_chance = 0.2 AND comment = 'A most excellent and useful table';");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddColumnAndComment() {
|
||||
|
||||
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily")
|
||||
@@ -134,10 +110,7 @@ public class AlterTableCqlGeneratorUnitTests {
|
||||
"ALTER TABLE addamsfamily ADD top_places list<ascii> ADD other list<ascii> WITH comment = 'A most excellent and useful table';");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-192
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-192
|
||||
public void alterTableAddCaching() {
|
||||
|
||||
Map<Object, Object> cachingMap = new LinkedHashMap<Object, Object>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -38,10 +38,7 @@ public class AlterUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspaceC
|
||||
session.execute("CREATE TYPE address (zip text, state text);");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldAddField() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address")//
|
||||
@@ -50,10 +47,7 @@ public class AlterUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspaceC
|
||||
session.execute(toCql(spec));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldAlterField() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address")//
|
||||
@@ -62,10 +56,7 @@ public class AlterUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspaceC
|
||||
session.execute(toCql(spec));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldRenameField() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address")//
|
||||
@@ -74,10 +65,7 @@ public class AlterUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspaceC
|
||||
session.execute(toCql(spec));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldRenameFields() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address")//
|
||||
@@ -87,18 +75,12 @@ public class AlterUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspaceC
|
||||
session.execute(toCql(spec));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-172
|
||||
public void generationFailsIfNameIsNotSet() {
|
||||
toCql(AlterUserTypeSpecification.alterType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-172
|
||||
public void generationFailsWithoutFields() {
|
||||
toCql(AlterUserTypeSpecification.alterType().name("hello"));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -30,10 +30,7 @@ import com.datastax.driver.core.DataType;
|
||||
*/
|
||||
public class AlterUserTypeCqlGeneratorUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldAddField() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address") //
|
||||
@@ -42,10 +39,7 @@ public class AlterUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TYPE address ADD zip varchar;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldAlterField() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address") //
|
||||
@@ -54,10 +48,7 @@ public class AlterUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TYPE address ALTER zip TYPE varchar;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldRenameField() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address") //
|
||||
@@ -66,10 +57,7 @@ public class AlterUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TYPE address RENAME zip TO zap;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void alterTypeShouldRenameFields() {
|
||||
|
||||
AlterUserTypeSpecification spec = AlterUserTypeSpecification.alterType("address") //
|
||||
@@ -79,18 +67,12 @@ public class AlterUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("ALTER TYPE address RENAME zip TO zap AND city TO county;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-172
|
||||
public void generationFailsIfNameIsNotSet() {
|
||||
toCql(AlterUserTypeSpecification.alterType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-172
|
||||
public void generationFailsWithoutFields() {
|
||||
toCql(AlterUserTypeSpecification.alterType().name("hello"));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.cassandra.core.cql.generator;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.springframework.cassandra.core.cql.generator.CreateUserTypeCqlGenerator.*;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -41,10 +41,7 @@ public class CreateUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspace
|
||||
session.execute("DROP TYPE IF EXISTS address;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void createUserType() {
|
||||
|
||||
CreateUserTypeSpecification spec = CreateUserTypeSpecification //
|
||||
@@ -59,10 +56,7 @@ public class CreateUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspace
|
||||
assertThat(address.getFieldNames()).contains("zip", "city");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void createUserTypeIfNotExists() {
|
||||
|
||||
CreateUserTypeSpecification spec = CreateUserTypeSpecification //
|
||||
@@ -77,10 +71,7 @@ public class CreateUserTypeCqlGeneratorIntegrationTests extends AbstractKeyspace
|
||||
assertThat(address.getFieldNames()).contains("zip", "city");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void createNestedUserType() {
|
||||
|
||||
CreateUserTypeSpecification addressSpec = CreateUserTypeSpecification //
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -30,10 +30,7 @@ import com.datastax.driver.core.DataType;
|
||||
*/
|
||||
public class CreateUserTypeCqlGeneratorUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void createUserType() {
|
||||
|
||||
CreateUserTypeSpecification spec = CreateUserTypeSpecification //
|
||||
@@ -43,10 +40,7 @@ public class CreateUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("CREATE TYPE address (city varchar);");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void createMultiFieldUserType() {
|
||||
|
||||
CreateUserTypeSpecification spec = CreateUserTypeSpecification //
|
||||
@@ -57,10 +51,7 @@ public class CreateUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("CREATE TYPE address (zip ascii, city varchar);");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void createUserTypeIfNotExists() {
|
||||
|
||||
CreateUserTypeSpecification spec = CreateUserTypeSpecification //
|
||||
@@ -71,18 +62,12 @@ public class CreateUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("CREATE TYPE IF NOT EXISTS address (zip ascii, city varchar);");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-172
|
||||
public void generationFailsIfNameIsNotSet() {
|
||||
toCql(CreateUserTypeSpecification.createType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATACASS-172
|
||||
public void generationFailsWithoutFields() {
|
||||
toCql(CreateUserTypeSpecification.createType().name("hello"));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.cassandra.core.cql.generator;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.springframework.cassandra.core.cql.generator.DropUserTypeCqlGenerator.*;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -28,10 +28,7 @@ import org.springframework.cassandra.core.keyspace.DropUserTypeSpecification;
|
||||
*/
|
||||
public class DropUserTypeCqlGeneratorUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void shouldDropUserType() {
|
||||
|
||||
DropUserTypeSpecification spec = DropUserTypeSpecification.dropType("address");
|
||||
@@ -39,10 +36,7 @@ public class DropUserTypeCqlGeneratorUnitTests {
|
||||
assertThat(toCql(spec)).isEqualTo("DROP TYPE address;");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-172
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-172
|
||||
public void shouldDropUserTypeIfExists() {
|
||||
|
||||
DropUserTypeSpecification spec = DropUserTypeSpecification.dropType("address").ifExists();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors
|
||||
* Copyright 2016-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.
|
||||
@@ -49,10 +49,7 @@ public class CassandraAccessorUnitTests {
|
||||
cassandraAccessor = new CassandraAccessor();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void afterPropertiesSetWithUnitializedSessionThrowsIllegalStateException() {
|
||||
|
||||
try {
|
||||
@@ -63,20 +60,14 @@ public class CassandraAccessorUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void setAndGetExceptionTranslator() {
|
||||
|
||||
cassandraAccessor.setExceptionTranslator(mockExceptionTranslator);
|
||||
assertThat(cassandraAccessor.getExceptionTranslator()).isSameAs(mockExceptionTranslator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void setExceptionTranslatorToNullThrowsIllegalArgumentException() {
|
||||
|
||||
try {
|
||||
@@ -87,28 +78,19 @@ public class CassandraAccessorUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void getUninitializedExceptionTranslatorReturnsDefault() {
|
||||
assertThat(cassandraAccessor.getExceptionTranslator()).isEqualTo(cassandraAccessor.exceptionTranslator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void setAndGetSession() {
|
||||
|
||||
cassandraAccessor.setSession(mockSession);
|
||||
assertThat(cassandraAccessor.getSession()).isSameAs(mockSession);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void setSessionToNullThrowsIllegalArgumentException() {
|
||||
|
||||
try {
|
||||
@@ -119,10 +101,7 @@ public class CassandraAccessorUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-286
|
||||
public void getUninitializedSessionThrowsIllegalStateException() {
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
@@ -57,10 +57,7 @@ public class PropertyPlaceholderNamespaceCreatingXmlConfigIntegrationTests
|
||||
assertThat(ops).isNotNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void localAndRemotePoolingOptionsWereConfiguredProperly() {
|
||||
|
||||
PoolingOptions poolingOptions = cassandraCluster.getConfiguration().getPoolingOptions();
|
||||
@@ -78,10 +75,7 @@ public class PropertyPlaceholderNamespaceCreatingXmlConfigIntegrationTests
|
||||
assertThat(poolingOptions.getNewConnectionThreshold(HostDistance.REMOTE)).isEqualTo(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void socketOptionsWereConfiguredProperly() {
|
||||
|
||||
SocketOptions socketOptions = cassandraCluster.getConfiguration().getSocketOptions();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
@@ -108,10 +108,7 @@ public class XmlConfigIntegrationTests extends AbstractEmbeddedCassandraIntegrat
|
||||
assertThat(((TestClusterBuilderConfigurer) clusterBuilderConfigurer).configureCalled.get()).isTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void localAndRemotePoolingOptionsWereConfiguredProperly() {
|
||||
|
||||
PoolingOptions poolingOptions = cluster.getConfiguration().getPoolingOptions();
|
||||
@@ -130,10 +127,7 @@ public class XmlConfigIntegrationTests extends AbstractEmbeddedCassandraIntegrat
|
||||
assertThat(poolingOptions.getNewConnectionThreshold(HostDistance.REMOTE)).isEqualTo(25);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://jira.spring.io/browse/DATACASS-298">DATACASS-298</a>
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-298
|
||||
public void socketOptionsWereConfiguredProperly() {
|
||||
|
||||
SocketOptions socketOptions = cluster.getConfiguration().getSocketOptions();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -1074,10 +1074,7 @@ public class CqlOperationsIntegrationTests extends AbstractKeyspaceCreatingInteg
|
||||
cqlTemplate.execute(truncate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACASS-202
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACASS-202
|
||||
public void queryShouldApplyFetchSize() {
|
||||
|
||||
insertTestObjectArray();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.cassandra.test.integration.support;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
@@ -23,8 +25,6 @@ import org.springframework.util.Assert;
|
||||
|
||||
import com.google.common.io.Resources;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
/**
|
||||
* An executable CQL data set. The data set can be created from class path resources and execution can be bound to a
|
||||
* particular keyspace.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
package org.springframework.cassandra.test.integration.support;
|
||||
|
||||
import io.netty.channel.EventLoopGroup;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.datastax.driver.core.NettyOptions;
|
||||
|
||||
import io.netty.channel.EventLoopGroup;
|
||||
|
||||
/**
|
||||
* {@link NettyOptions} to shutdown a {@link com.datastax.driver.core.Cluster} instance without wait time.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-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.
|
||||
|
||||
Reference in New Issue
Block a user