Package com.gitblit.models

Examples of com.gitblit.models.ServerSettings


    assertTrue("No federation sets were retrieved!", sets.size() >= 0);
  }

  @Test
  public void testSettings() throws Exception {
    ServerSettings settings = RpcUtils.getSettings(url, account, password.toCharArray());
    assertNotNull("No settings were retrieved!", settings);
  }
View Full Code Here


  @Test
  public void testUpdateSettings() throws Exception {
    Map<String, String> updated = new HashMap<String, String>();

    // grab current setting
    ServerSettings settings = RpcUtils.getSettings(url, account, password.toCharArray());
    boolean showSizes = settings.get(Keys.web.showRepositorySizes).getBoolean(true);
    showSizes = !showSizes;

    // update setting
    updated.put(Keys.web.showRepositorySizes, String.valueOf(showSizes));
    boolean success = RpcUtils.updateSettings(updated, url, account, password.toCharArray());
    assertTrue("Failed to update server settings", success);

    // confirm setting change
    settings = RpcUtils.getSettings(url, account, password.toCharArray());
    boolean newValue = settings.get(Keys.web.showRepositorySizes).getBoolean(false);
    assertEquals(newValue, showSizes);

    // restore setting
    newValue = !newValue;
    updated.put(Keys.web.showRepositorySizes, String.valueOf(newValue));
    success = RpcUtils.updateSettings(updated, url, account, password.toCharArray());
    assertTrue("Failed to update server settings", success);
    settings = RpcUtils.getSettings(url, account, password.toCharArray());
    showSizes = settings.get(Keys.web.showRepositorySizes).getBoolean(true);
    assertEquals(newValue, showSizes);
  }
View Full Code Here

TOP

Related Classes of com.gitblit.models.ServerSettings

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.