Open DavidZemon opened 9 years ago
Thanks for the update. I am a bit busy at the moment, but will take a look in a few days.
Alasdair On 25 Feb 2015 08:15, "David Zemon" notifications@github.com wrote:
I've modified the first example in a simple fashion. I'm hoping maybe you could incorporate these changes into AnnotatedTestRunner.runTests(...):
@Test public void testThreading() { final AnnotatedTestRunner runner = new AnnotatedTestRunner(); // Run all Weaver tests in this class, using MyList as the Class Under Test. try { runner.runTests(this.getClass(), MyList.class); } catch (final RuntimeException e) { final Throwable root = ExceptionUtils.getRootCause(e); if (root instanceof AssertionError) throw (AssertionError) root; else throw e; } }
— Reply to this email directly or view it on GitHub https://github.com/google/thread-weaver/issues/4.
On Wed, Feb 25, 2015 at 8:15 AM, David Zemon notifications@github.com wrote:
I've modified the first example in a simple fashion. I'm hoping maybe you could incorporate these changes into AnnotatedTestRunner.runTests(...):
@Test public void testThreading() { final AnnotatedTestRunner runner = new AnnotatedTestRunner(); // Run all Weaver tests in this class, using MyList as the Class Under Test. try { runner.runTests(this.getClass(), MyList.class); } catch (final RuntimeException e) { final Throwable root = ExceptionUtils.getRootCause(e); if (root instanceof AssertionError) throw (AssertionError) root; else throw e; } }
Hi David,
My only slight concern about doing this is that it would drag in yet another dependency to the build, which already has a lot of dependencies. How important do you think this is?
Alasdair
Definitely understandable. I'd say take a look at the source code for ExceptionUtils.getRootCause
and just implement it yourself.
I've modified the first example in a simple fashion. I'm hoping maybe you could incorporate these changes into
AnnotatedTestRunner.runTests(...)
: