Examples of Abbreviator


Examples of com.google.caja.util.Abbreviator

    if (abbreviator == null) {
      Set<String> uris = new HashSet<String>();
      for (InputSource is : inputSources) {
        uris.add(is.getUri().toString());
      }
      abbreviator = new Abbreviator(uris, "/");
    }
    return abbreviator.unambiguousAbbreviationFor(
        toAbbreviate.getUri().toString());
  }
View Full Code Here

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

Examples of org.slf4j.migrator.helper.Abbreviator

    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

Examples of org.slf4j.migrator.helper.Abbreviator

      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

Examples of org.slf4j.migrator.helper.Abbreviator

    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

Examples of org.slf4j.migrator.helper.Abbreviator

  }

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

Examples of org.slf4j.migrator.helper.Abbreviator

      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
Copyright © 2018 www.massapi.com. 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.