Skip to content

Commit

Permalink
Update ServerRequestTests.java
Browse files Browse the repository at this point in the history
  • Loading branch information
gdeluna-branch committed Oct 14, 2023
1 parent 7f50ed2 commit c81e744
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void tearDown() throws InterruptedException {

@Test
public void testTimedOutInitSessionCallbackInvoked() {
setTimeouts(1, PrefHelper.CONNECT_TIMEOUT);
setTimeouts(1, 1);
initSessionResumeActivity(null, new Runnable() {
@Override
public void run() {
Expand All @@ -49,7 +49,7 @@ public void testTimedOutLastAttributedTouchDataCallbackInvoked() {
initSessionResumeActivity(null, new Runnable() {
@Override
public void run() {
setTimeouts(1, PrefHelper.CONNECT_TIMEOUT);
setTimeouts(1, 1);

final CountDownLatch lock1 = new CountDownLatch(1);
Branch.getInstance().getLastAttributedTouchData(new ServerRequestGetLATD.BranchLastAttributedTouchDataListener() {
Expand All @@ -76,7 +76,7 @@ public void testTimedOutGenerateShortUrlCallbackInvoked() {
initSessionResumeActivity(null, new Runnable() {
@Override
public void run() {
setTimeouts(1, PrefHelper.CONNECT_TIMEOUT);
setTimeouts(1, 1);

final CountDownLatch lock3 = new CountDownLatch(1);
BranchUniversalObject buo = new BranchUniversalObject()
Expand All @@ -100,9 +100,13 @@ public void run() {
@Override
public void onLinkCreate(String url, BranchError error) {
BranchLogger.v("error is " + error);
Assert.assertTrue((BranchError.ERR_BRANCH_REQ_TIMED_OUT == error.getErrorCode())
|| BranchError.ERR_BRANCH_NO_CONNECTIVITY == error.getErrorCode());
lock3.countDown();
if (error == null) {
Assert.fail("Error was null");
}
else {
Assert.assertTrue((BranchError.ERR_BRANCH_REQ_TIMED_OUT == error.getErrorCode()) || BranchError.ERR_BRANCH_NO_CONNECTIVITY == error.getErrorCode());
lock3.countDown();
}
}
});
try {
Expand Down

0 comments on commit c81e744

Please sign in to comment.