2 * Copyright 2016-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.
16 package org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.adapter.impl;
18 import static org.junit.Assert.assertTrue;
20 import java.io.IOException;
22 import org.junit.Ignore;
23 import org.junit.Test;
24 import org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.adapter.impl.JujuClientManager;
28 import net.sf.json.JSONObject;
30 public class JujuClientManagerTest {
33 public void testdeploy() {
34 JujuClientManager jujuClientManager = new JujuClientManager();
35 JSONObject json = jujuClientManager.deploy("charmPath", "appName");
36 assertTrue(json != null);
40 public void testdeploy3() {
41 new MockUp<ProcessBuilder>() {
43 public Process start() throws IOException {
44 Process process = new ProcessMockImpl();
48 JujuClientManager jujuClientManager = new JujuClientManager();
49 JSONObject json = jujuClientManager.deploy("charmPath","appName");
50 assertTrue(json != null);
54 public void testdeploy1() {
56 JujuClientManager jujuClientManager = new JujuClientManager();
57 JSONObject json = jujuClientManager.deploy("charmPath", null);
58 assertTrue(json != null);
62 public void testdeploy2() {
64 JujuClientManager jujuClientManager = new JujuClientManager();
65 JSONObject json = jujuClientManager.deploy(null, null);
66 assertTrue(json != null);
71 public void testdestroy() {
73 JujuClientManager jujuClientManager = new JujuClientManager();
74 JSONObject json = jujuClientManager.destroy("appName");
75 assertTrue(json != null);
79 public void testdestroy1() {
80 new MockUp<ProcessBuilder>() {
82 public Process start() throws IOException {
83 Process process = new ProcessMockImpl();
87 JujuClientManager jujuClientManager = new JujuClientManager();
88 JSONObject json = jujuClientManager.destroy("appName");
89 assertTrue(json != null);
93 public void testgetStatus() {
95 JujuClientManager jujuClientManager = new JujuClientManager();
96 JSONObject json = jujuClientManager.getStatus("appName");
97 assertTrue(json != null);
101 public void testgetStatus1() {
103 JujuClientManager jujuClientManager = new JujuClientManager();
104 JSONObject json = jujuClientManager.getStatus("");
105 assertTrue(json != null);
109 public void testgetStatus2() {
110 new MockUp<ProcessBuilder>() {
112 public Process start() throws IOException {
113 Process process = new ProcessMockImpl();
118 JujuClientManager jujuClientManager = new JujuClientManager();
119 JSONObject json = jujuClientManager.getStatus("");
120 assertTrue(json != null);
123 public void testParseYaml(){
124 JujuClientManager jujuClientManager = new JujuClientManager();
125 jujuClientManager.parseYaml("abc/efg", "mediawiki.yaml", "addResource");