diff --git a/COMPILING.adoc b/COMPILING.adoc index 2d7c8994..1a7d24d7 100644 --- a/COMPILING.adoc +++ b/COMPILING.adoc @@ -27,7 +27,7 @@ under the License. Compiling Sqoop requires the following tools: -* Apache ant (1.9.7) or Gradle (4.9) +* Apache ant (1.9.7) or Gradle (5.4.1) * Java JDK 1.8 Additionally, building the documentation requires these tools: diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 0d4a9516..5c2d1cf0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a95009c3..f4d7b2bf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index cccdd3d5..b0d6d0ab 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed 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. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" diff --git a/gradlew.bat b/gradlew.bat index f9553162..9991c503 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/src/test/org/apache/sqoop/TestSqoopOptions.java b/src/test/org/apache/sqoop/TestSqoopOptions.java index 39d2d7c8..47793825 100644 --- a/src/test/org/apache/sqoop/TestSqoopOptions.java +++ b/src/test/org/apache/sqoop/TestSqoopOptions.java @@ -26,10 +26,12 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Properties; import java.util.Random; import java.util.Set; import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.lang.ArrayUtils; import org.apache.sqoop.manager.oracle.OracleUtils; @@ -918,7 +920,7 @@ private void setFieldToValueIfApplicable(Object target, Field field) throws Exce } private T createAndFill(Class clazz) throws Exception { - T instance = clazz.newInstance(); + T instance = clazz.getConstructor().newInstance(); for(Field field: clazz.getDeclaredFields()) { if (field.getType().equals(clazz) || field.getType().equals(ClassLoader.class) @@ -977,6 +979,9 @@ else if (type.isArray()) { int length = random.nextInt(9) + 1; return Array.newInstance(type.getComponentType(), length); } + else if (type.equals(ConcurrentHashMap.class)) { + return type.getConstructor().newInstance(); + } else if (Number.class.isAssignableFrom(type)) { return random.nextInt(Byte.MAX_VALUE) + 1; } diff --git a/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java b/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java index 14413b1e..982b135c 100644 --- a/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java +++ b/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java @@ -23,9 +23,10 @@ import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Method; +import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.net.URLClassLoader; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -184,22 +185,25 @@ protected static String getClasspath(File confDir) throws URISyntaxException { StringBuilder classpathBuilder = new StringBuilder(64); classpathBuilder.append(confDir.getAbsolutePath()); + for (URL u : getUrlsFromClassPath()) { + append(classpathBuilder, u); + } + return classpathBuilder.toString(); + } - // assume 0 is the system classloader and skip it - for (int i = 1; i < classloaders.size(); i++) { - ClassLoader classLoader = classloaders.get(i); - - if (classLoader instanceof URLClassLoader) { - - for (URL u : ((URLClassLoader) classLoader).getURLs()) { - append(classpathBuilder, u); - } - } else { - throw new IllegalArgumentException("Unknown classloader type : " + classLoader.getClass().getName()); + public static URL[] getUrlsFromClassPath() { + String classpath = System.getProperty("java.class.path"); + String[] entries = classpath.split(File.pathSeparator); + URL[] result = new URL[entries.length]; + for(int i = 0; i < entries.length; i++) { + try { + result[i] = Paths.get(entries[i]).toAbsolutePath().toUri().toURL(); + } + catch (MalformedURLException ex) { + throw new RuntimeException(ex); } } - - return classpathBuilder.toString(); + return result; } private static void append(StringBuilder classpathBuilder, URL url) throws URISyntaxException {