On Fri, Aug 7, 2009 at 10:30 AM, Bruce Johnson<[email protected]> wrote:
> I think assumeThat() might indeed be a good general solution, along the
> lines of your examples. It subsumes the annotations I proposed, and it's
> nice that it could be generalized easily to any sort of tests. Also, it
> *might* be possible for the compiler to optimize it statically somewhat such
> that if a test contained "assumeThat(X)" where X was statically know to be
> false, the whole method could go away. (Of course, we'd need that behavior
> to be generalized somehow -- I'm not proposing JUnit-specific compiler
> behavior, which would be way too hacky).

I *think* that assumeThat(X) functions by throwing some sort of
IgnoreThisTestException when X is false.  In the case that X is
statically false, the compiler might be able to determine that all the
code after assumeThat(false) would not execute because an uncaught
exception would be thrown.  Perhaps the test method would be optimized
to

@Test
public void testSomething() {
  throw new IgnoreThisTestException();
}

Ian

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to