我正在使用 编写集成测试spock-framework
,我可以在执行集成测试开始并加载文件maven-cassandra-plugin
之前使用 ie (我们在属性中提到过,然后我们的测试将运行,运行后测试将关闭。以同样的方式我想用。我在网上看到过以下插件示例cassandra
cql
configuration
maven-cassandra-plugin
cassandra
maven-redis-plugin
<plugin>
<groupId>ru.trylogic.maven.plugins</groupId>
<artifactId>redis-maven-plugin</artifactId>
<version>1.4.6</version>
<configuration>
<forked>true</forked>
</configuration>
<executions>
<execution>
<id>launch-redis</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>stop-redis</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
样本 2:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>launch-redis</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>redis-server</executable>
<arguments>
<argument>${project.basedir}/src/test/redis/redis.conf</argument>
<argument>--port</argument>
<argument>${redisPort}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>shutdown-redis</id>
<phase>post-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>redis-cli</executable>
<arguments>
<argument>-p</argument>
<argument>${redisPort}</argument>
<argument>shutdown</argument>
</arguments>
</configuration>
</execution>
我想将一些数据插入缓存,然后使用我的集成测试类我想对该数据执行 CRUD 操作