mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Add client version to groups table.
This commit is contained in:
@@ -241,7 +241,8 @@ public interface DatabaseComponent {
|
|||||||
* <p/>
|
* <p/>
|
||||||
* Read-only.
|
* Read-only.
|
||||||
*/
|
*/
|
||||||
Collection<Group> getGroups(Transaction txn, ClientId c) throws DbException;
|
Collection<Group> getGroups(Transaction txn, ClientId c, int clientVersion)
|
||||||
|
throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the given group's visibility to the given contact, or
|
* Returns the given group's visibility to the given contact, or
|
||||||
|
|||||||
@@ -17,13 +17,16 @@ public class Group {
|
|||||||
|
|
||||||
private final GroupId id;
|
private final GroupId id;
|
||||||
private final ClientId clientId;
|
private final ClientId clientId;
|
||||||
|
private final int clientVersion;
|
||||||
private final byte[] descriptor;
|
private final byte[] descriptor;
|
||||||
|
|
||||||
public Group(GroupId id, ClientId clientId, byte[] descriptor) {
|
public Group(GroupId id, ClientId clientId, int clientVersion,
|
||||||
|
byte[] descriptor) {
|
||||||
if (descriptor.length > MAX_GROUP_DESCRIPTOR_LENGTH)
|
if (descriptor.length > MAX_GROUP_DESCRIPTOR_LENGTH)
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.clientId = clientId;
|
this.clientId = clientId;
|
||||||
|
this.clientVersion = clientVersion;
|
||||||
this.descriptor = descriptor;
|
this.descriptor = descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,6 +44,13 @@ public class Group {
|
|||||||
return clientId;
|
return clientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the version of the client to which the group belongs.
|
||||||
|
*/
|
||||||
|
public int getClientVersion() {
|
||||||
|
return clientVersion;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the group's descriptor.
|
* Returns the group's descriptor.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -117,15 +117,16 @@ public class TestUtils {
|
|||||||
return new Author(id, FORMAT_VERSION, name, publicKey);
|
return new Author(id, FORMAT_VERSION, name, publicKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Group getGroup(ClientId clientId) {
|
public static Group getGroup(ClientId clientId, int clientVersion) {
|
||||||
int descriptorLength = 1 + random.nextInt(MAX_GROUP_DESCRIPTOR_LENGTH);
|
int descriptorLength = 1 + random.nextInt(MAX_GROUP_DESCRIPTOR_LENGTH);
|
||||||
return getGroup(clientId, descriptorLength);
|
return getGroup(clientId, clientVersion, descriptorLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Group getGroup(ClientId clientId, int descriptorLength) {
|
public static Group getGroup(ClientId clientId, int clientVersion,
|
||||||
|
int descriptorLength) {
|
||||||
GroupId groupId = new GroupId(getRandomId());
|
GroupId groupId = new GroupId(getRandomId());
|
||||||
byte[] descriptor = getRandomBytes(descriptorLength);
|
byte[] descriptor = getRandomBytes(descriptorLength);
|
||||||
return new Group(groupId, clientId, descriptor);
|
return new Group(groupId, clientId, clientVersion, descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Message getMessage(GroupId groupId) {
|
public static Message getMessage(GroupId groupId) {
|
||||||
|
|||||||
@@ -266,7 +266,8 @@ interface Database<T> {
|
|||||||
* <p/>
|
* <p/>
|
||||||
* Read-only.
|
* Read-only.
|
||||||
*/
|
*/
|
||||||
Collection<Group> getGroups(T txn, ClientId c) throws DbException;
|
Collection<Group> getGroups(T txn, ClientId c, int clientVersion)
|
||||||
|
throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the given group's visibility to the given contact, or
|
* Returns the given group's visibility to the given contact, or
|
||||||
|
|||||||
@@ -435,10 +435,10 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Group> getGroups(Transaction transaction, ClientId c)
|
public Collection<Group> getGroups(Transaction transaction, ClientId c,
|
||||||
throws DbException {
|
int clientVersion) throws DbException {
|
||||||
T txn = unbox(transaction);
|
T txn = unbox(transaction);
|
||||||
return db.getGroups(txn, c);
|
return db.getGroups(txn, c, clientVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
"CREATE TABLE groups"
|
"CREATE TABLE groups"
|
||||||
+ " (groupId _HASH NOT NULL,"
|
+ " (groupId _HASH NOT NULL,"
|
||||||
+ " clientId _STRING NOT NULL,"
|
+ " clientId _STRING NOT NULL,"
|
||||||
|
+ " clientVersion INT NOT NULL,"
|
||||||
+ " descriptor _BINARY NOT NULL,"
|
+ " descriptor _BINARY NOT NULL,"
|
||||||
+ " PRIMARY KEY (groupId))";
|
+ " PRIMARY KEY (groupId))";
|
||||||
|
|
||||||
@@ -275,9 +276,9 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
"CREATE INDEX IF NOT EXISTS contactsByAuthorId"
|
"CREATE INDEX IF NOT EXISTS contactsByAuthorId"
|
||||||
+ " ON contacts (authorId)";
|
+ " ON contacts (authorId)";
|
||||||
|
|
||||||
private static final String INDEX_GROUPS_BY_CLIENT_ID =
|
private static final String INDEX_GROUPS_BY_CLIENT_ID_CLIENT_VERSION =
|
||||||
"CREATE INDEX IF NOT EXISTS groupsByClientId"
|
"CREATE INDEX IF NOT EXISTS groupsByClientIdClientVersion"
|
||||||
+ " ON groups (clientId)";
|
+ " ON groups (clientId, clientVersion)";
|
||||||
|
|
||||||
private static final String INDEX_MESSAGE_METADATA_BY_GROUP_ID_STATE =
|
private static final String INDEX_MESSAGE_METADATA_BY_GROUP_ID_STATE =
|
||||||
"CREATE INDEX IF NOT EXISTS messageMetadataByGroupIdState"
|
"CREATE INDEX IF NOT EXISTS messageMetadataByGroupIdState"
|
||||||
@@ -444,7 +445,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
try {
|
try {
|
||||||
s = txn.createStatement();
|
s = txn.createStatement();
|
||||||
s.executeUpdate(INDEX_CONTACTS_BY_AUTHOR_ID);
|
s.executeUpdate(INDEX_CONTACTS_BY_AUTHOR_ID);
|
||||||
s.executeUpdate(INDEX_GROUPS_BY_CLIENT_ID);
|
s.executeUpdate(INDEX_GROUPS_BY_CLIENT_ID_CLIENT_VERSION);
|
||||||
s.executeUpdate(INDEX_MESSAGE_METADATA_BY_GROUP_ID_STATE);
|
s.executeUpdate(INDEX_MESSAGE_METADATA_BY_GROUP_ID_STATE);
|
||||||
s.executeUpdate(INDEX_MESSAGE_DEPENDENCIES_BY_DEPENDENCY_ID);
|
s.executeUpdate(INDEX_MESSAGE_DEPENDENCIES_BY_DEPENDENCY_ID);
|
||||||
s.executeUpdate(INDEX_STATUSES_BY_CONTACT_ID_GROUP_ID);
|
s.executeUpdate(INDEX_STATUSES_BY_CONTACT_ID_GROUP_ID);
|
||||||
@@ -612,12 +613,14 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
public void addGroup(Connection txn, Group g) throws DbException {
|
public void addGroup(Connection txn, Group g) throws DbException {
|
||||||
PreparedStatement ps = null;
|
PreparedStatement ps = null;
|
||||||
try {
|
try {
|
||||||
String sql = "INSERT INTO groups (groupId, clientId, descriptor)"
|
String sql = "INSERT INTO groups"
|
||||||
+ " VALUES (?, ?, ?)";
|
+ " (groupId, clientId, clientVersion, descriptor)"
|
||||||
|
+ " VALUES (?, ?, ?, ?)";
|
||||||
ps = txn.prepareStatement(sql);
|
ps = txn.prepareStatement(sql);
|
||||||
ps.setBytes(1, g.getId().getBytes());
|
ps.setBytes(1, g.getId().getBytes());
|
||||||
ps.setString(2, g.getClientId().getString());
|
ps.setString(2, g.getClientId().getString());
|
||||||
ps.setBytes(3, g.getDescriptor());
|
ps.setInt(3, g.getClientVersion());
|
||||||
|
ps.setBytes(4, g.getDescriptor());
|
||||||
int affected = ps.executeUpdate();
|
int affected = ps.executeUpdate();
|
||||||
if (affected != 1) throw new DbStateException();
|
if (affected != 1) throw new DbStateException();
|
||||||
ps.close();
|
ps.close();
|
||||||
@@ -1346,17 +1349,18 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
PreparedStatement ps = null;
|
PreparedStatement ps = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
String sql = "SELECT clientId, descriptor FROM groups"
|
String sql = "SELECT clientId, clientVersion, descriptor"
|
||||||
+ " WHERE groupId = ?";
|
+ " FROM groups WHERE groupId = ?";
|
||||||
ps = txn.prepareStatement(sql);
|
ps = txn.prepareStatement(sql);
|
||||||
ps.setBytes(1, g.getBytes());
|
ps.setBytes(1, g.getBytes());
|
||||||
rs = ps.executeQuery();
|
rs = ps.executeQuery();
|
||||||
if (!rs.next()) throw new DbStateException();
|
if (!rs.next()) throw new DbStateException();
|
||||||
ClientId clientId = new ClientId(rs.getString(1));
|
ClientId clientId = new ClientId(rs.getString(1));
|
||||||
byte[] descriptor = rs.getBytes(2);
|
int clientVersion = rs.getInt(2);
|
||||||
|
byte[] descriptor = rs.getBytes(3);
|
||||||
rs.close();
|
rs.close();
|
||||||
ps.close();
|
ps.close();
|
||||||
return new Group(g, clientId, descriptor);
|
return new Group(g, clientId, clientVersion, descriptor);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
tryToClose(rs);
|
tryToClose(rs);
|
||||||
tryToClose(ps);
|
tryToClose(ps);
|
||||||
@@ -1365,21 +1369,22 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Group> getGroups(Connection txn, ClientId c)
|
public Collection<Group> getGroups(Connection txn, ClientId c,
|
||||||
throws DbException {
|
int clientVersion) throws DbException {
|
||||||
PreparedStatement ps = null;
|
PreparedStatement ps = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
String sql = "SELECT groupId, descriptor FROM groups"
|
String sql = "SELECT groupId, descriptor FROM groups"
|
||||||
+ " WHERE clientId = ?";
|
+ " WHERE clientId = ? AND clientVersion = ?";
|
||||||
ps = txn.prepareStatement(sql);
|
ps = txn.prepareStatement(sql);
|
||||||
ps.setString(1, c.getString());
|
ps.setString(1, c.getString());
|
||||||
|
ps.setInt(2, clientVersion);
|
||||||
rs = ps.executeQuery();
|
rs = ps.executeQuery();
|
||||||
List<Group> groups = new ArrayList<>();
|
List<Group> groups = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
GroupId id = new GroupId(rs.getBytes(1));
|
GroupId id = new GroupId(rs.getBytes(1));
|
||||||
byte[] descriptor = rs.getBytes(2);
|
byte[] descriptor = rs.getBytes(2);
|
||||||
groups.add(new Group(id, c, descriptor));
|
groups.add(new Group(id, c, clientVersion, descriptor));
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
ps.close();
|
ps.close();
|
||||||
|
|||||||
@@ -34,6 +34,6 @@ class GroupFactoryImpl implements GroupFactory {
|
|||||||
byte[] hash = crypto.hash(LABEL, new byte[] {FORMAT_VERSION},
|
byte[] hash = crypto.hash(LABEL, new byte[] {FORMAT_VERSION},
|
||||||
StringUtils.toUtf8(c.getString()), clientVersionBytes,
|
StringUtils.toUtf8(c.getString()), clientVersionBytes,
|
||||||
descriptor);
|
descriptor);
|
||||||
return new Group(new GroupId(hash), c, descriptor);
|
return new Group(new GroupId(hash), c, clientVersion, descriptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public class DatabaseComponentImplTest extends BrambleMockTestCase {
|
|||||||
|
|
||||||
private final Object txn = new Object();
|
private final Object txn = new Object();
|
||||||
private final ClientId clientId;
|
private final ClientId clientId;
|
||||||
|
private final int clientVersion;
|
||||||
private final GroupId groupId;
|
private final GroupId groupId;
|
||||||
private final Group group;
|
private final Group group;
|
||||||
private final Author author;
|
private final Author author;
|
||||||
@@ -106,7 +107,8 @@ public class DatabaseComponentImplTest extends BrambleMockTestCase {
|
|||||||
|
|
||||||
public DatabaseComponentImplTest() {
|
public DatabaseComponentImplTest() {
|
||||||
clientId = getClientId();
|
clientId = getClientId();
|
||||||
group = getGroup(clientId);
|
clientVersion = 123;
|
||||||
|
group = getGroup(clientId, clientVersion);
|
||||||
groupId = group.getId();
|
groupId = group.getId();
|
||||||
author = getAuthor();
|
author = getAuthor();
|
||||||
localAuthor = getLocalAuthor();
|
localAuthor = getLocalAuthor();
|
||||||
@@ -175,7 +177,7 @@ public class DatabaseComponentImplTest extends BrambleMockTestCase {
|
|||||||
oneOf(database).containsGroup(txn, groupId);
|
oneOf(database).containsGroup(txn, groupId);
|
||||||
will(returnValue(true));
|
will(returnValue(true));
|
||||||
// getGroups()
|
// getGroups()
|
||||||
oneOf(database).getGroups(txn, clientId);
|
oneOf(database).getGroups(txn, clientId, clientVersion);
|
||||||
will(returnValue(singletonList(group)));
|
will(returnValue(singletonList(group)));
|
||||||
// removeGroup()
|
// removeGroup()
|
||||||
oneOf(database).containsGroup(txn, groupId);
|
oneOf(database).containsGroup(txn, groupId);
|
||||||
@@ -215,7 +217,7 @@ public class DatabaseComponentImplTest extends BrambleMockTestCase {
|
|||||||
db.addGroup(transaction, group); // First time - listeners called
|
db.addGroup(transaction, group); // First time - listeners called
|
||||||
db.addGroup(transaction, group); // Second time - not called
|
db.addGroup(transaction, group); // Second time - not called
|
||||||
assertEquals(singletonList(group),
|
assertEquals(singletonList(group),
|
||||||
db.getGroups(transaction, clientId));
|
db.getGroups(transaction, clientId, clientVersion));
|
||||||
db.removeGroup(transaction, group);
|
db.removeGroup(transaction, group);
|
||||||
db.removeContact(transaction, contactId);
|
db.removeContact(transaction, contactId);
|
||||||
db.removeLocalAuthor(transaction, localAuthor.getId());
|
db.removeLocalAuthor(transaction, localAuthor.getId());
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ public abstract class DatabasePerformanceTest extends BrambleTestCase {
|
|||||||
String name = "getGroups(T, ClientId)";
|
String name = "getGroups(T, ClientId)";
|
||||||
benchmark(name, db -> {
|
benchmark(name, db -> {
|
||||||
Connection txn = db.startTransaction();
|
Connection txn = db.startTransaction();
|
||||||
db.getGroups(txn, pickRandom(clientIds));
|
db.getGroups(txn, pickRandom(clientIds), 123);
|
||||||
db.commitTransaction(txn);
|
db.commitTransaction(txn);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -550,7 +550,7 @@ public abstract class DatabasePerformanceTest extends BrambleTestCase {
|
|||||||
contacts.add(db.getContact(txn, c));
|
contacts.add(db.getContact(txn, c));
|
||||||
contactGroups.put(c, new ArrayList<>());
|
contactGroups.put(c, new ArrayList<>());
|
||||||
for (int j = 0; j < GROUPS_PER_CONTACT; j++) {
|
for (int j = 0; j < GROUPS_PER_CONTACT; j++) {
|
||||||
Group g = getGroup(clientIds.get(j % CLIENTS));
|
Group g = getGroup(clientIds.get(j % CLIENTS), 123);
|
||||||
groups.add(g);
|
groups.add(g);
|
||||||
messageMeta.put(g.getId(), new ArrayList<>());
|
messageMeta.put(g.getId(), new ArrayList<>());
|
||||||
contactGroups.get(c).add(g);
|
contactGroups.get(c).add(g);
|
||||||
@@ -584,7 +584,7 @@ public abstract class DatabasePerformanceTest extends BrambleTestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < LOCAL_GROUPS; i++) {
|
for (int i = 0; i < LOCAL_GROUPS; i++) {
|
||||||
Group g = getGroup(clientIds.get(i % CLIENTS));
|
Group g = getGroup(clientIds.get(i % CLIENTS), 123);
|
||||||
groups.add(g);
|
groups.add(g);
|
||||||
messageMeta.put(g.getId(), new ArrayList<>());
|
messageMeta.put(g.getId(), new ArrayList<>());
|
||||||
groupMessages.put(g.getId(), new ArrayList<>());
|
groupMessages.put(g.getId(), new ArrayList<>());
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
|||||||
private final File testDir = TestUtils.getTestDirectory();
|
private final File testDir = TestUtils.getTestDirectory();
|
||||||
private final GroupId groupId;
|
private final GroupId groupId;
|
||||||
private final ClientId clientId;
|
private final ClientId clientId;
|
||||||
|
private final int clientVersion;
|
||||||
private final Group group;
|
private final Group group;
|
||||||
private final Author author;
|
private final Author author;
|
||||||
private final LocalAuthor localAuthor;
|
private final LocalAuthor localAuthor;
|
||||||
@@ -96,7 +97,8 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
|||||||
|
|
||||||
JdbcDatabaseTest() throws Exception {
|
JdbcDatabaseTest() throws Exception {
|
||||||
clientId = getClientId();
|
clientId = getClientId();
|
||||||
group = getGroup(clientId);
|
clientVersion = 123;
|
||||||
|
group = getGroup(clientId, clientVersion);
|
||||||
groupId = group.getId();
|
groupId = group.getId();
|
||||||
author = getAuthor();
|
author = getAuthor();
|
||||||
localAuthor = getLocalAuthor();
|
localAuthor = getLocalAuthor();
|
||||||
@@ -1460,7 +1462,7 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
|||||||
db.addMessage(txn, message, PENDING, true, contactId);
|
db.addMessage(txn, message, PENDING, true, contactId);
|
||||||
|
|
||||||
// Add a second group
|
// Add a second group
|
||||||
Group group1 = getGroup(clientId);
|
Group group1 = getGroup(clientId, 123);
|
||||||
GroupId groupId1 = group1.getId();
|
GroupId groupId1 = group1.getId();
|
||||||
db.addGroup(txn, group1);
|
db.addGroup(txn, group1);
|
||||||
|
|
||||||
@@ -1828,6 +1830,22 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
|||||||
db.close();
|
db.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetGroups() throws Exception {
|
||||||
|
Database<Connection> db = open(false);
|
||||||
|
Connection txn = db.startTransaction();
|
||||||
|
|
||||||
|
assertEquals(emptyList(), db.getGroups(txn, clientId, clientVersion));
|
||||||
|
db.addGroup(txn, group);
|
||||||
|
assertEquals(singletonList(group),
|
||||||
|
db.getGroups(txn, clientId, clientVersion));
|
||||||
|
db.removeGroup(txn, groupId);
|
||||||
|
assertEquals(emptyList(), db.getGroups(txn, clientId, clientVersion));
|
||||||
|
|
||||||
|
db.commitTransaction(txn);
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExceptionHandling() throws Exception {
|
public void testExceptionHandling() throws Exception {
|
||||||
Database<Connection> db = open(false);
|
Database<Connection> db = open(false);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
context.mock(ContactGroupFactory.class);
|
context.mock(ContactGroupFactory.class);
|
||||||
private final Clock clock = context.mock(Clock.class);
|
private final Clock clock = context.mock(Clock.class);
|
||||||
|
|
||||||
private final Group localGroup = getGroup(CLIENT_ID);
|
private final Group localGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
private final LocalAuthor localAuthor = getLocalAuthor();
|
private final LocalAuthor localAuthor = getLocalAuthor();
|
||||||
private final BdfDictionary fooPropertiesDict = BdfDictionary.of(
|
private final BdfDictionary fooPropertiesDict = BdfDictionary.of(
|
||||||
new BdfEntry("fooKey1", "fooValue1"),
|
new BdfEntry("fooKey1", "fooValue1"),
|
||||||
@@ -90,8 +90,8 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
Contact contact1 = getContact(true);
|
Contact contact1 = getContact(true);
|
||||||
Contact contact2 = getContact(true);
|
Contact contact2 = getContact(true);
|
||||||
List<Contact> contacts = Arrays.asList(contact1, contact2);
|
List<Contact> contacts = Arrays.asList(contact1, contact2);
|
||||||
Group contactGroup1 = getGroup(CLIENT_ID);
|
Group contactGroup1 = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
Group contactGroup2 = getGroup(CLIENT_ID);
|
Group contactGroup2 = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
|
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
oneOf(db).containsGroup(txn, localGroup.getId());
|
oneOf(db).containsGroup(txn, localGroup.getId());
|
||||||
@@ -144,7 +144,7 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
public void testCreatesContactGroupWhenAddingContact() throws Exception {
|
public void testCreatesContactGroupWhenAddingContact() throws Exception {
|
||||||
Transaction txn = new Transaction(null, false);
|
Transaction txn = new Transaction(null, false);
|
||||||
Contact contact = getContact(true);
|
Contact contact = getContact(true);
|
||||||
Group contactGroup = getGroup(CLIENT_ID);
|
Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
|
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
// Create the group and share it with the contact
|
// Create the group and share it with the contact
|
||||||
@@ -172,7 +172,7 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
public void testRemovesGroupWhenRemovingContact() throws Exception {
|
public void testRemovesGroupWhenRemovingContact() throws Exception {
|
||||||
Transaction txn = new Transaction(null, false);
|
Transaction txn = new Transaction(null, false);
|
||||||
Contact contact = getContact(true);
|
Contact contact = getContact(true);
|
||||||
Group contactGroup = getGroup(CLIENT_ID);
|
Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
|
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
oneOf(contactGroupFactory).createContactGroup(CLIENT_ID,
|
oneOf(contactGroupFactory).createContactGroup(CLIENT_ID,
|
||||||
@@ -307,7 +307,7 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testStoresRemotePropertiesWithVersion0() throws Exception {
|
public void testStoresRemotePropertiesWithVersion0() throws Exception {
|
||||||
Contact contact = getContact(true);
|
Contact contact = getContact(true);
|
||||||
Group contactGroup = getGroup(CLIENT_ID);
|
Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
Transaction txn = new Transaction(null, false);
|
Transaction txn = new Transaction(null, false);
|
||||||
Map<TransportId, TransportProperties> properties =
|
Map<TransportId, TransportProperties> properties =
|
||||||
new LinkedHashMap<>();
|
new LinkedHashMap<>();
|
||||||
@@ -421,8 +421,8 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
Contact contact3 = getContact(true);
|
Contact contact3 = getContact(true);
|
||||||
List<Contact> contacts =
|
List<Contact> contacts =
|
||||||
Arrays.asList(contact1, contact2, contact3);
|
Arrays.asList(contact1, contact2, contact3);
|
||||||
Group contactGroup2 = getGroup(CLIENT_ID);
|
Group contactGroup2 = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
Group contactGroup3 = getGroup(CLIENT_ID);
|
Group contactGroup3 = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
Map<MessageId, BdfDictionary> messageMetadata3 =
|
Map<MessageId, BdfDictionary> messageMetadata3 =
|
||||||
new LinkedHashMap<>();
|
new LinkedHashMap<>();
|
||||||
// A remote update for another transport should be ignored
|
// A remote update for another transport should be ignored
|
||||||
@@ -524,7 +524,7 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
public void testMergingNewPropertiesCreatesUpdate() throws Exception {
|
public void testMergingNewPropertiesCreatesUpdate() throws Exception {
|
||||||
Transaction txn = new Transaction(null, false);
|
Transaction txn = new Transaction(null, false);
|
||||||
Contact contact = getContact(true);
|
Contact contact = getContact(true);
|
||||||
Group contactGroup = getGroup(CLIENT_ID);
|
Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
|
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
oneOf(db).startTransaction(false);
|
oneOf(db).startTransaction(false);
|
||||||
@@ -559,7 +559,7 @@ public class TransportPropertyManagerImplTest extends BrambleMockTestCase {
|
|||||||
public void testMergingUpdatedPropertiesCreatesUpdate() throws Exception {
|
public void testMergingUpdatedPropertiesCreatesUpdate() throws Exception {
|
||||||
Transaction txn = new Transaction(null, false);
|
Transaction txn = new Transaction(null, false);
|
||||||
Contact contact = getContact(true);
|
Contact contact = getContact(true);
|
||||||
Group contactGroup = getGroup(CLIENT_ID);
|
Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
BdfDictionary oldMetadata = BdfDictionary.of(
|
BdfDictionary oldMetadata = BdfDictionary.of(
|
||||||
new BdfEntry("transportId", "foo"),
|
new BdfEntry("transportId", "foo"),
|
||||||
new BdfEntry("version", 1),
|
new BdfEntry("version", 1),
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ import org.junit.Test;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static org.briarproject.bramble.api.plugin.TransportId.MAX_TRANSPORT_ID_LENGTH;
|
import static org.briarproject.bramble.api.plugin.TransportId.MAX_TRANSPORT_ID_LENGTH;
|
||||||
import static org.briarproject.bramble.test.TestUtils.getClientId;
|
import static org.briarproject.bramble.api.properties.TransportPropertyManager.CLIENT_ID;
|
||||||
|
import static org.briarproject.bramble.api.properties.TransportPropertyManager.CLIENT_VERSION;
|
||||||
import static org.briarproject.bramble.test.TestUtils.getGroup;
|
import static org.briarproject.bramble.test.TestUtils.getGroup;
|
||||||
import static org.briarproject.bramble.test.TestUtils.getMessage;
|
import static org.briarproject.bramble.test.TestUtils.getMessage;
|
||||||
import static org.briarproject.bramble.test.TestUtils.getTransportId;
|
import static org.briarproject.bramble.test.TestUtils.getTransportId;
|
||||||
@@ -42,7 +43,7 @@ public class TransportPropertyValidatorTest extends BrambleMockTestCase {
|
|||||||
transportProperties = new TransportProperties();
|
transportProperties = new TransportProperties();
|
||||||
transportProperties.put("foo", "bar");
|
transportProperties.put("foo", "bar");
|
||||||
|
|
||||||
group = getGroup(getClientId());
|
group = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
message = getMessage(group.getId());
|
message = getMessage(group.getId());
|
||||||
|
|
||||||
MetadataEncoder metadataEncoder = context.mock(MetadataEncoder.class);
|
MetadataEncoder metadataEncoder = context.mock(MetadataEncoder.class);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class ValidationManagerImplTest extends BrambleMockTestCase {
|
|||||||
private final MessageId messageId = new MessageId(getRandomId());
|
private final MessageId messageId = new MessageId(getRandomId());
|
||||||
private final MessageId messageId1 = new MessageId(getRandomId());
|
private final MessageId messageId1 = new MessageId(getRandomId());
|
||||||
private final MessageId messageId2 = new MessageId(getRandomId());
|
private final MessageId messageId2 = new MessageId(getRandomId());
|
||||||
private final Group group = getGroup(clientId);
|
private final Group group = getGroup(clientId, 123);
|
||||||
private final GroupId groupId = group.getId();
|
private final GroupId groupId = group.getId();
|
||||||
private final long timestamp = System.currentTimeMillis();
|
private final long timestamp = System.currentTimeMillis();
|
||||||
private final byte[] raw = new byte[123];
|
private final byte[] raw = new byte[123];
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ class BlogManagerImpl extends BdfIncomingMessageHook implements BlogManager,
|
|||||||
Collection<Group> groups;
|
Collection<Group> groups;
|
||||||
Transaction txn = db.startTransaction(true);
|
Transaction txn = db.startTransaction(true);
|
||||||
try {
|
try {
|
||||||
groups = db.getGroups(txn, CLIENT_ID);
|
groups = db.getGroups(txn, CLIENT_ID, CLIENT_VERSION);
|
||||||
for (Group g : groups) {
|
for (Group g : groups) {
|
||||||
blogs.add(blogFactory.parseBlog(g));
|
blogs.add(blogFactory.parseBlog(g));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class ForumManagerImpl extends BdfIncomingMessageHook implements ForumManager {
|
|||||||
Collection<Group> groups;
|
Collection<Group> groups;
|
||||||
Transaction txn = db.startTransaction(true);
|
Transaction txn = db.startTransaction(true);
|
||||||
try {
|
try {
|
||||||
groups = db.getGroups(txn, CLIENT_ID);
|
groups = db.getGroups(txn, CLIENT_ID, CLIENT_VERSION);
|
||||||
db.commitTransaction(txn);
|
db.commitTransaction(txn);
|
||||||
} finally {
|
} finally {
|
||||||
db.endTransaction(txn);
|
db.endTransaction(txn);
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ class PrivateGroupManagerImpl extends BdfIncomingMessageHook
|
|||||||
Collection<Group> groups;
|
Collection<Group> groups;
|
||||||
Transaction txn = db.startTransaction(true);
|
Transaction txn = db.startTransaction(true);
|
||||||
try {
|
try {
|
||||||
groups = db.getGroups(txn, CLIENT_ID);
|
groups = db.getGroups(txn, CLIENT_ID, CLIENT_VERSION);
|
||||||
db.commitTransaction(txn);
|
db.commitTransaction(txn);
|
||||||
} finally {
|
} finally {
|
||||||
db.endTransaction(txn);
|
db.endTransaction(txn);
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ class GroupInvitationManagerImpl extends ConversationClientImpl
|
|||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
// If the contact belongs to any private groups, create a peer session
|
// If the contact belongs to any private groups, create a peer session
|
||||||
for (Group pg : db.getGroups(txn, PrivateGroupManager.CLIENT_ID)) {
|
for (Group pg : db.getGroups(txn, PrivateGroupManager.CLIENT_ID,
|
||||||
|
PrivateGroupManager.CLIENT_VERSION)) {
|
||||||
if (privateGroupManager.isMember(txn, pg.getId(), c.getAuthor()))
|
if (privateGroupManager.isMember(txn, pg.getId(), c.getAuthor()))
|
||||||
addingMember(txn, pg.getId(), c);
|
addingMember(txn, pg.getId(), c);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.briarproject.bramble.api.db.Transaction;
|
|||||||
import org.briarproject.bramble.api.identity.Author;
|
import org.briarproject.bramble.api.identity.Author;
|
||||||
import org.briarproject.bramble.api.identity.IdentityManager;
|
import org.briarproject.bramble.api.identity.IdentityManager;
|
||||||
import org.briarproject.bramble.api.identity.LocalAuthor;
|
import org.briarproject.bramble.api.identity.LocalAuthor;
|
||||||
|
import org.briarproject.bramble.api.sync.Group;
|
||||||
import org.briarproject.bramble.api.sync.Message;
|
import org.briarproject.bramble.api.sync.Message;
|
||||||
import org.briarproject.bramble.api.sync.MessageId;
|
import org.briarproject.bramble.api.sync.MessageId;
|
||||||
import org.briarproject.briar.api.blog.Blog;
|
import org.briarproject.briar.api.blog.Blog;
|
||||||
@@ -49,6 +50,7 @@ import static org.briarproject.briar.api.blog.BlogConstants.KEY_TIME_RECEIVED;
|
|||||||
import static org.briarproject.briar.api.blog.BlogConstants.KEY_TYPE;
|
import static org.briarproject.briar.api.blog.BlogConstants.KEY_TYPE;
|
||||||
import static org.briarproject.briar.api.blog.BlogConstants.MAX_BLOG_COMMENT_LENGTH;
|
import static org.briarproject.briar.api.blog.BlogConstants.MAX_BLOG_COMMENT_LENGTH;
|
||||||
import static org.briarproject.briar.api.blog.BlogManager.CLIENT_ID;
|
import static org.briarproject.briar.api.blog.BlogManager.CLIENT_ID;
|
||||||
|
import static org.briarproject.briar.api.blog.BlogManager.CLIENT_VERSION;
|
||||||
import static org.briarproject.briar.api.blog.MessageType.COMMENT;
|
import static org.briarproject.briar.api.blog.MessageType.COMMENT;
|
||||||
import static org.briarproject.briar.api.blog.MessageType.POST;
|
import static org.briarproject.briar.api.blog.MessageType.POST;
|
||||||
import static org.briarproject.briar.api.blog.MessageType.WRAPPED_COMMENT;
|
import static org.briarproject.briar.api.blog.MessageType.WRAPPED_COMMENT;
|
||||||
@@ -866,7 +868,8 @@ public class BlogManagerImplTest extends BriarTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Blog createBlog(LocalAuthor localAuthor, boolean rssFeed) {
|
private Blog createBlog(LocalAuthor localAuthor, boolean rssFeed) {
|
||||||
return new Blog(getGroup(CLIENT_ID), localAuthor, rssFeed);
|
Group group = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
|
return new Blog(group, localAuthor, rssFeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BdfList authorToBdfList(Author a) {
|
private BdfList authorToBdfList(Author a) {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class BlogPostValidatorTest extends BriarTestCase {
|
|||||||
private final String body = getRandomString(42);
|
private final String body = getRandomString(42);
|
||||||
|
|
||||||
public BlogPostValidatorTest() {
|
public BlogPostValidatorTest() {
|
||||||
group = getGroup(CLIENT_ID);
|
group = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
descriptor = group.getDescriptor();
|
descriptor = group.getDescriptor();
|
||||||
author = getAuthor();
|
author = getAuthor();
|
||||||
authorList = BdfList.of(
|
authorList = BdfList.of(
|
||||||
|
|||||||
@@ -61,9 +61,10 @@ public class FeedManagerImplTest extends BrambleMockTestCase {
|
|||||||
private final Clock clock = context.mock(Clock.class);
|
private final Clock clock = context.mock(Clock.class);
|
||||||
private final Dns noDnsLookups = context.mock(Dns.class);
|
private final Dns noDnsLookups = context.mock(Dns.class);
|
||||||
|
|
||||||
private final Group localGroup = getGroup(CLIENT_ID);
|
private final Group localGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
private final GroupId localGroupId = localGroup.getId();
|
private final GroupId localGroupId = localGroup.getId();
|
||||||
private final Group blogGroup = getGroup(BlogManager.CLIENT_ID);
|
private final Group blogGroup =
|
||||||
|
getGroup(BlogManager.CLIENT_ID, BlogManager.CLIENT_VERSION);
|
||||||
private final GroupId blogGroupId = blogGroup.getId();
|
private final GroupId blogGroupId = blogGroup.getId();
|
||||||
private final LocalAuthor localAuthor = getLocalAuthor();
|
private final LocalAuthor localAuthor = getLocalAuthor();
|
||||||
private final Blog blog = new Blog(blogGroup, localAuthor, true);
|
private final Blog blog = new Blog(blogGroup, localAuthor, true);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import static org.briarproject.briar.api.privategroup.PrivateGroupConstants.GROU
|
|||||||
import static org.briarproject.briar.api.privategroup.PrivateGroupConstants.MAX_GROUP_INVITATION_MSG_LENGTH;
|
import static org.briarproject.briar.api.privategroup.PrivateGroupConstants.MAX_GROUP_INVITATION_MSG_LENGTH;
|
||||||
import static org.briarproject.briar.api.privategroup.PrivateGroupConstants.MAX_GROUP_NAME_LENGTH;
|
import static org.briarproject.briar.api.privategroup.PrivateGroupConstants.MAX_GROUP_NAME_LENGTH;
|
||||||
import static org.briarproject.briar.api.privategroup.PrivateGroupManager.CLIENT_ID;
|
import static org.briarproject.briar.api.privategroup.PrivateGroupManager.CLIENT_ID;
|
||||||
|
import static org.briarproject.briar.api.privategroup.PrivateGroupManager.CLIENT_VERSION;
|
||||||
import static org.briarproject.briar.privategroup.invitation.GroupInvitationConstants.GROUP_KEY_CONTACT_ID;
|
import static org.briarproject.briar.privategroup.invitation.GroupInvitationConstants.GROUP_KEY_CONTACT_ID;
|
||||||
import static org.briarproject.briar.privategroup.invitation.MessageType.ABORT;
|
import static org.briarproject.briar.privategroup.invitation.MessageType.ABORT;
|
||||||
import static org.briarproject.briar.privategroup.invitation.MessageType.INVITE;
|
import static org.briarproject.briar.privategroup.invitation.MessageType.INVITE;
|
||||||
@@ -64,7 +65,8 @@ public abstract class AbstractProtocolEngineTest extends BrambleMockTestCase {
|
|||||||
|
|
||||||
protected final Transaction txn = new Transaction(null, false);
|
protected final Transaction txn = new Transaction(null, false);
|
||||||
protected final GroupId contactGroupId = new GroupId(getRandomId());
|
protected final GroupId contactGroupId = new GroupId(getRandomId());
|
||||||
protected final Group privateGroupGroup = getGroup(CLIENT_ID);
|
protected final Group privateGroupGroup =
|
||||||
|
getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
protected final GroupId privateGroupId = privateGroupGroup.getId();
|
protected final GroupId privateGroupId = privateGroupGroup.getId();
|
||||||
protected final Author author = getAuthor();
|
protected final Author author = getAuthor();
|
||||||
protected final PrivateGroup privateGroup =
|
protected final PrivateGroup privateGroup =
|
||||||
|
|||||||
@@ -99,9 +99,9 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
|||||||
private final Author author = getAuthor();
|
private final Author author = getAuthor();
|
||||||
private final Contact contact = new Contact(contactId, author,
|
private final Contact contact = new Contact(contactId, author,
|
||||||
new AuthorId(getRandomId()), true, true);
|
new AuthorId(getRandomId()), true, true);
|
||||||
private final Group localGroup = getGroup(CLIENT_ID);
|
private final Group localGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
private final Group contactGroup = getGroup(CLIENT_ID);
|
private final Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
private final Group privateGroup = getGroup(CLIENT_ID);
|
private final Group privateGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
private final BdfDictionary meta = BdfDictionary.of(new BdfEntry("m", "e"));
|
private final BdfDictionary meta = BdfDictionary.of(new BdfEntry("m", "e"));
|
||||||
private final Message message =
|
private final Message message =
|
||||||
new Message(new MessageId(getRandomId()), contactGroup.getId(),
|
new Message(new MessageId(getRandomId()), contactGroup.getId(),
|
||||||
@@ -194,7 +194,8 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
|||||||
SHARED);
|
SHARED);
|
||||||
oneOf(clientHelper)
|
oneOf(clientHelper)
|
||||||
.mergeGroupMetadata(txn, contactGroup.getId(), meta);
|
.mergeGroupMetadata(txn, contactGroup.getId(), meta);
|
||||||
oneOf(db).getGroups(txn, PrivateGroupManager.CLIENT_ID);
|
oneOf(db).getGroups(txn, PrivateGroupManager.CLIENT_ID,
|
||||||
|
PrivateGroupManager.CLIENT_VERSION);
|
||||||
will(returnValue(Collections.singletonList(privateGroup)));
|
will(returnValue(Collections.singletonList(privateGroup)));
|
||||||
oneOf(privateGroupManager)
|
oneOf(privateGroupManager)
|
||||||
.isMember(txn, privateGroup.getId(), c.getAuthor());
|
.isMember(txn, privateGroup.getId(), c.getAuthor());
|
||||||
@@ -854,8 +855,8 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
|||||||
Collection<Contact> contacts =
|
Collection<Contact> contacts =
|
||||||
Arrays.asList(contact, contact2, contact3);
|
Arrays.asList(contact, contact2, contact3);
|
||||||
|
|
||||||
Group contactGroup2 = getGroup(CLIENT_ID);
|
Group contactGroup2 = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
Group contactGroup3 = getGroup(CLIENT_ID);
|
Group contactGroup3 = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
|
|
||||||
MessageId storageId2 = new MessageId(getRandomId());
|
MessageId storageId2 = new MessageId(getRandomId());
|
||||||
MessageId storageId3 = new MessageId(getRandomId());
|
MessageId storageId3 = new MessageId(getRandomId());
|
||||||
|
|||||||
@@ -65,11 +65,13 @@ public class BlogSharingManagerImplTest extends BrambleMockTestCase {
|
|||||||
new Contact(contactId, author, localAuthor.getId(), true, true);
|
new Contact(contactId, author, localAuthor.getId(), true, true);
|
||||||
private final Collection<Contact> contacts =
|
private final Collection<Contact> contacts =
|
||||||
Collections.singletonList(contact);
|
Collections.singletonList(contact);
|
||||||
private final Group localGroup = getGroup(CLIENT_ID);
|
private final Group localGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
private final Group contactGroup = getGroup(CLIENT_ID);
|
private final Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
private final Group blogGroup = getGroup(BlogManager.CLIENT_ID);
|
private final Group blogGroup =
|
||||||
|
getGroup(BlogManager.CLIENT_ID, BlogManager.CLIENT_VERSION);
|
||||||
private final Blog blog = new Blog(blogGroup, author, false);
|
private final Blog blog = new Blog(blogGroup, author, false);
|
||||||
private final Group localBlogGroup = getGroup(BlogManager.CLIENT_ID);
|
private final Group localBlogGroup =
|
||||||
|
getGroup(BlogManager.CLIENT_ID, BlogManager.CLIENT_VERSION);
|
||||||
private final Blog localBlog = new Blog(localBlogGroup, localAuthor, false);
|
private final Blog localBlog = new Blog(localBlogGroup, localAuthor, false);
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private final ProtocolEngine<Blog> engine =
|
private final ProtocolEngine<Blog> engine =
|
||||||
@@ -225,7 +227,7 @@ public class BlogSharingManagerImplTest extends BrambleMockTestCase {
|
|||||||
private void expectPreShareShareable(Transaction txn, Contact contact,
|
private void expectPreShareShareable(Transaction txn, Contact contact,
|
||||||
Blog blog, Map<MessageId, BdfDictionary> sessions)
|
Blog blog, Map<MessageId, BdfDictionary> sessions)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
Group contactGroup = getGroup(CLIENT_ID);
|
Group contactGroup = getGroup(CLIENT_ID, CLIENT_VERSION);
|
||||||
BdfDictionary sessionDict = new BdfDictionary();
|
BdfDictionary sessionDict = new BdfDictionary();
|
||||||
Message message = new Message(new MessageId(getRandomId()),
|
Message message = new Message(new MessageId(getRandomId()),
|
||||||
contactGroup.getId(), 42L, getRandomBytes(1337));
|
contactGroup.getId(), 42L, getRandomBytes(1337));
|
||||||
|
|||||||
Reference in New Issue
Block a user