当前位置: 首页>>代码示例>>Java>>正文


Java ServerPaths类代码示例

本文整理汇总了Java中jetbrains.buildServer.serverSide.ServerPaths的典型用法代码示例。如果您正苦于以下问题:Java ServerPaths类的具体用法?Java ServerPaths怎么用?Java ServerPaths使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServerPaths类属于jetbrains.buildServer.serverSide包,在下文中一共展示了ServerPaths类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TestEmptyDefaultsConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Test
public void TestEmptyDefaultsConfig(){
    String expectedConfigDirectory = ".";
    ServerPaths serverPaths = mock(ServerPaths.class);
    when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

    MsTeamsNotificationMainSettings whms = new MsTeamsNotificationMainSettings(server, serverPaths);
    whms.register();
    whms.readFrom(getEmptyDefaultsConfigElement());
    String proxy = whms.getProxy();
    MsTeamsNotificationProxyConfig whpc = whms.getProxyConfig();
    assertTrue(proxy.equals(this.proxyHost));
    assertTrue(whpc.getProxyHost().equals(this.proxyHost ));
    assertTrue(whpc.getProxyPort().equals(this.proxyPort));
    assertTrue(whms.getToken().equals(this.token));
    assertTrue(whms.getIconUrl().equals(this.iconUrl));
    assertTrue(whms.getBotName().equals(this.botName));
    assertNull(whms.getShowBuildAgent());
    assertNull(whms.getShowElapsedBuildTime());
    assertTrue(whms.getShowCommits());
    assertEquals(5, whms.getMaxCommitsToDisplay());
    assertNull(whms.getShowFailureReason());

}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:25,代码来源:MsTeamsNotificationMainSettingsTest.java

