Package org.auraframework.util.text.Hash

Examples of org.auraframework.util.text.Hash.StringBuilder.build()


    private void assertStringBuilderHash(String toHash) throws Exception {
        int expected = getHashCode(toHash);
        StringBuilder builder = new StringBuilder();
        builder.addString(toHash);
        assertHash(builder.build(), true, expected);
    }

    public void testStringBuilderEmptyString() throws Exception {
        assertStringBuilderHash("");
    }
View Full Code Here


        StringBuilder builder = new StringBuilder();
        // split string by word boundaries
        for (String part : toHash.split("\\b")) {
            builder.addString(part);
        }
        assertHash(builder.build(), true, expected);
    }

    public void testStringBuilderNoStrings() throws Exception {
        int expected = Arrays.hashCode(MessageDigest.getInstance("MD5").digest());
        StringBuilder builder = new StringBuilder();
View Full Code Here

    }

    public void testStringBuilderNoStrings() throws Exception {
        int expected = Arrays.hashCode(MessageDigest.getInstance("MD5").digest());
        StringBuilder builder = new StringBuilder();
        assertHash(builder.build(), true, expected);
    }

    public void testStringBuilderNull() throws Exception {
        int expected = Arrays.hashCode(MessageDigest.getInstance("MD5").digest());
        StringBuilder builder = new StringBuilder();
View Full Code Here

    public void testStringBuilderNull() throws Exception {
        int expected = Arrays.hashCode(MessageDigest.getInstance("MD5").digest());
        StringBuilder builder = new StringBuilder();
        builder.addString(null);
        assertHash(builder.build(), true, expected);
    }

}
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.