Java 类org.apache.hadoop.hbase.filter.RegexStringComparator.EngineType 实例源码

项目:ditb    文件:TestRegexComparator.java   
@Test
public void testSerialization() throws Exception {
  // Default engine is the Java engine
  RegexStringComparator a = new RegexStringComparator("a|b");
  RegexStringComparator b = RegexStringComparator.parseFrom(a.toByteArray());
  assertTrue(a.areSerializedFieldsEqual(b));
  assertTrue(b.getEngine() instanceof RegexStringComparator.JavaRegexEngine);

  // joni engine
  a = new RegexStringComparator("a|b", EngineType.JONI);
  b = RegexStringComparator.parseFrom(a.toByteArray());
  assertTrue(a.areSerializedFieldsEqual(b));
  assertTrue(b.getEngine() instanceof RegexStringComparator.JoniRegexEngine);
}
项目:ditb    文件:TestRegexComparator.java   
@Test
public void testJavaEngine() throws Exception {
  for (TestCase t: TEST_CASES) {
    boolean result = new RegexStringComparator(t.regex, t.flags, EngineType.JAVA)
      .compareTo(Bytes.toBytes(t.haystack)) == 0;
    assertEquals("Regex '" + t.regex + "' failed test '" + t.haystack + "'", result,
      t.expected);
  }
}
项目:ditb    文件:TestRegexComparator.java   
@Test
public void testJoniEngine() throws Exception {
  for (TestCase t: TEST_CASES) {
    boolean result = new RegexStringComparator(t.regex, t.flags, EngineType.JONI)
      .compareTo(Bytes.toBytes(t.haystack)) == 0;
    assertEquals("Regex '" + t.regex + "' failed test '" + t.haystack + "'", result,
      t.expected);
  }
}
项目:pbase    文件:TestRegexComparator.java   
@Test
public void testSerialization() throws Exception {
  // Default engine is the Java engine
  RegexStringComparator a = new RegexStringComparator("a|b");
  RegexStringComparator b = RegexStringComparator.parseFrom(a.toByteArray());
  assertTrue(a.areSerializedFieldsEqual(b));
  assertTrue(b.getEngine() instanceof RegexStringComparator.JavaRegexEngine);

  // joni engine
  a = new RegexStringComparator("a|b", EngineType.JONI);
  b = RegexStringComparator.parseFrom(a.toByteArray());
  assertTrue(a.areSerializedFieldsEqual(b));
  assertTrue(b.getEngine() instanceof RegexStringComparator.JoniRegexEngine);
}
项目:pbase    文件:TestRegexComparator.java   
@Test
public void testJavaEngine() throws Exception {
  for (TestCase t: TEST_CASES) {
    boolean result = new RegexStringComparator(t.regex, t.flags, EngineType.JAVA)
      .compareTo(Bytes.toBytes(t.haystack)) == 0;
    assertEquals("Regex '" + t.regex + "' failed test '" + t.haystack + "'", result,
      t.expected);
  }
}
项目:pbase    文件:TestRegexComparator.java   
@Test
public void testJoniEngine() throws Exception {
  for (TestCase t: TEST_CASES) {
    boolean result = new RegexStringComparator(t.regex, t.flags, EngineType.JONI)
      .compareTo(Bytes.toBytes(t.haystack)) == 0;
    assertEquals("Regex '" + t.regex + "' failed test '" + t.haystack + "'", result,
      t.expected);
  }
}
项目:hbase    文件:TestRegexComparator.java   
@Test
public void testSerialization() throws Exception {
  // Default engine is the Java engine
  RegexStringComparator a = new RegexStringComparator("a|b");
  RegexStringComparator b = RegexStringComparator.parseFrom(a.toByteArray());
  assertTrue(a.areSerializedFieldsEqual(b));
  assertTrue(b.getEngine() instanceof RegexStringComparator.JavaRegexEngine);

  // joni engine
  a = new RegexStringComparator("a|b", EngineType.JONI);
  b = RegexStringComparator.parseFrom(a.toByteArray());
  assertTrue(a.areSerializedFieldsEqual(b));
  assertTrue(b.getEngine() instanceof RegexStringComparator.JoniRegexEngine);
}
项目:hbase    文件:TestRegexComparator.java   
@Test
public void testJavaEngine() throws Exception {
  for (TestCase t: TEST_CASES) {
    boolean result = new RegexStringComparator(t.regex, t.flags, EngineType.JAVA)
      .compareTo(Bytes.toBytes(t.haystack)) == 0;
    assertEquals("Regex '" + t.regex + "' failed test '" + t.haystack + "'", result,
      t.expected);
  }
}
项目:hbase    文件:TestRegexComparator.java   
@Test
public void testJoniEngine() throws Exception {
  for (TestCase t: TEST_CASES) {
    boolean result = new RegexStringComparator(t.regex, t.flags, EngineType.JONI)
      .compareTo(Bytes.toBytes(t.haystack)) == 0;
    assertEquals("Regex '" + t.regex + "' failed test '" + t.haystack + "'", result,
      t.expected);
  }
}