2 * Copyright 2016 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.openo.baseservice.bus.util;
19 import java.io.FileInputStream;
20 import java.io.IOException;
22 import javax.ws.rs.core.Response;
24 import org.junit.After;
25 import org.junit.Before;
26 import org.junit.Test;
27 import org.openo.baseservice.util.impl.SystemEnvVariablesDefImpl;
29 import junit.framework.Assert;
33 public class TestRegisterService {
35 public void setUp() throws Exception {
39 public void tearDown() throws Exception {
44 public void testregisterServce() throws IOException {
46 File file = new File("");
49 final String path = file.getAbsolutePath();
51 new MockUp<SystemEnvVariablesDefImpl>() {
53 public String getAppRoot() {
59 res = RegisterService.registerService(path, true);
60 } catch(Exception e) {
61 Assert.assertNotNull(e);