Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Commits on Oct 19, 2011
Commits on Oct 15, 2011
  1. Stefan Birkner

    added Common Public License Version 1.0

    stefanbirkner authored committed
  2. Stefan Birkner

    ExpectedSystemExit restores SecurityManager.

    stefanbirkner authored committed
    After each test the original SecurityManager is restored.
  3. Stefan Birkner

    Removed dependency to hamcrest.

    stefanbirkner authored committed
    Using assertEquals(...) instead of assertThat(...) in order to avoid
    a dependency to hamcrest.
  4. Stefan Birkner

    Added ExpectedSystemExit rule.

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

    Added TextFromStandardInputStream rule.

    stefanbirkner authored committed
    The TextFromStandardInputStream rule replaces System.in with
    another InputStream, which provides an arbitrary text. The original
    System.in is restored after the test.
  2. Stefan Birkner

    Replaced ClearSystemProperty by ClearSystemProperties.

    stefanbirkner authored committed
    The ClearSystemProperties accepts a list of properties, which are
    cleared.
Commits on Oct 5, 2011
Commits on Sep 27, 2011
  1. Stefan Birkner

    Added ProvideSecurityManager rule.

    stefanbirkner authored
    The ProvideSecurityManager  rule provides an arbitrary security
    manager to a test. After the test the original security manager
    is restored.
Commits on Sep 25, 2011
  1. Stephen Connolly

    Remove redundant copy & paste from ParentRunner

    stephenc authored committed
  2. Stephen Connolly

    Initial PoC implementation of Assumes

    stephenc authored committed
    * 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.
  3. Stefan Birkner
  4. Stefan Birkner

    Renamed StandardStreamLog to PrintStreamLog

    stefanbirkner authored committed
  5. Update of multiple system properties in one rule

    authored
    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);
  6. Introduced ClearSystemProperty rule.

    authored
    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");
Commits on Sep 24, 2011
  1. Stefan Birkner
  2. Stefan Birkner
  3. Stefan Birkner

    Added StandardErrorStreamLog and StandardOutputStreamLog rules.

    stefanbirkner authored
    The tow rules capture writes to the standard error stream and standard
    output stream. The text written is available via getLog().
  4. Stefan Birkner

    Added ProvideSystemProperty rule.

    stefanbirkner authored
    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.
Commits on Sep 23, 2011
  1. Stefan Birkner

    Added RestoreSystemProperties rule, which undoes changes of system pr…

    stefanbirkner authored
    …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}.
Commits on Aug 8, 2011
  1. Merge pull request #6 from thomasmueller/master

    David Saff authored
    Documentation
  2. Thomas Mueller
Commits on Aug 5, 2011
  1. Thomas Mueller
  2. Thomas Mueller
Commits on Aug 3, 2011
  1. Merge pull request #5 from thomasmueller/master

    David Saff authored
    getLastThrown() is now static
  2. Thomas Mueller

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

    thomasmueller authored
    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.
  3. Thomas Mueller
  4. Thomas Mueller
Commits on Aug 2, 2011
  1. Thomas Mueller

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

    thomasmueller authored
    supported. Additional test cases.
Commits on Aug 1, 2011
  1. Thomas Mueller
  2. Thomas Mueller

    The CompilingProxyFactoryTest could not create a proxy for a method or

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

    Documentation.

    thomasmueller authored
  3. Thomas Mueller

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

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

    David Saff authored
    Fixed documentation bugs
Something went wrong with that request. Please try again.