congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HandlerConfigProperty
Code IndexAdd Tabnine to your IDE (free)

How to use
HandlerConfigProperty
in
org.chorusbdd.chorus.handlerconfig.configproperty

Best Java code snippets using org.chorusbdd.chorus.handlerconfig.configproperty.HandlerConfigProperty (Showing top 8 results out of 315)

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());
}
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 primitiveTypedPropertiesGetDefaultValidation() throws ConfigBuilderException {
  Map<String, HandlerConfigProperty> m = configPropertyParser.getConfigPropertiesByName(ConfigBeanWithPrimitiveTypedProperties.class);
  assertEquals("^[-+]?\\d+$", m.get("integerProperty").getValidationPattern().get().pattern());
  assertEquals("^[-+]?\\d+$", m.get("longProperty").getValidationPattern().get().pattern());
  assertEquals("^[-+]?\\d+$", m.get("shortProperty").getValidationPattern().get().pattern());
  assertEquals("^[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?$", m.get("floatProperty").getValidationPattern().get().pattern());
  assertEquals("^[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?$", m.get("doubleProperty").getValidationPattern().get().pattern());
  assertEquals("(?i)^true|false$", m.get("booleanProperty").getValidationPattern().get().pattern());
  assertEquals("^\\S$", m.get("charProperty").getValidationPattern().get().pattern());
}
origin: Chorus-bdd/Chorus

@Test
public void defaultValuesCanBeConvertedToSimpleTypes() throws ConfigBuilderException {
  Map<String, HandlerConfigProperty> m = configPropertyParser.getConfigPropertiesByName(ConfigBeanWithPrimitiveTypedProperties.class);
  assertEquals(7, m.size());
  assertEquals(1, m.get("integerProperty").getDefaultValue().get());
  assertEquals(1000000L, m.get("longProperty").getDefaultValue().get());
  assertEquals(1.23d, m.get("doubleProperty").getDefaultValue().get());
  assertEquals(2.34f, m.get("floatProperty").getDefaultValue().get());
  assertEquals(true, m.get("booleanProperty").getDefaultValue().get());
  assertEquals('C', m.get("charProperty").getDefaultValue().get());
  assertEquals((short)9, m.get("shortProperty").getDefaultValue().get());
}
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 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 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 aPropertyIsMandatoryByDefault() throws ConfigBuilderException {
  List<HandlerConfigProperty> properties = configPropertyParser.getConfigProperties(ConfigBeanWithAValidAnnotation.class);
  assertEquals(1, properties.size());
  HandlerConfigProperty p = properties.get(0);
  assertTrue( p.isMandatory());
}
org.chorusbdd.chorus.handlerconfig.configpropertyHandlerConfigProperty

Most used methods

  • getDefaultValue
  • getDescription
  • getJavaType
  • getName
  • getValidationPattern
  • isMandatory

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • JFrame (javax.swing)
  • JList (javax.swing)
  • From CI to AI: The AI layer in your organization
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