Commit 560c1739 authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Merge branch feature/jorgen.lind/run_java_tests_in_ci with refs/heads/master...

Merge branch feature/jorgen.lind/run_java_tests_in_ci with refs/heads/master into refs/merge-requests/142/train
parents 9295f816 3a0da6e7
Pipeline #1895 passed with stages
in 2 minutes and 49 seconds
......@@ -9,3 +9,4 @@ pybind11-2.4.3
CMakeArtifacts*
curl*
libuv*
java*
#This file depends on being in open-vds/CMake directory
set(Fetch3rdPartyDir ${CMAKE_CURRENT_LIST_DIR})
macro(Fetch3rdParty_File name dir_prefix version ext url url_hash)
get_filename_component(thirdParty "${Fetch3rdPartyDir}/../3rdparty/${dir_prefix}" ABSOLUTE)
file(MAKE_DIRECTORY ${thirdParty})
set(SRC_FILE ${thirdParty}/${name}-${version}.${ext})
set(${name}_SOURCE_FILE ${SRC_FILE} PARENT_SCOPE)
set(${name}_VERSION ${version} PARENT_SCOPE)
if (NOT (EXISTS ${SRC_FILE}))
file(DOWNLOAD ${url}
${SRC_FILE}
SHOW_PROGRESS
EXPECTED_HASH ${url_hash}
)
endif()
endmacro()
macro(Fetch3rdParty_Package name version url url_hash)
get_filename_component(thirdParty "${Fetch3rdPartyDir}/../3rdparty" ABSOLUTE)
set(SRC_DIR ${thirdParty}/${name}-${version})
......@@ -21,7 +36,6 @@ function(Fetch3rdParty)
include(CMake/FetchContentLocal.cmake)
set(FETCHCONTENT_QUIET OFF)
# Fetch3rdParty_Package(aws-cpp-sdk 1.7.213 https://codeload.github.com/aws/aws-sdk-cpp/tar.gz/1.7.213 SHA256=dd0485837ee2b3b46a98f439fb6799e2bb63d9a0038b0de1c2173181630b775c)
Fetch3rdParty_Package(aws-cpp-sdk 1.7.282 https://codeload.github.com/aws/aws-sdk-cpp/tar.gz/1.7.282 SHA256=e325497a93614b0980df8c294192150e81dc2fe55269b3a6945ee8a381247da4)
Fetch3rdParty_Package(gtest 1.10.0 https://github.com/google/googletest/archive/release-1.10.0.tar.gz SHA256=9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb)
Fetch3rdParty_Package(jsoncpp 1.8.4 https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz MD5=fa47a3ab6b381869b6a5f20811198662)
......@@ -31,13 +45,9 @@ function(Fetch3rdParty)
Fetch3rdParty_Package(pybind11 2.4.3 https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz SHA256=1eed57bc6863190e35637290f97a20c81cfe4d9090ac0a24f3bbf08f265eb71d)
Fetch3rdParty_Package(curl 7.68.0 https://github.com/curl/curl/releases/download/curl-7_68_0/curl-7.68.0.tar.gz SHA256=1dd7604e418b0b9a9077f62f763f6684c1b092a7bc17e3f354b8ad5c964d7358)
Fetch3rdParty_Package(libuv 1.34.1 https://github.com/libuv/libuv/archive/v1.34.1.tar.gz SHA256=e3e0105c9b26e181e0547607cb6893462beb0c652674c3795766b2e5555288b3)
# if (BUILD_JAVA)
# Fetch3rdParty_Package(junit4 4.13.0 https://github.com/junit-team/junit4/archive/r4.13.tar.gz SHA256=c4e8f5681ad387a386a5aebe05ed4b73ffbfff963e154fbc4d77090f230777c7)
# endif()
if (BUILD_ZLIB)
Fetch3rdParty_Package(zlib 1.2.11 http://zlib.net/zlib-1.2.11.tar.gz SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1)
endif()
Fetch3rdParty_Package(zlib 1.2.11 http://zlib.net/zlib-1.2.11.tar.gz SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1)
Fetch3rdParty_File(testng java 6.14.3 jar https://repo1.maven.org/maven2/org/testng/testng/6.14.3/testng-6.14.3.jar MD5=9f17a8f9e99165e148c42b21f4b63d7c)
Fetch3rdParty_File(jcommander java 1.72 jar https://repo1.maven.org/maven2/com/beust/jcommander/1.72/jcommander-1.72.jar MD5=9fde6bc0ba1032eceb7267fd1ad1657b)
endfunction()
......@@ -5,6 +5,9 @@ RUN apk add python3 python3-dev gcc g++ cmake make ninja git ccache doxygen open
libxml2-dev boost-dev zlib-dev openssl-dev curl-dev libuv-dev \
util-linux-dev # This package contains the uuid development headers
ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
ENV PATH="$JAVA_HOME/bin:${PATH}"
# Copy the python requirement list into the container and download the packages
COPY python/requirements-dev-with-docs.txt /tmp/requirements-dev.txt
RUN pip3 install -r tmp/requirements-dev.txt
......@@ -2,24 +2,12 @@ include(UseJava)
set(OPENVDS_JAVA_VERSION 0.0.6)
set(JAVA_TEST_ENABLED ON)
#set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.8" "-target" "1.8")
set(GENERATED_JNI_HEADERS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cpp/generated)
#file(REMOVE_RECURSE ${GENERATED_JNI_HEADERS_DIR})
file(MAKE_DIRECTORY ${GENERATED_JNI_HEADERS_DIR})
if(JAVA_TEST_ENABLED)
file (GLOB_RECURSE JAVA_TEST_SOURCES_FILES CONFIGURE_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/java/test/*.java)
endif()
if(JAVA_TEST_ENABLED)
foreach(FILE ${JAVA_TEST_SOURCES_FILES})
message(STATUS ${FILE})
endforeach()
endif()
set(JAVA_SOURCE_FILES
java/src/org/opengroup/openvds/AWSOpenOptions.java
java/src/org/opengroup/openvds/AzureOpenOptions.java
......@@ -88,21 +76,21 @@ create_javadoc(openvds-java-javadoc
VERSION TRUE
)
if(JAVA_TEST_ENABLED)
file(DOWNLOAD https://repo1.maven.org/maven2/org/testng/testng/6.14.3/testng-6.14.3.jar
${CMAKE_CURRENT_BINARY_DIR}/testng-6.14.3.jar
SHOW_PROGRESS
EXPECTED_HASH MD5=9f17a8f9e99165e148c42b21f4b63d7c)
add_jar(openvds-java-test
SOURCES ${JAVA_TEST_SOURCES_FILES}
VERSION ${OPENVDS_JAVA_VERSION}
INCLUDE_JARS
${CMAKE_CURRENT_BINARY_DIR}/testng-6.14.3.jar
${BUILT_JAR_FILE}
)
endif()
add_library(openvds-javacpp
set(JAVA_TEST_SOURCES_FILES
java/test/org/opengroup/openvds/AmazonS3Test.java
java/test/org/opengroup/openvds/MemoryVdsGeneratorTest.java
)
add_jar(openvds-java-test
SOURCES ${JAVA_TEST_SOURCES_FILES}
VERSION ${OPENVDS_JAVA_VERSION}
INCLUDE_JARS
${testng_SOURCE_FILE}
${BUILT_JAR_FILE}
)
add_library(openvds-javacpp
cpp/src/Common.cpp
cpp/src/CommonJni.cpp
cpp/src/JniPointer.cpp
......@@ -144,6 +132,3 @@ if (WIN32)
else()
install_jar(openvds-java DESTINATION java)
endif()
if(JAVA_TEST_ENABLED)
#install_jar(openvds-java-test DESTINATION java)
endif()
......@@ -772,8 +772,8 @@ public class MemoryVdsGeneratorTest {
assertEquals(4, descriptor.getBrickSizeMultiplier2D());
assertEquals(LOD_LEVELS_NONE, descriptor.getLODLevels());
assertTrue(!descriptor.isCreate2DLODs());
assertTrue(descriptor.isForceFullResolutionDimension());
assertEquals(0, descriptor.getFullResolutionDimension());
assertTrue(!descriptor.isForceFullResolutionDimension());
assertEquals(-1, descriptor.getFullResolutionDimension());
assertEquals(1, layout.getChannelCount());
......@@ -834,4 +834,4 @@ public class MemoryVdsGeneratorTest {
generator.close();
}
}
\ No newline at end of file
}
......@@ -97,7 +97,17 @@ add_test_executable(multithreaded_requests
add_test_executable(openvds_mixed_request
OpenVDS/RequestVolumeSubsetAndPageAccessor.cpp
)
if (BUILD_PYTHON)
add_subdirectory(python)
endif()
if (BUILD_JAVA)
add_custom_command(TARGET TestRootTarget
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:openvds-javacpp> $<TARGET_FILE_DIR:TestRootTarget>
DEPENDS openvds-javacpp
)
add_subdirectory(java)
endif()
int main(int argc, char **argv)
{
//Update 1
return 0;
}
if (UNIX)
set(separator ":")
else ()
set(separator ";")
endif()
get_property(BUILT_JAR_FILE TARGET openvds-java PROPERTY JAR_FILE)
get_property(BUILT_JAR_TEST_FILE TARGET openvds-java-test PROPERTY JAR_FILE)
add_test(NAME "Java.Java.AllJavaTests"
COMMAND ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=$<TARGET_FILE_DIR:openvds-javacpp>"
${Java_JAVA_EXECUTABLE} -cp "${testng_SOURCE_FILE}${separator}${jcommander_SOURCE_FILE}${separator}${BUILT_JAR_FILE}${separator}${BUILT_JAR_TEST_FILE}" org.testng.TestNG -testjar ${BUILT_JAR_TEST_FILE} -log 2
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment