Package org.sonar.api.platform

Examples of org.sonar.api.platform.Server


  PersistentSettings persistentSettings = mock(PersistentSettings.class);

  @Test
  public void testSaveProperties() throws ParseException {
    Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse("2010-05-18 17:59");
    Server server = mock(Server.class);
    when(server.getPermanentServerId()).thenReturn("1abcdef");
    when(server.getId()).thenReturn("123");
    when(server.getVersion()).thenReturn("3.2");
    when(server.getStartedAt()).thenReturn(date);
    ServerMetadataPersister persister = new ServerMetadataPersister(server, persistentSettings);
    persister.start();

    verify(persistentSettings).saveProperties(argThat(new ArgumentMatcher<Map<String, String>>() {
      @Override
View Full Code Here


  String path = "http://sonar";
  MacroInterpreter interpreter;

  @Before
  public void setUp() {
    Server server = mock(Server.class);
    when(server.getContextPath()).thenReturn(path);
    interpreter = new MacroInterpreter(server);
  }
View Full Code Here

    }
  }

  @Test
  public void userAgentIsSonarVersion() throws URISyntaxException, IOException {
    Server server = mock(Server.class);
    when(server.getVersion()).thenReturn("2.2");

    InputStream stream = new HttpDownloader(server, new Settings()).openStream(new URI(baseUrl));
    Properties props = new Properties();
    props.load(stream);
    stream.close();
View Full Code Here

TOP

Related Classes of org.sonar.api.platform.Server

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.