Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
16da3f2c
Verified
Commit
16da3f2c
authored
8 years ago
by
Torsten Grote
Browse files
Options
Downloads
Patches
Plain Diff
Fix SharerLeavesBeforeResponse Integration Test
Closes #575
parent
4a436607
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-android-tests/src/test/java/org/briarproject/ForumSharingIntegrationTest.java
+38
-8
38 additions, 8 deletions
...st/java/org/briarproject/ForumSharingIntegrationTest.java
with
38 additions
and
8 deletions
briar-android-tests/src/test/java/org/briarproject/ForumSharingIntegrationTest.java
+
38
−
8
View file @
16da3f2c
...
...
@@ -113,6 +113,7 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
private
final
String
SHARER
=
"Sharer"
;
private
final
String
INVITEE
=
"Invitee"
;
private
final
String
SHARER2
=
"Sharer2"
;
private
boolean
respond
=
true
;
private
static
final
Logger
LOG
=
Logger
.
getLogger
(
ForumSharingIntegrationTest
.
class
.
getName
());
...
...
@@ -408,7 +409,7 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
public
void
testSharerLeavesBeforeResponse
()
throws
Exception
{
startLifecycles
();
try
{
// initialize
and let invitee accept all request
s
// initialize
except event listener
s
defaultInit
(
true
);
// send invitation
...
...
@@ -418,17 +419,43 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
// sharer un-subscribes from forum
forumManager0
.
removeForum
(
forum0
);
// from here on expect the response to fail with an AssertionError,
// because there is in fact no invited forum available anymore
thrown
.
expect
(
AssertionError
.
class
);
// prevent invitee response before syncing messages
respond
=
false
;
// sync first request message and leave message
syncToInvitee
();
eventWaiter
.
await
(
TIMEOUT
,
1
);
assertTrue
(
listener1
.
requestReceived
);
// invitee has no forums available
// wait also for second message to arrive
msgWaiter
.
await
(
TIMEOUT
,
1
);
// ensure that invitee has no forum invitations available
assertEquals
(
0
,
forumSharingManager1
.
getInvited
().
size
());
assertEquals
(
0
,
forumManager1
.
getForums
().
size
());
// Try again, this time allow the response
addForumForSharer
();
respond
=
true
;
// send invitation
forumSharingManager0
.
sendInvitation
(
forum0
.
getId
(),
contactId1
,
null
);
// sharer un-subscribes from forum
forumManager0
.
removeForum
(
forum0
);
// sync first request message and leave message
syncToInvitee
();
eventWaiter
.
await
(
TIMEOUT
,
1
);
assertTrue
(
listener1
.
requestReceived
);
// wait also for second message to arrive
msgWaiter
.
await
(
TIMEOUT
,
1
);
// ensure that invitee has no forum invitations available
assertEquals
(
0
,
forumSharingManager1
.
getInvited
().
size
());
assertEquals
(
1
,
forumManager1
.
getForums
().
size
());
}
finally
{
stopLifecycles
();
}
...
...
@@ -979,9 +1006,12 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
try
{
eventWaiter
.
assertEquals
(
1
,
forumSharingManager1
.
getInvited
().
size
());
Contact
c
=
contactManager1
.
getContact
(
event
.
getContactId
());
forumSharingManager1
.
respondToInvitation
(
f
,
c
,
accept
);
if
(
respond
)
{
Contact
c
=
contactManager1
.
getContact
(
event
.
getContactId
());
forumSharingManager1
.
respondToInvitation
(
f
,
c
,
accept
);
}
}
catch
(
DbException
ex
)
{
eventWaiter
.
rethrow
(
ex
);
}
finally
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment