Package com.gitblit

Examples of com.gitblit.FileSettings


    assertEquals(AccessRestrictionType.VIEW, AccessRestrictionType.fromName("view"));
  }

  @Test
  public void testFileSettings() throws Exception {
    FileSettings settings = new FileSettings("src/main/distrib/data/gitblit.properties");
    assertEquals(true, settings.getBoolean("missing", true));
    assertEquals("default", settings.getString("missing", "default"));
    assertEquals(10, settings.getInteger("missing", 10));
    assertEquals(5, settings.getInteger("realm.realmFile", 5));

    assertTrue(settings.getBoolean("git.enableGitServlet", false));
    assertEquals("${baseFolder}/users.conf", settings.getString("realm.userService", null));
    assertEquals(5, settings.getInteger("realm.minPasswordLength", 0));
    List<String> mdExtensions = settings.getStrings("web.markdownExtensions");
    assertTrue(mdExtensions.size() > 0);
    assertTrue(mdExtensions.contains("md"));

    List<String> keys = settings.getAllKeys("server");
    assertTrue(keys.size() > 0);
    assertTrue(keys.contains("server.httpsPort"));

    assertTrue(settings.getChar("web.forwardSlashCharacter", ' ') == '/');
  }
View Full Code Here


    if (!localSettings.exists()) {
      extractResources(context, "/WEB-INF/data/", base);
    }

    // delegate all config to baseFolder/gitblit.properties file
    FileSettings fileSettings = new FileSettings(localSettings.getAbsolutePath());

    // merge the stored settings into the runtime settings
    //
    // if runtimeSettings is also a FileSettings w/o a specified target file,
    // the target file for runtimeSettings is set to "localSettings".
View Full Code Here

    // merge the WebXmlSettings into the runtime settings (for backwards-compatibilty)
    runtimeSettings.merge(webxmlSettings);

    // settings are to be stored in openshift/gitblit.properties
    File localSettings = new File(base, "gitblit.properties");
    FileSettings fileSettings = new FileSettings(localSettings.getAbsolutePath());

    // merge the stored settings into the runtime settings
    //
    // if runtimeSettings is also a FileSettings w/o a specified target file,
    // the target file for runtimeSettings is set to "localSettings".
View Full Code Here

    if (!localSettings.exists()) {
      extractResources(context, "/WEB-INF/data/", baseFolder);
    }

    // delegate all config to baseFolder/gitblit.properties file
    FileSettings fileSettings = new FileSettings(localSettings.getAbsolutePath());

    // merge the stored settings into the runtime settings
    //
    // if runtimeSettings is also a FileSettings w/o a specified target file,
    // the target file for runtimeSettings is set to "localSettings".
View Full Code Here

    // merge the WebXmlSettings into the runtime settings (for backwards-compatibilty)
    runtimeSettings.merge(webxmlSettings);

    // settings are to be stored in openshift/gitblit.properties
    File localSettings = new File(base, "gitblit.properties");
    FileSettings fileSettings = new FileSettings(localSettings.getAbsolutePath());

    // merge the stored settings into the runtime settings
    //
    // if runtimeSettings is also a FileSettings w/o a specified target file,
    // the target file for runtimeSettings is set to "localSettings".
View Full Code Here

  private IUserService loadUsers(File folder) {
    File file = new File(folder, "gitblit.properties");
    if (!file.exists()) {
      return null;
    }
    gitblitSettings = new FileSettings(file.getAbsolutePath());
    mail = new MailService(gitblitSettings);
    String us = gitblitSettings.getString(Keys.realm.userService, "${baseFolder}/users.conf");
    String ext = us.substring(us.lastIndexOf(".") + 1).toLowerCase();
    IUserService service = null;
    if (!ext.equals("conf") && !ext.equals("properties") && ext.contains("userservice")) {
View Full Code Here

    assertEquals(AccessRestrictionType.VIEW, AccessRestrictionType.fromName("view"));
  }

  @Test
  public void testFileSettings() throws Exception {
    FileSettings settings = new FileSettings("src/main/distrib/data/gitblit.properties");
    assertEquals(true, settings.getBoolean("missing", true));
    assertEquals("default", settings.getString("missing", "default"));
    assertEquals(10, settings.getInteger("missing", 10));
    assertEquals(5, settings.getInteger("realm.realmFile", 5));

    assertTrue(settings.getBoolean("git.enableGitServlet", false));
    assertEquals("${baseFolder}/users.conf", settings.getString("realm.userService", null));
    assertEquals(5, settings.getInteger("realm.minPasswordLength", 0));
    List<String> mdExtensions = settings.getStrings("web.markdownExtensions");
    assertTrue(mdExtensions.size() > 0);
    assertTrue(mdExtensions.contains("md"));

    List<String> keys = settings.getAllKeys("server");
    assertTrue(keys.size() > 0);
    assertTrue(keys.contains("server.httpsPort"));

    assertTrue(settings.getChar("web.forwardSlashCharacter", ' ') == '/');
  }
View Full Code Here

public class MailTest extends GitblitUnitTest {

  @Test
  public void testSendMail() throws Exception {
    FileSettings settings = new FileSettings("mailtest.properties");
    MailService mail = new MailService(settings);
    Mailing mailing = Mailing.newPlain();
    mailing.setRecipients(settings.getStrings(Keys.mail.adminAddresses));
    Message message = mail.createMessage(mailing);
    message.setSubject("Test");
    message.setText("Lägger till andra stycket i ny fil. UTF-8 encoded");
    mail.queue(message);
    mail.run();
View Full Code Here

TOP

Related Classes of com.gitblit.FileSettings

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.