Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include code format tools #37

Merged
merged 13 commits into from
Jun 4, 2021
Merged
Prev Previous commit
Next Next commit
Clean up some string formatting
  • Loading branch information
kevinlind committed Jun 3, 2021
commit cec8361ddef49997ef48f8613cb7cc477f4a7220
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class TestHelper {
// List of threads to wait for after test execution
private static List<String> knownThreads = new ArrayList<String>();

{
static {
knownThreads.add("pool"); // used for threads that execute the listeners code
knownThreads.add("ADB"); // module internal threads
}
Expand Down Expand Up @@ -293,21 +293,21 @@ public static void assertExpectedEvents(final boolean ignoreUnexpectedEvents) th

for (Map.Entry<EventSpec, ADBCountDownLatch> expected : expectedEvents.entrySet()) {
boolean awaitResult = expected.getValue().await(WAIT_EVENT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
assertTrue(
"Timed out waiting for event type " +
expected.getKey().type +
" and source " +
expected.getKey().source,
awaitResult
String failMessage = String.format(
"Timed out waiting for event type %s and source %s.",
expected.getKey().type,
expected.getKey().source
);
assertTrue(failMessage, awaitResult);
int expectedCount = expected.getValue().getInitialCount();
int receivedCount = expected.getValue().getCurrentCount();
String failMessage = String.format(
"Expected %d events for '%s', but received %d",
expectedCount,
expected.getKey(),
receivedCount
);
failMessage =
String.format(
"Expected %d events for '%s', but received %d",
expectedCount,
expected.getKey(),
receivedCount
);
assertEquals(failMessage, expectedCount, receivedCount);
}

Expand Down Expand Up @@ -372,10 +372,11 @@ public static void assertUnexpectedEvents(final boolean shouldWait) throws Inter
MobileCore.log(
LoggingMode.DEBUG,
TAG,
"Received unexpected event with type: " +
receivedEvent.getKey().type +
" source: " +
receivedEvent.getKey().source
String.format(
"Received unexpected event with type: %s source: %s",
receivedEvent.getKey().type,
receivedEvent.getKey().source
)
);
}
}
Expand Down