Package com.typesafe.config

Examples of com.typesafe.config.Config


    public GenerateSolrSequenceKey(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
      super(builder, config, parent, child, context);
      this.baseIdFieldName = getConfigs().getString(config, "baseIdField", Fields.BASE_ID);
      this.preserveExisting = getConfigs().getBoolean(config, "preserveExisting", true);     
     
      Config solrLocatorConfig = getConfigs().getConfig(config, "solrLocator");
      SolrLocator locator = new SolrLocator(solrLocatorConfig, context);
      LOG.debug("solrLocator: {}", locator);
      IndexSchema schema = locator.getIndexSchema();
      SchemaField uniqueKey = schema.getUniqueKeyField();
      uniqueKeyName = uniqueKey == null ? null : uniqueKey.getName();
View Full Code Here


  public void testParseVariables() throws Exception {
    System.setProperty("ENV_ZK_HOST", "zk.foo.com:2181/solr");
    System.setProperty("ENV_SOLR_URL", "http://foo.com:8983/solr/myCollection");
    System.setProperty("ENV_SOLR_LOCATOR", "{ collection : collection1 }");
    try {
      Config override = ConfigFactory.parseString("SOLR_LOCATOR : { collection : fallback } ");
      Config config = parse("test-morphlines/parseVariables", override);
      //System.out.println(config.root().render());
    } finally {
      System.clearProperty("ENV_ZK_HOST");
      System.clearProperty("ENV_SOLR_URL")
      System.clearProperty("ENV_SOLR_LOCATOR");
View Full Code Here

    assertEquals(Arrays.asList(), collector.getRecords());
  }
 
  @Test
  public void testJavaCompilationException() throws Exception {
    Config config = parse("test-morphlines/javaCompilationException");   
    try {
      createMorphline(config);
      fail();
    } catch (MorphlineCompilationException e) {
      assertTrue(e.getMessage().startsWith("Cannot compile script"));
View Full Code Here

    assertSame(record, collector.getFirstRecord());   
  }
 
  @Test
  public void testFindReplace() throws Exception {
    Config override = ConfigFactory.parseString("replaceFirst : false");
    morphline = createMorphline("test-morphlines/findReplace", override);   
    Record record = new Record();
    record.put("text", "hello ic world ic");
    Record expected = new Record();
    expected.put("text", "hello I see world I see");
View Full Code Here

    processAndVerifySuccess(record, expected);
  }
 
  @Test
  public void testFindReplaceWithReplaceFirst() throws Exception {
    Config override = ConfigFactory.parseString("replaceFirst : true");
    morphline = createMorphline("test-morphlines/findReplace", override);   
    Record record = new Record();
    record.put("text", "hello ic world ic");
    Record expected = new Record();
    expected.put("text", "hello I see world ic");
View Full Code Here

    processAndVerifySuccess(record, expected);
  }
 
  @Test
  public void testFindReplaceWithGrok() throws Exception {
    Config override = ConfigFactory.parseString("replaceFirst : false");
    morphline = createMorphline("test-morphlines/findReplaceWithGrok", override);   
    Record record = new Record();
    record.put("text", "hello ic world ic");
    Record expected = new Record();
    expected.put("text", "hello! ic! world! ic!");
View Full Code Here

    processAndVerifySuccess(record, expected);
  }
 
  @Test
  public void testFindReplaceWithGrokWithReplaceFirst() throws Exception {
    Config override = ConfigFactory.parseString("replaceFirst : true");
    morphline = createMorphline("test-morphlines/findReplaceWithGrok", override);   
    Record record = new Record();
    record.put("text", "hello ic world ic");
    Record expected = new Record();
    expected.put("text", "hello! ic world ic");
View Full Code Here

    processAndVerifySuccess(record, expected);
  }
 
  @Test
  public void testConvertTimestampWithBadTimezone() throws Exception {
    Config config = parse("test-morphlines/convertTimestampWithBadTimezone");   
    try {
      createMorphline(config);
      fail();
    } catch (MorphlineCompilationException e) {
      assertTrue(e.getMessage().startsWith("Unknown timezone"));
View Full Code Here

    String overridesStr = "queryParam : " + ConfigUtil.quoteString(paramName);
    if (maxParams >= 0) {
      fileName += "WithMaxParameters";
      overridesStr += "\nmaxParameters : " + maxParams;
    }
    Config override = ConfigFactory.parseString(overridesStr);
    morphline = createMorphline(fileName, override);
    Record record = new Record();
    record.put("in", url);
    Record expectedRecord = new Record();
    expectedRecord.put("in", url);
View Full Code Here

public class ValidatorTest extends Assert {
 
  @Test
  public void testValidatorEnums() {
    Config empty = ConfigFactory.empty();
    NumRequiredMatches param;
   
    param = null;
    param = new Validator<NumRequiredMatches>().validateEnum(empty, "all", NumRequiredMatches.class);
    assertEquals(param, NumRequiredMatches.all);
View Full Code Here

TOP

Related Classes of com.typesafe.config.Config

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.