@Test public void testHashCause() throws Throwable { StacktraceHash h = new StacktraceHash(); Throwable t1 = null; Throwable t2 = null; try { new TestClass().foo(1); } catch (RuntimeException e) { t1 = e; } try { new TestClass().foo(1); } catch (RuntimeException e) { t2 = e; } assertEquals( h.hash(Stacktrace.getInstance(t1)), h.hash(Stacktrace.getInstance(t2)) ); if (t1 != null) { t1.initCause(new RuntimeException("cause")); } assertNotEquals( h.hash(Stacktrace.getInstance(t1)), h.hash(Stacktrace.getInstance(t2)) ); }
@Override public String hash(final IStacktrace st) throws StacktraceHashException { return hashString(st.getStacktraceText()); }
StacktraceHash implements IStacktraceHash { @Override public String hash(final IStacktrace st) throws StacktraceHashException { return hashString(st.getStacktraceText()); } }
StacktraceHash implements IStacktraceHash { @Override public String hash(final IStacktrace st) throws StacktraceHashException { return hashString(st.getStacktraceText()); } StacktraceHash(final String algorithm);  StacktraceHash(); }
StacktraceHash implements IStacktraceHash { @Override public String hash(final IStacktrace st) throws StacktraceHashException { return hashString(st.getStacktraceText()); } StacktraceHash(final String algorithm);  StacktraceHash(); String getAlgorithm(); @Override String hash(final IStacktrace st); boolean isAlgorithmAvailable(); }
StacktraceHash implements IStacktraceHash { @Override public String hash(final IStacktrace st) throws StacktraceHashException { return hashString(st.getStacktraceText()); } StacktraceHash(final String algorithm);  StacktraceHash(); String getAlgorithm(); @Override String hash(final IStacktrace st); boolean isAlgorithmAvailable(); static final String DEFAULT_ALGORITHM; }