diff --git a/bin/common.sh b/bin/common.sh index c287535a778..a61edcfb064 100755 --- a/bin/common.sh +++ b/bin/common.sh @@ -239,6 +239,7 @@ add_maven_deps_to_classpath() { # clean it up and force us create a new one. f="${BK_HOME}/${MODULE_PATH}/target/cached_classpath.txt" output="${BK_HOME}/${MODULE_PATH}/target/build_classpath.out" + if [ ! -f ${f} ]; then echo "the classpath of module '${MODULE_PATH}' is not found, generating it ..." >&2 echo "see output at ${output} for the progress ..." >&2 diff --git a/bin/common_gradle.sh b/bin/common_gradle.sh index 9910d8c344a..3f65c23f3a6 100755 --- a/bin/common_gradle.sh +++ b/bin/common_gradle.sh @@ -155,7 +155,7 @@ is_released_binary() { find_module_jar_at() { DIR=$1 MODULE=$2 - REGEX="^${MODULE}.jar$" + REGEX="^${MODULE}[-0-9\\.]*((-[a-zA-Z]*(-[0-9]*)?)|(-SNAPSHOT))?.jar$" if [ -d ${DIR} ]; then cd ${DIR} for f in *.jar; do @@ -213,17 +213,12 @@ find_module_jar() { echo "Could not find module '${MODULE_JAR}' jar." >&2 exit 1 fi - ##echo ${MODULE_JAR} + echo "${MODULE_JAR}" return } add_maven_deps_to_classpath() { MODULE_PATH=$1 - MVN="mvn" - if [ "$MAVEN_HOME" != "" ]; then - MVN=${MAVEN_HOME}/bin/mvn - fi - # Need to generate classpath from maven pom. This is costly so generate it # and cache it. Save the file into our target dir so a mvn clean will get # clean it up and force us create a new one. diff --git a/bookkeeper-http/servlet-http-server/build.gradle b/bookkeeper-http/servlet-http-server/build.gradle new file mode 100644 index 00000000000..ea341bf0f31 --- /dev/null +++ b/bookkeeper-http/servlet-http-server/build.gradle @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + +dependencies { + implementation project(':bookkeeper-http:http-server') + implementation depLibs.slf4j + implementation depLibs.javaxServlet + implementation depLibs.commonsIO + + compileOnly depLibs.lombok + annotationProcessor depLibs.lombok + + testImplementation depLibs.junit + testImplementation depLibs.jettyWebapp +} + +publishing { + publications { + maven(MavenPublication) { + groupId = 'org.apache.bookkeeper.http' + artifactId = 'servlet-http-server' + } + } +} diff --git a/dependencies.gradle b/dependencies.gradle index 6b019f814ed..570ce8ca3cc 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -39,6 +39,7 @@ depVersions = [ dockerJava: "3.2.5", dropwizard: "3.2.5", errorprone: "2.4.0", + etcd: "0.5.4", freebuilder: "2.7.0", googleHTTPClient: "1.34.0", gradleTooling: "4.0.1", @@ -112,6 +113,9 @@ depLibs = [ }, dockerJava: "com.github.docker-java:docker-java:${depVersions.dockerJava}", errorprone: "com.google.errorprone:error_prone_annotations:${depVersions.errorprone}", + etcd: dependencies.create("io.etcd:jetcd-core:${depVersions.etcd}") { + exclude group: 'io.grpc' + }, freebuilder: "org.inferred:freebuilder:${depVersions.freebuilder}", googleHTTPClient: dependencies.create("com.google.http-client:google-http-client:${depVersions.googleHTTPClient}") { exclude group: 'com.google.code.findbugs', module: 'jsr305' @@ -152,6 +156,7 @@ depLibs = [ jettyServlet: dependencies.create("org.eclipse.jetty:jetty-servlet:${depVersions.jetty}") { exclude group: 'javax.servlet', module: 'javax.servlet-api' }, + jettyWebapp: "org.eclipse.jetty:jetty-webapp:${depVersions.jetty}", jmock: "org.jmock:jmock:${depVersions.jmock}", jmhCore: "org.openjdk.jmh:jmh-core:${depVersions.jmh}", jmhGeneratorAnnprocess: "org.openjdk.jmh:jmh-generator-annprocess:${depVersions.jmh}", diff --git a/metadata-drivers/etcd/build.gradle b/metadata-drivers/etcd/build.gradle new file mode 100644 index 00000000000..85af22a04a9 --- /dev/null +++ b/metadata-drivers/etcd/build.gradle @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + +dependencies { + implementation project(":bookkeeper-server") + implementation project(":bookkeeper-common") + implementation project(":bookkeeper-stats") + implementation depLibs.etcd + implementation depLibs.commonsConfiguration + implementation depLibs.grpc + implementation depLibs.zookeeper + + compileOnly depLibs.lombok + + testImplementation depLibs.arquillianCubeDocker + testImplementation depLibs.arquillianJunitStandalone + testImplementation depLibs.testcontainers + testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts') + testImplementation project(path: ':bookkeeper-server', configuration: 'testArtifacts') + testImplementation depLibs.dockerJava + testCompileOnly depLibs.lombok + + annotationProcessor depLibs.lombok + testAnnotationProcessor depLibs.lombok +} + +publishing { + publications { + maven(MavenPublication) { + groupId = 'org.apache.bookkeeper.metadata.drivers' + artifactId = 'metadata-stores-etcd' + } + } +} + diff --git a/metadata-drivers/etcd/src/main/java/org/apache/bookkeeper/metadata/etcd/EtcdMetadataDriverBase.java b/metadata-drivers/etcd/src/main/java/org/apache/bookkeeper/metadata/etcd/EtcdMetadataDriverBase.java index dec40ad74ac..2938770de85 100644 --- a/metadata-drivers/etcd/src/main/java/org/apache/bookkeeper/metadata/etcd/EtcdMetadataDriverBase.java +++ b/metadata-drivers/etcd/src/main/java/org/apache/bookkeeper/metadata/etcd/EtcdMetadataDriverBase.java @@ -17,7 +17,7 @@ */ package org.apache.bookkeeper.metadata.etcd; -import com.beust.jcommander.internal.Lists; +import com.google.common.collect.Lists; import io.etcd.jetcd.Client; import java.io.IOException; import java.util.List; diff --git a/settings.gradle b/settings.gradle index 336afccee3c..9cdf810a583 100644 --- a/settings.gradle +++ b/settings.gradle @@ -44,6 +44,7 @@ include(':bookkeeper-benchmark', 'bookkeeper-dist-src', 'bookkeeper-dist:storage-bench', 'bookkeeper-http:http-server', + 'bookkeeper-http:servlet-http-server', 'bookkeeper-http:vertx-http-server', 'bookkeeper-proto', 'bookkeeper-server', @@ -59,6 +60,7 @@ include(':bookkeeper-benchmark', 'cpu-affinity:src:main:affinity', 'dev:release', 'microbenchmarks', + 'metadata-drivers:etcd', 'shaded:distributedlog-core-shaded', 'stats:utils', 'stream:api', @@ -69,18 +71,33 @@ include(':bookkeeper-benchmark', 'stream:distributedlog:common', 'stream:distributedlog:core', 'stream:distributedlog:protocol', + 'stream:bk-grpc-name-resolver', 'stream:proto', 'stream:server', 'stream:statelib', 'stream:storage:api', 'stream:storage:impl', 'stream:tests-common', + 'tests:backward-compat', + 'tests:backward-compat:bc-non-fips', + 'tests:backward-compat:current-server-old-clients', + 'tests:backward-compat:hierarchical-ledger-manager', + 'tests:backward-compat:hostname-bookieid', + 'tests:backward-compat:old-cookie-new-cluster', + 'tests:backward-compat:recovery-no-password', + 'tests:backward-compat:upgrade', + 'tests:backward-compat:upgrade-direct', + 'tests:backward-compat:yahoo-custom-version', 'tests:integration-tests-base', 'tests:integration-tests-topologies', 'tests:integration-tests-utils', 'tests:integration:cluster', 'tests:integration:smoke', 'tests:integration:standalone', + 'tests:scripts', + 'tests:shaded:bookkeeper-server-shaded-test', + 'tests:shaded:bookkeeper-server-tests-shaded-test', + 'tests:shaded:distributedlog-core-shaded-test', 'tools:framework') project(':bookkeeper-tools').projectDir = file('tools/all') diff --git a/shaded/bookkeeper-server-tests-shaded/build.gradle b/shaded/bookkeeper-server-tests-shaded/build.gradle new file mode 100644 index 00000000000..6a3009f6d2c --- /dev/null +++ b/shaded/bookkeeper-server-tests-shaded/build.gradle @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +plugins { + id 'java' + id 'com.github.johnrengelman.shadow' + id 'com.github.hierynomus.license' +} + +dependencies { + implementation project(path: ':bookkeeper-server', configuration: 'testArtifacts') +} + +shadowJar { + dependencies { + } + relocate 'com.google', 'org.apache.bookkeeper.shaded.com.google' + archiveBaseName.set("bookkeeper-server-tests-shaded") + archiveClassifier.set("") +} diff --git a/stream/bk-grpc-name-resolver/build.gradle b/stream/bk-grpc-name-resolver/build.gradle new file mode 100644 index 00000000000..950bb61724a --- /dev/null +++ b/stream/bk-grpc-name-resolver/build.gradle @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + +dependencies { + implementation project(':bookkeeper-server') + implementation project(':bookkeeper-common') + implementation project(':bookkeeper-stats') + implementation project(':stream:common') + implementation depLibs.grpc + implementation depLibs.slf4j + implementation depLibs.commonsConfiguration + + compileOnly depLibs.jsr305 + compileOnly depLibs.lombok + annotationProcessor depLibs.lombok + + testImplementation project(':stream:clients:java:base') + testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts') + testImplementation project(path: ':bookkeeper-server', configuration: 'testArtifacts') + testImplementation depLibs.junit + testImplementation depLibs.zookeeper + + testCompileOnly depLibs.lombok + testAnnotationProcessor depLibs.lombok +} + +publishing { + publications { + maven(MavenPublication) { + artifactId = 'bk-grpc-name-resolver' + } + } +} diff --git a/tests/backward-compat/bc-non-fips/build.gradle b/tests/backward-compat/bc-non-fips/build.gradle new file mode 100644 index 00000000000..b87df1bc510 --- /dev/null +++ b/tests/backward-compat/bc-non-fips/build.gradle @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + +dependencies { + + testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts') + testImplementation project(path: ':bookkeeper-server', configuration: 'testArtifacts') + testImplementation depLibs.junit + testImplementation depLibs.slf4j + testImplementation depLibs.bcpkixJdk15on + testImplementation depLibs.bcproveExtJdk15on + + testCompileOnly depLibs.lombok + testAnnotationProcessor depLibs.lombok +} + diff --git a/tests/backward-compat/build.gradle b/tests/backward-compat/build.gradle new file mode 100644 index 00000000000..c64d49171e9 --- /dev/null +++ b/tests/backward-compat/build.gradle @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +plugins { + id 'groovy' + id 'com.adarshr.test-logger' +} + +subprojects { + if (project.name == "bc-non-fips") { + return + } + + apply plugin: 'groovy' + apply plugin: 'com.adarshr.test-logger' + + dependencies { + testImplementation 'org.codehaus.groovy:groovy-all:2.4.15' + testImplementation project(":tests:integration-tests-utils") + testImplementation project(":tests:integration-tests-topologies") + testImplementation depLibs.arquillianJunitContainer + testImplementation depLibs.junit + testImplementation depLibs.slf4j + testImplementation depLibs.arquillianCubeDocker + } + +} \ No newline at end of file diff --git a/tests/backward-compat/recovery-no-password/build.gradle b/tests/backward-compat/recovery-no-password/build.gradle new file mode 100644 index 00000000000..b720198f1e4 --- /dev/null +++ b/tests/backward-compat/recovery-no-password/build.gradle @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +dependencies { + testImplementation project(":bookkeeper-server") + testImplementation project(":bookkeeper-common") + testImplementation project(":bookkeeper-common-allocator") + testImplementation project(":bookkeeper-stats") + testImplementation depLibs.protobuf + testImplementation project(":bookkeeper-proto") + testImplementation depLibs.commonsConfiguration +} diff --git a/tests/scripts/build.gradle b/tests/scripts/build.gradle new file mode 100644 index 00000000000..d15c9411cc1 --- /dev/null +++ b/tests/scripts/build.gradle @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +plugins { + id "de.undercouch.download" version "4.1.2" +} + +task downloadShunit2(type: Download) { + src 'https://github.com/kward/shunit2/archive/v2.1.7.zip' + dest new File(buildDir, "shunit2-2.1.7.zip") +} + +task extractShunit2(dependsOn: downloadShunit2, type: Copy) { + from zipTree(downloadShunit2.dest) + into new File(buildDir, "libs/lib") +} + +task executeShTests(dependsOn: extractShunit2, type: Exec) { + workingDir "src/test/bash/gradle" + commandLine "./bk_test.sh" +} + +tasks.test.dependsOn("executeShTests") diff --git a/tests/scripts/src/test/bash/gradle/bk_test.sh b/tests/scripts/src/test/bash/gradle/bk_test.sh new file mode 100755 index 00000000000..3c7b02e6fe1 --- /dev/null +++ b/tests/scripts/src/test/bash/gradle/bk_test.sh @@ -0,0 +1,141 @@ +#!/usr/bin/env bash +# +# vim:et:ft=sh:sts=2:sw=2 +# +#/** +# * Licensed to the Apache Software Foundation (ASF) under one +# * or more contributor license agreements. See the NOTICE file +# * distributed with this work for additional information +# * regarding copyright ownership. The ASF licenses this file +# * to you under the Apache License, Version 2.0 (the +# * "License"); you may not use this file except in compliance +# * with the License. You may obtain a copy of the License at +# * +# * http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# */ + +ARGV0=`basename "$0"` +PREFIX="bk_test_" +SHELLS="/bin/sh /bin/bash" + +find_tests_at() { + DIR=$1 + PREF=$2 + REGEX="^${PREF}[a-z_]*.sh$" + RESULTS="" + if [ -d ${DIR} ]; then + cd ${DIR} + for f in *.sh; do + if [[ ${f} =~ ${REGEX} ]]; then + RESULTS="${RESULTS} ${f}" + fi + done + fi + echo ${RESULTS} +} + +TESTS=$(find_tests_at "." ${PREFIX}) + +# load common unit test functions +source ./versions +source ./bk_test_helpers + +usage() { + echo "usage: ${ARGV0} [-e key=val ...] [-s shell(s)] [-t test(s)]" +} + +env='' + +# process command line flags +while getopts 'e:hs:t:' opt; do + case ${opt} in + e) # set an environment variable + key=`expr "${OPTARG}" : '\([^=]*\)='` + val=`expr "${OPTARG}" : '[^=]*=\(.*\)'` + if [ -z "${key}" -o -z "${val}" ]; then + usage + exit 1 + fi + eval "${key}='${val}'" + export ${key} + env="${env:+${env} }${key}" + ;; + h) usage; exit 0 ;; # output help + s) shells=${OPTARG} ;; # list of shells to run + t) tests=${OPTARG} ;; # list of tests to run + *) usage; exit 1 ;; + esac +done +shift `expr ${OPTIND} - 1` + +# fill shells and/or tests +shells=${shells:-${SHELLS}} +tests=${tests:-${TESTS}} + +# error checking +if [ -z "${tests}" ]; then + bk_info 'no tests found to run; exiting' + exit 0 +fi + +# print run info +cat <&1; ) + done +done diff --git a/tests/scripts/src/test/bash/gradle/bk_test_bin_common.sh b/tests/scripts/src/test/bash/gradle/bk_test_bin_common.sh new file mode 100644 index 00000000000..c20165f6050 --- /dev/null +++ b/tests/scripts/src/test/bash/gradle/bk_test_bin_common.sh @@ -0,0 +1,263 @@ +#!/usr/bin/env bash +# +# vim:et:ft=sh:sts=2:sw=2 +# +#/** +# * Licensed to the Apache Software Foundation (ASF) under one +# * or more contributor license agreements. See the NOTICE file +# * distributed with this work for additional information +# * regarding copyright ownership. The ASF licenses this file +# * to you under the Apache License, Version 2.0 (the +# * "License"); you may not use this file except in compliance +# * with the License. You may obtain a copy of the License at +# * +# * http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# */ +# load test helpers +. ./bk_test_helpers + +#------------------------------------------------------------------------------ +# suite tests +# + +testDefaultVariables() { + source ${BK_BINDIR}/common_gradle.sh + assertEquals "BINDIR is not set correctly" "${BK_BINDIR}" "${BINDIR}" + assertEquals "BK_HOME is not set correctly" "${BK_HOMEDIR}" "${BK_HOME}" + assertEquals "DEFAULT_LOG_CONF is not set correctly" "${BK_CONFDIR}/log4j.properties" "${DEFAULT_LOG_CONF}" + assertEquals "NETTY_LEAK_DETECTION_LEVEL is not set correctly" "disabled" "${NETTY_LEAK_DETECTION_LEVEL}" + assertEquals "NETTY_RECYCLER_MAXCAPACITY is not set correctly" "1000" "${NETTY_RECYCLER_MAXCAPACITY}" + assertEquals "NETTY_RECYCLER_LINKCAPACITY is not set correctly" "1024" "${NETTY_RECYCLER_LINKCAPACITY}" + assertEquals "BOOKIE_MAX_HEAP_MEMORY is not set correctly" "1g" "${BOOKIE_MAX_HEAP_MEMORY}" + assertEquals "BOOKIE_MIN_HEAP_MEMORY is not set correctly" "1g" "${BOOKIE_MIN_HEAP_MEMORY}" + assertEquals "BOOKIE_MAX_DIRECT_MEMORY is not set correctly" "2g" "${BOOKIE_MAX_DIRECT_MEMORY}" + assertEquals "BOOKIE_MEM_OPTS is not set correctly" "-Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g" "${BOOKIE_MEM_OPTS}" + assertEquals "BOOKIE_GC_OPTS is not set correctly" "${DEFAULT_BOOKIE_GC_OPTS}" "${BOOKIE_GC_OPTS}" + assertEquals "BOOKIE_GC_LOGGING_OPTS is not set correctly" "${DEFAULT_BOOKIE_GC_LOGGING_OPTS}" "${BOOKIE_GC_LOGGING_OPTS}" + assertEquals "CLI_MAX_HEAP_MEMORY is not set correctly" "512M" "${CLI_MAX_HEAP_MEMORY}" + assertEquals "CLI_MIN_HEAP_MEMORY is not set correctly" "256M" "${CLI_MIN_HEAP_MEMORY}" + assertEquals "CLI_MEM_OPTS is not set correctly" "-Xms256M -Xmx512M" "${CLI_MEM_OPTS}" + assertEquals "CLI_GC_OPTS is not set correctly" "${DEFAULT_CLI_GC_OPTS}" "${CLI_GC_OPTS}" + assertEquals "CLI_GC_LOGGING_OPTS is not set correctly" "${DEFAULT_CLI_GC_LOGGING_OPTS}" "${CLI_GC_LOGGING_OPTS}" +} + +testFindModuleJarAt() { + source ${BK_BINDIR}/common_gradle.sh + + MODULE="test-module" + + # case 1: empty dir + TEST_DIR1=${BK_TMPDIR}/testdir1 + mkdir -p ${TEST_DIR1} + MODULE_JAR1=$(find_module_jar_at ${TEST_DIR1} ${MODULE}) + assertEquals "No module jar should be found at empty dir" "" "${MODULE_JAR1}" + + # case 2: SNAPSHOT jar + TEST_FILES=( + "invalid-${MODULE}.jar" + "invalid-${MODULE}-4.8.0.jar" + "invalid-${MODULE}-4.8.0-SNAPSHOT.jar" + "${MODULE}.jar.invalid" + "${MODULE}-4.8.0.jar.invalid" + "${MODULE}-4.8.0-SNAPSHOT.jar.invalid" + "${MODULE}.jar" + "${MODULE}-4.8.0-SNAPSHOT.jar" + ) + + TEST_DIR2=${BK_TMPDIR}/testdir2 + mkdir -p ${TEST_DIR2} + count=0 + while [ "x${TEST_FILES[count]}" != "x" ] + do + touch ${TEST_DIR2}/${TEST_FILES[count]} + count=$(( $count + 1 )) + done + MODULE_JAR2=$(find_module_jar_at ${TEST_DIR2} ${MODULE}) + assertEquals "${MODULE}-4.8.0-SNAPSHOT.jar is not found" "${TEST_DIR2}/${MODULE}-4.8.0-SNAPSHOT.jar" "${MODULE_JAR2}" + + # case 3: release jar + TEST_FILES=( + "invalid-${MODULE}.jar" + "invalid-${MODULE}-4.8.0.jar" + "invalid-${MODULE}-4.8.0-SNAPSHOT.jar" + "${MODULE}.jar.invalid" + "${MODULE}-4.8.0.jar.invalid" + "${MODULE}-4.8.0-SNAPSHOT.jar.invalid" + "${MODULE}.jar" + "${MODULE}-4.8.0.jar" + ) + + TEST_DIR3=${BK_TMPDIR}/testdir3 + mkdir -p ${TEST_DIR3} + count=0 + while [ "x${TEST_FILES[count]}" != "x" ] + do + touch ${TEST_DIR3}/${TEST_FILES[count]} + count=$(( $count + 1 )) + done + MODULE_JAR3=$(find_module_jar_at ${TEST_DIR3} ${MODULE}) + assertEquals "${MODULE}-4.8.0.jar is not found" "${TEST_DIR3}/${MODULE}-4.8.0.jar" "${MODULE_JAR3}" +} + +testFindModuleJar() { + BK_HOME=${BK_TMPDIR} + # prepare the env files + mkdir -p ${BK_HOME}/conf + echo "" > ${BK_HOME}/conf/nettyenv.sh + echo "" > ${BK_HOME}/conf/bkenv.sh + echo "" > ${BK_HOME}/conf/bk_cli_env.sh + + source ${BK_BINDIR}/common_gradle.sh + + MODULE="test-module" + MODULE_PATH="testmodule" + VERSION="4.8.0" + + TEST_FILES=( + "${MODULE}-${VERSION}.jar" + "lib/${MODULE}-${VERSION}.jar" + "${MODULE_PATH}/build/libs/${MODULE}-${VERSION}.jar" + ) + count=0 + while [ "x${TEST_FILES[count]}" != "x" ] + do + DIR=`dirname ${BK_TMPDIR}/${TEST_FILES[count]}` + mkdir -p ${DIR} + touch ${BK_TMPDIR}/${TEST_FILES[count]} + count=$(( $count + 1 )) + done + + count=0 + while [ "x${TEST_FILES[count]}" != "x" ] + do + FILE="${BK_TMPDIR}/${TEST_FILES[count]}" + ACTUAL_FILE=$(find_module_jar ${MODULE_PATH} ${MODULE}) + + assertEquals "Module file is not found" "${FILE}" "${ACTUAL_FILE}" + + # delete the file + rm ${FILE} + count=$(( $count + 1 )) + done + + unset BK_HOME +} + +testLoadEnvfiles() { + BK_HOME=${BK_TMPDIR} + + # prepare the env files + mkdir -p ${BK_HOME}/conf + echo "NETTY_LEAK_DETECTION_LEVEL=enabled" > ${BK_HOME}/conf/nettyenv.sh + echo "BOOKIE_MAX_HEAP_MEMORY=2048M" > ${BK_HOME}/conf/bkenv.sh + echo "CLI_MAX_HEAP_MEMORY=2048M" > ${BK_HOME}/conf/bk_cli_env.sh + + # load the common_gradle.sh + source ${BK_BINDIR}/common_gradle.sh + + assertEquals "NETTY_LEAK_DETECTION_LEVEL is not set correctly" "enabled" "${NETTY_LEAK_DETECTION_LEVEL}" + assertEquals "BOOKIE_MAX_HEAP_MEMORY is not set correctly" "2048M" "${BOOKIE_MAX_HEAP_MEMORY}" + assertEquals "CLI_MAX_HEAP_MEMORY is not set correctly" "2048M" "${CLI_MAX_HEAP_MEMORY}" + + unset NETTY_LEAK_DETECTION_LEVEL + unset BOOKIE_MAX_HEAP_MEMORY + unset CLI_MAX_HEAP_MEMORY + unset BK_HOME +} + +testBuildBookieJVMOpts() { + source ${BK_BINDIR}/common_gradle.sh + + TEST_LOG_DIR=${BK_TMPDIR}/logdir + TEST_GC_LOG_FILENAME="test-gc.log" + ACTUAL_JVM_OPTS=$(build_bookie_jvm_opts ${TEST_LOG_DIR} ${TEST_GC_LOG_FILENAME}) + USEJDK8=$(detect_jdk8) + if [ "$USING_JDK8" -ne "1" ]; then + EXPECTED_JVM_OPTS="-Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g ${DEFAULT_BOOKIE_GC_OPTS} ${DEFAULT_BOOKIE_GC_LOGGING_OPTS} -Xlog:gc=info:file=${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}::filecount=5,filesize=64m" + else + EXPECTED_JVM_OPTS="-Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g ${DEFAULT_BOOKIE_GC_OPTS} ${DEFAULT_BOOKIE_GC_LOGGING_OPTS} -Xloggc:${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}" + fi + assertEquals "JVM OPTS is not set correctly" "${EXPECTED_JVM_OPTS}" "${ACTUAL_JVM_OPTS}" +} + +testBuildCLIJVMOpts() { + source ${BK_BINDIR}/common_gradle.sh + + TEST_LOG_DIR=${BK_TMPDIR}/logdir + TEST_GC_LOG_FILENAME="test-gc.log" + ACTUAL_JVM_OPTS=$(build_cli_jvm_opts ${TEST_LOG_DIR} ${TEST_GC_LOG_FILENAME}) + USEJDK8=$(detect_jdk8) + if [ "$USING_JDK8" -ne "1" ]; then + EXPECTED_JVM_OPTS="-Xms256M -Xmx512M ${DEFAULT_CLI_GC_OPTS} ${DEFAULT_CLI_GC_LOGGING_OPTS} -Xlog:gc=info:file=${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}::filecount=5,filesize=64m" + else + EXPECTED_JVM_OPTS="-Xms256M -Xmx512M ${DEFAULT_CLI_GC_OPTS} ${DEFAULT_CLI_GC_LOGGING_OPTS} -Xloggc:${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}" + fi + assertEquals "JVM OPTS is not set correctly" "${EXPECTED_JVM_OPTS}" "${ACTUAL_JVM_OPTS}" +} + +testBuildNettyOpts() { + source ${BK_BINDIR}/common_gradle.sh + + ACTUAL_NETTY_OPTS=$(build_netty_opts) + EXPECTED_NETTY_OPTS="-Dio.netty.leakDetectionLevel=disabled \ + -Dio.netty.recycler.maxCapacity.default=1000 \ + -Dio.netty.recycler.linkCapacity=1024" + + assertEquals "Netty OPTS is not set correctly" "${EXPECTED_NETTY_OPTS}" "${ACTUAL_NETTY_OPTS}" +} + +testBuildBookieOpts() { + source ${BK_BINDIR}/common_gradle.sh + + ACTUAL_OPTS=$(build_bookie_opts) + EXPECTED_OPTS="-Djava.net.preferIPv4Stack=true" + + assertEquals "Bookie OPTS is not set correctly" "${EXPECTED_OPTS}" "${ACTUAL_OPTS}" +} + +testBuildLoggingOpts() { + TEST_CONF_FILE="test.conf" + TEST_LOG_DIR="test_log_dir" + TEST_LOG_FILE="test_log_file" + TEST_LOGGER="INFO,TEST" + + EXPECTED_OPTS="-Dlog4j.configuration=${TEST_CONF_FILE} \ + -Dbookkeeper.root.logger=${TEST_LOGGER} \ + -Dbookkeeper.log.dir=${TEST_LOG_DIR} \ + -Dbookkeeper.log.file=${TEST_LOG_FILE}" + ACTUAL_OPTS=$(build_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_DIR} ${TEST_LOG_FILE} ${TEST_LOGGER}) + + assertEquals "Logging OPTS is not set correctly" "${EXPECTED_OPTS}" "${ACTUAL_OPTS}" +} + +testBuildCLILoggingOpts() { + TEST_CONF_FILE="test.conf" + TEST_LOG_DIR="test_log_dir" + TEST_LOG_FILE="test_log_file" + TEST_LOGGER="INFO,TEST" + + EXPECTED_OPTS="-Dlog4j.configuration=${TEST_CONF_FILE} \ + -Dbookkeeper.cli.root.logger=${TEST_LOGGER} \ + -Dbookkeeper.cli.log.dir=${TEST_LOG_DIR} \ + -Dbookkeeper.cli.log.file=${TEST_LOG_FILE}" + ACTUAL_OPTS=$(build_cli_logging_opts ${TEST_CONF_FILE} ${TEST_LOG_DIR} ${TEST_LOG_FILE} ${TEST_LOGGER}) + + assertEquals "Logging OPTS is not set correctly" "${EXPECTED_OPTS}" "${ACTUAL_OPTS}" +} + +#------------------------------------------------------------------------------ +# suite functions +# + +oneTimeSetUp() { + bk_oneTimeSetUp +} + +# load and run shUnit2 +. ${BK_SHUNIT} diff --git a/tests/scripts/src/test/bash/gradle/bk_test_helpers b/tests/scripts/src/test/bash/gradle/bk_test_helpers new file mode 100644 index 00000000000..c2fb838ce64 --- /dev/null +++ b/tests/scripts/src/test/bash/gradle/bk_test_helpers @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +# +# vim:et:ft=sh:sts=2:sw=2 +# +#/** +# * Licensed to the Apache Software Foundation (ASF) under one +# * or more contributor license agreements. See the NOTICE file +# * distributed with this work for additional information +# * regarding copyright ownership. The ASF licenses this file +# * to you under the Apache License, Version 2.0 (the +# * "License"); you may not use this file except in compliance +# * with the License. You may obtain a copy of the License at +# * +# * http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# */ + +# name of script +BK_ARGV0=`basename "$0"` + +# path to shUnit2 library. can be overridden by setting BK_SHUNIT_INC. +BK_SHUNIT=${BK_SHUNIT_INC:-../../../../build/libs/lib/shunit2-2.1.7/shunit2} + +# path to bk bin directory. +TESTDIR=`dirname "$0"` +BK_BINDIR=`cd ${TESTDIR}/../../../../../../bin;pwd` +BK_HOMEDIR=`cd ${TESTDIR}/../../../../../..;pwd` +BK_CONFDIR=`cd ${TESTDIR}/../../../../../../conf;pwd` + +# +# test helper functions +# + +# message functions +bk_trace() { echo "bk_test:TRACE $@" >&2; } +bk_debug() { echo "bk_test:DEBUG $@" >&2; } +bk_info() { echo "bk_test:INFO $@" >&2; } +bk_warn() { echo "bk_test:WARN $@" >&2; } +bk_error() { echo "bk_test:ERROR $@" >&2; } +bk_fatal() { echo "bk_test:FATAL $@" >&2; } + +bk_oneTimeSetUp() { + # these will be cleaned up automatically by shunit2 + BK_TMPDIR=${SHUNIT_TMPDIR} + stdoutF="${BK_TMPDIR}/stdout" + stderrF="${BK_TMPDIR}/stderr" + expectedF="${BK_TMPDIR}/expected" +} + +# Assert the success of an operation. +# +# If an operation is not successful (i.e. it returns a non-zero return code) +# dump the output of the stderrF to the screen. +# +# Args: +# message: string: message to output [optional] +# result: integer: operation result +assertSuccess() { + if [ $# -eq 2 ]; then + bk_message_=$1 + shift + else + bk_message_='' + fi + bk_result_=$1 + + assertEquals "${bk_message_}" ${SHUNIT_TRUE} ${bk_result_} + [ ${bk_result_} -eq ${SHUNIT_TRUE} ] || cat "${stderrF}" + + unset bk_message_ bk_result_ +} + +assertError() { + if [ $# -eq 2 ]; then + bk_message_="$1: " + shift + else + bk_message_='' + fi + bk_error_=$1 + + bk_file_=${stderrF} + grep "^bk_test:ERROR.*${bk_error_}" "${bk_file_}" >/dev/null + bk_result_=$? + assertTrue "${bk_message_}missing '${bk_error_}' error" ${bk_result_} + [ ${bk_result_} -eq 0 ] || cat "${bk_file_}" + + unset bk_file_ bk_error_ bk_message_ bk_result_ +} diff --git a/tests/scripts/src/test/bash/gradle/versions b/tests/scripts/src/test/bash/gradle/versions new file mode 100644 index 00000000000..9b868f509df --- /dev/null +++ b/tests/scripts/src/test/bash/gradle/versions @@ -0,0 +1,173 @@ +#!/usr/bin/env bash +# +# vim:et:ft=sh:sts=2:sw=2 +# +#/** +# * Licensed to the Apache Software Foundation (ASF) under one +# * or more contributor license agreements. See the NOTICE file +# * distributed with this work for additional information +# * regarding copyright ownership. The ASF licenses this file +# * to you under the Apache License, Version 2.0 (the +# * "License"); you may not use this file except in compliance +# * with the License. You may obtain a copy of the License at +# * +# * http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# */ + +ARGV0=`basename "$0"` +LSB_RELEASE="/etc/lsb-release" +VERSIONS_SHELLS="/bin/bash /bin/sh" + +true; TRUE=$? +false; FALSE=$? +ERROR=2 + +UNAME_R=`uname -r` +UNAME_S=`uname -s` + +__versions_haveStrings=${ERROR} + +versions_osName() { + os_name_='unrecognized' + os_system_=${UNAME_S} + os_release_=${UNAME_R} + case ${os_system_} in + CYGWIN_NT-*) os_name_='Cygwin' ;; + Darwin) + os_name_=`/usr/bin/sw_vers -productName` + os_version_=`versions_osVersion` + case ${os_version_} in + 10.4|10.4.[0-9]*) os_name_='Mac OS X Tiger' ;; + 10.5|10.5.[0-9]*) os_name_='Mac OS X Leopard' ;; + 10.6|10.6.[0-9]*) os_name_='Mac OS X Snow Leopard' ;; + 10.7|10.7.[0-9]*) os_name_='Mac OS X Lion' ;; + 10.8|10.8.[0-9]*) os_name_='Mac OS X Mountain Lion' ;; + 10.9|10.9.[0-9]*) os_name_='Mac OS X Mavericks' ;; + 10.10|10.10.[0-9]*) os_name_='Mac OS X Yosemite' ;; + 10.11|10.11.[0-9]*) os_name_='Mac OS X El Capitan' ;; + 10.12|10.12.[0-9]*) os_name_='macOS Sierra' ;; + 10.13|10.13.[0-9]*) os_name_='macOS High Sierra' ;; + *) os_name_='macOS' ;; + esac + ;; + FreeBSD) os_name_='FreeBSD' ;; + Linux) os_name_='Linux' ;; + SunOS) + os_name_='SunOS' + if [ -r '/etc/release' ]; then + if grep 'OpenSolaris' /etc/release >/dev/null; then + os_name_='OpenSolaris' + else + os_name_='Solaris' + fi + fi + ;; + esac + + echo ${os_name_} + unset os_name_ os_system_ os_release_ os_version_ +} + +versions_osVersion() { + os_version_='unrecognized' + os_system_=${UNAME_S} + os_release_=${UNAME_R} + case ${os_system_} in + CYGWIN_NT-*) + os_version_=`expr "${os_release_}" : '\([0-9]*\.[0-9]\.[0-9]*\).*'` + ;; + Darwin) + os_version_=`/usr/bin/sw_vers -productVersion` + ;; + FreeBSD) + os_version_=`expr "${os_release_}" : '\([0-9]*\.[0-9]*\)-.*'` + ;; + Linux) + if [ -r '/etc/os-release' ]; then + os_version_=`awk -F= '$1~/PRETTY_NAME/{print $2}' /etc/os-release \ + |sed 's/"//g'` + elif [ -r '/etc/redhat-release' ]; then + os_version_=`cat /etc/redhat-release` + elif [ -r '/etc/SuSE-release' ]; then + os_version_=`head -n 1 /etc/SuSE-release` + elif [ -r "${LSB_RELEASE}" ]; then + if grep -q 'DISTRIB_ID=Ubuntu' "${LSB_RELEASE}"; then + # shellcheck disable=SC2002 + os_version_=`cat "${LSB_RELEASE}" \ + |awk -F= '$1~/DISTRIB_DESCRIPTION/{print $2}' \ + |sed 's/"//g;s/ /-/g'` + fi + fi + ;; + SunOS) + if [ -r '/etc/release' ]; then + if grep 'OpenSolaris' /etc/release >/dev/null; then # OpenSolaris + os_version_=`grep 'OpenSolaris' /etc/release |awk '{print $2"("$3")"}'` + else # Solaris + major_=`echo "${os_release_}" |sed 's/[0-9]*\.\([0-9]*\)/\1/'` + minor_=`grep Solaris /etc/release |sed 's/[^u]*\(u[0-9]*\).*/\1/'` + os_version_="${major_}${minor_}" + fi + fi + ;; + esac + + echo "${os_version_}" + unset os_release_ os_system_ os_version_ major_ minor_ +} + +versions_shellVersion() { + shell_=$1 + + shell_present_=${FALSE} + case "${shell_}" in + ash) [ -x '/bin/busybox' ] && shell_present_=${TRUE} ;; + *) [ -x "${shell_}" ] && shell_present_=${TRUE} ;; + esac + if [ ${shell_present_} -eq ${FALSE} ]; then + echo 'not installed' + return ${FALSE} + fi + + version_='' + case ${shell_} in + */sh) + # This could be one of any number of shells. Try until one fits. + version_='' + [ -z "${version_}" ] && version_=`versions_shell_bash "${shell_}"` + ;; + */bash) version_=`versions_shell_bash "${shell_}"` ;; + *) version_='invalid' + esac + + echo "${version_:-unknown}" + unset shell_ version_ +} + +versions_shell_bash() { + $1 --version : 2>&1 |grep 'GNU bash' |sed 's/.*version \([^ ]*\).*/\1/' +} + +versions_main() { + # Treat unset variables as an error. + set -u + + os_name=`versions_osName` + os_version=`versions_osVersion` + echo "os: ${os_name} version: ${os_version}" + + for shell in ${VERSIONS_SHELLS}; do + shell_version=`versions_shellVersion "${shell}"` + echo "shell: ${shell} version: ${shell_version}" + done +} + +if [ "${ARGV0}" = 'versions' ]; then + versions_main "$@" +fi diff --git a/tests/shaded/bookkeeper-server-shaded-test/build.gradle b/tests/shaded/bookkeeper-server-shaded-test/build.gradle new file mode 100644 index 00000000000..78a05a3bc1e --- /dev/null +++ b/tests/shaded/bookkeeper-server-shaded-test/build.gradle @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + +dependencies { + testImplementation depLibs.slf4j + testImplementation depLibs.junit + testImplementation project(path: ':shaded:bookkeeper-server-shaded', configuration: 'shadow') +} + diff --git a/tests/shaded/bookkeeper-server-tests-shaded-test/build.gradle b/tests/shaded/bookkeeper-server-tests-shaded-test/build.gradle new file mode 100644 index 00000000000..cc6dcd8f488 --- /dev/null +++ b/tests/shaded/bookkeeper-server-tests-shaded-test/build.gradle @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + +dependencies { + testImplementation depLibs.slf4j + testImplementation depLibs.junit + testImplementation depLibs.commonsConfiguration + testImplementation project(path: ':shaded:bookkeeper-server-shaded', configuration: 'shadow') + testImplementation project(path: ':shaded:bookkeeper-server-tests-shaded', configuration: 'shadow') +} + diff --git a/tests/shaded/distributedlog-core-shaded-test/build.gradle b/tests/shaded/distributedlog-core-shaded-test/build.gradle new file mode 100644 index 00000000000..bc783ee7981 --- /dev/null +++ b/tests/shaded/distributedlog-core-shaded-test/build.gradle @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + +dependencies { + testImplementation depLibs.slf4j + testImplementation depLibs.junit + testImplementation depLibs.mockito + testImplementation depLibs.powermockMockito + testImplementation depLibs.powermockJunit + testImplementation depLibs.commonsConfiguration + testImplementation project(path: ':shaded:distributedlog-core-shaded', configuration: 'shadow') +} +