Commits on Oct 19, 2011
Commits on Oct 15, 2011
  1. @stefanbirkner
  2. @stefanbirkner

    ExpectedSystemExit restores SecurityManager.

    After each test the original SecurityManager is restored.
    stefanbirkner committed with Oct 7, 2011
  3. @stefanbirkner

    Removed dependency to hamcrest.

    Using assertEquals(...) instead of assertThat(...) in order to avoid
    a dependency to hamcrest.
    stefanbirkner committed with Oct 7, 2011
  4. @stefanbirkner

    Added ExpectedSystemExit rule.

    The ExpectedSystemExit allows in-test specification of expected
    System.exit(...) calls.
    stefanbirkner committed with Oct 7, 2011
Commits on Oct 6, 2011
  1. @stefanbirkner

    Added TextFromStandardInputStream rule.

    The TextFromStandardInputStream rule replaces System.in with
    another InputStream, which provides an arbitrary text. The original
    System.in is restored after the test.
    stefanbirkner committed with Oct 7, 2011
  2. @stefanbirkner

    Replaced ClearSystemProperty by ClearSystemProperties.

    The ClearSystemProperties accepts a list of properties, which are
    cleared.
    stefanbirkner committed with Oct 7, 2011
Commits on Oct 5, 2011
Commits on Sep 27, 2011
  1. @stefanbirkner

    Added ProvideSecurityManager rule.

    The ProvideSecurityManager  rule provides an arbitrary security
    manager to a test. After the test the original security manager
    is restored.
    stefanbirkner committed Sep 27, 2011
Commits on Sep 25, 2011
  1. @stephenc
  2. @stephenc

    Initial PoC implementation of Assumes

    * Sorting could probably be improved somewhat
    
    * A circular assumption will have somewhat undefined ordering, would be better to bomb out the circular assumption with an error
    
    * Had to copy a bit too much from ParentRunner, possibly indicating the lack of a suitable extension point in ParentRunner to support this use case.
    
    * Cobertura reports 86% line coverage and 96% branch coverage. While the untested code is the Copy and Paste from ParentRunner, more tests, especially around ordering, would be good.
    stephenc committed with Sep 15, 2011
  3. @stefanbirkner
  4. @stefanbirkner
  5. Update of multiple system properties in one rule

    For the sake of brevity it may be desirable to let the ProvideSystemProperty
    rule update multiple system properties in a single rule definition, e.g.
    
      @Rule
      public final ProvideSystemProperty properties
        = new ProvideSystemProperty("property", "value").and("OtherProperty", null);
    committed Sep 25, 2011
  6. Introduced ClearSystemProperty rule.

    The null argument of the ProvideSystemProperty rule seemed a little quirky to me.
    I think the new rule better expresses the intend of clearing a system property.
    
    Here's a quick comparison:
    
      @Rule ProvideSystemProperty clearMyProperty = new ProvideSystemProperty("myProperty", null);
    
      @Rule ClearSystemProperty clearMyProperty = new ClearSystemProperty("myProperty");
    committed Sep 25, 2011
Commits on Sep 24, 2011
  1. @stefanbirkner
  2. @stefanbirkner
  3. @stefanbirkner

    Added StandardErrorStreamLog and StandardOutputStreamLog rules.

    The tow rules capture writes to the standard error stream and standard
    output stream. The text written is available via getLog().
    stefanbirkner committed Sep 24, 2011
  4. @stefanbirkner

    Added ProvideSystemProperty rule.

    The ProvideSystemProperty rule provides an arbitrary value for a system
    property to a test. After the test the original value is restored. You
    can ensure that a property is not set by providing null.
    
    Let's assume the system property MyProperty is not set and the system
    property OtherProperty has the value OtherValue. Now run the test
    
     public void MyTest {
       @Rule
       public final ProvideSystemProperty myPropertyHasMyValue
         = new ProvideSystemProperty("MyProperty", "MyValue");
    
       @Rule
       public final ProvideSystemProperty otherPropertyIsMissing
         = new ProvideSystemProperty("OtherProperty", null);
    
       @Test
       public void overrideProperty() {
         assertEquals("MyValue", System.getProperty("MyProperty"));
         assertNull(System.getProperty("OtherProperty"));
       }
     }
    
    The test succeeds and after the test, the system property MyProperty is
    not set and the system property OtherProperty has the value OtherValue.
    stefanbirkner committed Sep 24, 2011
Commits on Sep 23, 2011
  1. @stefanbirkner

    Added RestoreSystemProperties rule, which undoes changes of system pr…

    …operties.
    
    Let's assume the system property MyProperty has the value MyValue.
    Now run the test
    
     public void MyTest {
       @Rule
       public final RestoreSystemProperties restoreSystemProperties
         = new RestoreSystemProperties("MyProperty");
    
       @Test
       public void overrideProperty() {
         System.setProperty("MyProperty", "other value");
         ...
       }
     }
    
    After running the test, the system property {@code MyProperty} has still the
    value {@code MyValue}.
    stefanbirkner committed Sep 23, 2011
Commits on Aug 8, 2011
  1. Merge pull request #6 from thomasmueller/master

    Documentation
    David Saff committed Aug 8, 2011
  2. @thomasmueller
Commits on Aug 5, 2011
  1. @thomasmueller
  2. @thomasmueller
Commits on Aug 3, 2011
  1. Merge pull request #5 from thomasmueller/master

    getLastThrown() is now static
    David Saff committed Aug 3, 2011
  2. @thomasmueller

    Use less static state (less singletons) to allow better testing of all

    variants (with and without Objenisis, with and without using the system
    java compiler). Also, creating new objects using reflection now works
    better if objenesis is not in the classpath.
    thomasmueller committed Aug 3, 2011
  3. @thomasmueller
  4. @thomasmueller
Commits on Aug 2, 2011
  1. @thomasmueller

    Document that create a class proxy on a class proxy is not

    supported. Additional test cases.
    thomasmueller committed Aug 2, 2011
Commits on Aug 1, 2011
  1. @thomasmueller
  2. @thomasmueller

    The CompilingProxyFactoryTest could not create a proxy for a method or

    class name with a non-ASCII character unless the default character
    encoding for the system was UTF-8.
    thomasmueller committed Aug 1, 2011
Commits on Jul 30, 2011
  1. @thomasmueller
  2. @thomasmueller

    Documentation.

    thomasmueller committed Jul 30, 2011
  3. @thomasmueller

    AssertThrows.getLastThrown() is now static and works for both the proxy

    and the anonymous class. The detection of forgetting to call a method /
    calling a final method has been improved, tested, and documented.
    thomasmueller committed Jul 30, 2011
Commits on Jul 29, 2011
  1. Merge pull request #4 from thomasmueller/master

    Fixed documentation bugs
    David Saff committed Jul 29, 2011