Skip to content

Commit 13a00c2

Browse files
authored
Merge pull request #330 from riptano/CPP-854
CPP-854 - Removing Simulacron in favor of unit tests
2 parents b04618e + 3c008a6 commit 13a00c2

21 files changed

Lines changed: 12 additions & 3099 deletions

cpp-driver/cmake/modules/CppDriver.cmake

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -521,30 +521,6 @@ macro(CassHttpParser)
521521
include_directories(${HTTP_PARSER_INCLUDE_DIR})
522522
endmacro()
523523

524-
#------------------------
525-
# CassSimulacron
526-
#
527-
# Set up Simulacron for use in tests.
528-
#
529-
# Input: TESTS_SIMULACRON_SERVER_DIR
530-
# Output: SIMULACRON_SERVER_JAR
531-
#------------------------
532-
macro(CassSimulacron)
533-
# Determine if Simulacron server can be executed (Java runtime is available)
534-
find_package(Java COMPONENTS Runtime)
535-
if(Java_Runtime_FOUND)
536-
# Determine the Simulacron jar file
537-
file(GLOB SIMULACRON_SERVER_JAR
538-
${TESTS_SIMULACRON_SERVER_DIR}/simulacron-standalone-*.jar)
539-
endif()
540-
541-
# Determine if the Simulacron server will be available for the tests
542-
if(NOT EXISTS ${SIMULACRON_SERVER_JAR})
543-
message(WARNING "Simulacron Not Found: Simulacron support will be disabled")
544-
endif()
545-
endmacro()
546-
547-
548524
#------------------------
549525
# CassUseBoost
550526
#

cpp-driver/gtests/CMakeLists.txt

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ GtestOptions()
2020

