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.

BranchTicketServiceTest.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.BranchTicketService;
  28. import com.gitblit.tickets.ITicketService;
  29. /**
  30. * Tests the branch ticket service.
  31. *
  32. * @author James Moger
  33. *
  34. */
  35. public class BranchTicketServiceTest extends TicketServiceTest {
  36. final RepositoryModel repo = new RepositoryModel("tickets/branch.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. BranchTicketService service = new BranchTicketService(
  49. runtimeManager,
  50. notificationManager,
  51. userManager,
  52. repositoryManager).start();
  53. if (deleteAll) {
  54. service.deleteAll(getRepository());
  55. }
  56. return service;
  57. }
  58. }