Skip to content

Commit

Permalink
Fix some [style violations](https://google.github.io/styleguide/javag…
Browse files Browse the repository at this point in the history
…uide.html#s5.2.3-method-names) in test method names.

RELNOTES=n/a
PiperOrigin-RevId: 655713573
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jul 24, 2024
1 parent 41800d5 commit 85c6f88
Show file tree
Hide file tree
Showing 58 changed files with 297 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ public void setUp() throws Exception {
}

/** Test null reference yields error */
public void testOf_NullPointerException() {
public void testOf_nullPointerException() {
try {
EquivalenceTester.of(null);
fail("Should fail on null reference");
} catch (NullPointerException expected) {
}
}

public void testTest_NoData() {
public void testTest_noData() {
tester.test();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class GcFinalizationTest extends TestCase {
// Ordinary tests of successful method execution
// ----------------------------------------------------------------

public void testAwait_CountDownLatch() {
public void testAwait_countDownLatch() {
final CountDownLatch latch = new CountDownLatch(1);
Object unused =
new Object() {
Expand All @@ -57,7 +57,7 @@ protected void finalize() {
assertEquals(0, latch.getCount());
}

public void testAwaitDone_Future() {
public void testAwaitDone_future() {
final SettableFuture<@Nullable Void> future = SettableFuture.create();
Object unused =
new Object() {
Expand All @@ -73,7 +73,7 @@ protected void finalize() {
assertFalse(future.isCancelled());
}

public void testAwaitDone_Future_Cancel() {
public void testAwaitDone_future_cancel() {
final SettableFuture<@Nullable Void> future = SettableFuture.create();
Object unused =
new Object() {
Expand All @@ -95,7 +95,7 @@ public void testAwaitClear() {
assertNull(ref.get());
}

public void testAwaitDone_FinalizationPredicate() {
public void testAwaitDone_finalizationPredicate() {
final WeakHashMap<Object, Object> map = new WeakHashMap<>();
map.put(new Object(), Boolean.TRUE);
GcFinalization.awaitDone(
Expand Down Expand Up @@ -148,7 +148,7 @@ void assertWrapsInterruptedException(RuntimeException e) {
assertThat(e).hasCauseThat().isInstanceOf(InterruptedException.class);
}

public void testAwait_CountDownLatch_Interrupted() {
public void testAwait_countDownLatch_interrupted() {
Interruptenator interruptenator = new Interruptenator(Thread.currentThread());
try {
final CountDownLatch latch = new CountDownLatch(1);
Expand All @@ -161,7 +161,7 @@ public void testAwait_CountDownLatch_Interrupted() {
}
}

public void testAwaitDone_Future_Interrupted_Interrupted() {
public void testAwaitDone_future_interrupted_interrupted() {
Interruptenator interruptenator = new Interruptenator(Thread.currentThread());
try {
final SettableFuture<@Nullable Void> future = SettableFuture.create();
Expand All @@ -174,7 +174,7 @@ public void testAwaitDone_Future_Interrupted_Interrupted() {
}
}

public void testAwaitClear_Interrupted() {
public void testAwaitClear_interrupted() {
Interruptenator interruptenator = new Interruptenator(Thread.currentThread());
try {
final WeakReference<Object> ref = new WeakReference<Object>(Boolean.TRUE);
Expand All @@ -187,7 +187,7 @@ public void testAwaitClear_Interrupted() {
}
}

public void testAwaitDone_FinalizationPredicate_Interrupted() {
public void testAwaitDone_finalizationPredicate_interrupted() {
Interruptenator interruptenator = new Interruptenator(Thread.currentThread());
try {
RuntimeException expected =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ public void testGet_present() {
}

@SuppressWarnings("OptionalOfRedundantMethod") // Unit tests for Optional
public void testOr_T_present() {
public void testOr_t_present() {
assertEquals("a", Optional.of("a").or("default"));
}

public void testOr_T_absent() {
public void testOr_t_absent() {
assertEquals("default", Optional.absent().or("default"));
}

Expand Down Expand Up @@ -125,11 +125,11 @@ public void testOr_nullSupplier_present() {
}

@SuppressWarnings("OptionalOfRedundantMethod") // Unit tests for Optional
public void testOr_Optional_present() {
public void testOr_optional_present() {
assertEquals(Optional.of("a"), Optional.of("a").or(Optional.of("fallback")));
}

public void testOr_Optional_absent() {
public void testOr_optional_absent() {
assertEquals(Optional.of("fallback"), Optional.absent().or(Optional.of("fallback")));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ public void testMapSplitter_notTrimmed() {
assertThat(m.entrySet()).containsExactlyElementsIn(expected.entrySet()).inOrder();
}

public void testMapSplitter_CharacterSeparator() {
public void testMapSplitter_characterSeparator() {
// try different delimiters.
Map<String, String> m =
Splitter.on(",").withKeyValueSeparator(':').split("boy:tom,girl:tina,cat:kitty,dog:tommy");
Expand Down
64 changes: 32 additions & 32 deletions android/guava-tests/test/com/google/common/base/ThrowablesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
*/
@GwtCompatible(emulated = true)
public class ThrowablesTest extends TestCase {
public void testThrowIfUnchecked_Unchecked() {
public void testThrowIfUnchecked_unchecked() {
try {
throwIfUnchecked(new SomeUncheckedException());
fail();
} catch (SomeUncheckedException expected) {
}
}

public void testThrowIfUnchecked_Error() {
public void testThrowIfUnchecked_error() {
try {
throwIfUnchecked(new SomeError());
fail();
Expand All @@ -60,13 +60,13 @@ public void testThrowIfUnchecked_Error() {
}

@SuppressWarnings("ThrowIfUncheckedKnownChecked")
public void testThrowIfUnchecked_Checked() {
public void testThrowIfUnchecked_checked() {
throwIfUnchecked(new SomeCheckedException());
}

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible
public void testPropagateIfPossible_NoneDeclared_NoneThrown() {
public void testPropagateIfPossible_noneDeclared_noneThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -86,7 +86,7 @@ public void noneDeclared() {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible
public void testPropagateIfPossible_NoneDeclared_UncheckedThrown() {
public void testPropagateIfPossible_noneDeclared_uncheckedThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -106,7 +106,7 @@ public void noneDeclared() {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible
public void testPropagateIfPossible_NoneDeclared_UndeclaredThrown() {
public void testPropagateIfPossible_noneDeclared_undeclaredThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -126,7 +126,7 @@ public void noneDeclared() {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class)
public void testPropagateIfPossible_OneDeclared_NoneThrown() throws SomeCheckedException {
public void testPropagateIfPossible_oneDeclared_noneThrown() throws SomeCheckedException {
Sample sample =
new Sample() {
@Override
Expand All @@ -148,7 +148,7 @@ public void oneDeclared() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class)
public void testPropagateIfPossible_OneDeclared_UncheckedThrown() throws SomeCheckedException {
public void testPropagateIfPossible_oneDeclared_uncheckedThrown() throws SomeCheckedException {
Sample sample =
new Sample() {
@Override
Expand All @@ -168,7 +168,7 @@ public void oneDeclared() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class)
public void testPropagateIfPossible_OneDeclared_CheckedThrown() {
public void testPropagateIfPossible_oneDeclared_checkedThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -188,7 +188,7 @@ public void oneDeclared() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class)
public void testPropagateIfPossible_OneDeclared_UndeclaredThrown() throws SomeCheckedException {
public void testPropagateIfPossible_oneDeclared_undeclaredThrown() throws SomeCheckedException {
Sample sample =
new Sample() {
@Override
Expand All @@ -208,7 +208,7 @@ public void oneDeclared() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class, Class)
public void testPropagateIfPossible_TwoDeclared_NoneThrown()
public void testPropagateIfPossible_twoDeclared_noneThrown()
throws SomeCheckedException, SomeOtherCheckedException {
Sample sample =
new Sample() {
Expand All @@ -230,7 +230,7 @@ public void twoDeclared() throws SomeCheckedException, SomeOtherCheckedException

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class, Class)
public void testPropagateIfPossible_TwoDeclared_UncheckedThrown()
public void testPropagateIfPossible_twoDeclared_uncheckedThrown()
throws SomeCheckedException, SomeOtherCheckedException {
Sample sample =
new Sample() {
Expand All @@ -252,7 +252,7 @@ public void twoDeclared() throws SomeCheckedException, SomeOtherCheckedException

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class, Class)
public void testPropagateIfPossible_TwoDeclared_CheckedThrown() throws SomeOtherCheckedException {
public void testPropagateIfPossible_twoDeclared_checkedThrown() throws SomeOtherCheckedException {
Sample sample =
new Sample() {
@Override
Expand All @@ -273,7 +273,7 @@ public void twoDeclared() throws SomeCheckedException, SomeOtherCheckedException

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class, Class)
public void testPropagateIfPossible_TwoDeclared_OtherCheckedThrown() throws SomeCheckedException {
public void testPropagateIfPossible_twoDeclared_otherCheckedThrown() throws SomeCheckedException {
Sample sample =
new Sample() {
@Override
Expand Down Expand Up @@ -308,19 +308,19 @@ public void testPropageIfPossible_null() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class)
public void testPropageIfPossible_OneDeclared_null() throws SomeCheckedException {
public void testPropageIfPossible_oneDeclared_null() throws SomeCheckedException {
Throwables.propagateIfPossible(null, SomeCheckedException.class);
}

@J2ktIncompatible
@GwtIncompatible // propagateIfPossible(Throwable, Class, Class)
public void testPropageIfPossible_TwoDeclared_null() throws SomeCheckedException {
public void testPropageIfPossible_twoDeclared_null() throws SomeCheckedException {
Throwables.propagateIfPossible(null, SomeCheckedException.class, SomeUncheckedException.class);
}

@J2ktIncompatible
@GwtIncompatible // propagate
public void testPropagate_NoneDeclared_NoneThrown() {
public void testPropagate_noneDeclared_noneThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -339,7 +339,7 @@ public void noneDeclared() {

@J2ktIncompatible
@GwtIncompatible // propagate
public void testPropagate_NoneDeclared_UncheckedThrown() {
public void testPropagate_noneDeclared_uncheckedThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -358,7 +358,7 @@ public void noneDeclared() {

@J2ktIncompatible
@GwtIncompatible // propagate
public void testPropagate_NoneDeclared_ErrorThrown() {
public void testPropagate_noneDeclared_errorThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -377,7 +377,7 @@ public void noneDeclared() {

@J2ktIncompatible
@GwtIncompatible // propagate
public void testPropagate_NoneDeclared_CheckedThrown() {
public void testPropagate_noneDeclared_checkedThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -396,32 +396,32 @@ public void noneDeclared() {
}

@GwtIncompatible // throwIfInstanceOf
public void testThrowIfInstanceOf_Unchecked() throws SomeCheckedException {
public void testThrowIfInstanceOf_unchecked() throws SomeCheckedException {
throwIfInstanceOf(new SomeUncheckedException(), SomeCheckedException.class);
}

@GwtIncompatible // throwIfInstanceOf
public void testThrowIfInstanceOf_CheckedDifferent() throws SomeCheckedException {
public void testThrowIfInstanceOf_checkedDifferent() throws SomeCheckedException {
throwIfInstanceOf(new SomeOtherCheckedException(), SomeCheckedException.class);
}

@GwtIncompatible // throwIfInstanceOf
public void testThrowIfInstanceOf_CheckedSame() {
public void testThrowIfInstanceOf_checkedSame() {
assertThrows(
SomeCheckedException.class,
() -> throwIfInstanceOf(new SomeCheckedException(), SomeCheckedException.class));
}

@GwtIncompatible // throwIfInstanceOf
public void testThrowIfInstanceOf_CheckedSubclass() {
public void testThrowIfInstanceOf_checkedSubclass() {
assertThrows(
SomeCheckedException.class,
() -> throwIfInstanceOf(new SomeCheckedException() {}, SomeCheckedException.class));
}

@J2ktIncompatible
@GwtIncompatible // propagate]IfInstanceOf
public void testPropagateIfInstanceOf_NoneThrown() throws SomeCheckedException {
public void testPropagateIfInstanceOf_noneThrown() throws SomeCheckedException {
Sample sample =
new Sample() {
@Override
Expand All @@ -441,7 +441,7 @@ public void oneDeclared() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfInstanceOf
public void testPropagateIfInstanceOf_DeclaredThrown() {
public void testPropagateIfInstanceOf_declaredThrown() {
Sample sample =
new Sample() {
@Override
Expand All @@ -461,7 +461,7 @@ public void oneDeclared() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfInstanceOf
public void testPropagateIfInstanceOf_UncheckedThrown() throws SomeCheckedException {
public void testPropagateIfInstanceOf_uncheckedThrown() throws SomeCheckedException {
Sample sample =
new Sample() {
@Override
Expand All @@ -481,7 +481,7 @@ public void oneDeclared() throws SomeCheckedException {

@J2ktIncompatible
@GwtIncompatible // propagateIfInstanceOf
public void testPropagateIfInstanceOf_UndeclaredThrown() throws SomeCheckedException {
public void testPropagateIfInstanceOf_undeclaredThrown() throws SomeCheckedException {
Sample sample =
new Sample() {
@Override
Expand Down Expand Up @@ -512,24 +512,24 @@ public void testPropageIfInstanceOf_null() throws SomeCheckedException {
Throwables.propagateIfInstanceOf(null, SomeCheckedException.class);
}

public void testGetRootCause_NoCause() {
public void testGetRootCause_noCause() {
SomeCheckedException exception = new SomeCheckedException();
assertSame(exception, Throwables.getRootCause(exception));
}

public void testGetRootCause_SingleWrapped() {
public void testGetRootCause_singleWrapped() {
SomeCheckedException cause = new SomeCheckedException();
SomeChainingException exception = new SomeChainingException(cause);
assertSame(cause, Throwables.getRootCause(exception));
}

public void testGetRootCause_DoubleWrapped() {
public void testGetRootCause_doubleWrapped() {
SomeCheckedException cause = new SomeCheckedException();
SomeChainingException exception = new SomeChainingException(new SomeChainingException(cause));
assertSame(cause, Throwables.getRootCause(exception));
}

public void testGetRootCause_Loop() {
public void testGetRootCause_loop() {
Exception cause = new Exception();
Exception exception = new Exception(cause);
cause.initCause(exception);
Expand Down
Loading

0 comments on commit 85c6f88

Please sign in to comment.