Package com.codingcrayons.aspectfaces.properties

Examples of com.codingcrayons.aspectfaces.properties.PropertyLoader


  private String namePattern;
  private String profilesDelimiter;
  private String userRolesDelimiter;

  public SavingPlugin() throws ConfigurationFileNotFoundException, ConfigurationParsingException {
    PropertyLoader loader = new PropertyLoader(PROPERTIES_FILE);
    outputDirectory = loader.getProperty("output", DEFAULT_OUTPUT_DIRECTORY);
    namePattern = loader.getProperty("name-pattern", DEFAULT_NAME_PATTERN);
    profilesDelimiter = loader.getProperty("profiles-delimiter", DEFAULT_PROFILE_DELIMITER);
    userRolesDelimiter = loader.getProperty("user-roles-delimiter", DEFAULT_USER_ROLES_DELIMITER);
  }
View Full Code Here


   *
   * @throws ConfigurationFileNotFoundException, ConfigurationParsingException
   */
  public static void init() throws ConfigurationFileNotFoundException, ConfigurationParsingException {
    LOGGER.trace("Loading properties from {}.", PROPERTIES_FILE);
    PropertyLoader loader = new PropertyLoader(PROPERTIES_FILE);
    AFWeaver.init(loader);
  }
View Full Code Here

   * @param input - input stream of properties file
   * @throws ConfigurationFileNotFoundException, ConfigurationParsingException
   */
  public static void init(InputStream input) throws ConfigurationFileNotFoundException, ConfigurationParsingException {
    LOGGER.trace("Loading properties from input stream");
    PropertyLoader loader = new PropertyLoader(input);
    AFWeaver.init(loader);
  }
View Full Code Here

    assertEquals(test, "true");
  }

  @Test
  public void testGettingPropertyNotNull() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test=true"));
    String test = loader.getProperty("test");
    assertNotNull(test);
  }
View Full Code Here

    assertNotNull(test);
  }

  @Test
  public void testGettingPropertyNull() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test=true"));
    String test = loader.getProperty("true");
    assertNull(test);
  }
View Full Code Here

    assertNull(test);
  }

  @Test
  public void testNotUsingDefaultValue() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test=true"));
    String test = loader.getProperty("test", "false");
    assertEquals(test, "true");
  }
View Full Code Here

public class PropertyLoaderTest {

  @Test(expectedExceptions = ConfigurationFileNotFoundException.class)
  public void testNullValueOnNonExFile() throws ConfigurationFileNotFoundException, ConfigurationParsingException {
    // non-existing property file
    PropertyLoader loader = new PropertyLoader("wheee");
    // throws here
    String test = loader.getProperty("test");
    assertNull(test);
  }
View Full Code Here

  }

  @Test(expectedExceptions = ConfigurationFileNotFoundException.class)
  public void testDefaultValueOnNonExFile() throws ConfigurationFileNotFoundException, ConfigurationParsingException {
    // non-existing property file
    PropertyLoader loader = new PropertyLoader("wheee");
    // throws here
    String test = loader.getProperty("test", "test");
    assertEquals(test, "test");
  }
View Full Code Here

    assertEquals(test, "test");
  }

  @Test
  public void testNullValue() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test2=true"));
    String test = loader.getProperty("test");
    assertNull(test);
  }
View Full Code Here

    assertNull(test);
  }

  @Test
  public void testDefaultValue() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test2=true"));
    String test = loader.getProperty("test", "test");
    assertEquals(test, "test");
  }
View Full Code Here

TOP

Related Classes of com.codingcrayons.aspectfaces.properties.PropertyLoader

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.