Skip to content

Commit

Permalink
Use the Google style guide code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
rschmitt committed Jun 4, 2015
1 parent 8f167ec commit 6f85c78
Showing 1 changed file with 27 additions and 32 deletions.
59 changes: 27 additions & 32 deletions src/main/java/org/junit/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -937,39 +937,36 @@ public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
* assertThat(&quot;Zero is one&quot;, 0, is(not(1))) // passes
* </pre>
*
* <code>org.hamcrest.Matcher</code> does not currently document the meaning
* of its type parameter <code>T</code>. This method assumes that a matcher
* typed as <code>Matcher&lt;T&gt;</code> can be meaningfully applied only
* to values that could be assigned to a variable of type <code>T</code>.
* <code>org.hamcrest.Matcher</code> does not currently document the meaning of its type
* parameter <code>T</code>. This method assumes that a matcher typed as
* <code>Matcher&lt;T&gt;</code> can be meaningfully applied only to values that could be
* assigned to a variable of type <code>T</code>.
*
* @param reason additional information about the error
* @param <T> the static type accepted by the matcher (this can flag obvious
* compile-time problems such as {@code assertThat(1, is("a"))}
* @param actual the computed value being compared
* @param matcher an expression, built of {@link Matcher}s, specifying allowed
* values
* @param reason additional information about the error
* @param <T> the static type accepted by the matcher (this can flag obvious compile-time
* problems such as {@code assertThat(1, is("a"))}
* @param actual the computed value being compared
* @param matcher an expression, built of {@link Matcher}s, specifying allowed values
* @see org.hamcrest.CoreMatchers
* @see org.hamcrest.MatcherAssert
*/
public static <T> void assertThat(String reason, T actual,
Matcher<? super T> matcher) {
Matcher<? super T> matcher) {
MatcherAssert.assertThat(reason, actual, matcher);
}

/**
* This interface facilitates the use of expectThrows from Java 8. It allows
* method references to void methods (that declare checked exceptions) to be
* passed directly into expectThrows without wrapping. It is not meant to be
* implemented directly.
* This interface facilitates the use of expectThrows from Java 8. It allows method references
* to void methods (that declare checked exceptions) to be passed directly into expectThrows
* without wrapping. It is not meant to be implemented directly.
*/
public interface ThrowingRunnable {
void run() throws Throwable;
}

/**
* Asserts that {@code runnable} throws an exception when executed. If it
* does, the exception object is returned. If it does not, an
* {@link AssertionError} is thrown.
* Asserts that {@code runnable} throws an exception when executed. If it does, the exception
* object is returned. If it does not, an {@link AssertionError} is thrown.
*
* @param runnable A function that is expected to throw an exception when executed
* @return The exception thrown by {@code runnable}
Expand All @@ -979,11 +976,11 @@ public static <T extends Throwable> T expectThrows(ThrowingRunnable runnable) {
}

/**
* Asserts that {@code runnable} throws an exception when executed. If it
* does, the exception object is returned. If it does not, an
* {@link AssertionError} is thrown with the given {@code message}.
* Asserts that {@code runnable} throws an exception when executed. If it does, the exception
* object is returned. If it does not, an {@link AssertionError} is thrown with the given {@code
* message}.
*
* @param message the identifying message for the {@link AssertionError}
* @param message the identifying message for the {@link AssertionError}
* @param runnable A function that is expected to throw an exception when executed
* @return The exception thrown by {@code runnable}
*/
Expand All @@ -992,11 +989,10 @@ public static <T extends Throwable> T expectThrows(String message, ThrowingRunna
}

/**
* Asserts that {@code runnable} throws an exception of type
* {@code throwableClass} when executed. If it does, the exception object
* is returned. If it does not throw an exception, an {@link AssertionError}
* is thrown. If it throws the wrong type of exception, an
* {@code AssertionError} is thrown describing the mismatch.
* Asserts that {@code runnable} throws an exception of type {@code throwableClass} when
* executed. If it does, the exception object is returned. If it does not throw an exception, an
* {@link AssertionError} is thrown. If it throws the wrong type of exception, an {@code
* AssertionError} is thrown describing the mismatch.
*
* @param throwableClass the expected type of the exception
* @param runnable A function that is expected to throw an exception when executed
Expand All @@ -1007,13 +1003,12 @@ public static <T extends Throwable> T expectThrows(Class<T> throwableClass, Thro
}

/**
* Asserts that {@code runnable} throws an exception of type
* {@code throwableClass} when executed. If it does, the exception object
* is returned. If it does not throw an exception, an {@link AssertionError}
* is thrown with the given {@code message}. If it throws the wrong type
* Asserts that {@code runnable} throws an exception of type {@code throwableClass} when
* executed. If it does, the exception object is returned. If it does not throw an exception, an
* {@link AssertionError} is thrown with the given {@code message}. If it throws the wrong type
* of exception, an {@code AssertionError} is thrown describing the mismatch.
*
* @param message the identifying message for the {@link AssertionError}
* @param message the identifying message for the {@link AssertionError}
* @param throwableClass the expected type of the exception
* @param runnable A function that is expected to throw an exception when executed
* @return The exception thrown by {@code runnable}
Expand Down

0 comments on commit 6f85c78

Please sign in to comment.