diff --git a/pom.xml b/pom.xml index 26c9cb7..a0e4b29 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.qcloud.cos hadoop-cos - 8.3.14 + 8.3.15 jar Apache Hadoop Tencent Cloud COS Support diff --git a/src/test/java/org/apache/hadoop/fs/CosNFileSystemTestBase.java b/src/test/java/org/apache/hadoop/fs/CosNFileSystemTestBase.java index 9f85f77..9df50dc 100644 --- a/src/test/java/org/apache/hadoop/fs/CosNFileSystemTestBase.java +++ b/src/test/java/org/apache/hadoop/fs/CosNFileSystemTestBase.java @@ -1,6 +1,5 @@ package org.apache.hadoop.fs; -import org.apache.commons.lang3.RandomStringUtils; import org.apache.hadoop.conf.Configuration; import org.junit.After; import org.junit.AfterClass; @@ -9,12 +8,15 @@ import java.io.IOException; import java.util.Arrays; +import java.util.Random; +import java.security.SecureRandom; public class CosNFileSystemTestBase extends CosNFileSystemTestWithTimeout { protected static Configuration configuration; protected static FileSystem fs; + static Random random = new Random(); - protected static final Path unittestDirPath = new Path("/unittest-dir" + RandomStringUtils.randomAlphanumeric(8)); + protected static final Path unittestDirPath = new Path("/unittest-dir" + random.nextInt()); protected final Path testDirPath = new Path(unittestDirPath, "test-dir"); protected final Path testFilePath = new Path(unittestDirPath, "test-file"); @@ -87,7 +89,8 @@ protected Path methodPath() throws IOException { */ protected static byte[] getTestData(int size) { byte[] testData = new byte[size]; - System.arraycopy(RandomStringUtils.randomAlphabetic(size).getBytes(), 0, testData, 0, size); + SecureRandom secureRandom = new SecureRandom(); + secureRandom.nextBytes(testData); // 生成随机字节 return testData; }