Tabnine Logo
ConfigPropertyParser.getConfigProperties
Code IndexAdd Tabnine to your IDE (free)

How to use
getConfigProperties
method
in
org.chorusbdd.chorus.handlerconfig.configproperty.ConfigPropertyParser

Best Java code snippets using org.chorusbdd.chorus.handlerconfig.configproperty.ConfigPropertyParser.getConfigProperties (Showing top 13 results out of 315)

origin: Chorus-bdd/Chorus

Map<String, HandlerConfigProperty> getConfigPropertiesByName(Class configClass) throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = getConfigProperties(configClass);
  return properties.stream().collect(toMap(HandlerConfigProperty::getName, identity()));
}
origin: Chorus-bdd/Chorus

@Test(expected = ConfigBuilderException.class)
public void anAnnotationOnAMethodWhichDoesNotStartWithSetThrowsAnException() throws ConfigBuilderException {
  configPropertyParser.getConfigProperties(ConfigBeanWithAnnotationOnMethodWhichDoesNotStartWithSet.class);
}
origin: Chorus-bdd/Chorus

@Test(expected = ConfigBuilderException.class)
public void anAnnotationOnAMethodWithNoArgumentThrowsAnException() throws ConfigBuilderException {
  configPropertyParser.getConfigProperties(ConfigBeanWithAnnotationOnSetterWithNoArgument.class);
}

origin: Chorus-bdd/Chorus

@Test
public void aBeanWithNoAnnotatedMethodsProducesAnEmptyList() throws ConfigBuilderException {
  List properties = configPropertyParser.getConfigProperties(ConfigBeanWithNoAnnotatedProperties.class);
  assertEquals(0, properties.size());
}
origin: Chorus-bdd/Chorus

@Test
public void testDefaultValuesWhichDoNotMatchValidationPatternThrowException() {
  try {
    configPropertyParser.getConfigProperties(ConfigBeanWithADefaultValueWhichDoesNotSatisfyValidation.class);
    fail("Should fail to convert");
  } catch (Exception e) {
    System.out.println(e.getMessage());
    assertEquals("The default value [the other] did not match the validation pattern [(this|that)], for ConfigProperty annotation with name prop", e.getMessage());
  }
}
origin: Chorus-bdd/Chorus

@Test
public void testAValidationPatternWhichCannotCompileThrowsException() {
  try {
    configPropertyParser.getConfigProperties(ConfigBeanWithAValidationPatternWhichCannotBeCompiled.class);
    fail("Should fail to convert");
  } catch (Exception e) {
    System.out.println(e.getMessage());
    assertEquals("The validation pattern '^&*(%' could not be compiled, for ConfigProperty annotation with name prop", e.getMessage());
  }
}
origin: Chorus-bdd/Chorus

@Test
public void testAValidationPatternCanBeSetWithoutADefaultValue() throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = configPropertyParser.getConfigProperties(ConfigBeanWithValidationPatternAndNoDefaultValue.class);
  HandlerConfigProperty p = properties.get(0);
  assertEquals("test.*", p.getValidationPattern().get().pattern());
}

origin: Chorus-bdd/Chorus

@Test
public void testDefaultValuesWhichCannotBeConvertedToJavaTypeThrowsException() {
  try {
    configPropertyParser.getConfigProperties(ConfigBeanWithADefaultValueWhichCannotConvertToJavaType.class);
    fail("Should fail to convert");
  } catch (Exception e) {
    System.out.println(e.getMessage());
    assertEquals("The default value [wibble] did not match the validation pattern [^[-+]?\\d+$], for ConfigProperty annotation with name badDefaultProperty", e.getMessage());
  }
}
origin: Chorus-bdd/Chorus

@Test
public void testConfigSettersWhichHavePrimitiveArgumentAreDescribedUsingTheEquivalentWrapperType() throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = configPropertyParser.getConfigProperties(ConfigBeanWithASetterWithPrimitiveTypeParameter.class);
  assertEquals(1, properties.size());
  HandlerConfigProperty p = properties.get(0);
  assertTrue( p.isMandatory());
}
origin: Chorus-bdd/Chorus

@Test
public void aPropertyCanBeConfiguredNotMandatory() throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = configPropertyParser.getConfigProperties(ConfigBeanPropertyCanBeConfiguredNotMandatory.class);
  assertEquals(1, properties.size());
  HandlerConfigProperty p = properties.get(0);
  assertFalse( p.isMandatory());
}
origin: Chorus-bdd/Chorus

@Test
public void enumFieldsCanBeParsed() throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = configPropertyParser.getConfigProperties(ConfigBeanWithEnumTypes.class);
  assertEquals(1, properties.size());
  HandlerConfigProperty p = properties.get(0);
  assertEquals( p.getJavaType(), Scope.class);
}
origin: Chorus-bdd/Chorus

@Test
public void aPropertyIsMandatoryByDefault() throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = configPropertyParser.getConfigProperties(ConfigBeanWithAValidAnnotation.class);
  assertEquals(1, properties.size());
  HandlerConfigProperty p = properties.get(0);
  assertTrue( p.isMandatory());
}
origin: Chorus-bdd/Chorus

@Test
public void aBeanWithAValidAnnotationReturnsAConfigProperty() throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = configPropertyParser.getConfigProperties(ConfigBeanWithAValidAnnotation.class);
  assertEquals(1, properties.size());
  HandlerConfigProperty p = properties.get(0);
  assertEquals( p.getName(), "myProperty");
  assertEquals( p.getDescription(), "My Property Description");
  assertFalse(p.getValidationPattern().isPresent());
  assertFalse(p.getDefaultValue().isPresent());
}
org.chorusbdd.chorus.handlerconfig.configpropertyConfigPropertyParsergetConfigProperties

Popular methods of ConfigPropertyParser

  • getConfigPropertiesByName
  • addConfigProperty
  • checkValidationMethod
  • compilePattern
  • convertDefaultValue
  • getAnnotationDescription
  • getConverterFunction
  • getDefaultValidationPattern
    Try to create a sensible default for validation pattern, in the case where the java type of the para
  • getMethodsFromConfigClass
  • getValidationMethods
  • getValidationPattern
  • validateDefaultValue
  • getValidationPattern,
  • validateDefaultValue

Popular in Java

  • Start an intent from android
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now