2 * Copyright 2017 Huawei Technologies Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.openo.nfvo.vnfmadapter.service.csm.connect;
19 import org.apache.commons.httpclient.params.HttpConnectionParams;
20 import org.junit.Test;
21 import org.openo.nfvo.vnfmadapter.common.VnfmException;
23 import java.io.IOException;
26 * Created by QuanZhong on 2017/3/20.
28 public class SslCertificateSocketTest {
30 public void initTest(){
31 SslCertificateSocket socket = new SslCertificateSocket();
34 } catch (VnfmException e) {
39 public void createSocketTest(){
40 SslCertificateSocket socket = new SslCertificateSocket();
42 socket.createSocket("http://127.0.0.1",1234);
43 } catch (IOException e) {
49 public void createSocketTest2(){
50 SslCertificateSocket socket = new SslCertificateSocket();
52 socket.createSocket("http://127.0.0.1",1234,null,4321,null);
53 } catch (IOException e) {
58 public void createSocketTest3(){
59 SslCertificateSocket socket = new SslCertificateSocket();
61 HttpConnectionParams params = new HttpConnectionParams();
62 params.setConnectionTimeout(0);
63 socket.createSocket("http://127.0.0.1",1234,null,4321,params);
64 } catch (IOException e) {
69 public void createSocketTest4(){
70 SslCertificateSocket socket = new SslCertificateSocket();
72 HttpConnectionParams params = new HttpConnectionParams();
73 params.setConnectionTimeout(3000);
74 socket.createSocket("http://127.0.0.1",1234,null,4321,params);
75 } catch (IOException e) {