2121
# Build the base include paths for the tests
2222
set(TESTS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
23-
set(TESTS_SIMULACRON_SOURCE_DIR "${TESTS_SOURCE_DIR}/integration/simulacron")
24-
set(TESTS_SIMULACRON_SERVER_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
2523
set(VENDOR_DIR "${TESTS_SOURCE_DIR}/vendor")
2624
include_directories(${VENDOR_DIR})
2725

28-
GtestSourceGroups()
29-
3026
#------------------------------
3127
# Google test framework
3228
#------------------------------
@@ -36,7 +32,6 @@ GtestFramework()
3632
# Integration test executable
3733
#------------------------------
3834
if(CASS_BUILD_INTEGRATION_TESTS)
39-
CassSimulacron()
4035
CassRapidJson()
4136

4237
set(INTEGRATION_TESTS_NAME "cassandra-integration-tests")
@@ -53,39 +48,21 @@ if(CASS_BUILD_INTEGRATION_TESTS)
5348
set(${var_name} ${CASS_${var_name}})
5449
endforeach()
5550

56-
if (EXISTS ${SIMULACRON_SERVER_JAR})
57-
# Configure the integration tests to use Simulacron
58-
add_definitions(-DUSE_SIMULACRON_SERVER)
59-
get_filename_component(SIMULACRON_SERVER_JAR_BASENAME
60-
${SIMULACRON_SERVER_JAR} NAME)
61-
add_definitions(-DSIMULACRON_SERVER_JAR="${SIMULACRON_SERVER_JAR_BASENAME}")
62-
file(GLOB INTEGRATION_TESTS_SIMULACRON_INCLUDE_FILES ${TESTS_SIMULACRON_SOURCE_DIR}/*.hpp)
63-
file(GLOB INTEGRATION_TESTS_SIMULACRON_RESULTS_INCLUDE_FILES ${TESTS_SIMULACRON_SOURCE_DIR}/results/*.hpp)
64-
file(GLOB INTEGRATION_TESTS_SIMULACRON_SOURCE_FILES ${TESTS_SIMULACRON_SOURCE_DIR}/*.cpp)
65-
file(GLOB INTEGRATION_TESTS_SIMULACRON_TESTS_SOURCE_FILES ${INTEGRATION_TESTS_SOURCE_DIR}/tests/simulacron/*.cpp)
66-
source_group("Header Files\\simulacron" FILES ${INTEGRATION_TESTS_SIMULACRON_INCLUDE_FILES})
67-
source_group("Header Files\\simulacron\\results" FILES ${INTEGRATION_TESTS_SIMULACRON_RESULTS_INCLUDE_FILES})
68-
source_group("Source Files\\simulacron" FILES ${INTEGRATION_TESTS_SIMULACRON_SOURCE_FILES})
69-
source_group("Source Files\\tests\\simulacron" FILES ${INTEGRATION_TESTS_SIMULACRON_TESTS_SOURCE_FILES})
70-
include_directories(${TESTS_SIMULACRON_SOURCE_DIR})
71-
endif()
72-
7351
if(LIBSSH2_FOUND)
7452
add_definitions(-DCASS_USE_LIBSSH2)
7553
endif()
7654

7755
GtestIntegrationTestSourceGroups()
7856
GtestCommonIntegrationTestSourceFiles()
7957
add_executable(${INTEGRATION_TESTS_NAME}
58+
${INTEGRATION_TESTS_INCLUDE_FILES}
8059
${INTEGRATION_TESTS_OBJECTS_INCLUDE_FILES}
8160
${INTEGRATION_TESTS_POLICIES_INCLUDE_FILES}
8261
${INTEGRATION_TESTS_VALUES_INCLUDE_FILES}
83-
${INTEGRATION_TESTS_SIMULACRON_SOURCE_FILES}
84-
${INTEGRATION_TESTS_SIMULACRON_TESTS_SOURCE_FILES}
85-
${INTEGRATION_TESTS_SIMULACRON_INCLUDE_FILES}
86-
${INTEGRATION_TESTS_SIMULACRON_RESULTS_INCLUDE_FILES}
62+
${CASS_API_HEADER_FILES}
63+
${COMMON_INTEGRATION_TEST_INCLUDE_FILES}
8764
${COMMON_INTEGRATION_TEST_SOURCE_FILES}
88-
)
65+
${RAPIDJSON_HEADER_FILES})
8966
if(CMAKE_VERSION VERSION_LESS "2.8.11")
9067
include_directories(${INTEGRATION_TESTS_SOURCE_DIR})
9168
include_directories(${CCM_BRIDGE_INCLUDES})
@@ -107,22 +84,6 @@ if(CASS_BUILD_INTEGRATION_TESTS)
10784
if(LIBSSH2_LIBRARY_NAME)
10885
add_dependencies(${INTEGRATION_TESTS_NAME} ${LIBSSH2_LIBRARY_NAME})
10986
endif()
110-
111-
# Copy the test related dependencies to their proper locations
112-
if(EXISTS ${SIMULACRON_SERVER_JAR})
113-
# Copy the standalone Simulacron server JAR file to output directory
114-
configure_file(${SIMULACRON_SERVER_JAR} ${CMAKE_BINARY_DIR} COPYONLY)
115-
if(WIN32)
116-
# Copy Simulacron server to additional locations for use with IDE
117-
if(NOT EXISTS ${CMAKE_BINARY_DIR}/tests)
118-
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
119-
endif()
120-
get_filename_component(SIMULACRON_SERVER_JAR_FILENAME
121-
${SIMULACRON_SERVER_JAR}
122-
NAME)
123-
configure_file(${SIMULACRON_SERVER_JAR} ${CMAKE_BINARY_DIR}/tests COPYONLY)
124-
endif()
125-
endif()
12687
endif()
12788

12889
#------------------------------
-8.34 MB
Binary file not shown.

cpp-driver/gtests/src/integration/options.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class Options {
312312
*/
313313
static CCM::DeploymentType deployment_type_;
314314
/**
315-
* Test types (Cassandra|DSE|Simulacron)
315+
* Test types (Cassandra|DSE)
316316
*/
317317
static std::set<TestCategory> categories_;
318318
/**

cpp-driver/gtests/src/integration/simulacron/priming_requests.hpp

Lines changed: 0 additions & 190 deletions
This file was deleted.

0 commit comments

Comments
 (0)