2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2022 Samsung Electronics
\r
6 * =============================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.open.infc.grpc.server;
\r
23 import org.junit.Assert;
\r
24 import org.junit.Test;
\r
26 import java.io.IOException;
\r
28 public class OpenInterfaceGrpcServerTest {
\r
30 private static final String CONF_FILE = "oclip-grpc-server.properties";
\r
31 private static final String CONF_SERVER_PORT = "oclip.grpc_server_port";
\r
32 private static final String CONF_SERVER_HOST = "oclip.grpc_server_host";
\r
35 public void multiInputArgs() throws IOException, InterruptedException{
\r
36 String[] args = {"help"};
\r
37 OpenInterfaceGrpcServer interfaceGrpcServer = new OpenInterfaceGrpcServer();
\r
38 OpenInterfaceGrpcServer.OpenRemoteCli openRemoteCli = new OpenInterfaceGrpcServer.OpenRemoteCli(args);
\r
39 openRemoteCli.setArgs(args);
\r
40 Assert.assertEquals("",openRemoteCli.getResult());
\r
43 @Test(expected=NullPointerException.class)
\r
44 public void invalidNullInputArgs() throws IOException, InterruptedException{
\r
45 OpenInterfaceGrpcServer interfaceGrpcServer = new OpenInterfaceGrpcServer();
\r
46 OpenInterfaceGrpcServer.main(null);
\r
49 @Test(expected=NumberFormatException.class)
\r
50 public void invalidInputArgs() throws IOException, InterruptedException{
\r
51 String[] args = {"test"};
\r
52 OpenInterfaceGrpcServer interfaceGrpcServer = new OpenInterfaceGrpcServer();
\r
53 OpenInterfaceGrpcServer.main(args);
\r