Merge "Logger usage Issue In ScaleManager"
[vfc/nfvo/driver/vnfm/svnfm.git] / huawei / vnfmadapter / VnfmadapterService / service / src / test / java / org / onap / vfc / nfvo / vnfm / svnfm / vnfmadapter / common / restclient / RestfulConfigureTest.java
1 /*
2  * Copyright 2016 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 package org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.common.restclient;
19
20 import static org.junit.Assert.*;
21
22 import java.io.IOException;
23
24 import org.junit.Test;
25
26 import net.sf.json.JSONException;
27
28 public class RestfulConfigureTest {
29
30         @Test
31         public void testRestfulConfigure() {
32                  RestfulConfigure rc = new  RestfulConfigure();
33                  rc.toString();
34         }
35         
36         @Test
37         public void testRestfulConfigureStringNoFilePath() {
38                  RestfulConfigure rc = new  RestfulConfigure("");
39                  RestfulOptions rp = rc.getOptions();
40                  assertTrue(true);
41         }
42
43         @Test
44         public void testRestfulConfigureStringNoFileExist() {
45                  RestfulConfigure rc = new  RestfulConfigure("C:/Users/Public/Desktop");
46                  RestfulOptions rp = rc.getOptions();
47                  assertTrue(true);
48         }
49         
50         @Test
51         public void testRestfulConfigureString() {
52                  RestfulConfigure rc = new  RestfulConfigure("src/test/resources/Check7.txt");
53                  RestfulOptions rp = rc.getOptions();
54                  assertTrue(true);
55         }
56         
57         @Test
58         public void testRestfulConfigureStringNoFile() {
59                  RestfulConfigure rc = new  RestfulConfigure("src/test/resources/Check1.txt");
60                  RestfulOptions rp = rc.getOptions();
61                  assertTrue(true);
62         }
63         
64         @Test
65         public void testRestfulConfigureStringWrongFile() {
66                  RestfulConfigure rc = new  RestfulConfigure("src/test/resources/Check2.txt");
67                  RestfulOptions rp = rc.getOptions();
68                  assertTrue(true);
69         }
70         
71         @Test
72         public void testRestfulConfigureStringEmptyFile() {
73                  RestfulConfigure rc = new  RestfulConfigure("src/test/resources/Check3.txt");
74                  RestfulOptions rp = rc.getOptions();
75                  assertTrue(true);
76         }
77         @Test
78         public void testRestfulConfigureStringNoHostFile() {
79                  RestfulConfigure rc = new  RestfulConfigure("src/test/resources/Check4.txt");
80                  RestfulOptions rp = rc.getOptions();
81                  assertTrue(true);
82         }
83         @Test(expected=JSONException.class)
84         public void testRestfulConfigureStringZeroFile() throws IOException {
85                  RestfulConfigure rc = new  RestfulConfigure("src/test/resources/Check5.txt");
86                  rc.getOptions();
87         }
88         /*@Test
89         public void testRestfulConfigureStringClose()  {
90                  RestfulConfigure rc = new  RestfulConfigure("src/test/resources/Check6.txt");
91                  rc.getOptions();
92         }*/
93 }