Browse Source

Remove unnecessary dependencies

jianghua 4 years ago
parent
commit
cca96f37ae
2 changed files with 29 additions and 56 deletions
  1. 22 46
      pom.xml
  2. 7 10
      src/test/java/io/milvus/client/MilvusGrpcClientTest.java

+ 22 - 46
pom.xml

@@ -71,6 +71,7 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <grpc.version>1.30.2</grpc.version>
+        <testcontainers.version>1.14.3</testcontainers.version>
         <protobuf.version>3.11.0</protobuf.version>
         <protoc.version>3.11.0</protoc.version>
         <maven.compiler.source>1.8</maven.compiler.source>
@@ -90,52 +91,21 @@
     </dependencyManagement>
 
     <dependencies>
-        <dependency>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-gpg-plugin</artifactId>
-            <version>1.6</version>
-        </dependency>
-        <dependency>
-            <groupId>io.grpc</groupId>
-            <artifactId>grpc-netty-shaded</artifactId>
-            <version>1.30.2</version>
-            <scope>runtime</scope>
-        </dependency>
         <dependency>
             <groupId>io.grpc</groupId>
             <artifactId>grpc-protobuf</artifactId>
-            <version>1.30.2</version>
+            <version>${grpc.version}</version>
         </dependency>
         <dependency>
             <groupId>io.grpc</groupId>
             <artifactId>grpc-stub</artifactId>
-            <version>1.30.2</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.annotation</groupId>
-            <artifactId>javax.annotation-api</artifactId>
-            <version>1.2</version>
-            <scope>provided</scope> <!-- not needed at runtime -->
-        </dependency>
-        <dependency>
-            <groupId>com.google.protobuf</groupId>
-            <artifactId>protobuf-java-util</artifactId>
-            <version>${protobuf.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.google.errorprone</groupId>
-            <artifactId>error_prone_annotations</artifactId>
-            <version>2.3.4</version> <!-- prefer to use 2.3.3 or later -->
+            <version>${grpc.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-text</artifactId>
-            <version>1.6</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-collections4</artifactId>
-            <version>4.4</version>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-netty-shaded</artifactId>
+            <version>${grpc.version}</version>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>org.json</groupId>
@@ -148,15 +118,15 @@
             <version>1.7.30</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-slf4j-impl</artifactId>
-            <version>2.12.1</version>
-            <scope>test</scope>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.10</version>
         </dependency>
         <dependency>
-            <groupId>io.grpc</groupId>
-            <artifactId>grpc-testing</artifactId>
-            <scope>test</scope>
+            <groupId>javax.annotation</groupId>
+            <artifactId>javax.annotation-api</artifactId>
+            <version>1.2</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.junit.jupiter</groupId>
@@ -167,13 +137,19 @@
         <dependency>
             <groupId>org.testcontainers</groupId>
             <artifactId>testcontainers</artifactId>
-            <version>1.14.3</version>
+            <version>${testcontainers.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.testcontainers</groupId>
             <artifactId>junit-jupiter</artifactId>
-            <version>1.14.3</version>
+            <version>${testcontainers.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <version>2.12.1</version>
             <scope>test</scope>
         </dependency>
     </dependencies>

+ 7 - 10
src/test/java/io/milvus/client/MilvusGrpcClientTest.java

@@ -28,7 +28,7 @@ import io.milvus.client.exception.ClientSideMilvusException;
 import io.milvus.client.exception.ServerSideMilvusException;
 import io.milvus.client.exception.UnsupportedServerVersion;
 import io.milvus.grpc.ErrorCode;
-import org.apache.commons.text.RandomStringGenerator;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.json.JSONArray;
 import org.json.JSONObject;
 import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
@@ -102,8 +102,6 @@ class MilvusClientTest {
 
   private MilvusClient client;
 
-  private RandomStringGenerator generator;
-
   protected String randomCollectionName;
   private int size;
   private int dimension;
@@ -208,8 +206,7 @@ class MilvusClientTest {
     ConnectParam connectParam = connectParamBuilder().build();
     client = new MilvusGrpcClient(connectParam);
 
-    generator = new RandomStringGenerator.Builder().withinRange('a', 'z').build();
-    randomCollectionName = generator.generate(10);
+    randomCollectionName = RandomStringUtils.randomAlphabetic(10);
     size = 100000;
     dimension = 128;
 
@@ -338,7 +335,7 @@ class MilvusClientTest {
 
   @org.junit.jupiter.api.Test
   void dropCollection() {
-    String nonExistingCollectionName = generator.generate(10);
+    String nonExistingCollectionName = RandomStringUtils.randomAlphabetic(10);
     assertErrorCode(ErrorCode.COLLECTION_NOT_EXISTS, () -> client.dropCollection(nonExistingCollectionName));
   }
 
@@ -463,7 +460,7 @@ class MilvusClientTest {
   void insertBinary() {
     final int binaryDimension = 10000;
 
-    String binaryCollectionName = generator.generate(10);
+    String binaryCollectionName = RandomStringUtils.randomAlphabetic(10);
 
     CollectionMapping collectionMapping = CollectionMapping
         .create(binaryCollectionName)
@@ -544,7 +541,7 @@ class MilvusClientTest {
   void searchBinary() {
     final int binaryDimension = 64;
 
-    String binaryCollectionName = generator.generate(10);
+    String binaryCollectionName = RandomStringUtils.randomAlphabetic(10);
     CollectionMapping collectionMapping = CollectionMapping
         .create(binaryCollectionName)
         .addField("int64", DataType.INT64)
@@ -610,7 +607,7 @@ class MilvusClientTest {
       }
     }
 
-    String nonExistingCollectionName = generator.generate(10);
+    String nonExistingCollectionName = RandomStringUtils.randomAlphabetic(10);
     assertErrorCode(ErrorCode.COLLECTION_NOT_EXISTS, () -> client.getCollectionInfo(nonExistingCollectionName));
   }
 
@@ -698,7 +695,7 @@ class MilvusClientTest {
   void getEntityByIDBinary() {
     final int binaryDimension = 64;
 
-    String binaryCollectionName = generator.generate(10);
+    String binaryCollectionName = RandomStringUtils.randomAlphabetic(10);
     CollectionMapping collectionMapping = CollectionMapping
         .create(binaryCollectionName)
         .addVectorField("binary_vec", DataType.VECTOR_BINARY, binaryDimension)