+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP : APPC\r
+ * ================================================================================\r
+ * Copyright (C) 2022 Samsung Electronics\r
+ * =============================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.open.infc.grpc.server;\r
+\r
+import org.junit.Assert;\r
+import org.junit.Test;\r
+\r
+import java.io.IOException;\r
+\r
+public class OpenInterfaceGrpcServerTest {\r
+\r
+ private static final String CONF_FILE = "oclip-grpc-server.properties";\r
+ private static final String CONF_SERVER_PORT = "oclip.grpc_server_port";\r
+ private static final String CONF_SERVER_HOST = "oclip.grpc_server_host";\r
+\r
+ @Test\r
+ public void multiInputArgs() throws IOException, InterruptedException{\r
+ String[] args = {"help"};\r
+ OpenInterfaceGrpcServer interfaceGrpcServer = new OpenInterfaceGrpcServer();\r
+ OpenInterfaceGrpcServer.OpenRemoteCli openRemoteCli = new OpenInterfaceGrpcServer.OpenRemoteCli(args);\r
+ openRemoteCli.setArgs(args);\r
+ Assert.assertEquals("",openRemoteCli.getResult());\r
+ }\r
+\r
+ @Test(expected=NullPointerException.class)\r
+ public void invalidNullInputArgs() throws IOException, InterruptedException{\r
+ OpenInterfaceGrpcServer interfaceGrpcServer = new OpenInterfaceGrpcServer();\r
+ OpenInterfaceGrpcServer.main(null);\r
+ }\r
+\r
+ @Test(expected=NumberFormatException.class)\r
+ public void invalidInputArgs() throws IOException, InterruptedException{\r
+ String[] args = {"test"};\r
+ OpenInterfaceGrpcServer interfaceGrpcServer = new OpenInterfaceGrpcServer();\r
+ OpenInterfaceGrpcServer.main(args);\r
+ }\r
+}\r