2 * Copyright (c) 2016, Huawei Technologies Co., Ltd.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package org.openo.gso.gui.servicegateway.roa.impl;
\r
19 import static org.junit.Assert.assertNotNull;
\r
21 import java.io.IOException;
\r
22 import java.io.Reader;
\r
23 import java.sql.Connection;
\r
24 import java.sql.SQLException;
\r
26 import javax.servlet.http.HttpServletRequest;
\r
28 import org.apache.ibatis.io.Resources;
\r
29 import org.apache.ibatis.jdbc.ScriptRunner;
\r
30 import org.apache.ibatis.session.SqlSession;
\r
31 import org.apache.ibatis.session.SqlSessionFactory;
\r
32 import org.apache.ibatis.session.SqlSessionFactoryBuilder;
\r
33 import org.junit.After;
\r
34 import org.junit.Before;
\r
35 import org.junit.Test;
\r
36 import org.openo.baseservice.remoteservice.exception.ServiceException;
\r
37 import org.openo.gso.gui.servicegateway.service.impl.ServiceGatewayImpl;
\r
40 * Test ServicemgrRoaModuleImpl class.<br/>
\r
45 * @version GSO 0.5 2016/8/3
\r
47 public class ServiceGatewayRoaModuleImplTest {
\r
52 ServiceGatewayRoaModuleImpl serviceRoa = new ServiceGatewayRoaModuleImpl();
\r
57 ServiceGatewayImpl serviceManager = new ServiceGatewayImpl();
\r
63 HttpServletRequest httpRequest;
\r
66 * Before executing UT, start sql.<br/>
\r
71 public void start() throws IOException, SQLException {
\r
78 * After executing UT, close session<br/>
\r
83 public void stop() {
\r
88 * Test create service.<br/>
\r
90 * @throws ServiceException when fail to operate database or parameter is wrong.
\r
94 public void testCreateService() throws ServiceException {
\r
99 * Test delete service.<br/>
\r
101 * @throws ServiceException when fail to operate database or parameter is wrong.
\r
105 public void testTeleteService() throws ServiceException {
\r
106 serviceRoa.deleteService("1", httpRequest);
\r