8000 merged from master · forumjava/spring-data-cassandra@4406cf3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4406cf3

Browse files
committed
merged from master
2 parents f3da0a1 + f834ba1 commit 4406cf3

File tree

65 files changed

+2381
-929
lines changed
  • test
  • spring-data-cassandra/src/test
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    65 files changed

    +2381
    -929
    lines changed

    pom.xml

    Lines changed: 61 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -273,6 +273,40 @@
    273273
    </execution>
    274274
    </executions>
    275275
    </plugin>
    276+
    <plugin>
    277+
    <groupId>org.codehaus.mojo</groupId>
    278+
    <artifactId>build-helper-maven-plugin</artifactId>
    279+
    <version>1.8</version>
    280+
    <executions>
    281+
    <execution>
    282+
    <id>reserve-network-port</id>
    283+
    <goals>
    284+
    <goal>reserve-network-port</goal>
    285+
    </goals>
    286+
    <phase>process-resources</phase>
    287+
    <configuration>
    288+
    <portNames>
    289+
    <portName>build.cassandra.native_transport_port</portName>
    290+
    <portName>build.cassandra.rpc_port</portName>
    291+
    <portName>build.cassandra.storage_port</portName>
    292+
    <portName>build.cassandra.ssl_storage_port</portName>
    293+
    </portNames>
    294+
    </configuration>
    295+
    </execution>
    296+
    <execution>
    297+
    <id>add-shared-source-dir</id>
    298+
    <goals>
    299+
    <goal>add-test-source</goal>
    300+
    </goals>
    301+
    <phase>generate-test-sources</phase>
    302+
    <configuration>
    303+
    <sources>
    304+
    <source>../shared/src/test/java</source>
    305+
    </sources>
    306+
    </configuration>
    307+
    </execution>
    308+
    </executions>
    309+
    </plugin>
    276310
    <plugin>
    277311
    <groupId>org.apache.maven.plugins</groupId>
    278312
    <artifactId>maven-dependency-plugin</artifactId>
    @@ -304,6 +338,7 @@
    304338
    <configuration>
    305339
    <forkCount>1</forkCount>
    306340
    <argLine>-Xmx1024m -Xss512m -javaagent:${com.github.stephenc:jamm:jar}</argLine>
    341+
    <reuseForks>true</reuseForks>
    307342
    <useFile>false</useFile>
    308343
    <includes>
    309344
    <include>**/test/integration/**/*.java</include>
    @@ -326,5 +361,31 @@
    326361
    </executions>
    327362
    </plugin>
    328363
    </plugins>
    364+
    365+
    <resources>
    366+
    <resource>
    367+
    <directory>src/main/resources</directory>
    368+
    <filtering>true</filtering>
    369+
    <includes>
    370+
    <include>**/*</include>
    371+
    </includes>
    372+
    </resource>
    373+
    </resources>
    374+
    <testResources>
    375+
    <testResource>
    376+
    <directory>src/test/resources</directory>
    377+
    <filtering>true</filtering>
    378+
    <includes>
    379+
    <include>**/*</include>
    380+
    </includes>
    381+
    </testResource>
    382+
    <testResource>
    383+
    <directory>../shared/src/test/resources</directory>
    384+
    <filtering>true</filtering>
    385+
    <includes>
    386+
    <include>**/*</include>
    387+
    </includes>
    388+
    </testResource>
    389+
    </testResources>
    329390
    </build>
    330391
    </project>
    Lines changed: 16 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,16 @@
    1+
    package org.springframework.cassandra.test.integration.support;
    2+
    3+
    import org.springframework.cassandra.config.java.AbstractCassandraConfiguration;
    4+
    import org.springframework.context.annotation.Configuration;
    5+
    6+
    @Configuration
    7+
    public abstract class AbstractTestJavaConfig extends AbstractCassandraConfiguration {
    8+
    9+
    public static BuildProperties PROPS = new BuildProperties();
    10+
    public static final int PORT = PROPS.getCassandraPort();
    11+
    12+
    @Override
    13+
    protected int getPort() {
    14+
    return PORT;
    15+
    }
    16< 1241 /td>+
    }
    Lines changed: 64 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,64 @@
    1+
    package org.springframework.cassandra.test.integration.support;
    2+
    3+
    import java.io.InputStream;
    4+
    import java.util.Properties;
    5+
    6+
    @SuppressWarnings("serial")
    7+
    public class BuildProperties extends Properties {
    8+
    9+
    public BuildProperties() {
    10+
    this("/build.properties");
    11+
    }
    12+
    13+
    public BuildProperties(String resourceName) {
    14+
    loadProperties(resourceName);
    15+
    }
    16+
    17+
    public void loadProperties(String resourceName) {
    18+
    InputStream in = null;
    19+
    try {
    20+
    in = getClass().getResourceAsStream(resourceName);
    21+
    if (in == null) {
    22+
    return;
    23+
    }
    24+
    load(in);
    25+
    26+
    } catch (Exception x) {
    27+
    throw new RuntimeException(x);
    28+
    29+
    } finally {
    30+
    if (in != null) {
    31+
    try {
    32+
    in.close();
    33+
    } catch (Exception e) {
    34+
    // gulp
    35+
    }
    36+
    }
    37+
    }
    38+
    }
    39+
    40+
    public int getCassandraPort() {
    41+
    return getInt("build.cassandra.native_transport_port");
    42+
    }
    43+
    44+
    public int getCassandraRpcPort() {
    45+
    return getInt("build.cassandra.rpc_port");
    46+
    }
    47+
    48+
    public int getCassandraStoragePort() {
    49+
    return getInt("build.cassandra.storage_port");
    50+
    }
    51+
    52+
    public int getCassandraSslStoragePort() {
    53+
    return getInt("build.cassandra.ssl_storage_port");
    54+
    }
    55+
    56+
    public int getInt(String key) {
    57+
    String property = getProperty(key);
    58+
    return Integer.parseInt(property);
    59+
    }
    60+
    61+
    public boolean getBoolean(String key) {
    62+
    return Boolean.parseBoolean(getProperty(key));
    63+
    }
    64+
    }
    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,4 @@
    1+
    build.cassandra.native_transport_port=@build.cassandra.native_transport_port@
    2+
    build.cassandra.rpc_port=@build.cassandra.rpc_port@
    3+
    build.cassandra.storage_port=@build.cassandra.storage_port@
    4+
    build.cassandra.ssl_storage_port=@build.cassandra.ssl_storage_port@

    spring-cassandra/pom.xml

    Lines changed: 15 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -41,6 +41,21 @@
    4141
    <groupId>org.springframework</groupId>
    4242
    <artifactId>spring-tx</artifactId>
    4343
    </dependency>
    44+
    <dependency>
    45+
    <groupId>${project.groupId}</groupId>
    46+
    <artifactId>spring-data-commons</artifactId>
    47+
    <version>${springdata.commons}</version>
    48+
    </dependency>
    49+
    <dependency>
    50+
    <groupId>com.datastax.cassandra</groupId>
    51+
    <artifactId>cassandra-driver-core</artifactId>
    52+
    <exclusions>
    53+
    <exclusion>
    54+
    <artifactId>log4j</artifactId>
    55+
    <groupId>log4j</groupId>
    56+
    </exclusion>
    57+
    </exclusions>
    58+
    </dependency>
    4459
    <dependency>
    4560
    <groupId>javax.enterprise</groupId>
    4661
    <artifactId>cdi-api</artifactId>

    0 commit comments

    Comments
     (0)
    0