You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FileTicketServiceTest.java 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2014 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. import com.gitblit.IStoredSettings;
  18. import com.gitblit.manager.INotificationManager;
  19. import com.gitblit.manager.IRepositoryManager;
  20. import com.gitblit.manager.IRuntimeManager;
  21. import com.gitblit.manager.IUserManager;
  22. import com.gitblit.manager.NotificationManager;
  23. import com.gitblit.manager.RepositoryManager;
  24. import com.gitblit.manager.RuntimeManager;
  25. import com.gitblit.manager.UserManager;
  26. import com.gitblit.models.RepositoryModel;
  27. import com.gitblit.tickets.FileTicketService;
  28. import com.gitblit.tickets.ITicketService;
  29. /**
  30. * Tests the file ticket service.
  31. *
  32. * @author James Moger
  33. *
  34. */
  35. public class FileTicketServiceTest extends TicketServiceTest {
  36. final RepositoryModel repo = new RepositoryModel("tickets/file.git", null, null, null);
  37. @Override
  38. protected RepositoryModel getRepository() {
  39. return repo;
  40. }
  41. @Override
  42. protected ITicketService getService(boolean deleteAll) throws Exception {
  43. IStoredSettings settings = getSettings(deleteAll);
  44. IRuntimeManager runtimeManager = new RuntimeManager(settings).start();
  45. INotificationManager notificationManager = new NotificationManager(settings).start();
  46. IUserManager userManager = new UserManager(runtimeManager).start();
  47. IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, userManager).start();
  48. FileTicketService service = new FileTicketService(
  49. runtimeManager,
  50. notificationManager,
  51. userManager,
  52. repositoryManager).start();
  53. if (deleteAll) {
  54. service.deleteAll(getRepository());
  55. }
  56. return service;
  57. }
  58. }