mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
Rename object to nameable
This commit is contained in:
@@ -108,7 +108,7 @@ class BlogControllerImpl extends BaseControllerImpl
|
|||||||
BlogInvitationResponseReceivedEvent b =
|
BlogInvitationResponseReceivedEvent b =
|
||||||
(BlogInvitationResponseReceivedEvent) e;
|
(BlogInvitationResponseReceivedEvent) e;
|
||||||
PrivateResponse<Blog> r = b.getMessageHeader();
|
PrivateResponse<Blog> r = b.getMessageHeader();
|
||||||
if (r.getObject().getId().equals(groupId) && r.wasAccepted()) {
|
if (r.getNameable().getId().equals(groupId) && r.wasAccepted()) {
|
||||||
LOG.info("Blog invitation accepted");
|
LOG.info("Blog invitation accepted");
|
||||||
onBlogInvitationAccepted(b.getContactId());
|
onBlogInvitationAccepted(b.getContactId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ abstract class ConversationItem {
|
|||||||
return new ConversationRequestItem(ir.getId(),
|
return new ConversationRequestItem(ir.getId(),
|
||||||
ir.getGroupId(), type, ir.getSessionId(), text,
|
ir.getGroupId(), type, ir.getSessionId(), text,
|
||||||
ir.getMessage(), ir.getTimestamp(), ir.isRead(),
|
ir.getMessage(), ir.getTimestamp(), ir.isRead(),
|
||||||
((Shareable) ir.getObject()).getId(), !ir.wasAnswered(),
|
((Shareable) ir.getNameable()).getId(), !ir.wasAnswered(),
|
||||||
ir.doesExist());
|
ir.doesExist());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,14 +163,14 @@ abstract class ConversationItem {
|
|||||||
if (ir.wasAccepted()) {
|
if (ir.wasAccepted()) {
|
||||||
text = ctx.getString(
|
text = ctx.getString(
|
||||||
R.string.introduction_response_accepted_sent,
|
R.string.introduction_response_accepted_sent,
|
||||||
ir.getObject().getName());
|
ir.getNameable().getName());
|
||||||
text += "\n\n" + ctx.getString(
|
text += "\n\n" + ctx.getString(
|
||||||
R.string.introduction_response_accepted_sent_info,
|
R.string.introduction_response_accepted_sent_info,
|
||||||
ir.getObject().getName());
|
ir.getNameable().getName());
|
||||||
} else {
|
} else {
|
||||||
text = ctx.getString(
|
text = ctx.getString(
|
||||||
R.string.introduction_response_declined_sent,
|
R.string.introduction_response_declined_sent,
|
||||||
ir.getObject().getName());
|
ir.getNameable().getName());
|
||||||
}
|
}
|
||||||
return new ConversationNoticeOutItem(ir.getId(), ir.getGroupId(),
|
return new ConversationNoticeOutItem(ir.getId(), ir.getGroupId(),
|
||||||
text, null, ir.getTimestamp(), ir.isSent(), ir.isSeen());
|
text, null, ir.getTimestamp(), ir.isSent(), ir.isSeen());
|
||||||
@@ -179,7 +179,7 @@ abstract class ConversationItem {
|
|||||||
if (ir.wasAccepted()) {
|
if (ir.wasAccepted()) {
|
||||||
res = R.string.introduction_response_accepted_received;
|
res = R.string.introduction_response_accepted_received;
|
||||||
} else {
|
} else {
|
||||||
if (ir.getObject().isIntroducer()) {
|
if (ir.getNameable().isIntroducer()) {
|
||||||
res = R.string.introduction_response_declined_received;
|
res = R.string.introduction_response_declined_received;
|
||||||
} else {
|
} else {
|
||||||
res =
|
res =
|
||||||
@@ -187,7 +187,7 @@ abstract class ConversationItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String text =
|
String text =
|
||||||
ctx.getString(res, contactName, ir.getObject().getName());
|
ctx.getString(res, contactName, ir.getNameable().getName());
|
||||||
return new ConversationNoticeInItem(ir.getId(), ir.getGroupId(),
|
return new ConversationNoticeInItem(ir.getId(), ir.getGroupId(),
|
||||||
text, null, ir.getTimestamp(), ir.isRead());
|
text, null, ir.getTimestamp(), ir.isRead());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class ForumControllerImpl extends
|
|||||||
ForumInvitationResponseReceivedEvent f =
|
ForumInvitationResponseReceivedEvent f =
|
||||||
(ForumInvitationResponseReceivedEvent) e;
|
(ForumInvitationResponseReceivedEvent) e;
|
||||||
ForumInvitationResponse r = f.getMessageHeader();
|
ForumInvitationResponse r = f.getMessageHeader();
|
||||||
if (r.getObject().getId().equals(getGroupId()) && r.wasAccepted()) {
|
if (r.getNameable().getId().equals(getGroupId()) && r.wasAccepted()) {
|
||||||
LOG.info("Forum invitation was accepted");
|
LOG.info("Forum invitation was accepted");
|
||||||
onForumInvitationAccepted(f.getContactId());
|
onForumInvitationAccepted(f.getContactId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class GroupControllerImpl extends
|
|||||||
GroupInvitationResponseReceivedEvent g =
|
GroupInvitationResponseReceivedEvent g =
|
||||||
(GroupInvitationResponseReceivedEvent) e;
|
(GroupInvitationResponseReceivedEvent) e;
|
||||||
GroupInvitationResponse r = g.getMessageHeader();
|
GroupInvitationResponse r = g.getMessageHeader();
|
||||||
if (getGroupId().equals(r.getObject().getId()) && r.wasAccepted()) {
|
if (getGroupId().equals(r.getNameable().getId()) && r.wasAccepted()) {
|
||||||
listener.runOnUiThreadUnlessDestroyed(
|
listener.runOnUiThreadUnlessDestroyed(
|
||||||
() -> listener.onInvitationAccepted(g.getContactId()));
|
() -> listener.onInvitationAccepted(g.getContactId()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,21 +10,21 @@ import javax.annotation.concurrent.Immutable;
|
|||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
@NotNullByDefault
|
@NotNullByDefault
|
||||||
public class PrivateRequest<O extends Nameable> extends PrivateMessageHeader {
|
public class PrivateRequest<N extends Nameable> extends PrivateMessageHeader {
|
||||||
|
|
||||||
private final SessionId sessionId;
|
private final SessionId sessionId;
|
||||||
private final O object;
|
private final N nameable;
|
||||||
@Nullable
|
@Nullable
|
||||||
private final String message;
|
private final String message;
|
||||||
private final boolean answered, exists;
|
private final boolean answered, exists;
|
||||||
|
|
||||||
public PrivateRequest(MessageId messageId, GroupId groupId, long time,
|
public PrivateRequest(MessageId messageId, GroupId groupId, long time,
|
||||||
boolean local, boolean sent, boolean seen, boolean read,
|
boolean local, boolean sent, boolean seen, boolean read,
|
||||||
SessionId sessionId, O object, @Nullable String message,
|
SessionId sessionId, N nameable, @Nullable String message,
|
||||||
boolean answered, boolean exists) {
|
boolean answered, boolean exists) {
|
||||||
super(messageId, groupId, time, local, sent, seen, read);
|
super(messageId, groupId, time, local, sent, seen, read);
|
||||||
this.sessionId = sessionId;
|
this.sessionId = sessionId;
|
||||||
this.object = object;
|
this.nameable = nameable;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.answered = answered;
|
this.answered = answered;
|
||||||
this.exists = exists;
|
this.exists = exists;
|
||||||
@@ -34,12 +34,12 @@ public class PrivateRequest<O extends Nameable> extends PrivateMessageHeader {
|
|||||||
return sessionId;
|
return sessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public O getObject() {
|
public N getNameable() {
|
||||||
return object;
|
return nameable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return object.getName();
|
return nameable.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -9,19 +9,19 @@ import javax.annotation.concurrent.Immutable;
|
|||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
@NotNullByDefault
|
@NotNullByDefault
|
||||||
public abstract class PrivateResponse<O extends Nameable>
|
public abstract class PrivateResponse<N extends Nameable>
|
||||||
extends PrivateMessageHeader {
|
extends PrivateMessageHeader {
|
||||||
|
|
||||||
private final SessionId sessionId;
|
private final SessionId sessionId;
|
||||||
private final O object;
|
private final N nameable;
|
||||||
private final boolean accepted;
|
private final boolean accepted;
|
||||||
|
|
||||||
public PrivateResponse(MessageId id, GroupId groupId, long time,
|
public PrivateResponse(MessageId id, GroupId groupId, long time,
|
||||||
boolean local, boolean sent, boolean seen, boolean read,
|
boolean local, boolean sent, boolean seen, boolean read,
|
||||||
SessionId sessionId, O object, boolean accepted) {
|
SessionId sessionId, N nameable, boolean accepted) {
|
||||||
super(id, groupId, time, local, sent, seen, read);
|
super(id, groupId, time, local, sent, seen, read);
|
||||||
this.sessionId = sessionId;
|
this.sessionId = sessionId;
|
||||||
this.object = object;
|
this.nameable = nameable;
|
||||||
this.accepted = accepted;
|
this.accepted = accepted;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ public abstract class PrivateResponse<O extends Nameable>
|
|||||||
return sessionId;
|
return sessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public O getObject() {
|
public N getNameable() {
|
||||||
return object;
|
return nameable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean wasAccepted() {
|
public boolean wasAccepted() {
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ class GroupInvitationManagerImpl extends ConversationClientImpl
|
|||||||
GroupInvitationRequest invite = parseInvitationRequest(txn,
|
GroupInvitationRequest invite = parseInvitationRequest(txn,
|
||||||
contactGroupId, m, meta, status);
|
contactGroupId, m, meta, status);
|
||||||
messages.add(invite);
|
messages.add(invite);
|
||||||
privateGroups.put(invite.getSessionId(), invite.getObject());
|
privateGroups.put(invite.getSessionId(), invite.getNameable());
|
||||||
}
|
}
|
||||||
for (Entry<MessageId, BdfDictionary> e : results.entrySet()) {
|
for (Entry<MessageId, BdfDictionary> e : results.entrySet()) {
|
||||||
MessageId m = e.getKey();
|
MessageId m = e.getKey();
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ abstract class SharingManagerImpl<S extends Shareable>
|
|||||||
PrivateRequest<S> invite = parseInvitationRequest(txn, c, m,
|
PrivateRequest<S> invite = parseInvitationRequest(txn, c, m,
|
||||||
meta, status);
|
meta, status);
|
||||||
messages.add(invite);
|
messages.add(invite);
|
||||||
shareables.put(invite.getObject().getId(), invite.getObject());
|
shareables.put(invite.getNameable().getId(), invite.getNameable());
|
||||||
}
|
}
|
||||||
for (Entry<MessageId, BdfDictionary> e : results.entrySet()) {
|
for (Entry<MessageId, BdfDictionary> e : results.entrySet()) {
|
||||||
MessageId m = e.getKey();
|
MessageId m = e.getKey();
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ public class IntroductionIntegrationTest
|
|||||||
eventWaiter.await(TIMEOUT, 1);
|
eventWaiter.await(TIMEOUT, 1);
|
||||||
assertTrue(listener0.response1Received);
|
assertTrue(listener0.response1Received);
|
||||||
assertEquals(introducee2.getAuthor().getName(),
|
assertEquals(introducee2.getAuthor().getName(),
|
||||||
listener0.getResponse().getObject().getName());
|
listener0.getResponse().getNameable().getName());
|
||||||
assertGroupCount(messageTracker0, g1.getId(), 2, 1);
|
assertGroupCount(messageTracker0, g1.getId(), 2, 1);
|
||||||
|
|
||||||
// sync second ACCEPT message
|
// sync second ACCEPT message
|
||||||
@@ -169,7 +169,7 @@ public class IntroductionIntegrationTest
|
|||||||
eventWaiter.await(TIMEOUT, 1);
|
eventWaiter.await(TIMEOUT, 1);
|
||||||
assertTrue(listener0.response2Received);
|
assertTrue(listener0.response2Received);
|
||||||
assertEquals(introducee1.getAuthor().getName(),
|
assertEquals(introducee1.getAuthor().getName(),
|
||||||
listener0.getResponse().getObject().getName());
|
listener0.getResponse().getNameable().getName());
|
||||||
assertGroupCount(messageTracker0, g2.getId(), 2, 1);
|
assertGroupCount(messageTracker0, g2.getId(), 2, 1);
|
||||||
|
|
||||||
// sync forwarded ACCEPT messages to introducees
|
// sync forwarded ACCEPT messages to introducees
|
||||||
@@ -267,7 +267,7 @@ public class IntroductionIntegrationTest
|
|||||||
|
|
||||||
// assert that the name on the decline event is correct
|
// assert that the name on the decline event is correct
|
||||||
assertEquals(introducee2.getAuthor().getName(),
|
assertEquals(introducee2.getAuthor().getName(),
|
||||||
listener0.getResponse().getObject().getName());
|
listener0.getResponse().getNameable().getName());
|
||||||
|
|
||||||
// sync second response
|
// sync second response
|
||||||
sync2To0(1, true);
|
sync2To0(1, true);
|
||||||
@@ -284,7 +284,7 @@ public class IntroductionIntegrationTest
|
|||||||
// assert that the name on the decline event is correct
|
// assert that the name on the decline event is correct
|
||||||
eventWaiter.await(TIMEOUT, 1);
|
eventWaiter.await(TIMEOUT, 1);
|
||||||
assertEquals(introducee1.getAuthor().getName(),
|
assertEquals(introducee1.getAuthor().getName(),
|
||||||
listener2.getResponse().getObject().getName());
|
listener2.getResponse().getNameable().getName());
|
||||||
|
|
||||||
// note how the introducer does not forward the second response,
|
// note how the introducer does not forward the second response,
|
||||||
// because after the first decline the protocol finished
|
// because after the first decline the protocol finished
|
||||||
@@ -358,7 +358,7 @@ public class IntroductionIntegrationTest
|
|||||||
// assert that the name on the decline event is correct
|
// assert that the name on the decline event is correct
|
||||||
eventWaiter.await(TIMEOUT, 1);
|
eventWaiter.await(TIMEOUT, 1);
|
||||||
assertEquals(contact2From0.getAuthor().getName(),
|
assertEquals(contact2From0.getAuthor().getName(),
|
||||||
listener1.getResponse().getObject().getName());
|
listener1.getResponse().getNameable().getName());
|
||||||
|
|
||||||
assertFalse(contactManager1
|
assertFalse(contactManager1
|
||||||
.contactExists(author2.getId(), author1.getId()));
|
.contactExists(author2.getId(), author1.getId()));
|
||||||
@@ -486,7 +486,7 @@ public class IntroductionIntegrationTest
|
|||||||
// assert that the name on the decline event is correct
|
// assert that the name on the decline event is correct
|
||||||
eventWaiter.await(TIMEOUT, 1);
|
eventWaiter.await(TIMEOUT, 1);
|
||||||
assertEquals(introducee1.getAuthor().getName(),
|
assertEquals(introducee1.getAuthor().getName(),
|
||||||
listener2.getResponse().getObject().getName());
|
listener2.getResponse().getNameable().getName());
|
||||||
|
|
||||||
// assert that introducee2 is in correct state
|
// assert that introducee2 is in correct state
|
||||||
introduceeSession = getIntroduceeSession(c2);
|
introduceeSession = getIntroduceeSession(c2);
|
||||||
|
|||||||
@@ -99,9 +99,9 @@ public class GroupInvitationIntegrationTest
|
|||||||
GroupInvitationRequest request =
|
GroupInvitationRequest request =
|
||||||
(GroupInvitationRequest) messages.iterator().next();
|
(GroupInvitationRequest) messages.iterator().next();
|
||||||
assertEquals(msg, request.getMessage());
|
assertEquals(msg, request.getMessage());
|
||||||
assertEquals(author0, request.getObject().getCreator());
|
assertEquals(author0, request.getNameable().getCreator());
|
||||||
assertEquals(timestamp, request.getTimestamp());
|
assertEquals(timestamp, request.getTimestamp());
|
||||||
assertEquals(privateGroup0.getName(), request.getObject().getName());
|
assertEquals(privateGroup0.getName(), request.getNameable().getName());
|
||||||
assertFalse(request.isLocal());
|
assertFalse(request.isLocal());
|
||||||
assertFalse(request.isRead());
|
assertFalse(request.isRead());
|
||||||
assertFalse(request.doesExist());
|
assertFalse(request.doesExist());
|
||||||
@@ -127,7 +127,7 @@ public class GroupInvitationIntegrationTest
|
|||||||
if (m instanceof GroupInvitationResponse) {
|
if (m instanceof GroupInvitationResponse) {
|
||||||
foundResponse = true;
|
foundResponse = true;
|
||||||
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
||||||
assertEquals(privateGroup0, response.getObject());
|
assertEquals(privateGroup0, response.getNameable());
|
||||||
assertTrue(response.isLocal());
|
assertTrue(response.isLocal());
|
||||||
assertFalse(response.wasAccepted());
|
assertFalse(response.wasAccepted());
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ public class GroupInvitationIntegrationTest
|
|||||||
if (m instanceof GroupInvitationResponse) {
|
if (m instanceof GroupInvitationResponse) {
|
||||||
foundResponse = true;
|
foundResponse = true;
|
||||||
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
||||||
assertEquals(privateGroup0, response.getObject());
|
assertEquals(privateGroup0, response.getNameable());
|
||||||
assertFalse(response.isLocal());
|
assertFalse(response.isLocal());
|
||||||
assertFalse(response.wasAccepted());
|
assertFalse(response.wasAccepted());
|
||||||
}
|
}
|
||||||
@@ -177,11 +177,11 @@ public class GroupInvitationIntegrationTest
|
|||||||
if (m instanceof GroupInvitationResponse) {
|
if (m instanceof GroupInvitationResponse) {
|
||||||
foundResponse = true;
|
foundResponse = true;
|
||||||
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
||||||
assertEquals(privateGroup0, response.getObject());
|
assertEquals(privateGroup0, response.getNameable());
|
||||||
assertTrue(response.wasAccepted());
|
assertTrue(response.wasAccepted());
|
||||||
} else {
|
} else {
|
||||||
GroupInvitationRequest request = (GroupInvitationRequest) m;
|
GroupInvitationRequest request = (GroupInvitationRequest) m;
|
||||||
assertEquals(privateGroup0, request.getObject());
|
assertEquals(privateGroup0, request.getNameable());
|
||||||
assertTrue(request.doesExist());
|
assertTrue(request.doesExist());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,7 @@ public class GroupInvitationIntegrationTest
|
|||||||
if (m instanceof GroupInvitationResponse) {
|
if (m instanceof GroupInvitationResponse) {
|
||||||
foundResponse = true;
|
foundResponse = true;
|
||||||
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
GroupInvitationResponse response = (GroupInvitationResponse) m;
|
||||||
assertEquals(privateGroup0, response.getObject());
|
assertEquals(privateGroup0, response.getNameable());
|
||||||
assertTrue(response.wasAccepted());
|
assertTrue(response.wasAccepted());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -708,11 +708,11 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
|||||||
if (m.getId().equals(message.getId())) {
|
if (m.getId().equals(message.getId())) {
|
||||||
assertTrue(m instanceof GroupInvitationRequest);
|
assertTrue(m instanceof GroupInvitationRequest);
|
||||||
assertEquals(time1, m.getTimestamp());
|
assertEquals(time1, m.getTimestamp());
|
||||||
assertEquals(pg, ((GroupInvitationRequest) m).getObject());
|
assertEquals(pg, ((GroupInvitationRequest) m).getNameable());
|
||||||
} else if (m.getId().equals(messageId2)) {
|
} else if (m.getId().equals(messageId2)) {
|
||||||
assertTrue(m instanceof GroupInvitationResponse);
|
assertTrue(m instanceof GroupInvitationResponse);
|
||||||
assertEquals(time2, m.getTimestamp());
|
assertEquals(time2, m.getTimestamp());
|
||||||
assertEquals(pg, ((GroupInvitationResponse) m).getObject());
|
assertEquals(pg, ((GroupInvitationResponse) m).getNameable());
|
||||||
} else {
|
} else {
|
||||||
throw new AssertionError();
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,15 +152,15 @@ public class BlogSharingIntegrationTest
|
|||||||
for (PrivateMessageHeader m : list) {
|
for (PrivateMessageHeader m : list) {
|
||||||
if (m instanceof BlogInvitationRequest) {
|
if (m instanceof BlogInvitationRequest) {
|
||||||
BlogInvitationRequest invitation = (BlogInvitationRequest) m;
|
BlogInvitationRequest invitation = (BlogInvitationRequest) m;
|
||||||
assertEquals(blog2, invitation.getObject());
|
assertEquals(blog2, invitation.getNameable());
|
||||||
assertFalse(invitation.wasAnswered());
|
assertFalse(invitation.wasAnswered());
|
||||||
assertEquals(blog2.getAuthor().getName(),
|
assertEquals(blog2.getAuthor().getName(),
|
||||||
invitation.getName());
|
invitation.getName());
|
||||||
assertFalse(invitation.getObject().isRssFeed());
|
assertFalse(invitation.getNameable().isRssFeed());
|
||||||
assertEquals("Hi!", invitation.getMessage());
|
assertEquals("Hi!", invitation.getMessage());
|
||||||
} else {
|
} else {
|
||||||
BlogInvitationResponse response = (BlogInvitationResponse) m;
|
BlogInvitationResponse response = (BlogInvitationResponse) m;
|
||||||
assertEquals(blog2, response.getObject());
|
assertEquals(blog2, response.getNameable());
|
||||||
assertTrue(response.wasAccepted());
|
assertTrue(response.wasAccepted());
|
||||||
assertTrue(response.isLocal());
|
assertTrue(response.isLocal());
|
||||||
}
|
}
|
||||||
@@ -225,15 +225,15 @@ public class BlogSharingIntegrationTest
|
|||||||
for (PrivateMessageHeader m : list) {
|
for (PrivateMessageHeader m : list) {
|
||||||
if (m instanceof BlogInvitationRequest) {
|
if (m instanceof BlogInvitationRequest) {
|
||||||
BlogInvitationRequest invitation = (BlogInvitationRequest) m;
|
BlogInvitationRequest invitation = (BlogInvitationRequest) m;
|
||||||
assertEquals(rssBlog, invitation.getObject());
|
assertEquals(rssBlog, invitation.getNameable());
|
||||||
assertFalse(invitation.wasAnswered());
|
assertFalse(invitation.wasAnswered());
|
||||||
assertEquals(rssBlog.getAuthor().getName(),
|
assertEquals(rssBlog.getAuthor().getName(),
|
||||||
invitation.getName());
|
invitation.getName());
|
||||||
assertTrue(invitation.getObject().isRssFeed());
|
assertTrue(invitation.getNameable().isRssFeed());
|
||||||
assertEquals("Hi!", invitation.getMessage());
|
assertEquals("Hi!", invitation.getMessage());
|
||||||
} else {
|
} else {
|
||||||
BlogInvitationResponse response = (BlogInvitationResponse) m;
|
BlogInvitationResponse response = (BlogInvitationResponse) m;
|
||||||
assertEquals(rssBlog, response.getObject());
|
assertEquals(rssBlog, response.getNameable());
|
||||||
assertTrue(response.wasAccepted());
|
assertTrue(response.wasAccepted());
|
||||||
assertTrue(response.isLocal());
|
assertTrue(response.isLocal());
|
||||||
}
|
}
|
||||||
@@ -287,14 +287,14 @@ public class BlogSharingIntegrationTest
|
|||||||
for (PrivateMessageHeader m : list) {
|
for (PrivateMessageHeader m : list) {
|
||||||
if (m instanceof BlogInvitationRequest) {
|
if (m instanceof BlogInvitationRequest) {
|
||||||
BlogInvitationRequest invitation = (BlogInvitationRequest) m;
|
BlogInvitationRequest invitation = (BlogInvitationRequest) m;
|
||||||
assertEquals(blog2, invitation.getObject());
|
assertEquals(blog2, invitation.getNameable());
|
||||||
assertFalse(invitation.wasAnswered());
|
assertFalse(invitation.wasAnswered());
|
||||||
assertEquals(blog2.getAuthor().getName(),
|
assertEquals(blog2.getAuthor().getName(),
|
||||||
invitation.getName());
|
invitation.getName());
|
||||||
assertEquals(null, invitation.getMessage());
|
assertEquals(null, invitation.getMessage());
|
||||||
} else {
|
} else {
|
||||||
BlogInvitationResponse response = (BlogInvitationResponse) m;
|
BlogInvitationResponse response = (BlogInvitationResponse) m;
|
||||||
assertEquals(blog2, response.getObject());
|
assertEquals(blog2, response.getNameable());
|
||||||
assertFalse(response.wasAccepted());
|
assertFalse(response.wasAccepted());
|
||||||
assertTrue(response.isLocal());
|
assertTrue(response.isLocal());
|
||||||
}
|
}
|
||||||
@@ -559,7 +559,7 @@ public class BlogSharingIntegrationTest
|
|||||||
BlogInvitationRequestReceivedEvent event =
|
BlogInvitationRequestReceivedEvent event =
|
||||||
(BlogInvitationRequestReceivedEvent) e;
|
(BlogInvitationRequestReceivedEvent) e;
|
||||||
eventWaiter.assertEquals(contactId1From0, event.getContactId());
|
eventWaiter.assertEquals(contactId1From0, event.getContactId());
|
||||||
Blog b = event.getMessageHeader().getObject();
|
Blog b = event.getMessageHeader().getNameable();
|
||||||
try {
|
try {
|
||||||
Contact c = contactManager0.getContact(contactId1From0);
|
Contact c = contactManager0.getContact(contactId1From0);
|
||||||
blogSharingManager0.respondToInvitation(b, c, true);
|
blogSharingManager0.respondToInvitation(b, c, true);
|
||||||
@@ -595,7 +595,7 @@ public class BlogSharingIntegrationTest
|
|||||||
(BlogInvitationRequestReceivedEvent) e;
|
(BlogInvitationRequestReceivedEvent) e;
|
||||||
requestReceived = true;
|
requestReceived = true;
|
||||||
if (!answer) return;
|
if (!answer) return;
|
||||||
Blog b = event.getMessageHeader().getObject();
|
Blog b = event.getMessageHeader().getNameable();
|
||||||
try {
|
try {
|
||||||
eventWaiter.assertEquals(1,
|
eventWaiter.assertEquals(1,
|
||||||
blogSharingManager1.getInvitations().size());
|
blogSharingManager1.getInvitations().size());
|
||||||
|
|||||||
@@ -137,12 +137,12 @@ public class ForumSharingIntegrationTest
|
|||||||
ForumInvitationRequest invitation = (ForumInvitationRequest) m;
|
ForumInvitationRequest invitation = (ForumInvitationRequest) m;
|
||||||
assertFalse(invitation.wasAnswered());
|
assertFalse(invitation.wasAnswered());
|
||||||
assertEquals(forum0.getName(), invitation.getName());
|
assertEquals(forum0.getName(), invitation.getName());
|
||||||
assertEquals(forum0, invitation.getObject());
|
assertEquals(forum0, invitation.getNameable());
|
||||||
assertEquals("Hi!", invitation.getMessage());
|
assertEquals("Hi!", invitation.getMessage());
|
||||||
assertTrue(invitation.doesExist());
|
assertTrue(invitation.doesExist());
|
||||||
} else {
|
} else {
|
||||||
ForumInvitationResponse response = (ForumInvitationResponse) m;
|
ForumInvitationResponse response = (ForumInvitationResponse) m;
|
||||||
assertEquals(forum0, response.getObject());
|
assertEquals(forum0, response.getNameable());
|
||||||
assertTrue(response.wasAccepted());
|
assertTrue(response.wasAccepted());
|
||||||
assertTrue(response.isLocal());
|
assertTrue(response.isLocal());
|
||||||
}
|
}
|
||||||
@@ -191,14 +191,14 @@ public class ForumSharingIntegrationTest
|
|||||||
for (PrivateMessageHeader m : list) {
|
for (PrivateMessageHeader m : list) {
|
||||||
if (m instanceof ForumInvitationRequest) {
|
if (m instanceof ForumInvitationRequest) {
|
||||||
ForumInvitationRequest invitation = (ForumInvitationRequest) m;
|
ForumInvitationRequest invitation = (ForumInvitationRequest) m;
|
||||||
assertEquals(forum0, invitation.getObject());
|
assertEquals(forum0, invitation.getNameable());
|
||||||
assertFalse(invitation.wasAnswered());
|
assertFalse(invitation.wasAnswered());
|
||||||
assertEquals(forum0.getName(), invitation.getName());
|
assertEquals(forum0.getName(), invitation.getName());
|
||||||
assertEquals(null, invitation.getMessage());
|
assertEquals(null, invitation.getMessage());
|
||||||
assertFalse(invitation.doesExist());
|
assertFalse(invitation.doesExist());
|
||||||
} else {
|
} else {
|
||||||
ForumInvitationResponse response = (ForumInvitationResponse) m;
|
ForumInvitationResponse response = (ForumInvitationResponse) m;
|
||||||
assertEquals(forum0, response.getObject());
|
assertEquals(forum0, response.getNameable());
|
||||||
assertFalse(response.wasAccepted());
|
assertFalse(response.wasAccepted());
|
||||||
assertTrue(response.isLocal());
|
assertTrue(response.isLocal());
|
||||||
}
|
}
|
||||||
@@ -805,7 +805,7 @@ public class ForumSharingIntegrationTest
|
|||||||
(ForumInvitationRequestReceivedEvent) e;
|
(ForumInvitationRequestReceivedEvent) e;
|
||||||
eventWaiter.assertEquals(contactId1From0, event.getContactId());
|
eventWaiter.assertEquals(contactId1From0, event.getContactId());
|
||||||
requestReceived = true;
|
requestReceived = true;
|
||||||
Forum f = event.getMessageHeader().getObject();
|
Forum f = event.getMessageHeader().getNameable();
|
||||||
try {
|
try {
|
||||||
if (respond) {
|
if (respond) {
|
||||||
Contact c = contactManager0.getContact(contactId1From0);
|
Contact c = contactManager0.getContact(contactId1From0);
|
||||||
@@ -843,7 +843,7 @@ public class ForumSharingIntegrationTest
|
|||||||
(ForumInvitationRequestReceivedEvent) e;
|
(ForumInvitationRequestReceivedEvent) e;
|
||||||
requestReceived = true;
|
requestReceived = true;
|
||||||
if (!answer) return;
|
if (!answer) return;
|
||||||
Forum f = event.getMessageHeader().getObject();
|
Forum f = event.getMessageHeader().getNameable();
|
||||||
try {
|
try {
|
||||||
if (respond) {
|
if (respond) {
|
||||||
eventWaiter.assertEquals(1,
|
eventWaiter.assertEquals(1,
|
||||||
|
|||||||
Reference in New Issue
Block a user