Package org.slf4j.migrator.helper

Examples of org.slf4j.migrator.helper.Abbreviator


 
 

  public ProgressListenerImpl(File projectFolder, MigratorFrame frame) {
    this.frame = frame;
    this.abbr = new Abbreviator((int) projectFolder.length(),
        TARGET_FILE_LENGTH, File.separatorChar);
  }
View Full Code Here


    super.tearDown();
  }

  public void testSmoke() {
    {
      Abbreviator abb = new Abbreviator(2, 100, FS);
      String r = abb.abbreviate(INPUT_0);
      assertEquals(INPUT_0, r);
    }

    {
      Abbreviator abb = new Abbreviator(3, 8, FS);
      String r = abb.abbreviate(INPUT_0);
      assertEquals("/abc/.../ABC", r);
    }
    {
      Abbreviator abb = new Abbreviator(3, 8, FS);
      String r = abb.abbreviate(INPUT_0);
      assertEquals("/abc/.../ABC", r);
    }
  }
View Full Code Here

      assertEquals("/abc/.../ABC", r);
    }
  }

  public void testImpossibleToAbbreviate() {
    Abbreviator abb = new Abbreviator(2, 20, FS);
    String in = "iczldqwivpgm/mgrmvbjdxrwmqgprdjusth";
    String r = abb.abbreviate(in);
    assertEquals(in, r);
  }
View Full Code Here

    String r = abb.abbreviate(in);
    assertEquals(in, r);
  }

  public void testNoFS() {
    Abbreviator abb = new Abbreviator(2, 100, FS);
    String r = abb.abbreviate("hello");
    assertEquals("hello", r);

  }
View Full Code Here

  }

  public void testZeroPrefix() {
    {
      Abbreviator abb = new Abbreviator(0, 100, FS);
      String r = abb.abbreviate(INPUT_0);
      assertEquals(INPUT_0, r);
    }
  }
View Full Code Here

      if (targetLen > maxLen) {
        targetLen = maxLen;
      }
      String filename = rh.buildRandomFileName(averageLen, maxLen);

      Abbreviator abb = new Abbreviator(fixedLen, targetLen, FS);
      String result = abb.abbreviate(filename);
      assertTheory0(averageLen, filename, result, fixedLen, targetLen);
      assertUsefulness(averageLen, filename, result, fixedLen, targetLen);
      assertTheory1(filename, result, fixedLen, targetLen);
      assertTheory2(filename, result, fixedLen, targetLen);
    }
View Full Code Here

TOP

Related Classes of org.slf4j.migrator.helper.Abbreviator

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.