DATACASS-347 - Support NettyOptions configuration in XML-based configuration.
We now support `NettyOptions` bean references in XML-based configuration. <bean id="nettyOptions" class="…" /> <cass:cluster contact-points="…" netty-options-ref="nettyOptions" />
This commit is contained in:
@@ -263,6 +263,24 @@ LoadBalancingPolicy implementation.
|
||||
<xsd:union memberTypes="xsd:string" />
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="netty-options-ref" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
NettyOptions implementation reference.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:annotation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:assignable-to
|
||||
type="com.datastax.driver.core.NettyOptions" />
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
<xsd:union memberTypes="xsd:string" />
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="max-queue-size" type="xsd:string" default="256" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.w3c.dom.NodeList;
|
||||
* Test suite of Unit tests testing the contract and functionality of the {@link CassandraCqlClusterParser}.
|
||||
*
|
||||
* @author John Blum
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
// TODO add more tests!
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
@@ -92,6 +93,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
when(mockElement.getAttribute("host-state-listener-ref")).thenReturn("testHostStateListener");
|
||||
when(mockElement.getAttribute("latency-tracker-ref")).thenReturn("testLatencyTracker");
|
||||
when(mockElement.getAttribute("load-balancing-policy-ref")).thenReturn("testLoadBalancingPolicy");
|
||||
when(mockElement.getAttribute("netty-options-ref")).thenReturn("testNettyOptions");
|
||||
when(mockElement.getAttribute("reconnection-policy-ref")).thenReturn("testReconnectionPolicy");
|
||||
when(mockElement.getAttribute("retry-policy-ref")).thenReturn("testRetryPolicy");
|
||||
when(mockElement.getAttribute("speculative-execution-policy-ref")).thenReturn("testSpeculativeExecutionPolicy");
|
||||
@@ -129,6 +131,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
assertThat(getPropertyValueAsString(beanDefinition, "hostStateListener"), is(equalTo("testHostStateListener")));
|
||||
assertThat(getPropertyValueAsString(beanDefinition, "latencyTracker"), is(equalTo("testLatencyTracker")));
|
||||
assertThat(getPropertyValueAsString(beanDefinition, "loadBalancingPolicy"), is(equalTo("testLoadBalancingPolicy")));
|
||||
assertThat(getPropertyValueAsString(beanDefinition, "nettyOptions"), is(equalTo("testNettyOptions")));
|
||||
assertThat(getPropertyValueAsString(beanDefinition, "reconnectionPolicy"), is(equalTo("testReconnectionPolicy")));
|
||||
assertThat(getPropertyValueAsString(beanDefinition, "retryPolicy"), is(equalTo("testRetryPolicy")));
|
||||
assertThat(getPropertyValueAsString(beanDefinition, "speculativeExecutionPolicy"), is(equalTo("testSpeculativeExecutionPolicy")));
|
||||
@@ -152,6 +155,7 @@ public class CassandraCqlClusterParserUnitTests {
|
||||
verify(mockElement).getAttribute(eq("host-state-listener-ref"));
|
||||
verify(mockElement).getAttribute(eq("latency-tracker-ref"));
|
||||
verify(mockElement).getAttribute(eq("load-balancing-policy-ref"));
|
||||
verify(mockElement).getAttribute(eq("netty-options-ref"));
|
||||
verify(mockElement).getAttribute(eq("reconnection-policy-ref"));
|
||||
verify(mockElement).getAttribute(eq("retry-policy-ref"));
|
||||
verify(mockElement).getAttribute(eq("speculative-execution-policy-ref"));
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
<context:property-placeholder
|
||||
location="classpath:/config/cassandra-connection.properties,classpath:/org/springframework/cassandra/test/integration/config/xml/FullySpecifiedKeyspaceCreatingXmlConfigIntegrationTests.properties" />
|
||||
|
||||
<cass:cluster port="${build.cassandra.native_transport_port}" compression="LZ4">
|
||||
<bean id="nettyOptions" class="org.springframework.cassandra.test.integration.support.FastShutdownNettyOptions" />
|
||||
|
||||
<cass:cluster port="${build.cassandra.native_transport_port}" compression="LZ4" netty-options-ref="nettyOptions">
|
||||
<cass:keyspace action="CREATE_DROP" durable-writes="true"
|
||||
name="full1">
|
||||
<cass:replication class="SIMPLE_STRATEGY">
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
<bean name="testTimestampGenerator" class="com.datastax.driver.core.AtomicMonotonicTimestampGenerator"/>
|
||||
|
||||
<bean id="nettyOptions" class="org.springframework.cassandra.test.integration.support.FastShutdownNettyOptions" />
|
||||
|
||||
<cassandra:cluster
|
||||
cluster-name="skynet" contact-points="localhost" port="${build.cassandra.native_transport_port}"
|
||||
address-translator-ref="testAddressTranslator"
|
||||
@@ -33,7 +35,9 @@
|
||||
max-schema-agreement-wait-seconds="2"
|
||||
pool-timeout-milliseconds="15000"
|
||||
speculative-execution-policy-ref="testSpeculativeExecutionPolicy"
|
||||
timestamp-generator-ref="testTimestampGenerator">
|
||||
timestamp-generator-ref="testTimestampGenerator"
|
||||
netty-options-ref="nettyOptions"
|
||||
>
|
||||
|
||||
<cassandra:local-pooling-options
|
||||
core-connections="2"
|
||||
|
||||
Reference in New Issue
Block a user