Package edu.zao.fire

Examples of edu.zao.fire.MatchReplaceRule


    }
  }

  @Test
  public void testGetNewName_CaseSensitive() {
    MatchReplaceRule rule = new MatchReplaceRule();
    rule.setMatchString("aba");
    rule.setReplaceString("cdc");
    rule.setCaseSensitive(true);

    File aaaFile = new File("aba bab.txt");
    try {
      String newName = rule.getNewName(aaaFile);
      assertTrue(newName.equals("cdc bab.txt"));
    } catch (IOException e) {
      fail("Should not throw an exception");
      e.printStackTrace();
    }
View Full Code Here


    }
  }

  @Test
  public void testGetNewName_CaseSensitive2() {
    MatchReplaceRule rule = new MatchReplaceRule();
    rule.setMatchString("aba");
    rule.setReplaceString("cdc");
    rule.setCaseSensitive(true);

    File aaaFile = new File("ABA bab.txt");
    try {
      String newName = rule.getNewName(aaaFile);
      assertTrue(newName.equals("ABA bab.txt"));
    } catch (IOException e) {
      fail("Should not throw an exception");
      e.printStackTrace();
    }
View Full Code Here

    }
  }

  @Test
  public void testGetNewName_CaseInsensitive() {
    MatchReplaceRule rule = new MatchReplaceRule();
    rule.setMatchString("aba");
    rule.setReplaceString("cdc");
    rule.setCaseSensitive(false);

    File aaaFile = new File("ABA bab.txt");
    try {
      String newName = rule.getNewName(aaaFile);
      assertTrue(newName.equals("cdc bab.txt"));
    } catch (IOException e) {
      fail("Should not throw an exception");
      e.printStackTrace();
    }
View Full Code Here

    }
  }

  @Test
  public void testGetNewName_RegexGroup() {
    MatchReplaceRule rule = new MatchReplaceRule();
    rule.setMatchString("(ab)");
    rule.setReplaceString("-$1-");
    rule.setMatchRegularExpressions(true);
    rule.setReplacementLimit(ReplacementLimit.ALL);

    File aaaFile = new File("ABA bab.txt");
    try {
      String newName = rule.getNewName(aaaFile);
      assertTrue(newName.equals("-AB-A b-ab-.txt"));
    } catch (IOException e) {
      fail("Should not throw an exception");
      e.printStackTrace();
    }
View Full Code Here

public class MatchReplaceRuleEditorInput extends RenamerRuleEditorInput {

  private final MatchReplaceRule rule;

  public MatchReplaceRuleEditorInput() {
    rule = new MatchReplaceRule();
  }
View Full Code Here

TOP

Related Classes of edu.zao.fire.MatchReplaceRule

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.