示例2: test_AuthFailWrongCredsUsingProxyFromConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Ignore
@Test
public void test_AuthFailWrongCredsUsingProxyFromConfig() throws FileNotFoundException, IOException, InterruptedException {
	String expectedConfigDirectory = ".";
	ServerPaths serverPaths = mock(ServerPaths.class);
	when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

	MsTeamsNotificationTest test = new MsTeamsNotificationTest();
	MsTeamsNotificationMainConfig mainConfig = new MsTeamsNotificationMainConfig(serverPaths);
	mainConfig.setProxyHost(test.proxy);
	mainConfig.setProxyPort(test.proxyPort);
	mainConfig.setProxyShortNames(true);
	String url = "http://" + test.webserverHost + ":" + test.webserverPort + "/200";
	MsTeamsNotification w = new MsTeamsNotificationImpl(mainConfig.getProxyConfig());
	// w.setProxyUserAndPass("somethingIncorrect", "somethingIncorrect");
	MsTeamsNotificationTestServer s = test.startWebServer();
	MsTeamsNotificationTestProxyServer p = test.startProxyServerAuth("somthingCorrect", "somethingCorrect");
	w.setEnabled(true);
	w.post();
	test.stopWebServer(s);
	test.stopProxyServer(p);
	assertTrue(w.getStatus() == HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED);
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:24,代码来源:MsTeamsNotificationSettingsTest.java

示例3: test_AuthFailNoCredsUsingProxyFromConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Ignore
@Test
public void test_AuthFailNoCredsUsingProxyFromConfig() throws FileNotFoundException, IOException, InterruptedException {
	String expectedConfigDirectory = ".";
	ServerPaths serverPaths = mock(ServerPaths.class);
	when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

	MsTeamsNotificationTest test = new MsTeamsNotificationTest();
	MsTeamsNotificationMainConfig mainConfig = new MsTeamsNotificationMainConfig(serverPaths);
	mainConfig.setProxyHost(test.proxy);
	mainConfig.setProxyPort(test.proxyPort);
	mainConfig.setProxyShortNames(true);
	String url = "http://" + test.webserverHost + ":" + test.webserverPort + "/200";
	MsTeamsNotification w = new MsTeamsNotificationImpl(mainConfig.getProxyConfig());
	// w.setProxyUserAndPass("somethingIncorrect", "somethingIncorrect");
	MsTeamsNotificationTestServer s = test.startWebServer();
	MsTeamsNotificationTestProxyServer p = test.startProxyServerAuth("somethingCorrect", "somethingCorrect");
	w.setEnabled(true);
	w.post();
	test.stopWebServer(s);
	test.stopProxyServer(p);
	assertTrue(w.getStatus() == HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED);
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:24,代码来源:MsTeamsNotificationSettingsTest.java

示例4: createMockNotification_constructsValidNotification

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Test
public void createMockNotification_constructsValidNotification(){
    String expectedConfigDirectory = ".";
    ServerPaths serverPaths = mock(ServerPaths.class);
    when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

    PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class);

    MsTeamsNotificationMainConfig config = new MsTeamsNotificationMainConfig(serverPaths);

    MsTeamsNotificationPayloadManager payloadManager = new MsTeamsNotificationPayloadManager(sBuildServer);
    MsTeamsNotifierSettingsController controller = new MsTeamsNotifierSettingsController(
            sBuildServer, serverPaths, webControllerManager,
            config, payloadManager, pluginDescriptor);

    MsTeamsNotification notification = controller.createMockNotification("The Bot", "tokenthingy",
            MsTeamsNotificationMainConfig.DEFAULT_ICONURL, 5, true, true, true, true, true, null, null, null, null);

    assertNotNull(notification);
    assertEquals(MsTeamsNotificationMainConfig.DEFAULT_ICONURL, notification.getIconUrl());
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:22,代码来源:MsTeamsNotificationSettingsControllerTest.java

示例5: TelegramSettingsManager

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
public TelegramSettingsManager(@NotNull ServerPaths paths,
                               @NotNull TelegramBotManager botManager)
    throws JDOMException, IOException {

  configDir = Paths.get(paths.getConfigDir()).resolve("_notifications").
      resolve("telegram");
  configFile = configDir.resolve(CONFIG_FILE_NAME);
  this.botManager = botManager;

  initResources();
  reloadConfiguration();

  changeObserver = new FileWatcher(configFile.toFile());
  changeObserver.setSleepingPeriod(10000L);
  changeObserver.registerListener(this);
  changeObserver.start();
}
 
开发者ID:dancing-elf,项目名称:teamcity-telegram-plugin,代码行数:18,代码来源:TelegramSettingsManager.java

示例6: Controller

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
public Controller(@NotNull SBuildServer server,
                  @NotNull PluginDescriptor descriptor,
                  @NotNull ServerPaths serverPaths,
                  @NotNull WebControllerManager manager,
                  @NotNull ServerConfigurations configurations,
                  @NotNull final ProjectManager projectManager,
                  @NotNull ProjectSettingsManager projectSettingsManager) throws IOException {
  manager.registerController(CONTROLLER_PATH, this);
  Controller.configurations = configurations;
  this.myProjectManager = projectManager;
  this.projectSettingsManager = projectSettingsManager;
  this.configFilePath = (new File(serverPaths.getConfigDir(), CONFIG_FILE)).getCanonicalPath();
  this.listPagePath = descriptor.getPluginResourcesPath(LIST_PAGE);
  this.editPagePath = descriptor.getPluginResourcesPath(EDIT_PAGE);
  this.editTemplPagePath = descriptor.getPluginResourcesPath(EDIT_TEMPL_PAGE);
  this.errorPagePath = descriptor.getPluginResourcesPath(ERROR_PAGE);
}
 
开发者ID:IIIEII,项目名称:ServerConfigurations,代码行数:18,代码来源:Controller.java

示例7: TestEmptyDefaultsConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Test
public void TestEmptyDefaultsConfig(){
    String expectedConfigDirectory = ".";
    ServerPaths serverPaths = mock(ServerPaths.class);
    when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

    SlackNotificationMainSettings whms = new SlackNotificationMainSettings(server, serverPaths);
    whms.register();
    whms.readFrom(getEmptyDefaultsConfigElement());
    String proxy = whms.getProxy();
    SlackNotificationProxyConfig whpc = whms.getProxyConfig();
    assertTrue(proxy.equals(this.proxyHost));
    assertTrue(whpc.getProxyHost().equals(this.proxyHost ));
    assertTrue(whpc.getProxyPort().equals(this.proxyPort));
    assertTrue(whms.getDefaultChannel().equals(this.defaultChannel));
    assertTrue(whms.getTeamName().equals(this.teamName));
    assertTrue(whms.getToken().equals(this.token));
    assertTrue(whms.getIconUrl().equals(this.iconUrl));
    assertTrue(whms.getBotName().equals(this.botName));
    assertNull(whms.getShowBuildAgent());
    assertNull(whms.getShowElapsedBuildTime());
    assertTrue(whms.getShowCommits());
    assertEquals(5, whms.getMaxCommitsToDisplay());
    assertNull(whms.getShowFailureReason());

}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:27,代码来源:SlackNotificationMainSettingsTest.java

示例8: test_AuthFailWrongCredsUsingProxyFromConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Ignore
@Test
public void test_AuthFailWrongCredsUsingProxyFromConfig() throws FileNotFoundException, IOException, InterruptedException {
	String expectedConfigDirectory = ".";
	ServerPaths serverPaths = mock(ServerPaths.class);
	when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

	SlackNotificationTest test = new SlackNotificationTest();
	SlackNotificationMainConfig mainConfig = new SlackNotificationMainConfig(serverPaths);
	mainConfig.setProxyHost(test.proxy);
	mainConfig.setProxyPort(test.proxyPort);
	mainConfig.setProxyShortNames(true);
	String url = "http://" + test.webserverHost + ":" + test.webserverPort + "/200";
	SlackNotification w = new SlackNotificationImpl(url, mainConfig.getProxyConfig());
	// w.setProxyUserAndPass("somethingIncorrect", "somethingIncorrect");
	SlackNotificationTestServer s = test.startWebServer();
	SlackNotificationTestProxyServer p = test.startProxyServerAuth("somthingCorrect", "somethingCorrect");
	w.setEnabled(true);
	w.post();
	test.stopWebServer(s);
	test.stopProxyServer(p);
	assertTrue(w.getStatus() == HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED);
}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:24,代码来源:SlackNotificationSettingsTest.java

示例9: test_AuthFailNoCredsUsingProxyFromConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Ignore
@Test
public void test_AuthFailNoCredsUsingProxyFromConfig() throws FileNotFoundException, IOException, InterruptedException {
	String expectedConfigDirectory = ".";
	ServerPaths serverPaths = mock(ServerPaths.class);
	when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

	SlackNotificationTest test = new SlackNotificationTest();
	SlackNotificationMainConfig mainConfig = new SlackNotificationMainConfig(serverPaths);
	mainConfig.setProxyHost(test.proxy);
	mainConfig.setProxyPort(test.proxyPort);
	mainConfig.setProxyShortNames(true);
	String url = "http://" + test.webserverHost + ":" + test.webserverPort + "/200";
	SlackNotification w = new SlackNotificationImpl(url, mainConfig.getProxyConfig());
	// w.setProxyUserAndPass("somethingIncorrect", "somethingIncorrect");
	SlackNotificationTestServer s = test.startWebServer();
	SlackNotificationTestProxyServer p = test.startProxyServerAuth("somethingCorrect", "somethingCorrect");
	w.setEnabled(true);
	w.post();
	test.stopWebServer(s);
	test.stopProxyServer(p);
	assertTrue(w.getStatus() == HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED);
}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:24,代码来源:SlackNotificationSettingsTest.java

示例10: createMockNotification_constructsValidNotification

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Test
public void createMockNotification_constructsValidNotification(){
    String expectedConfigDirectory = ".";
    ServerPaths serverPaths = mock(ServerPaths.class);
    when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

    PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class);

    SlackNotificationMainConfig config = new SlackNotificationMainConfig(serverPaths);

    SlackNotificationPayloadManager payloadManager = new SlackNotificationPayloadManager(sBuildServer);
    SlackNotifierSettingsController controller = new SlackNotifierSettingsController(
            sBuildServer, serverPaths, webControllerManager,
            config, payloadManager, pluginDescriptor);

    SlackNotification notification = controller.createMockNotification("the team", "#general", "The Bot", "tokenthingy",
            SlackNotificationMainConfig.DEFAULT_ICONURL, 5, true, true, true, true, true, null, null, null, null);

    assertNotNull(notification);
    assertEquals("the team", notification.getTeamName());
    assertEquals(SlackNotificationMainConfig.DEFAULT_ICONURL, notification.getIconUrl());
}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:23,代码来源:SlackNotificationSettingsControllerTest.java

示例11: VSONotificatorConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
public VSONotificatorConfig(@NotNull ServerPaths serverPaths) throws IOException {
  final File configDir = new File(serverPaths.getConfigDir(), FreeMarkerHelper.TEMPLATES_ROOT + "/" + Constants.NOTIFICATOR_TYPE);
  configDir.mkdirs();
  myConfigFile = new File(configDir, CONFIG_FILENAME);
  FileUtil.copyResourceIfNotExists(getClass(), "/message_templates/" + CONFIG_FILENAME, myConfigFile);
  reloadConfiguration();

  copyMessageTemplates(configDir);

  myChangeObserver = new FileWatcher(myConfigFile);
  myChangeObserver.setSleepingPeriod(10000);
  myChangeObserver.registerListener(this);
  myChangeObserver.start();

  myConfiguration = FreeMarkerHelper.getConfiguration(serverPaths);
}
 
开发者ID:JetBrains,项目名称:tc-vso-rooms,代码行数:17,代码来源:VSONotificatorConfig.java

示例12: setUp

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@BeforeMethod
public void setUp() throws Exception {

  Mockery m = new Mockery();
  final XmlRpcHandlerManager rpcHandlerManager = m.mock(XmlRpcHandlerManager.class);
  final ExecutorServices executorServices = m.mock(ExecutorServices.class);
  myExecutorService = Executors.newScheduledThreadPool(4);
  final RootUrlHolder rootUrlHolder = m.mock(RootUrlHolder.class);
  m.checking(new Expectations() {{
    allowing(rpcHandlerManager).addHandler(with(any(String.class)), with(any(Object.class)));
    allowing(executorServices).getNormalExecutorService(); will(returnValue(myExecutorService));
    allowing(rootUrlHolder).getRootUrl(); will(returnValue("http://localhost:8111"));
  }});
  myTorrentTrackerManager = new TorrentTrackerManager(
          new TorrentConfigurator(new ServerPaths("/tmp"), rootUrlHolder, rpcHandlerManager),
          executorServices,
          new EventDispatcher<BuildServerListener>(BuildServerListener.class) {
          },
          m.mock(AddressChecker.class)
  );

}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:23,代码来源:TorrentTrackerManagerTest.java

示例13: MsTeamsNotificationMainSettings

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
public MsTeamsNotificationMainSettings(SBuildServer server, ServerPaths serverPaths){
       this.serverPaths = serverPaths;
       Loggers.SERVER.debug(NAME + " :: Constructor called");
	this.server = server;
	msteamsNotificationMainConfig = new MsTeamsNotificationMainConfig(serverPaths);

}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:8,代码来源:MsTeamsNotificationMainSettings.java

示例14: MsTeamsNotificationMainConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
public MsTeamsNotificationMainConfig(ServerPaths serverPaths) {
       this.content = new MsTeamsNotificationContentConfig();
	this.myConfigDir = new File(serverPaths.getConfigDir(), "msteams");
	this.myConfigFile = new File(this.myConfigDir, "msteams-config.xml");
       configFileExists = this.myConfigFile.exists();
	reloadConfiguration();
	this.myChangeObserver = new FileWatcher(this.myConfigFile);
	this.myChangeObserver.setSleepingPeriod(10000L);
	this.myChangeObserver.registerListener(this);
	this.myChangeObserver.start();
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:12,代码来源:MsTeamsNotificationMainConfig.java

示例15: TestFullConfig

import jetbrains.buildServer.serverSide.ServerPaths; //导入依赖的package包/类
@Test
public void TestFullConfig(){
       String expectedConfigDirectory = ".";
       ServerPaths serverPaths = mock(ServerPaths.class);
       when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

	MsTeamsNotificationMainSettings whms = new MsTeamsNotificationMainSettings(server, serverPaths);
	whms.register();
	whms.readFrom(getFullConfigElement());
	String proxy = whms.getProxy();
	MsTeamsNotificationProxyConfig whpc = whms.getProxyConfig();
	assertTrue(proxy.equals(this.proxyHost));
	assertTrue(whpc.getProxyHost().equals(this.proxyHost ));
	assertTrue(whpc.getProxyPort().equals(this.proxyPort));
       assertTrue(whms.getToken().equals(this.token));
       assertTrue(whms.getIconUrl().equals(this.iconUrl));
       assertTrue(whms.getBotName().equals(this.botName));
       assertTrue(whms.getShowBuildAgent());
       assertTrue(whms.getShowElapsedBuildTime());
       assertFalse(whms.getShowCommits());
       assertEquals(15, whms.getMaxCommitsToDisplay());
       assertTrue(whms.getShowFailureReason());

       Credentials credentials = whpc.getCreds();
       
	assertEquals("some-username", credentials.getUserPrincipal().getName());
	assertEquals("some-password", credentials.getPassword());
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:29,代码来源:MsTeamsNotificationMainSettingsTest.java


注:本文中的jetbrains.buildServer.serverSide.ServerPaths类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。