Package org.springframework.core.convert.support

Examples of org.springframework.core.convert.support.DefaultConversionService


  }

  @Test
  public void testBindCaseInsensitiveEnumsWithConverter() throws Exception {
    VanillaTarget target = new VanillaTarget();
    this.conversionService = new DefaultConversionService();
    doTestBindCaseInsensitiveEnums(target);
  }
View Full Code Here


  private RelaxedDataBinder binder = new RelaxedDataBinder(this.security, "security");

  @Before
  public void init() {
    this.binder.setIgnoreUnknownFields(false);
    this.binder.setConversionService(new DefaultConversionService());
  }
View Full Code Here

  @Test
  public void testBindingCommandRefreshInterval() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    binder.bind(new MutablePropertyValues(Collections.singletonMap(
        "shell.command_refresh_interval", "1")));
    assertFalse(binder.getBindingResult().hasErrors());
    assertEquals(1, props.getCommandRefreshInterval());
  }
View Full Code Here

  @Test
  public void testBindingCommandPathPatterns() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    binder.bind(new MutablePropertyValues(Collections.singletonMap(
        "shell.command_path_patterns", "pattern1, pattern2")));
    assertFalse(binder.getBindingResult().hasErrors());
    assertEquals(2, props.getCommandPathPatterns().length);
    Assert.assertArrayEquals(new String[] { "pattern1", "pattern2" },
View Full Code Here

  @Test
  public void testBindingConfigPathPatterns() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    binder.bind(new MutablePropertyValues(Collections.singletonMap(
        "shell.config_path_patterns", "pattern1, pattern2")));
    assertFalse(binder.getBindingResult().hasErrors());
    assertEquals(2, props.getConfigPathPatterns().length);
    Assert.assertArrayEquals(new String[] { "pattern1", "pattern2" },
View Full Code Here

  @Test
  public void testBindingDisabledPlugins() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    binder.bind(new MutablePropertyValues(Collections.singletonMap(
        "shell.disabled_plugins", "pattern1, pattern2")));
    assertFalse(binder.getBindingResult().hasErrors());
    assertEquals(2, props.getDisabledPlugins().length);
    assertArrayEquals(new String[] { "pattern1", "pattern2" },
View Full Code Here

  @Test
  public void testBindingDisabledCommands() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    binder.bind(new MutablePropertyValues(Collections.singletonMap(
        "shell.disabled_commands", "pattern1, pattern2")));
    assertFalse(binder.getBindingResult().hasErrors());
    assertEquals(2, props.getDisabledCommands().length);
    assertArrayEquals(new String[] { "pattern1", "pattern2" },
View Full Code Here

  @Test
  public void testBindingSsh() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    Map<String, String> map = new HashMap<String, String>();
    map.put("shell.ssh.enabled", "true");
    map.put("shell.ssh.port", "2222");
    map.put("shell.ssh.key_path", "~/.ssh/test.pem");
    binder.bind(new MutablePropertyValues(map));
View Full Code Here

  @Test
  public void testBindingSshIgnored() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    Map<String, String> map = new HashMap<String, String>();
    map.put("shell.ssh.enabled", "false");
    map.put("shell.ssh.port", "2222");
    map.put("shell.ssh.key_path", "~/.ssh/test.pem");
    binder.bind(new MutablePropertyValues(map));
View Full Code Here

  @Test
  public void testBindingTelnet() {
    ShellProperties props = new ShellProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell");
    binder.setConversionService(new DefaultConversionService());
    Map<String, String> map = new HashMap<String, String>();
    map.put("shell.telnet.enabled", "true");
    map.put("shell.telnet.port", "2222");
    binder.bind(new MutablePropertyValues(map));
    assertFalse(binder.getBindingResult().hasErrors());
View Full Code Here

TOP

Related Classes of org.springframework.core.convert.support.DefaultConversionService

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.