// Test ValueSourceHasher
@Test
public void testValueSourceHasher()
{
AkCollator caseInsensitiveCollator = AkCollatorFactory.getAkCollator("sv_se_ci");
AkCollator binaryCollator = AkCollatorFactory.getAkCollator(AkCollatorFactory.UCS_BINARY);
PersistitKeyValueSource source = new PersistitKeyValueSource(MString.VARCHAR.instance(true));
long hash_AB;
long hash_ab;
Key key = store().createKey();
{
binaryCollator.append(key.clear(), "AB");
source.attach(key, 0, MString.VARCHAR.instance(true));
hash_AB = ValueSources.hash(source, binaryCollator);
binaryCollator.append(key.clear(), "ab");
source.attach(key, 0, MString.VARCHAR.instance(true));
hash_ab = ValueSources.hash(source, binaryCollator);
assertTrue(hash_AB != hash_ab);
}
{