jetbrains.buildServer.serverSide.settings.ProjectSettingsManager Java Examples

The following examples show how to use jetbrains.buildServer.serverSide.settings.ProjectSettingsManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SQSManagerTest.java    From TeamCity.SonarQubePlugin with Apache License 2.0 6 votes vote down vote up
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
    myRoot = mock(SProject.class);
    when(myRoot.getProjectId()).thenReturn(myRootProjectId);
    when(myRoot.getParentProject()).thenReturn(null);

    myProject = mock(SProject.class);
    when(myProject.getProjectId()).thenReturn(myProjectId);
    when(myProject.getParentProject()).thenReturn(myRoot);

    mySettingsManager = mock(ProjectSettingsManager.class);

    myServerInfo = mockSQSInfo(mySettingsManager, myServerId, myProjectId);

    myRootServerInfo = mockSQSInfo(mySettingsManager, myRootServerId, myRootProjectId);
}
 
Example #2
Source File: SQSManagerTest.java    From TeamCity.SonarQubePlugin with Apache License 2.0 5 votes vote down vote up
@NotNull
public static SQSInfo mockSQSInfo(@NotNull final ProjectSettingsManager settingsManager,
                                  @NotNull final String serverId,
                                  @NotNull final String inProject) {
    final SQSProjectSettings t = new SQSProjectSettings();
    final SQSInfo modifiedServer = new XMLBasedSQSInfo(serverId, null, null, null, null, null, null, null);
    t.setInfo(serverId, modifiedServer);
    when(settingsManager.getSettings(inProject, SQSManagerImpl.SQS_MANAGER_KEY)).thenReturn(t);
    return modifiedServer;
}
 
Example #3
Source File: SlackServerAdapter.java    From TCSlackNotifierPlugin with MIT License 5 votes vote down vote up
public SlackServerAdapter(SBuildServer sBuildServer, ProjectManager projectManager, ProjectSettingsManager projectSettingsManager , SlackConfigProcessor configProcessor) {

        this.projectManager = projectManager ;
        this.projectSettingsManager = projectSettingsManager ;
        this.buildServer = sBuildServer ;
        this.slackConfig = configProcessor ;
    }
 
Example #4
Source File: SlackProjectTab.java    From TCSlackNotifierPlugin with MIT License 5 votes vote down vote up
public SlackProjectTab(PagePlaces pagePlaces , ProjectManager projectManager , PluginDescriptor pluginDescriptor , ProjectSettingsManager projectSettingsManager , SlackConfigProcessor slackConfigProcessor)
{
    super("slackNotifierProjectTab","Slack" , pagePlaces , projectManager);
    setIncludeUrl(pluginDescriptor.getPluginResourcesPath("/admin/slackProjectPage.jsp"));

    this.slackConfigProcessor = slackConfigProcessor;
    this.projectSettingsManager = projectSettingsManager ;
}
 
Example #5
Source File: SlackNotificationListener.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
public SlackNotificationListener(SBuildServer sBuildServer, ProjectSettingsManager settings,
                                   SlackNotificationMainSettings configSettings, SlackNotificationPayloadManager manager,
                                   SlackNotificationFactory factory) {

      myBuildServer = sBuildServer;
      mySettings = settings;
      myMainSettings = configSettings;
      myManager = manager;
      slackNotificationFactory = factory;
notificationUtility = new NotificationUtility();
      Loggers.SERVER.info("SlackNotificationListener :: Starting");
  }
 
Example #6
Source File: SlackNotificationAjaxEditPageController.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
public SlackNotificationAjaxEditPageController(SBuildServer server, WebControllerManager webManager,
                                                  ProjectSettingsManager settings, SlackNotificationProjectSettings whSettings, SlackNotificationPayloadManager manager,
                                                  PluginDescriptor pluginDescriptor, SlackNotificationMainSettings mainSettings) {
    super(server);
    myWebManager = webManager;
    myServer = server;
    mySettings = settings;
    myPluginPath = pluginDescriptor.getPluginResourcesPath();
    myManager = manager;
       myMainSettings = mainSettings;
}
 
Example #7
Source File: SlackNotificationAjaxSettingsListPageController.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
public SlackNotificationAjaxSettingsListPageController(SBuildServer server, WebControllerManager webManager,
                                                          ProjectSettingsManager settings, SlackNotificationPayloadManager manager, PluginDescriptor pluginDescriptor,
                                                          SlackNotificationMainSettings mainSettings) {
    super(server);
    myWebManager = webManager;
    myServer = server;
    mySettings = settings;
    myPluginDescriptor = pluginDescriptor;
    myManager = manager;
       myMainSettings = mainSettings;
}
 
