TestPing.java 931 字节
Newer Older
J
JinHai-CN 已提交
1 2
package com;

Z
zhenwu 已提交
3
import io.milvus.client.*;
J
JinHai-CN 已提交
4 5 6 7
import org.testng.annotations.Test;

public class TestPing {
    @Test(dataProvider = "DefaultConnectArgs", dataProviderClass = MainClass.class)
Z
zhenwu 已提交
8
    public void test_server_status(String host, String port) throws ConnectFailedException {
J
JinHai-CN 已提交
9 10 11 12 13 14 15
        System.out.println("Host: "+host+", Port: "+port);
        MilvusClient client = new MilvusGrpcClient();
        ConnectParam connectParam = new ConnectParam.Builder()
                .withHost(host)
                .withPort(port)
                .build();
        client.connect(connectParam);
Z
zhenwu 已提交
16
        Response res = client.getServerStatus();
J
JinHai-CN 已提交
17 18 19 20 21
        assert (res.ok());
    }

    @Test(dataProvider = "DisConnectInstance", dataProviderClass = MainClass.class)
    public void test_server_status_without_connected(MilvusGrpcClient client, String tableName){
Z
zhenwu 已提交
22
        Response res = client.getServerStatus();
J
JinHai-CN 已提交
23 24 25
        assert (!res.ok());
    }
}