Codota Logo
TestConfigProperty
Code IndexAdd Codota to your IDE (free)

How to use
TestConfigProperty
in
org.chorusbdd.chorus.config

Best Java code snippets using org.chorusbdd.chorus.config.TestConfigProperty (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: Chorus-bdd/Chorus

public boolean hasDefaults() {
  return getDefaults().length > 0;
}
origin: Chorus-bdd/Chorus

/**
 * @return the ConfigurationProperty for which either switchName or switchShortName matches flag
 */
public boolean matchesSwitch(String s) {
  return getSwitchName().equals(s) || getSwitchShortName().equals(s);
}
origin: Chorus-bdd/Chorus

public static List<ConfigurationProperty> getAll() {
  List<ConfigurationProperty> l = new ArrayList<>();
  Collections.addAll(l, values());
  return l;
}
origin: Chorus-bdd/Chorus

@Test
public void testArgWithNoValues() throws InterpreterPropertyException {
  propertyMap = new HashMap<>();
  Map<ConfigurationProperty, List<String>> parsedArgs = new CommandLineParser(TestConfigProperty.getAll()).parseProperties(propertyMap, TEST_ARGS);
  Assert.assertTrue("-showErrors flag not found", parsedArgs.containsKey(TestConfigProperty.SHOW_ERRORS));
}
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

public String getHyphenatedSwitch() {
  return "-" + getSwitchName();
}
origin: Chorus-bdd/Chorus

@Test
public void testArgWithSingleValue() throws InterpreterPropertyException {
  Map<ConfigurationProperty, List<String>> parsedArgs = new CommandLineParser(TestConfigProperty.getAll()).parseProperties(propertyMap, TEST_ARGS);
  List<String> fValues = parsedArgs.get(TestConfigProperty.FEATURE_PATHS);
  Assert.assertEquals("incorrect nunber of -f args found", 1, fValues.size());
}
origin: Chorus-bdd/Chorus

public String toString() {
  return getSwitchName();
}
origin: Chorus-bdd/Chorus

@Test
public void testValueOfWithSingleArg() throws InterpreterPropertyException {
  Map<ConfigurationProperty, List<String>> parsedArgs = new CommandLineParser(TestConfigProperty.getAll()).parseProperties(propertyMap, TEST_ARGS);
  List<String> fValues = parsedArgs.get(TestConfigProperty.FEATURE_PATHS);
  Assert.assertEquals("incorrect value for -f arg found", "file1", fValues.get(0));
}
origin: Chorus-bdd/Chorus

public static ConfigurationProperty getConfigPropertyForSysProp(String systemProperty) {
  ConfigurationProperty result = null;
  for ( ConfigurationProperty p : values()) {
    if ( p.getSystemProperty().equals(systemProperty)) {
      result = p;
      break;
    }
  }
  return result;
}
origin: Chorus-bdd/Chorus

@Test
public void testArgWithMultipleValues() throws InterpreterPropertyException {
  Map<ConfigurationProperty, List<String>> parsedArgs = new CommandLineParser(TestConfigProperty.getAll()).parseProperties(propertyMap, TEST_ARGS);
  Assert.assertTrue("-h flag not found", parsedArgs.containsKey(TestConfigProperty.HANDLER_PACKAGES));
  Assert.assertEquals("wrong number of values found for -h flag", 2, parsedArgs.get(TestConfigProperty.HANDLER_PACKAGES).size());
}
origin: Chorus-bdd/Chorus

@Test
public void testPathsWithHyphens() throws InterpreterPropertyException {
  Map<ConfigurationProperty, List<String>> parsedArgs = new CommandLineParser(TestConfigProperty.getAll()).parseProperties(propertyMap, TEST_PATH_ARG_WITH_INLINE_HYPHEN);
  Assert.assertTrue("-h flag not found", parsedArgs.containsKey(TestConfigProperty.HANDLER_PACKAGES));
  Assert.assertEquals("Not equal to handlers.package-name-with-hyphens-", "handlers.package-name-with-hyphens-", parsedArgs.get(TestConfigProperty.HANDLER_PACKAGES).get(0));
  Assert.assertTrue("-f flag not found", parsedArgs.containsKey(TestConfigProperty.FEATURE_PATHS));
  Assert.assertEquals("Not equal to test.with-hyphen.dir", "test.with-hyphen.dir", parsedArgs.get(TestConfigProperty.FEATURE_PATHS).get(0));
}
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

@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 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 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));
}
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 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));
}
org.chorusbdd.chorus.configTestConfigProperty

Javadoc

Created by IntelliJ IDEA. User: Nick Ebbutt Date: 12/06/12 Time: 08:52 Config properties for testing

Most used methods

  • getAll
  • getDefaults
  • getSwitchName
  • getSwitchShortName
  • getSystemProperty
  • values

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JFrame (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
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