workaroud for snor issue
[vfc/nfvo/wfengine.git] / wso2 / common-util / src / test / java / org / openo / baseservice / bus / util / TestRegisterServiceListener.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 package org.openo.baseservice.bus.util;
17
18 import java.io.File;
19
20 import javax.servlet.ServletContextEvent;
21
22 import org.junit.After;
23 import org.junit.Before;
24 import org.junit.Test;
25
26 import mockit.Mock;
27 import mockit.MockUp;
28
29 public class TestRegisterServiceListener {
30     
31     @Before
32     public void setUp() throws Exception {
33     }
34
35     @After
36     public void tearDown() throws Exception {
37         
38     }
39     
40     @Test
41     public void testRegisterServiceListener() {
42         
43         RegisterServiceListener impl = new RegisterServiceListener();
44         
45         ServletContextEvent sce = null;
46         
47         new MockUp<File>() {
48             @Mock
49             public File[] listFiles() {
50                 File file = new File("");
51                 File[] filelist = new File[]{file};
52                 return filelist;
53             }
54             
55         };
56         
57         impl.contextInitialized(sce);
58     }
59     
60 }