James Moger
2015-11-22 ed552ba47c02779c270ffd62841d6d1048dade70
commit | author | age
db4f6b 1 /*
JM 2  * Copyright 2013 gitblit.com.
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 com.gitblit.tests;
17
18 import com.gitblit.IStoredSettings;
285bfa 19 import com.gitblit.manager.IAuthenticationManager;
db4f6b 20 import com.gitblit.manager.IFederationManager;
bd0e83 21 import com.gitblit.manager.IFilestoreManager;
3a9e76 22 import com.gitblit.manager.IGitblit;
db4f6b 23 import com.gitblit.manager.INotificationManager;
JM 24 import com.gitblit.manager.IProjectManager;
25 import com.gitblit.manager.IRepositoryManager;
26 import com.gitblit.manager.IRuntimeManager;
27 import com.gitblit.manager.IUserManager;
7bf6e1 28 import com.gitblit.servlet.GitblitContext;
db4f6b 29
JM 30
31 public class GitblitUnitTest extends org.junit.Assert {
32
33     public static IStoredSettings settings() {
34         return runtime().getSettings();
35     }
36
37     public static IRuntimeManager runtime() {
7bf6e1 38         return GitblitContext.getManager(IRuntimeManager.class);
db4f6b 39     }
JM 40
41     public static INotificationManager notifier() {
7bf6e1 42         return GitblitContext.getManager(INotificationManager.class);
db4f6b 43     }
JM 44
45     public static IUserManager users() {
7bf6e1 46         return GitblitContext.getManager(IUserManager.class);
db4f6b 47     }
JM 48
04a985 49     public static IAuthenticationManager authentication() {
JM 50         return GitblitContext.getManager(IAuthenticationManager.class);
db4f6b 51     }
JM 52
53     public static IRepositoryManager repositories() {
7bf6e1 54         return GitblitContext.getManager(IRepositoryManager.class);
db4f6b 55     }
JM 56
57     public static IProjectManager projects() {
7bf6e1 58         return GitblitContext.getManager(IProjectManager.class);
db4f6b 59     }
JM 60
61     public static IFederationManager federation() {
7bf6e1 62         return GitblitContext.getManager(IFederationManager.class);
db4f6b 63     }
JM 64
3a9e76 65     public static IGitblit gitblit() {
JM 66         return GitblitContext.getManager(IGitblit.class);
db4f6b 67     }
bd0e83 68     
PM 69     public static IFilestoreManager filestore() {
70         return GitblitContext.getManager(IFilestoreManager.class); 
71     }
db4f6b 72 }