Example #8
Source File: SlackNotificationIndexPageController.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
public SlackNotificationIndexPageController(SBuildServer server, WebControllerManager webManager,
                                               ProjectSettingsManager settings, PluginDescriptor pluginDescriptor, SlackNotificationPayloadManager manager,
                                               SlackNotificationMainSettings configSettings) {
    super(server);
    myWebManager = webManager;
    myServer = server;
    mySettings = settings;
    myPluginDescriptor = pluginDescriptor;
    myMainSettings = configSettings;
    myManager = manager;
}
 
Example #9
Source File: SlackNotificationBuildTabExtension.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
protected SlackNotificationBuildTabExtension(
           PagePlaces pagePlaces, ProjectManager projectManager,
           ProjectSettingsManager settings, WebControllerManager manager,
           PluginDescriptor pluginDescriptor) {
	//super(myTitle, myTitle, null, projectManager);
	super(SLACK_NOTIFICATIONS, "Slack", manager, projectManager);
	this.projSettings = settings;
	myPluginPath = pluginDescriptor.getPluginResourcesPath();
}
 
Example #10
Source File: SlackNotificationProjectTabExtension.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
protected SlackNotificationProjectTabExtension(
           PagePlaces pagePlaces, ProjectManager projectManager,
           ProjectSettingsManager settings, PluginDescriptor pluginDescriptor) {
	super("slackNotifications", "Slack", pagePlaces, projectManager);
	this.projSettings = settings;
	myPluginPath = pluginDescriptor.getPluginResourcesPath();
}
 
Example #11
Source File: SQSManagerImpl.java    From TeamCity.SonarQubePlugin with Apache License 2.0 4 votes vote down vote up
public SQSManagerImpl(@NotNull final ProjectSettingsManager settingsManager) {
    mySettingsManager = settingsManager;
    mySettingsManager.registerSettingsFactory(SQS_MANAGER_KEY, this);
}
 
Example #12
Source File: SQSManagerTest.java    From TeamCity.SonarQubePlugin with Apache License 2.0 4 votes vote down vote up
@NotNull
public static SQSManagerImpl getSQSManager(ProjectSettingsManager settingsManager) {
    return new SQSManagerImpl(settingsManager);
}
 
Example #13
Source File: MigratingSQSManagerTest.java    From TeamCity.SonarQubePlugin with Apache License 2.0 4 votes vote down vote up
public void test() {
    ProjectSettingsManager settingsManager = mock(ProjectSettingsManager.class);

    String serverId = "serverId";
    SQSInfo serverInfo = SQSManagerTest.mockSQSInfo(settingsManager, serverId, myProjectId);

    String rootServerId = "rootServerId";
    SQSInfo rootServerInfo = SQSManagerTest.mockSQSInfo(settingsManager, rootServerId, myRootProjectId);

    SQSManagerImpl SQSManager = new SQSManagerImpl(settingsManager);

    final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class);

    final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, SQSManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class));

    BDDAssertions.then(migratingSQSManager.getOwnServer(myRoot, serverId)).isNull();
    BDDAssertions.then(migratingSQSManager.getOwnServer(myRoot, rootServerId)).isNotNull().isSameAs(rootServerInfo);

    BDDAssertions.then(migratingSQSManager.getOwnServer(myProject, serverId)).isNotNull().isSameAs(serverInfo);
    BDDAssertions.then(migratingSQSManager.getOwnServer(myProject, rootServerId)).isNull();

    final BaseSQSInfo replacement = new BaseSQSInfo("newServer");
    when(sqsManagerProjectFeatures.getOwnServer(myProject, serverId)).thenReturn(replacement);
    BDDAssertions.then(migratingSQSManager.getOwnServer(myProject, serverId)).isNotNull().isSameAs(replacement);
}
 
Example #14
Source File: SlackProjectSettingsFactory.java    From TCSlackNotifierPlugin with MIT License 4 votes vote down vote up
public SlackProjectSettingsFactory(ProjectSettingsManager projectSettingsManager)
{
    projectSettingsManager.registerSettingsFactory(SETTINGS_KEY, this);
}
 
Example #15
Source File: TestListener.java    From tcSlackBuildNotifier with MIT License 4 votes vote down vote up
public TestListener(SBuildServer sBuildServer, ProjectSettingsManager settings) {
	myBuildServer = sBuildServer;
	logit("TestListener :: Starting");
}
 
Example #16
Source File: SlackNotificationProjectSettingsFactory.java    From tcSlackBuildNotifier with MIT License 4 votes vote down vote up
public SlackNotificationProjectSettingsFactory(ProjectSettingsManager projectSettingsManager){
	Loggers.SERVER.info("SlackNotificationProjectSettingsFactory :: Registering");
	projectSettingsManager.registerSettingsFactory("slackNotifications", this);
}