zhenwu dbd98c267a Update README.md #27
Former-commit-id: a230ef1235fadff6f6403fdc95dbf93fa1b0be3a
2019-10-17 16:55:46 +08:00

25 lines
931 B
Java

package com;
import io.milvus.client.*;
import org.testng.annotations.Test;
public class TestPing {
@Test(dataProvider = "DefaultConnectArgs", dataProviderClass = MainClass.class)
public void test_server_status(String host, String port) throws ConnectFailedException {
System.out.println("Host: "+host+", Port: "+port);
MilvusClient client = new MilvusGrpcClient();
ConnectParam connectParam = new ConnectParam.Builder()
.withHost(host)
.withPort(port)
.build();
client.connect(connectParam);
Response res = client.getServerStatus();
assert (res.ok());
}
@Test(dataProvider = "DisConnectInstance", dataProviderClass = MainClass.class)
public void test_server_status_without_connected(MilvusGrpcClient client, String tableName){
Response res = client.getServerStatus();
assert (!res.ok());
}
}