removed 'shared' test source & resource directory
This commit is contained in:
24
pom.xml
24
pom.xml
@@ -77,11 +77,6 @@
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-cassandra</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.datastax.cassandra</groupId>
|
||||
<artifactId>cassandra-driver-core</artifactId>
|
||||
@@ -293,18 +288,6 @@
|
||||
</portNames>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add-shared-source-dir</id>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<phase>generate-test-sources</phase>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>../shared/src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -379,13 +362,6 @@
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</testResource>
|
||||
<testResource>
|
||||
<directory>../shared/src/test/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</testResource>
|
||||
</testResources>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -83,4 +83,21 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -6,15 +6,23 @@ import java.util.Properties;
|
||||
@SuppressWarnings("serial")
|
||||
public class BuildProperties extends Properties {
|
||||
|
||||
protected String resourceName = null;
|
||||
|
||||
public BuildProperties() {
|
||||
this("/build.properties");
|
||||
this("/" + BuildProperties.class.getName() + ".properties");
|
||||
}
|
||||
|
||||
public BuildProperties(String resourceName) {
|
||||
protected BuildProperties(String resourceName) {
|
||||
this.resourceName = resourceName;
|
||||
|
||||
loadProperties();
|
||||
}
|
||||
|
||||
public void loadProperties() {
|
||||
loadProperties(resourceName);
|
||||
}
|
||||
|
||||
public void loadProperties(String resourceName) {
|
||||
protected void loadProperties(String resourceName) {
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = getClass().getResourceAsStream(resourceName);
|
||||
@@ -8,7 +8,7 @@
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
|
||||
<context:property-placeholder
|
||||
location="classpath:build.properties,classpath:/org/springframework/cassandra/test/integration/config/xml/FullySpecifiedKeyspaceCreatingXmlConfigTest.properties" />
|
||||
location="classpath:org.springframework.cassandra.test.integration.support.BuildProperties.properties,classpath:/org/springframework/cassandra/test/integration/config/xml/FullySpecifiedKeyspaceCreatingXmlConfigTest.properties" />
|
||||
|
||||
<cass:cluster port="${build.cassandra.native_transport_port}">
|
||||
<cass:keyspace action="CREATE_DROP" durable-writes="true"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
|
||||
<context:property-placeholder
|
||||
location="classpath:build.properties" />
|
||||
location="classpath:org.springframework.cassandra.test.integration.support.BuildProperties.properties" />
|
||||
|
||||
<cass:cluster port="${build.cassandra.native_transport_port}">
|
||||
<cass:keyspace action="CREATE_DROP" name="minimal" />
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
|
||||
<context:property-placeholder
|
||||
location="classpath:build.properties" />
|
||||
location="classpath:org.springframework.cassandra.test.integration.support.BuildProperties.properties" />
|
||||
|
||||
<cassandra:cluster port="${build.cassandra.native_transport_port}" />
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
|
||||
<context:property-placeholder
|
||||
location="classpath:build.properties" />
|
||||
location="classpath:org.springframework.cassandra.test.integration.support.BuildProperties.properties" />
|
||||
|
||||
<cassandra:cluster id="cassandra-cluster"
|
||||
contactPoints="localhost" port="${build.cassandra.native_transport_port}">
|
||||
|
||||
@@ -25,6 +25,16 @@
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-cassandra</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-cassandra</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<!-- <classifier>tests</classifier> -->
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring -->
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.springframework.data.cassandra.test.integration.config;
|
||||
|
||||
import org.springframework.cassandra.test.integration.support.BuildProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.cassandra.config.java.AbstractSpringDataCassandraConfiguration;
|
||||
@@ -9,6 +8,7 @@ import org.springframework.data.cassandra.convert.MappingCassandraConverter;
|
||||
import org.springframework.data.cassandra.core.CassandraDataOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraDataTemplate;
|
||||
import org.springframework.data.cassandra.mapping.DefaultCassandraMappingContext;
|
||||
import org.springframework.data.cassandra.test.integration.support.SpringDataBuildProperties;
|
||||
|
||||
/**
|
||||
* Setup any spring configuration for unit tests
|
||||
@@ -19,7 +19,7 @@ import org.springframework.data.cassandra.mapping.DefaultCassandraMappingContext
|
||||
@Configuration
|
||||
public class TestConfig extends AbstractSpringDataCassandraConfiguration {
|
||||
|
||||
public static final BuildProperties PROPS = new BuildProperties();
|
||||
public static final SpringDataBuildProperties PROPS = new SpringDataBuildProperties();
|
||||
public static final int PORT = PROPS.getCassandraPort();
|
||||
public static final int RPC_PORT = PROPS.getCassandraRpcPort();
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.springframework.data.cassandra.test.integration.support;
|
||||
|
||||
import org.springframework.cassandra.test.integration.support.BuildProperties;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class SpringDataBuildProperties extends BuildProperties {
|
||||
|
||||
public SpringDataBuildProperties() {
|
||||
super("/" + SpringDataBuildProperties.class.getName() + ".properties");
|
||||
}
|
||||
}
|
||||
@@ -39,9 +39,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cassandra.core.ConsistencyLevel;
|
||||
import org.springframework.cassandra.core.QueryOptions;
|
||||
import org.springframework.cassandra.core.RetryPolicy;
|
||||
import org.springframework.cassandra.test.integration.support.BuildProperties;
|
||||
import org.springframework.data.cassandra.core.CassandraDataOperations;
|
||||
import org.springframework.data.cassandra.test.integration.config.TestConfig;
|
||||
import org.springframework.data.cassandra.test.integration.support.SpringDataBuildProperties;
|
||||
import org.springframework.data.cassandra.test.integration.table.Book;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@@ -65,7 +65,7 @@ public class CassandraDataOperationsTest {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(CassandraDataOperationsTest.class);
|
||||
|
||||
private final static BuildProperties PROPS = new BuildProperties();
|
||||
public static final SpringDataBuildProperties PROPS = new SpringDataBuildProperties();
|
||||
private final static String CASSANDRA_CONFIG = "cassandra.yaml";
|
||||
private final static String KEYSPACE_NAME = "test";
|
||||
private final static String CASSANDRA_HOST = "localhost";
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
build.cassandra.native_transport_port=@build.cassandra.native_transport_port@
|
||||
build.cassandra.rpc_port=@build.cassandra.rpc_port@
|
||||
build.cassandra.storage_port=@build.cassandra.storage_port@
|
||||
build.cassandra.ssl_storage_port=@build.cassandra.ssl_storage_port@
|
||||
@@ -1,3 +1,3 @@
|
||||
cassandra.contactPoints=localhost
|
||||
cassandra.native_transport_port=${build.cassandra.native_transport_port}
|
||||
cassandra.native_transport_port=@build.cassandra.native_transport_port@
|
||||
cassandra.keyspace=TestKS123
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
location="classpath:/org/springframework/data/cassandra/test/integration/repository/cassandra.properties" />
|
||||
|
||||
<cassandra:cluster id="cassandra-cluster"
|
||||
contactPoints="${cassandra.contactPoints}" port="${build.cassandra.native_transport_port}"
|
||||
contactPoints="${cassandra.contactPoints}" port="${cassandra.native_transport_port}"
|
||||
compression="SNAPPY">
|
||||
<cassandra-base:local-pooling-options
|
||||
min-simultaneous-requests="25" max-simultaneous-requests="100"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
cassandra.contactPoints=localhost
|
||||
cassandra.native_transport_port=${build.cassandra.native_transport_port}
|
||||
cassandra.native_transport_port=@build.cassandra.native_transport_port@
|
||||
cassandra.keyspace=TestKS123
|
||||
|
||||
Reference in New Issue
Block a user