Codota Logo
ConfigReader.readConfiguration
Code IndexAdd Codota to your IDE (free)

How to use
readConfiguration
method
in
org.chorusbdd.chorus.config.ConfigReader

Best Java code snippets using org.chorusbdd.chorus.config.ConfigReader.readConfiguration (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: Chorus-bdd/Chorus

@Test
public void appendPropertyMayBeSetFromMultipleSources() throws InterpreterPropertyException {
  ConfigurationProperty propertyWithMinValues = new TestProperty(TestConfigProperty.HANDLER_PACKAGES) {
    public PropertySourceMode getPropertySourceMode() {
      return PropertySourceMode.APPEND;
    }
  };
  try {
    System.setProperty("chorusHandlerPackages", "secondvalue");
    ConfigReader c = new ConfigReader(Collections.singletonList(propertyWithMinValues), new String[] { "-h", "onevalue" });
    c.readConfiguration();
    List<String> values = c.getValues(propertyWithMinValues);
    assertEquals("property value count", 2, values.size());
  } finally {
    System.clearProperty("chorusHandlerPackages");
  }
}
origin: Chorus-bdd/Chorus

@Test
public void testCannotSetLessThanMinimumValues() {
  ConfigurationProperty propertyWithMinValues = new TestProperty(TestConfigProperty.HANDLER_PACKAGES) {
    public int getMinValueCount() {
      return 2;
    }
  };
  ConfigReader c = new ConfigReader(Collections.singletonList(propertyWithMinValues), new String[] { "-h", "onevalue" });
  try {
    c.readConfiguration();
  } catch (InterpreterPropertyException e) {
    assertTrue("contains At Least 2", e.getMessage().contains("At least 2 value(s) must be supplied"));
    return;
  }
  fail("Must complain when less than min vals set");
}
origin: Chorus-bdd/Chorus

@Test
public void testCannotSetMoreThanMaxValues() {
  ConfigurationProperty propertyWithMinValues = new TestProperty(TestConfigProperty.HANDLER_PACKAGES) {
    public int getMaxValueCount() {
      return 1;
    }
  };
  ConfigReader c = new ConfigReader(Collections.singletonList(propertyWithMinValues), new String[] { "-h", "onevalue", "twovalues" });
  try {
    c.readConfiguration();
  } catch (InterpreterPropertyException e) {
    assertTrue("contains At Most 1", e.getMessage().contains("At most 1 value(s) must be supplied"));
    return;
  }
  fail("Must complain when more than max vals set");
}
origin: Chorus-bdd/Chorus

@Test
public void mandatoryPropertyMustBeSet() {
  System.clearProperty(TestConfigProperty.FEATURE_PATHS.getSystemProperty());  //in case set
  String[] switches = new String[] { "-d" };
  ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches);
  try {
    c.readConfiguration();
  } catch (InterpreterPropertyException e) {
    assertTrue(e.getMessage().contains("Mandatory property featurePaths was not set"));
    return;
  }
  fail("Must require mandatory -f property value");
}
origin: Chorus-bdd/Chorus

@Test
public void testADefaultValueDoesNotGetSetIfNoDefaultDefined() throws InterpreterPropertyException {
  String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus" };
  ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches);
  c.readConfiguration();
  assertTrue(! c.isSet(TestConfigProperty.TAG_EXPRESSION));
}
origin: Chorus-bdd/Chorus

public Chorus(String[] args) throws InterpreterPropertyException {
  //*********  To set up config and logging / output
  configReader = new ConfigReader(ChorusConfigProperty.getAll(), args);
  configReader.readConfiguration();
  outputAndLoggingConfigurer = new OutputAndLoggingConfigurer();
  configureOutputAndLogging();
  //*********  After config and logging / output is set up
  subsystemManager = new SubsystemManagerImpl();
  //add custom execution listeners before subsystem listeners
  //guarantees user listener will have their callbacks before subsystems
  addCustomExecutionListeners();
  configureSubsystems();
  //configure logging first
  interpreterBuilder = new InterpreterBuilder(listenerSupport);
  interpreter = interpreterBuilder.buildAndConfigure(configReader, subsystemManager);
  featureListBuilder = new FeatureListBuilder();
}
origin: Chorus-bdd/Chorus

@Test
public void testBooleanSwitchUsingShortName() throws InterpreterPropertyException {
  String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-d" };
  ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches);
  c.readConfiguration();
  assertTrue(c.isTrue(TestConfigProperty.DRY_RUN));
  assertTrue(c.isSet(TestConfigProperty.DRY_RUN));
}
origin: Chorus-bdd/Chorus

@Test
public void testBooleanSwitchWithValue() throws InterpreterPropertyException {
  String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-dryrun", "true" };
  ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches);
  c.readConfiguration();
  assertTrue(c.isTrue(TestConfigProperty.DRY_RUN));
  assertTrue(c.isSet(TestConfigProperty.DRY_RUN));
}
origin: Chorus-bdd/Chorus

@Test
public void testDefaultValueGetsSetIfAvailable() throws InterpreterPropertyException {
  String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus" };
  ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches);
  c.readConfiguration();
  assertTrue(! c.isTrue(TestConfigProperty.DRY_RUN));
  assertTrue(c.isSet(TestConfigProperty.DRY_RUN));
}
origin: Chorus-bdd/Chorus

@Test
public void testBooleanSwitchCanBeSetFalse() throws InterpreterPropertyException {
  String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-dryrun", "false" };
  ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches);
  c.readConfiguration();
  assertTrue(! c.isTrue(TestConfigProperty.DRY_RUN));
  assertTrue(c.isSet(TestConfigProperty.DRY_RUN));
}
origin: Chorus-bdd/Chorus

@Test
public void testBooleanSwitchWithoutValue() throws InterpreterPropertyException {
  String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-dryrun" };
  ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches);
  c.readConfiguration();
  assertTrue(c.isTrue(TestConfigProperty.DRY_RUN));
  assertTrue(c.isSet(TestConfigProperty.DRY_RUN));
}
org.chorusbdd.chorus.configConfigReaderreadConfiguration

Popular methods of ConfigReader

  • isSet
  • <init>
    Create a configuration using process arguments, System Properties and defaults
  • getValue
  • getValues
  • checkIfMandatory
  • checkValueCount
  • checkValues
  • getOrCreatePropertyValues
  • isTrue
    for boolean properties, is the property set true
  • mergeProperties
  • mergeValues
  • validateProperties
  • mergeValues,
  • validateProperties

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now